Creating CSP tables

The system tables described in Table 8-1 are required if you are using CSPs in DB2.

Table 8-1: CSP tables

CSP

System table

Table description

sp_stored_procedure

SYSPROCEDURES

This table contains specific information about stored procedures created at your site.

sp_sproc_columns

SYSPROCCOLUMNS

These tables contain specific information about the arguments in the stored procedures created at your site.

The system administrator maintains the information in each table.

StepsTo use the cspdb2.sql script to create the tables

  1. Start the DirectConnect server by issuing the direct -S command.

  2. If you are using Windows, display the Windows command line.

  3. Run cspdb2.sql by entering the following:

    isql -Uuserid -Ppassword -Sservice_name -icspdb2.sql
    

    where:

    • isql starts the utility of the same name.

    • userid is a valid DB2 user ID with create table privileges.

    • password is a valid password for DB2 for the user ID you entered.

    • service_name is the desired DB2 service name.

    The script drops any tables with the same names as the tables created. If the table does not exist, the DropTable command returns an error message. This does not prevent successful execution of the rest of the script.

  4. Log in to DirectConnect for z/OS Option and issue a SELECT statement against each table to verify that you successfully created each one.

  5. Grant SELECT authorization to the following DB2 system tables for all CSP users:

    • SYSIBM.SYSCOLAUTH

    • SYSIBM.SYSCOLUMNS

    • SYSIBM.SYSDATABASE

    • SYSIBM.SYSFOREIGNKEYS

    • SYSIBM.SYSINDEXES

    • SYSIBM.SYSKEYS

    • SYSIBM.SYSRELS

    • SYSIBM.SYSSYNONYMS

    • SYSIBM.SYSTABAUTH

    • SYSIBM.SYSTABLES

    Although cspdb2.sql automatically grants select authorization to PUBLIC for the tables it creates, you must grant authorization to these DB2 system tables.