Creating a DB2 database on Linux and UNIX systems

When you create a broker, you specify the user ID and password that are used to connect to the broker database. The user ID must be known to the database and must own the tables that are being accessed. When you create the database, ensure that you create them for the right user ID. DB2 authenticates the user ID using operating system user management, you do not have to define the user ID to DB2 itself.

  1. Logon as root.
  2. Create a database instance. Use the commands shown here for guidance for the different platforms.
    1. On AIX:
      /usr/lpp/db2_08_01/instance/db2icrt -u fence_userID username
    2. On Linux, Solaris, or HP-UX:
      /opt/IBM/db2/V8.1/instance/db2icrt -u fence_userID username

    The username that you specify on this command determines the nominated owner of the database instance. You are recommended to log on as this user whenever you perform any actions against the database instance (for example, creating or modifying a database). The command examples that are used in this help assume that you are logged on as username, and use the tilde (~) character to indicate this user ID in the DB2 commands issued.

    If you are not logged on as the user that owns the database instance, you must modify the commands shown to specify explicit ownership by specifying the owner user ID username following the ~ character wherever it is used in the examples.

    The fence_userID refers to the user ID under which stored procedures execute. You can specify a different ID to the instance owner ID for the database for extra security and protection, which is achieved because the stored procedure runs under a different ID, and therefore in a different process, to the database instance itself.

    For further explanation of database ownership, refer to the DB2 library, accessible on the Web.

  3. Logon as username
  4. Create a database (in this example called WBRKBKDB) using the following commands (on some platforms, an explicit path name is required).
    Note: You must insert a space between the starting period and the tilde character in the first command shown here:
    . ~/sqllib/db2profile
    db2start
    db2 create database WBRKBKDB
    db2 connect to WBRKBKDB
    db2 bind ~/sqllib/bnd/@db2cli.lst grant public CLIPKG 5
  5. You must increase the database heap size to ensure it is sufficient for the broker. This task is described in Customizing DB2 databases.

Start of changeIf you are using a 64-bit DB2 instance, ensure that you add <DB2 instance directory>/sqllib/lib32 to the start of the library search path environment variable. If you are using a 64-bit Oracle instance, ensure that you add $ORACLE_HOME/lib32 to the start of the library search path environment variable. If you are using 64-bit execution groups, ensure that you set the environment variable MQSI_LIBPATH64 to include the regular 64-bit database libraries.End of change

When you issue the command that creates the broker, tables are created within the database to hold the information required.

Related tasks
Configuring component databases
Connecting to the databases
Customizing DB2 databases
Authorizing access to the databases
Related reference
Supported databases