Task 9: Set up the Db2 environment

If you are using queue-sharing groups you must create the required Db2® objects by customizing and running a number of sample jobs.

For more information about selecting which offload storage environment to use, see Deciding your offload storage environment.

If you choose Db2 as the offload storage environment, see Set up the Db2 environment. If you choose SMDS as the offload storage environment, see Set up the SMDS environment. If you are choosing the SMDS offload storage environment, you are still required to set up the Db2 environment for shared queues.

Set up the Db2 environment

You must create and bind the required Db2 objects by customizing and running a number of sample jobs.

  • Repeat this task for each Db2 data-sharing group.
  • You might need to perform this task when migrating from a previous version.
  • Omit this task if you are not using queue-sharing groups.

    If you later want to use queue-sharing groups, perform this task at that time.

IBM® MQ provides two equivalent sets of jobs. Those with the CSQ45 prefix are for compatibility with earlier versions of IBM MQ and for use with Db2 version 11 and earlier. If you are setting up a new data-sharing group with Db2 V12 or later, you are encouraged to use the jobs with CSQ4X prefix, as these jobs exploit more recent Db2 capabilities for dynamic sizing and Universal Table Spaces.

You must establish an environment in which IBM MQ can access and execute the Db2 plans that are used for queue-sharing groups.

The following steps must be performed for each new Db2 data-sharing group. All the sample JCL is in thlqual.SCSQPROC.
  1. Customize and execute sample JCL CSQ45CSG (or CSQ4XCSG) to create the storage group that is to be used for the IBM MQ database, table spaces, and tables.
  2. Customize and execute sample JCL CSQ45CDB (or CSQ4XCDB) to create the database to be used by all queue managers that are connecting to this Db2 data-sharing group.
  3. Customize and execute sample JCL CSQ45CTS (or CSQ4XCTS) to create the table spaces that contain the queue manager and channel initiator tables used for queue-sharing groups (to be created in step 1 ).
  4. Customize and execute sample JCL CSQ45CTB (or CSQ4XCTB) to create the 12 Db2 tables and associated indexes. Do not change any of the row names or attributes.
  5. Customize and execute sample JCL CSQ45BPL (or CSQ4XBPL)to bind the Db2 plans for the queue manager, utilities, and channel initiator.
  6. Customize and execute sample JCL CSQ45GEX (or CSQ4XGEX)to grant execute authority to the plans for the user IDs that are used by the queue manager, utilities, and channel initiator. The user IDs for the queue manager and channel initiator are the user IDs under which their started task procedures run. The user IDs for the utilities are the user IDs under which the batch jobs can be submitted. The names of the appropriate plans are:
    User Plans
    Queue manager CSQ5A 800, CSQ5C 800, CSQ5D 800, CSQ5K 800, CSQ5L 800, CSQ5M 800, CSQ5P 800, CSQ5R 800, CSQ5S 800, CSQ5T 800, CSQ5U 800, CSQ5W 800
    SDEFS function of the CSQUTIL batch utility CSQ52 800
    CSQ5PQSG and CSQJUCNV batch utilities CSQ5B 800
    CSQUZAP service utility CSQ5Z 800
In the event of a failure during Db2 setup, the following jobs can be customized and executed:
  • CSQ45DTB to drop the tables and indexes.
  • CSQ45DTS to drop the table spaces.
  • CSQ45DDB to drop the database.
  • CSQ45DSG to drop the storage group.
Note: If these jobs fail because of a Db2 locking problem it is probably due to contention for a Db2 resource, especially if the system is being heavily used. Resubmit the jobs later. It is preferable to run these jobs when the system is lightly used or quiesced.

See Db2 10 for z/OS: Db2 Administration for more information about setting up Db2.

See Planning on z/OS® for information about Db2 table sizes.

Set up the SMDS environment

You should use SMDS to offload large messages. You can offload all messages to SMDS to give you more capacity in your structure.

You can use Storage Class Memory(SCM); see Use of storage class memory with shared queues.

  • Estimate structure and data set space requirements. See Shared message data set capacity considerations.
  • Allocate and preformat data sets. See Creating a shared message data set.
  • Use the following MQSC command to display the CFLEVEL and OFFLOAD status.
    
    DISPLAY CFSTRUCT(*) CFLEVEL OFFLOAD
    

    For more information about the DISPLAY CFSTRUCT command, see DISPLAY CFSTRUCT.

  • Ensure that the coupling facility structure is defined with CFLEVEL(5) and OFFLOAD(SMDS) by using the following MQSC commands:
    
    ALTER CFSTRUCT(APP1) CFLEVEL(5)
    
    ALTER CFSTRUCT(APP1) OFFLOAD(SMDS)
    

    For more information about the ALTER CFSTRUCT command, see ALTER CFSTRUCT.