Running Database and Index Cleanup Scripts

In some troubleshooting situations, you may be advised to start with new configuration data.

You can run SQL scripts to delete all the tables in any of the following databases that IBM® Cognos® Analytics components use:

  • content store for data that IBM Cognos Analytics needs to operate
  • delivery database for report notifications
  • database for human tasks and annotations

You can run SQL scripts to delete all the tables and indexes in the logging database for log messages.

When you delete a table, its structural definition and data are deleted permanently from the database.

When you delete the indexes from a logging database, they are deleted permanently from the database.

When you restart the IBM Cognos service, a new set of required database tables and indexes are created automatically in the location specified by your configuration settings.

Procedure

  1. On each computer where Content Manager is located, stop the IBM Cognos service.
  2. Go to the appropriate directory:
    • To delete tables and indexes from the logging database, go to install_location\configuration\schemas\logging.
    • To delete tables from the content store, go to install_location\configuration\schemas\content.
    • To delete tables from the notification database, go to install_location\configuration\schemas\delivery.
    • To delete tables from the human task and annotation database, go to install_location\configuration\schemas\hts.
  3. Go to the appropriate database directory.
  4. Depending on the database and database type, run one of the following scripts in the appropriate database tool to delete the tables.

    The following table lists the script names for the content store database.

    Table 1. Database type and script name for the content store database

    Database type

    Script name

    DB2®

    dbClean_db2.sql

    Db2 on z/OS®

    dbClean_db2zOS.sql

    Informix®

    dbClean_informix.sql

    Microsoft SQL Server

    dbClean_mssqlserver.sql

    Oracle

    dbClean_oracle.sql

    Sybase

    dbClean_sybase.sql

    The following table lists the script names for the notification database.

    Table 2. Database types and script names for the notification database

    Database type

    Script name

    Db2

    NC_DROP_DB2.sql

    Db2 on z/OS

    NC_DROP_DB2.sql

    Informix

    NC_DROP_IFX.sql

    Microsoft SQL Server

    NC_DROP_MS.sql

    Oracle

    NC_DROP_ORA.sql

    Sybase

    NC_DROP_SYBASE.sql

    The following table lists the script names to clean up tables and indexes for the logging database.

    For Informix, the index cleanup script must be edited if you host more than one audit logging database on the Informix instance and use them at the same time. See step 5.

    Table 3. Script names to cleanup tables and indexes for the logging database.

    Database type

    Script name

    Db2

    LS_dbClean_db2.sql

    LS_dbCleanIndexes_db2.sql

    Db2 on z/OS

    LS_dbClean_db2zOS.sql

    LS_dbCleanIndexes_db2zOS.sql

    Informix

    LS_dbClean_informix.sql

    LS_dbCleanIndexes_informix.sql

    Microsoft SQL Server

    LS_dbClean_mssql.sql

    LS_dbCleanIndexes_mssql.sql

    Oracle

    LS_dbClean_oracle.sql

    LS_dbCleanIndexes_oracle.sql

    Sybase

    LS_dbClean_sybase.sql

    LS_dbCleanIndexes_sybase.sql

    The following table lists the script names for the Human Task and Annotation database.

    Table 4. Script names for the Human Task and Annotation database

    Database type

    Script name

    all types

    humanTaskService-dropScript.sql

  5. If you have more than one audit logging database on your Informix instance, do the following:
    • Go to install_location\configuration\schemas\logging\informix and open the file LS_dbCleanIndexes_informix.sql in a text editor.
    • Replace every instance of IPFSCRIPTIDX with the value that you specified when you created the IPFSCRIPTIDX property in IBM Cognos Configuration. For more information, see the topic about specifying a log messages repository in the IBM Cognos Analytics Installation and Configuration Guide.
    • Save and close the file.
  6. Start the IBM Cognos service.