Configuring global coordination with DB2 using a 32-bit queue manager

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

Before you start:

To configure your broker environment for global coordination using a 32-bit queue manager as the transaction manager:

  1. Decide whether the broker will connect to databases using TCP/IP or using 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. Start of changeCreate the symbolic links required for your platform, queue manager, and DB2 version combination. You must be logged in as root.
    • AIX platform On AIX®:
      • If you have DB2 Version 8 performing coordination using WebSphere® MQ Version 5.3:
        ln -s <DB2_installation_directory>/lib/libdb2.a /var/mqm/exits/libdb2.a
      • If you have DB2 Version 8 performing coordination using WebSphere MQ Version 6.0:
        ln -s <DB2_installation_directory>/lib/libdb2.a /var/mqm/exits/libdb2.a
        ln -s <DB2_installation_directory>/lib64/libdb2.a /var/mqm/exits64/libdb2.a
      • If you have DB2 Version 9 performing coordination using WebSphere MQ Version 5.3:
        ln -s <DB2_installation_directory>/lib32/libdb2.a /var/mqm/exits/libdb2.a
      • If you have DB2 Version 9 performing coordination using WebSphere MQVersion 6.0:
        ln -s <DB2_installation_directory>/lib32/libdb2.a /var/mqm/exits/libdb2.a
        ln -s <DB2_installation_directory>/lib64/libdb2.a /var/mqm/exits64/libdb2.a
    • HP-UX platform On HP-UX:
      • If you have DB2 Version 8 performing coordination using WebSphere MQVersion 5.3:
        ln -s <DB2_installation_directory>/lib/libdb2.sl /var/mqm/exits/libdb2.sl
      • If you have DB2 Version 8 performing coordination using WebSphere MQVersion 6.0:
        ln -s <DB2_installation_directory>/lib/libdb2.sl /var/mqm/exits/libdb2.sl
        ln -s <DB2_installation_directory>/lib64/libdb2.sl /var/mqm/exits64/libdb2.sl
      • If you have DB2 Version 9 performing coordination using WebSphere MQVersion 5.3:
        ln -s <DB2_installation_directory>/lib32/libdb2.sl /var/mqm/exits/libdb2.sl
      • If you have DB2 Version 9 performing coordination using WebSphere MQ Version 6.0:
        ln -s <DB2_installation_directory>/lib32/libdb2.sl /var/mqm/exits/libdb2.sl
        ln -s <DB2_installation_directory>/lib64/libdb2.sl /var/mqm/exits64/libdb2.sl
    • Solaris platform On Solaris:
      • If you have DB2 Version 8 performing coordination using WebSphere MQ Version 5.3:
        ln -s <DB2_installation_directory>/lib/libdb2.so /var/mqm/exits/libdb2.so
      • If you have DB2 Version 8 performing coordination using WebSphere MQ Version 6.0:
        ln -s <DB2_installation_directory>/lib/libdb2.so /var/mqm/exits/libdb2.so
        ln -s <DB2_installation_directory>/lib64/libdb2.so /var/mqm/exits64/libdb2.so
      • If you have DB2 Version 9 performing coordination using WebSphere MQ Version 5.3:
        ln -s <DB2_installation_directory>/lib32/libdb2.so /var/mqm/exits/libdb2.so
      • If you have DB2 Version 9 performing coordination using WebSphere MQ Version 6.0:
        ln -s <DB2_installation_directory>/lib32/libdb2.so /var/mqm/exits/libdb2.so
        ln -s <DB2_installation_directory>/lib64/libdb2.so /var/mqm/exits64/libdb2.so
    • Linux platform On Linux® on x86:
      • If you have DB2 Version 8 or DB2 Version 9 performing coordination using WebSphere MQ Version 5.3 or WebSphere MQ Version 6.0:
        ln -s <DB2_installation_directory>/lib/libdb2.so /var/mqm/exits/libdb2.so
    End of change
  3. Configure the broker's queue manager with XA resource manager information for each database that is involved in the transaction that the queue manager will globally coordinate. If the message flows reference message dictionaries, or contain Publication nodes, you must use the same method to define XA resource manager information for the broker database and for the user databases.

    Linux platformUNIX platform Start of changeOn Linux on x86 and UNIX®:End of change

    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=install_dir/sample/xatm/db2swit
      XAOpenString=db=MyDataSource,uid=MyUserId,pwd=MyPassword,toc=t
      XACloseString=
      ThreadOfControl=THREAD
    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. The user name that the broker uses can be defined in a number of ways. If you use the -u parameter on the mqsicreatebroker command when you create the broker, this user name is used to connect to the database, unless the mqsisetdbparms command has been used to associate a specific user name and password with a specific data source name (DSN). If you use neither the -u parameter on the mqsicreatebroker command, nor the mqsisetdbparms command, the name used is the broker's 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, on AIX:
      XAResourceManager:
      Name=DB2
      SwitchFile=/opt/mqsi/sample/xatm/db2swit
      XAOpenString=db=MYDB,uid=wbrkuid,pwd=wbrkpw,toc=t
      XACloseString=
      ThreadOfControl=THREAD

    Windows platform On Windows®:

    1. From the Start menu, open the WebSphere MQ graphical interface for your WebSphere MQ version:
      • WebSphere MQ Version 6: WebSphere MQ Explorer
      • WebSphere MQ Version 5.3: WebSphere MQ Services
    2. Open the queue manager's Properties dialog box, then open XA resource managers.
    3. 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
    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:
      • 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. The user name that the broker uses can be defined in a number of ways. If you use the -u parameter on the mqsicreatebroker command when you create the broker, this user name is used to connect to the database, unless the mqsisetdbparms command has been used to associate a specific user name and password with a specific data source name (DSN). If you use neither the -u parameter on the mqsicreatebroker command, nor the mqsisetdbparms command, the name used is the broker's 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.
      For example:
      db=MYDB,uid=wbrkuid,pwd=wbrkpw,toc=t
    6. Accept the default values for all the other fields on the page.
  4. Stop then restart the queue manager to apply the changes, because qm.ini is read only while the queue manager is running.
    To stop then 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's log for any 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 a 32-bit queue manager coordinating transactions.
Next: you can deploy globally coordinated message flows to the broker.
Related tasks
Configuring globally coordinated message flows
Configuring global coordination of transactions (two-phase commit)
Related reference
Start of changemqsistart commandEnd of change
Start of changemqsistop commandEnd of change
Start of changemqsicreatebroker commandEnd of change
Supported databases
Related information
WebSphere MQ Version 6 information center online
WebSphere MQ library Web page
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2009Copyright IBM Corporation 1999, 2009.
Last updated : 2009-01-07 15:19:58

ac00900_