IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Configuring global coordination with DB2

Configure your broker environment to globally coordinate message flow transactions with updates in DB2® databases under the control of your broker queue manager.

Ensure that the databases are configured for global coordination of transactions, see Configuring databases for global coordination of transactions.
Follow the instructions appropriate to your platform:
Linux platformUNIX platform

Linux and UNIX

  1. Linux platformOn Linux on x86: decide whether the broker needs to connect to databases by using TCP/IP or shared memory.

    For more information about TCP/IP connections, see the example in the section about message SQL1224N in Resolving problems when using databases.

    To enable shared memory:

    1. Stop the broker by running the following command, where broker is the name of your broker:
      mqsistop broker
    2. Run the following command to ensure that the broker is run in an environment with the extended memory variable exported:
      export EXTSHM=ON
    3. Restart the broker by running the following command, where broker is the name of your broker:
      mqsistart broker
    4. On the DB2 server, ensure that shared memory support is turned on. For more information, see Configuring databases for global coordination of transactions.
  2. Linux platformUNIX platformRun the mqsimanagexalinks command to create the links that are required by WebSphere® MQ to include databases in XA transactions. For more information, see mqsimanagexalinks command.
  3. Linux platformUNIX platformConfigure the broker queue manager with XA resource manager information for each database that is involved in the transaction that the queue manager will globally coordinate.
    1. Open the queue manager's qm.ini file in a text editor. The qm.ini file is located at /var/mqm/qmgrs/queue_manager_name/qm.ini, where queue_manager_name is the name of the broker that is associated with the queue manager.
    2. At the end of the qm.ini file, paste the following stanza:
      XAResourceManager:
      Name=DB2
      SwitchFile=db2swit
      XAOpenString=db=MyDataSource,uid=MyUserId,pwd=MyPassword,toc=t
      XACloseString=
      ThreadOfControl=THREAD

      The switch file is supplied by IBM® Integration Bus.

    3. On the XAOpenString line, replace the following values with values that are appropriate for your configuration:
      • MyDataSource is the name of the data source to which you want to connect.
      • MyUserId must be the user name that the broker uses to connect to the database.
        You can define the user name that the broker uses in a number of ways; make sure that you specify the correct name in this file. The broker determines the user name by checking the following conditions in the order listed:
        1. A specific user name and password for this data source name (DSN), that you have defined by running the mqsisetdbparms command.
        2. A default user name and password for all DSNs, that you have defined by running the mqsisetdbparms command.
        3. A default user name and password for all DSNs, that you have defined by specifying the -u parameter on the mqsicreatebroker command.

          This parameter is valid only for brokers that you have migrated from previous releases.

        4. The broker service user name, which you define with the -i parameter on the mqsicreatebroker command
      • MyPassword is the password that is associated with the user name.
    4. Accept the default values for all the other lines in the stanza. For example:
      XAResourceManager:
      Name=DB2
      SwitchFile=db2swit
      XAOpenString=db=MYDB,uid=wbrkuid,pwd=wbrkpw,toc=t
      XACloseString=
      ThreadOfControl=THREAD
  4. Linux platformUNIX platformStop then restart the queue manager to apply the changes, because qm.ini is read only while the queue manager is running.
    To stop and restart the queue manager, enter the following commands, where queue_manager_name is the name of the queue manager:
    endmqm queue_manager_name
    strmqm queue_manager_name

    When the queue manager restarts, check the queue manager log for all warnings that are associated with the restart. The log files are located in /var/mqm/qmgrs/queue_manager_name/errors, where queue_manager_name is the name of the queue manager that you restarted.

    When the queue manager restarts successfully, the changes that you made to qm.ini are applied.
DB2 is now configured for global coordination with the broker queue manager coordinating transactions.
Next: you can deploy globally coordinated message flows to the broker.
Windows platform

Windows 32-bit

  1. Windows platformConfigure the broker queue manager with XA resource manager information for each database that is involved in the transaction that the queue manager will globally coordinate.
    1. From the Start menu, open WebSphere MQ Explorer.
    2. Open the queue manager Properties dialog box, then open XA resource managers.
    3. Click the Add button to create a resource manager.
      1. In the Name field, enter a name to refer to a resource manager.
      2. In the SwitchFile field, enter the full path to the switch file, as shown in the following example where install_dir is the location in which the broker is installed:
        install_dir\sample\xatm\db2swit.dll
      3. In the XAOpenString field, paste the following string:
        db=MyDataSource,uid=MyUserId,pwd=MyPassword,toc=t
      4. In the XAOpenString field, replace the values with values that are appropriate for your configuration:
        1. MyDataSource is the name of the data source to which you want to connect.
        2. MyUserId must be the user name that the broker uses to connect to the database.
          You can define the user name that the broker uses in a number of ways; make sure that you specify the correct name in this file. The broker determines the user name by checking the following conditions in the order listed:
          1. A specific user name and password for this data source name (DSN), that you have defined by running the mqsisetdbparms command.
          2. A default user name and password for all DSNs, that you have defined by running the mqsisetdbparms command.
          3. A default user name and password for all DSNs, that you have defined by specifying the -u parameter on the mqsicreatebroker command.

            This parameter is valid only for brokers that you have migrated from previous releases.

          4. The broker service user name, which you define with the -i parameter on the mqsicreatebroker command
        3. MyPassword is the password that is associated with the user name.
        For example:
        db=MYDB,uid=wbrkuid,pwd=wbrkpw,toc=t
      5. Accept the default values for all the other fields on the page.
  2. Windows platformStop then restart the queue manager to apply the changes.
    To stop and restart the queue manager, enter the following commands, where queue_manager_name is the name of the queue manager:
    endmqm queue_manager_name
    strmqm -si queue_manager_name

    When the queue manager restarts, check the queue manager log for all warnings that are associated with the restart. The log files are located in install_dir\WebSphere MQ\Qmgrs\IB9QMGR\errors, where install_dir is the location in which the broker is installed.

    When the queue manager restarts successfully, the changes that you made are applied.
DB2 is now configured for global coordination with the broker queue manager coordinating transactions.
Next: you can deploy globally coordinated message flows to the broker.
Windows platform

Windows 64-bit

  1. Windows platformConfigure the broker queue manager with XA resource manager information for each database that is involved in the transaction that the queue manager will globally coordinate.
    1. From the Start menu, open WebSphere MQ Explorer.
    2. Open the queue manager Properties dialog box, then open XA resource managers.
    3. Click the Add button to create a resource manager.
      1. In the Name field, enter a name to refer to a resource manager.
      2. In the SwitchFile field, enter db2swit
      3. Copy the provided DB2 switch files from the broker install location to the queue managers exits and exits64 directories (by default under C:\Program Files (x86)\IBM\WebSphere MQ).
        Copy the file:
        install_dir\sample\xatm\db2swit32.dll
        into the queue managers exits directory, and rename it to db2swit.dll.
        Copy the file
        install_dir\sample\xatm\db2swit.dll
        into the queue managers exits64 directory.
      4. In the XAOpenString field, paste the following string:
        db=MyDataSource,uid=MyUserId,pwd=MyPassword,toc=t
      5. In the XAOpenString field, replace the values with values that are appropriate for your configuration:
        1. MyDataSource is the name of the data source to which you want to connect.
        2. MyUserId must be the user name that the broker uses to connect to the database.
          You can define the user name that the broker uses in a number of ways; make sure that you specify the correct name in this file. The broker determines the user name by checking the following conditions in the order listed:
          1. A specific user name and password for this data source name (DSN), that you have defined by running the mqsisetdbparms command.
          2. A default user name and password for all DSNs, that you have defined by running the mqsisetdbparms command.
          3. A default user name and password for all DSNs, that you have defined by specifying the -u parameter on the mqsicreatebroker command.

            This parameter is valid only for brokers that you have migrated from previous releases.

          4. The broker service user name, which you define with the -i parameter on the mqsicreatebroker command
        3. MyPassword is the password that is associated with the user name.
        For example:
        db=MYDB,uid=wbrkuid,pwd=wbrkpw,toc=t
      6. Accept the default values for all the other fields on the page.
  2. Windows platformStop then restart the queue manager to apply the changes.
    To stop and restart the queue manager, enter the following commands, where queue_manager_name is the name of the queue manager:
    endmqm queue_manager_name
    strmqm -si queue_manager_name

    When the queue manager restarts, check the queue manager log for all warnings that are associated with the restart. The log files are located in install_dir\WebSphere MQ\Qmgrs\IB9QMGR\errors, where install_dir is the location in which the broker is installed.

    When the queue manager restarts successfully, the changes that you made are applied.
DB2 is now configured for global coordination with the broker queue manager coordinating transactions.
Next: you can deploy globally coordinated message flows to the broker.

bh26090_.htm | Last updated Friday, 21 July 2017