Installing and using the DB2 WebSphere MQ functions
The DB2 WebSphere® MQ functions are available in DB2® Version 9.1 for Linux®, UNIX, and Windows or later as user-defined functions. By using these functions, users can access the WebSphere MQ queues from DB2 database objects.
Before you begin
- Install DB2.
- Install WebSphere MQ Server Version 6 or a later edition on the same machine as the DB2 server.
- Ensure that the owner of the DB2 instance and the owner of the db2fmp process are in the mqm group.
- On Solaris, open a command prompt, and type: ulimit -n 1024. This command sets the limit for the number of files that are opened and allows you to create a queue manager for Solaris.
- If you use the WebSphere MQ user defined
functions with the db2mq1c schema and you want to enable the functions
for transactional context, you must issue the following command:
update dbm cfg using federated yes
- If you choose not to use the DB2 default queue manager and queue, create the message queues and WebSphere MQ objects by using the WebSphere MQ script commands (MQSC) that are provided by WebSphere MQ and DB2.
- Edit the queue information in the amtsamp.tst and amtsdfts.tst sample files to help you create the appropriate objects.
- Define the queues for the target queue Manager with the runmqsc command,
as in the following example:
You can use the message queues and objects in SQL statements only after they are created.runmqsc QMName <amtsamp.tst
About this task
You use the commands, enable_MQFunctions and disable_MQFunctions, for transactional and nontransactional MQ user-defined functions. The MQ user-defined functions are defined as a group or set under different schema names. The groups that do not support transactions have the schema db2mq. The groups that do support transactions have the schema db2mq1c. The enable_MQFunctions command with the options that support transactions, allows you to select a set of MQ user-defined functions to install or uninstall for transactional support. If you set a value in the -v parameter, you specify the type of schema that the enable_MQFunctions command creates. The possible values are all, 0pc, or 1pc. If you specify all, then the enablement creates all schemas under user-defined functions (db2mq, db2mq1c).
If you do not specify a value in -v parameter, the enablement defaults to the all option.
Restrictions
- The DB2 Version 9.1 MQ transactional functions that exist under the schema db2mq1c do not support CLOB type messages.
- The enable utility of the transactional MQ user-defined functions allows only 40 corresponding policies to exist in the MQPolicy table for the queue manager specified with the -q option. The -q option only applies to MQ user defined functions under schema db2mq1c. If you want to use a queue manager other than DB2MQ_DEFAULT_MQM, then you must create the queue manager.
- The transactional MQ user-defined functions support only one Queue Manager within a single transaction. The queue manager that you specify in Service and Policy must match. If you leave the Queue Manager blank in the service point, WebSphere MQ defaults to the manager designated by Policy. There is a default set of MQ queues and a default Queue Manager that is normally created during the MQ installation and the enable_MQFunctions processes.
- The Queue name and the Queue Manager name in the configuration tables do not support a double byte character set or a Unicode character set.
- MQ user-defined functions are not supported on a multiple processor partition (MPP) or DB2 Database Partitioning Feature (DPF) environment.