Creating a DB2 database on Linux and UNIX systems

Create a DB2® database for a broker or user database.

When you create a broker, you specify the user name and password that are used to connect to the broker database. The process of creating a broker creates the necessary broker tables in the user's schema within the broker database, if the tables do not already exist. DB2 authenticates the user name by using the operating system's user management; you do not have to define the user name to DB2 itself.

To create a DB2 database on Linux® or UNIX®:

  1. Log on as root.
  2. Create a database instance. Use the commands shown here for guidance for the different platforms.
    • On AIX®:
      /usr/lpp/db2_08_01/instance/db2icrt -u fence_userID username
    • 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. 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 topic 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 run. 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.

  3. Log on as username.
  4. Create a database (in this example called WBRKBKDB) by using the following commands (on some platforms, an explicit path name is required).
    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 that it is sufficient for the broker. This task is described in Changing the database heap size on DB2 broker databases.
  6. If you are using a 64-bit DB2 instance, add <DB2 instance directory>/sqllib/lib32 to the start of the library search path environment variable.
  7. If you are using 64-bit execution groups, set the environment variable MQSI_LIBPATH64 to include the regular 64-bit database libraries.

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

Next: If you have been following the instructions in Configuring broker and user databases, the next task is Changing the database heap size on DB2 broker databases.
Related tasks
Configuring broker and user databases
Enabling ODBC connections to the databases
Changing the database heap size on DB2 broker databases
Authorizing access to broker and user databases
Related reference
Supported databases
Related information
DB2 V9.1 information center (distributed systems)
DB2 V8 information center (distributed systems)
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2009Copyright IBM Corporation 1999, 2009.
Last updated : 2009-01-07 15:22:03

ah14480_