IBM DB2 Query Patroller Administration Guide


Replacing the DB2 Query Patroller Database

This chapter provides steps for replacing the DB2 Query Patroller Database. To replace the DB2 Query Patroller database, perform the following steps:

  1. Log on to the system using as the administrative user iwm.
  2. Set the default database for the instance to the name of the replacement database. This may be a new database you have created or an already existing database. You can set the default database using the following command:

    db2set DB2DBDFT=default_database -i instance    
    

    Where default_database is the name of the database, and instance is the name of the DB2 instance where the target database is defined. For additional information and the complete syntax of the db2set command, refer to the Command Reference.

  3. You require a tablespace for the IWM schema. You can use an existing tablespace in the replacement database, or you can create a separate tablespace to hold the IWM schema. Refer to the DB2 Administration Guide for information on creating tablespaces.
  4. You require a tablespace for the DB2 Query Patroller result tables. You can use an existing tablespace in the replacement database, or you can create a separate tablespace to hold the DB2 Query Patroller result tables. Refer to the DB2 Administration Guide for information on creating tablespaces.
  5. Set the profile variable DQP_RES_TBLSPC to the result tablespace name.

       db2set DQP_RES_TBLSPC=result_tablespace    
    

    Where result_tablespace is the name of the result tablespace that will hold the DB2 Query Patroller result tables. For additional information and the complete syntax of the db2set command, refer to the Command Reference

  6. Use the tool db2_qp_schema.exe to create the IWM schema and IWM control tables. db2_qp_schema.exe is located in the DB2_RUNTIME\bin directory, where DB2_RUNTIME is the DB2 installation path. From the DB2_RUNTIME\bin directory on Windows, or the DB2_RUNTIME/bin path on UNIX, enter the following command:

       db2_qp_schema.exe iwm_schema.sql dsn iwm password tablespace
    

    where password is the password for user iwm, tablespace is the name of the tablespace where the IWM schema will exist, and dsn is the name of the new database to be managed by DB2 query Patroller.

  7. Create the IWM schema explain tables. In a DB2 command window, execute the following commands from the DB2_RUNTIME\misc directory:
       db2 connect to database user iwm using password
       db2 -tvf EXPLAIN.DDL
       db2 commit
    

    where database is the name of the database you have added, and password is the password for the administrative user account, iwm.

  8. Bind the DB2 Query Patroller bind files to the database. From the DB2_RUNTIME\bnd directory on Windows, or the DB2_RUNTIME/bnd path on UNIX, enter the following commands:
       db2 connect to database user iwm using password
       db2 bind @ db2qp.lst blocking all grant public
       db2 bind @ db2qp_sp.lst
       db2 commit
    

    where database is the database the replacement database that will be managed by DB2 Query Patroller, and password is the password for the administrative user account, iwm.


[ Top of Page | Previous Page | Next Page ]