Configuring Oracle

Oracle support and configuration information.

Note: This topic is also available in IBM® MQ Version 8.0 and later versions. However, you cannot switch to a later version using the Change version list box. To go to the topic in a later version, edit the version number in the URL box in your browser.
Complete the following steps:
  1. Check environment variable settings.
  2. Create the Oracle switch load file.
  3. Add resource manager configuration information.
  4. Change the Oracle configuration parameters, if necessary.
A current list of levels of Oracle supported by IBM WebSphere® MQ is provided at the IBM WebSphere MQ detailed system requirements page.

Checking the Oracle environment variable settings

Ensure that your Oracle environment variables are set for queue manager processes as well as in your application processes. In particular, always set the following environment variables before starting the queue manager:
ORACLE_HOME
The Oracle home directory. For example, on UNIX and Linux® systems, use:

export ORACLE_HOME=/opt/oracle/product/8.1.6
On Windows systems, use:

set ORACLE_HOME=c:\oracle\ora81
ORACLE_SID
The Oracle SID being used. If you are using Net8 for client/server connectivity, you might not have to set this environment variable. Consult your Oracle documentation.
The subsequent example is an example of setting this environment variable, on UNIX and Linux systems:

export ORACLE_SID=sid1
The equivalent on Windows systems is:

set ORACLE_SID=sid1
Note: The PATH environment variable must be set to include the binaries directory (for example ORACLE_INSTALL_DIR/VERSION/32BIT_NAME/bin or ORACLE_INSTALL_DIR/VERSION/64BIT_NAME/bin), otherwise you might see a message stating that oraclient libraries are missing from the machine.

If you run queue managers on Windows 64 bit systems, then both 64 bit and 32 bit Oracle clients must be installed. You must install both clients because the queue manager runs as 32 bit processes that use a 32 bit switch load file, which must in turn start a 32 bit Oracle client dll.

The switch load file, loaded by 64 bit queue managers, must access the Oracle 64 bit client libraries. 32 bit queue managers must access the 32 bit Oracle client when IBM WebSphere MQ is running on a Windows 64 bit system.

Creating the Oracle switch load file

To create the Oracle switch load file, use the sample file xaswit.mak, which IBM WebSphere MQ provides to build the switch load files for various database products. On Windows systems, you can find xaswit.mak in the directory C:\Program Files\IBM\WebSphere MQ\tools\c\samples\xatm. To create the Oracle switch load file with Microsoft Visual C++, use: nmake /f xaswit.mak oraswit.dll

The generated switch file is placed in MQ_INSTALLATION_PATH\exits.MQ_INSTALLATION_PATH represents the high-level directory in which IBM WebSphere MQ is installed.

You can find xaswit.mak in the directory MQ_INSTALLATION_PATH/samp/xatm. MQ_INSTALLATION_PATH represents the high-level directory in which IBM WebSphere MQ is installed.

Edit xaswit.mak to uncomment the lines appropriate to the version of Oracle you are using. Then execute the makefile using the command:

make -f xaswit.mak oraswit

The generated 32 bit switch load file is placed in /var/mqm/exits.

The generated 64 bit switch load file is placed in /var/mqm/exits64.

Adding resource manager configuration information for Oracle

You must modify the configuration information for the queue manager to declare Oracle as a participant in global units of work. Modifying the configuration information for the queue manager in this way is described in more detail in Adding configuration information to the queue manager.
  • On Windows and Linux (x86 and x86-64 platforms) systems, use the IBM WebSphere MQ Explorer. Specify the details of the switch load file in the queue manager properties panel, under XA resource manager.
  • On all other systems specify the details of the switch load file in the XAResourceManager stanza in the qm.ini file of the queue manager.
Figure 1 is a UNIX and Linux systems sample showing an XAResourceManager entry. You must add a LogDir to the XA open string so that all error and tracing information is logged to the same place.
Figure 1. Sample XAResourceManager entry for Oracle on UNIX and Linux platforms

XAResourceManager:
  Name=myoracle
  SwitchFile=oraswit
  XAOpenString=Oracle_XA+Acc=P/myuser/mypasswd+SesTm=35+LogDir=/tmp+threads=true
  ThreadOfControl=THREAD
Note:
  1. In Figure 1, the xa_open string has been used with four parameters. Additional parameters can be included as described in Oracle's documentation.
  2. When using the IBM WebSphere MQ parameter ThreadOfControl=THREAD you must use the Oracle parameter +threads=true in the XAResourceManager stanza.

See the Oracle8 Server Application Developer's Guide for more information about the xa_open string.

Changing Oracle configuration parameters

For each Oracle database that the queue manager is coordinating, you must review your maximum sessions and set database privileges. To do so, complete these steps:
Review your maximum sessions
You might have to review your LICENSE_MAX_SESSIONS and PROCESSES settings to take into account the additional connections required by processes belonging to the queue manager. See Installing and configuring the database product for more details.
Set database privileges
The Oracle user name specified in the xa_open string must have privileges to access the DBA_PENDING_TRANSACTIONS view, as described in the Oracle documentation.
The necessary privilege can be given using the following example command:

 grant select on DBA_PENDING_TRANSACTIONS to myuser;