Using the DB2 group attach facility

When you are defining the connection between CICS® and DB2®, you can choose to have CICS connect to a specific DB2 subsystem.

About this task

You can specify the name of this DB2 subsystem using the DB2ID attribute of the DB2CONN definition. However, if you have multiple DB2 subsystems that are using DB2 Version 7 or later, you might want to use DB2's group attach facility to make it possible for CICS to connect to any of your subsystems, rather than just one named subsystem.

Group attach is a DB2 facility that allows CICS to connect to any one member of a data-sharing group of DB2 subsystems, rather than to a specific DB2 subsystem. The group attach facility chooses any one member of the group that is active on the local MVS™ image for the connection to CICS (members that are active on other MVS images are not eligible for selection).

To use the group attach facility:

Procedure

  1. Activate the group attach facility using the DB2GROUPID attribute of the DB2CONN definition. Specify the group attach name for the group of DB2 subsystems, instead of using the DB2ID attribute to specify the ID of an individual DB2 subsystem.
    With DB2 Version 10, you can also use a subgroup attach name to identify a subset of the group. Group attach means that you can use a common DB2CONN definition, specifying a DB2GROUPID, across multiple cloned AORs, and CICS connects to any active member of that data-sharing group or subgroup. See DB2CONN resources for information about how to define and install a DB2CONN definition.
  2. Specify the RESYNCMEMBER attribute of the DB2CONN definition to resolve any inbound units of work if the connection between CICS and DB2 is broken.
    If the connection is broken, CICS might not reconnect to the same DB2 subsystem - it might choose a different member of the data-sharing group of DB2 subsystems. This means that if indoubt UOWs are being held by the first DB2 subsystem to which CICS connected, they cannot be resolved. See Resolving indoubt units of work (UOWs) for information about the RESYNCMEMBER attribute and how to set it.
  3. After the connection has been established, use the INQUIRE DB2CONN DB2ID() command to find out which member of the data-sharing group has been chosen for the current connection.
  4. If you want CICS to connect to a specific DB2 subsystem, you can override the group attach.
    For example, if you want CICS to connect to the DB2 subsystem with an ID of “xyz”, you can specify the DB2ID using:
    • A SET DB2CONN DB2ID(xyz) command
    • A DSNC STRT xyz command (see DSNC STRT)
    Each of the previous methods overrides group attach by setting a DB2ID in the installed DB2CONN definition.

Results

Specifying a DB2ID in the previous steps causes the DB2GROUPID attribute of the installed DB2CONN definition to be blanked out. If you want to revert to using group attach, set the DB2GROUPID attribute again using a SET DB2CONN DB2GROUPID() command. However, specifying a DB2ID on the INITPARM=(DFHD2INI=db2id) system initialization parameter does not override group attach. If a DB2GROUPID is set in the DB2CONN definition, the INITPARM setting is ignored. See INITPARM system initialization parameter for more information about this parameter.