Release Notes


20.1 Installation and Configuration for the DB2 MQSeries Functions

This section describes how to configure a DB2 environment to use the DB2 MQSeries Functions. Upon successful completion of the following procedure you will be able to use the DB2 MQSeries Functions from within SQL. A description of these functions can be found in the SQL Reference section of the Release Notes.

The basic procedure for configuring and enabling the DB2 MQSeries Functions is:

  1. Install MQSeries on each physical machine.
  2. Install MQSeries AMI on physical machine.
  3. Enable and configure the DB2 MQSeries Functions.

In addition, to make use of the publish/subscribe capabilities provided by the DB2 MQSeries Functions, you must also install either MQSeries Integrator or the MQSeries Publish/Subscribe Functions on each physical machine. Information on MQSeries Integrator can be found at http://www.ibm.com/software/ts/mqseries/integrator. Information on the MQSeries Publish/Subscribe feature can be found at http://www.ibm.com/software/ts/mqseries/txppacs under category 3.

20.1.1 Install MQSeries

The first step is to ensure that a minimum of MQSeries Version 5.1 with the latest FixPak is installed on your DB2 server. If this version of MQSeries is already installed then skip to the next step, "Install MQSeries AMI." DB2 Version 7.2 includes a copy of the MQSeries server to be used with DB2. Platform specific instructions for installing MQSeries or for upgrading an existing MQSeries installation can be found in a platform specific Quick Beginnings book at http://www.ibm.com/software/ts/mqseries/library/manuals. Be sure to set up a default queue manager as you go through the installation process.

20.1.2 Install MQSeries AMI

The next step is to install the MQSeries Application Messaging Interface (AMI). This is an extension to the MQSeries programming interfaces that provides a clean separation of administrative and programming tasks. The DB2 MQSeries Functions require the installation of this interface. If the MQSeries AMI is already installed on your DB2 server then skip to the next step, "Enable DB2 MQSeries Functions." If the MQSeries AMI is not installed then you can do so from either the installation package provided with DB2 7.2 or by downloading a copy of the AMI from the MQSeries Support Pacs web site at http://www.ibm.com/software/ts/mqseries/txppacs. The AMI may be found under "Category 3 - Product Extensions." For convenience, we have provided a copy of the MQSeries AMI with DB2. This file is located in the sqllib/cfg directory. The name of the file is operating system dependent:

AIX Version 4.3 and greater ma0f_ax.tar.Z
HP-UX ma0f_hp.tar.Z
Solaris Operating Environment ma0f_sol7.tar.Z or mq0f_sol26.tar.Z
Windows 32-bit ma0f_nt.zip

Follow the normal AMI installation process as outlined in the AMI readme file contained in the compressed installation image.

20.1.3 Enable DB2 MQSeries Functions

During this step, you will configure and enable a database for the DB2 MQSeries Functions. The enable_MQFunctions utility is a flexible command that first checks that the proper MQSeries environment has been set up and then installs and creates a default configuration for the DB2 MQSeries functions, enables the specified database with these functions, and confirms that the configuration works.

  1. For Windows NT or Windows 2000, go to step 5.
  2. Setting Groups on UNIX: If you are enabling these functions on UNIX, you must first add the DB2 instance owner (often db2inst1) and the userid associated with fenced UDFs (often db2fenc1) to the MQSeries group mqm. This is needed for the DB2 functions to access MQSeries.
  3. Set DB2 Environment Variables on UNIX: Add the AMT_DATA_PATH environment variable to the list understood by DB2. You can edit the file $INSTHOME/sqllib/profile.env, add AMT_DATA_PATH to DB2ENVLIST. The db2set command can also be used.
  4. On UNIX, restart the database instance: For the environment variable changes to take effect, the database instance must be restarted.
  5. Change directory to $INSTHOME/sqllib/cfg for UNIX or %DB2PATH%/cfg on Windows.
  6. Run the command enable_MQFunctions to configure and enable a database for the DB2 MQSeries Functions. In a DB2 UDB EEE environment, only carry out this step on the catalog node. Refer to 20.6, enable_MQFunctions for a complete description of this command. Some common examples are given below. After successful completion, the specified database will have been enabled and the configuration tested.
  7. To test these functions using the Command Line Processor, issue the following commands after you have connected to the enabled database:
    values DB2MQ.MQSEND('a test')  
    values DB2MQ.MQRECEIVE()
    
    The first statement will send the message "a test" to the DB2MQ_DEFAULT_Q queue and the second will receive it back.
Note:
As a result of running enable_MQFunctions, a default MQSeries environment will be established. The MQSeries queue manager DB2MQ_DEFAULT_MQM and the default queue DB2MQ_DEFAULT_Q will be created. The files amt.xml, amthost.xml, and amt.dtd will be created if they do not already exist in the directory pointed to by AMT_DATA_PATH. If an amthost.xml file does exist, and does not contain a definition for connectionDB2MQ, then a line will be added to the file with the appropriate information. A copy of the original file will be saved as DB2MQSAVE.amthost.xml.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]