Oracle configuration

Do the following:

  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 WebSphere MQ is provided at:

http://www.ibm.com/software/ts/mqseries/platforms/supported.html

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(R) systems, use:
export ORACLE_HOME=/opt/oracle/product/8.1.6
On Windows(R) 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 need to set this environment variable. Consult your Oracle documentation.

An example of setting this, on UNIX systems, is:

export ORACLE_SID=sid1

The equivalent on Windows systems is:

set ORACLE_SID=sid1

Creating the Oracle switch load file

The easiest way to create the Oracle switch load file is to use the sample file xaswit.mak, which WebSphere MQ provides to build the switch load files for a variety of 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 c:\Program Files\IBM\WebSphere MQ\exits.

On AIX(R), you can find xaswit.mak in the directory /usr/mqm/samp/xatm; on other UNIX systems, you can find it in the directory /opt/mqm/samp/xatm.

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

The next step is to modify the configuration information for the queue manager, as described in Adding configuration information to the queue manager, to declare Oracle as a participant in global units of work.

Figure 12 is a UNIX sample showing an XAResourceManager entry. It is recommend that you add a LogDir to the XA open string so that all error and tracing information is logged to the same place.

Figure 12. Sample XAResourceManager entry for Oracle on UNIX platforms
XAResourceManager:
  Name=myoracle
  SwitchFile=oraswit
  XAOpenString=Oracle_XA+Acc=P/myuser/mypasswd+SesTm=35+LogDir=/tmp+threads=true
  ThreadOfControl=THREAD
Notes:
  1. In Figure 12, the xa_open string has been used with four parameters. Additional parameters can be included as described in Oracle's documentation.
  2. When using Oracle with WebSphere MQ V5.3 for AIX, you must add the +SqlNet clause to the xa_open string. WebSphere MQ V5.3 for AIX, uses AIX extended shared memory facilities and the +SqlNet client/server connectivity solution must be used to enable Oracle's client library to reach the Oracle server. Additional text must be added to the Oracle listener and tnsnames files, see Oracle's XA and Net9 documentation for details.
  3. When using the 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 on the xa_open string.

Changing Oracle configuration parameters

For each Oracle database that the queue manager is coordinating, you need to:

Review your maximum sessions
You might need to review your LICENSE_MAX_SESSIONS and PROCESSES settings to take into account the additional connections required by processes belonging to the queue manager. Refer to Database connections 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;