Configuring a repository database

IBM® Db2® Data Management Console uses the repository database to enable Monitor, Run SQL, and Explore features.

Before you begin

The IBM Db2 Data Management Console will use the ID and password that you provide to create the necessary objects in the repository database. Make sure that the account you use has been granted the proper privileges to enable a repository database:
  • For a Db2 repository database, the user must have the DBADM and SYSCTRL privileges.
    Note: If you do not want to make the DBADM to be the owner of the repository database, you can setup the repository by using a normal Db2 user. 

About this task

You must set up a repository database before you use the IBM Db2 Data Management Console.
Note: You cannot assign the same repository to multiple instances of IBM Db2 Data Management Console at a time.

Procedure

  1. To configure the repository database by an administrator:
    1. Configure the repository database to create the required objects and tables by using one of the following methods:
      Method 1- By using web console:
      1. Log in to IBM Db2 Data Management Console as the user with admin privilege.
      2. Click Administration and go to Settings > Repository.
      3. In the Repository page, enter the connection parameters for your repository database, along with the credentials of the repository database owner. You can also select the repository schema for your database.
      4. Click Save.
      Method 2- By customizing and executing the DDLs on the Db2 server:
      1. Customize the create.sql script in the following directory:
        <IBM Db2 Data Management Console installed directory>\samples\DB2LUW\
        Note: You can not customize the default schema IBMCONSOLE, and the tables/views definition.
      2. Log into Db2 with DBADM, and execute the customized create.sql script to create the necessary objects in the repository database.
      3. Log into IBM Db2 Data Management Console as the user with admin privilege.
      4. Click Administration and go to Settings > Repository.
      5. In the Repository page, enter the connection parameters for your repository database, along with the credentials of the repository database owner created by the customized create.sql script.
      6. Click Save.
  2. To configure a repository database by a Db2 user:
    1. Enable the Db2 user to be the owner of the repository database using the following steps:
      1. Log into a Db2 instance, using a Db2 ID that has the DBADM privilege.
      2. Create the database that you will use as your IBM Db2 Data Management Console repository database.
      3. Grant the required authorities and create the needed objects by executing the statements which are located in
        <IBM Db2 Data Management Console installed directory>\samples\DB2LUW\pre-create.sql 
        For example, you can enable a user account TOM as the owner of the IBM Db2 Data Management Console repository.
      4. Log into Db2 using the user account (for example: TOM) and navigate to DB2LUW directory.
        <IBM Db2 Data Management Console installed directory>\samples\DB2LUW\ 
        The following files are located in the DB2LUW directory:
        • pre-create.sql: You can use this script to grant the required authorities and create the necessary objects if you want a normal user to setup repository.
        • create.sql: You can use this script to manually create the product repository.
        • drop.sql: You can use this script to manually drop the product created objects.
        • grant.sql: You can use this script to grant privileges on tables and views.
        • compress.sql: You can use this script to manually enable static, adaptive or compression for the repository. By default, the repository has no compression.
        • reorg.sq:l: You can use this script to RUNSTATS and REORG the product repository tables.
      5. Locate and run the create.sql file, to create the repository database objects.
        Note: It is recommended to create the table space TS4CONSOLE with a page size of 32 KB.
    2. Log into IBM Db2 Data Management Console.
    3. Click Administration and go to Settings > Repository.
    4. In the Repository page, enter the connection parameters for your repository database, along with the credentials of the repository database owner (for example: TOM).
    5. Click Save.