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:
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.
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.
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.
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.
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.