enable_MQFunctions - Enable WebSphere MQ functions command
Enables Db2® WebSphere® MQ functions for the specified database and validates that the Db2 WebSphere MQ functions can be executed properly. The command fails if WebSphere MQ and WebSphere MQ AMI have not been installed and configured.
Authorization
To run the enable_MQFunctions command you need one of the
following authorities:
- IMPLICIT_SCHEMA authority on the database, if the schema name of the function does not refer to an existing schema.
- CREATEIN privilege on the schema, if the schema name DB2MQ or DB2MQ1C exists.
- DBADM authority.
- CREATE_EXTERNAL_ROUTINE authority on the database.
- SYSADM authority.
- DBADM authority if the DB2_ALTERNATE_AUTHZ_BEHAVIOUR registry variable is set and contains the
value EXTERNAL_ROUTINE_DBADM.Note: With the release of Db2 11.1.4.7 security special build 41268, the SYSADM authority, not the DBADM authority, implicitly has the CREATE_EXTERNAL_ROUTINE authority. If the DB2_ALTERNATE_AUTHZ_BEHAVIOUR registry variable is set and contains the value EXTERNAL_ROUTINE_DBADM, then the DBADM authority also implicitly has these privileges.
Command syntax
Command parameters
- –n database
- Specifies the name of the database that you want to enable.
- –u userid
- Specifies the user ID to connect to the database.
- –p password
- Specifies the password for the user ID.
- –force
- Optional. The use of this option allows the utility program to ignore the existing MQ UDFs. In other words, the program drops any existing functions, before recreating any MQ UDFs. Without this option, the command will not proceed after it finds that the MQ UDFs already exist.
- –xml xmlSize
- Optional. This is for defining the XML versions of the 0pc functions.
This option has no effect if the -v 1pc option
is specified.
The xmlSize specifies the length of XML data. The minimum length is 1 byte. The maximum length is 100M. The default is 1M. You can specify the length as n (number of bytes), nK (length in kilobytes), or nM (length in megabytes).
- –c clobSize
- Optional. Specifies the length of CLOB data. The minimum length is 1 byte; this is the default. The maximum length is 100M. You can specify the length as n (number of bytes), nK (length in kilobytes), or nM (length in megabytes).
- –novalidate
- Optional. This specifies that there will not be any validation of the Db2 MQSeries® functions.
- –v
- Optional. This is used for transactional and non-transactional user-defined function support. The values can be either all, 0pc, or 1pc. When you specify 0pc, the enablement creates schema db2mq. If you specify 1pc, then the enablement creates schema db2mq1c. If you specify all, then the enablement creates all schemas under user-defined functions (db2mq and db2mq1c). If you do not specify this option, the enablement defaults to the all option.
- –echo
- Optional. Prints the detailed SQL used to create the UDFs or diagnostic information.
Examples
The following example enables the
transactional and non-transactional user-defined functions. The user
connects to the database
SAMPLE
. enable_MQFunctions -n sample -u user1 -p password1
In
the next example, the user connects to the database SAMPLE. The example
creates DB2MQ1C functions with schema DB2MQ1C. enable_MQFunctions -n sample -u user1 -p password1 -v 1pc
Usage notes
The Db2 MQ user-defined functions run under the schemas DB2MQ or DB2MQ1C which are
automatically created by this command. Before executing this command:
- Ensure that WebSphere MQ and WebSphere Application Messaging Interface (AMI) are installed, and that the version of WebSphere MQ is 5.1 or higher.
- Ensure that the environment variable $AMT_DATA_PATH is defined.
- If you want to use transactional MQ UDFs, make sure that the database is configured for
federated operations. Do this with the following command
update dbm cfg using federated yes
- Change the directory to the cfg subdirectory of the DB2PATH
- Use db2set to add AMT_DATA_PATH to the DB2ENVLIST.
- Ensure that the user account associated with UDF execution is a member of the mqm group.
- Ensure that the user who will be calling this command is a member of the mqm group.
Note: AIX® 4.2 is not supported by MQSeries 5.2.