Configuring global coordination with Oracle

Configure your integration node environment to globally coordinate message flow transactions with updates in Oracle databases under the control of a WebSphere® MQ queue manager.

Before you begin

On distributed systems, a WebSphere MQ queue manager associated with the integration node performs the transaction manager role, which means that IBM® Integration Bus requires access to WebSphere MQ when processing messages. For more information about using WebSphere MQ with IBM Integration Bus, see Installing WebSphere MQ.

About this task

Configure your integration node environment for global coordination by using a 64-bit queue manager as the transaction manager with the DataDirect drivers:

Procedure

  1. Linux platformWindows platformUNIX platformRun the mqsimanagexalinks command.
  2. Windows platformAdd the directory specified as the queue manager’s ExitsDefaultPath to the system PATH.
  3. Configure the integration node queue manager with XA resource manager information for each database that is involved in the transaction that the queue manager will globally coordinate.

    Linux platformUNIX platformOn Linux® and UNIX:

    1. Open the queue managers' qm.ini file in a text editor.
      The qm.ini file is located at /var/mqm/qmgrs/queue_manager_name/qm.ini. Where queue_manager_name is the name of the integration node that is associated with the queue manager.
    2. Add the following stanza to the end of the qm.ini file:
      XAResourceManager:
      Name=OracleXA
      SwitchFile=UKoradtc95.so
      XAOpenString=ORACLE_XA
         +HostName=MyHostName
         +PortNumber=MyPortNumber
         +ServiceName=MyServiceName
         +ACC=P/MyUserId/MyPassword
         +sestm=100+threads=TRUE
         +DataSource=MyDataSourceName
         +K=2
      XACloseString=
      ThreadOfControl=THREAD
      
    3. On the XAOpenString line, replace the following values with values that are appropriate for your configuration:
      • MyHostName is the name of the TCP/IP host that hosts the Oracle database listener. When you are using Oracle Real Application Clusters with multiple listeners for the given Service Name, if the Oracle listener identified by the values for MyHostName and MyPortNumber in the XAOpenString is unavailable, the alternative Oracle listeners that you might have defined in the AlternateServers list in your odbc.ini file are also tried.
      • MyPortNumber is the TCP/IP port on which the Oracle database listener is listening.
      • MyUserId must be the user name that the integration node uses to connect to the database.
        You can define the user name that the integration node uses in a number of ways; make sure that you specify the correct name in this file. The integration node determines the user name by checking the following conditions in the order listed:
        1. A specific user name and password for this data source name (DSN), that you have defined by running the mqsisetdbparms command.
        2. A default user name and password for all DSNs, that you have defined by running the mqsisetdbparms command.
        3. The integration node service user name, which you define with the -i parameter on the mqsicreatebroker command
      • MyPassword is the password that is associated with the user name.
      • MyDataSourceName is the ODBC data source name for the database, as defined in your odbc.ini file.
      • MyServiceName is the value set for the Service Name in the stanza for MyDataSourceName in your odbc.ini file.
    4. Accept the default values for all the other lines in the stanza.
      For example:
      • On AIX®:
        XAResourceManager:
        Name=OracleXA
        SwitchFile=UKoradtc95.so
        XAOpenString=ORACLE_XA
           +HostName=diaz.hursley.ibm.com
           +PortNumber=1521
           +ServiceName=accounts_service
           +ACC=P/wbrkuid/wbrkpw
           +sestm=100+threads=TRUE
           +DataSource=MYDB+K=2
        XACloseString=
        ThreadOfControl=THREAD
        
    5. If you are using Global coordination to Oracle:
      • Set the ODBCINI environment variable to be visible in the environment from which you start your queue manager. The ODBCINI variable must reference the same file as the one being used by your integration node.
      • An optional additional property, CTO=Value, is available for the XAOpenString. CTO is the value set for a Connection TimeOut, indicating the number of seconds that the Oracle XA switch file will wait for a response from the Oracle database to an XA request. For example, the timeout can be used to prevent long delays in the integration node failing over to an alternative Oracle Real Application Clusters node, when the active Oracle instance fails abruptly leaving socket connections hanging. The Value should be set to a value larger than the Oracle session timeout sestm value set in the XAOpenString. If this property is used, you must set the corresponding connection option ConnectionTimeout=Value for the data source in the odbc.ini file. If this property is not used, or is set to zero, there will be no timeout (this is the default behavior).

    Windows platformOn Windows:

    1. From the Start menu, open WebSphere MQ Explorer.
    2. Open the queue manager Properties dialog box, then open XA resource managers.
    3. In the SwitchFile field, enter the name of the switch file, ukora95.dll.
    4. In the XAOpenString field, paste the following string:
      ORACLE_XA+
         +HostName=MyHostName
         +PortNumber=MyPortNumber
         +ServiceName=MyServiceName
         +ACC=P/MyUserId/MyPassword
         +sestm=100+threads=TRUE
         +DataSource=MyDataSourceName
         +K=2
    5. In the XAOpenString field, replace the values with values that are appropriate for your configuration:
      • MyHostName is the name of the TCP/IP host that hosts the Oracle database listener. When you are using Oracle Real Application Clusters with multiple listeners for the given Service Name, if the Oracle listener identified by the values for MyHostName and MyPortNumber in the XAOpenString is unavailable, the alternative Oracle listeners that you might have defined in the AlternateServers list in your odbc.ini file are also tried.
      • MyPortNumber is the TCP/IP port on which the Oracle database listener is listening.
      • MyUserId must be the user name that the integration node uses to connect to the database.
        You can define the user name that the integration node uses in a number of ways; make sure that you specify the correct name in this file. The integration node determines the user name by checking the following conditions in the order listed:
        1. A specific user name and password for this data source name (DSN), that you have defined by running the mqsisetdbparms command.
        2. A default user name and password for all DSNs, that you have defined by running the mqsisetdbparms command.
        3. The integration node service user name, which you define with the -i parameter on the mqsicreatebroker command
      • MyPassword is the password that is associated with the user name.
      • MyDataSourceName is the ODBC data source name for the database, as defined in your odbc.ini file.
      • MyServiceName is the value set for the Service Name in the ODBC definition for the data source MyDataSourceName.
      For example:
      ORACLE_XA+
         +HostName=diaz.hursley.ibm.com
         +PortNumber=1521
         +ServiceName=accounts_service
         +ACC=P/wbrkuid/wbrkpw
         +sestm=100+threads=TRUE
         +DataSource=MYDB+K=2
    6. Accept the default values for all the other fields on the page.
  4. The Oracle switch file is supplied by IBM Integration Bus, and uses static XA registration by default. On AIX and Linux on x86-64 only, if you want to enable Oracle data sources to perform dynamic XA registration, set the following environment variable: DDTEK_XA_DYNAMIC_REGISTRATION=1 (See Configuring databases for global coordination of transactions).
  5. Linux platformUNIX platformStop then restart the queue manager to apply the changes, because qm.ini is read only while the queue manager is running. Before you restart the queue manager, ensure that the ODBCINI and ODBCSYSINI environment variables have been exported, and that the user ID that the queue manager processes will run under has read access to the odbc.ini and odbcinst.ini files.
    To stop and restart the queue manager, enter the following commands, where queue_manager_name is the name of the queue manager:
    endmqm queue_manager_name
    strmqm queue_manager_name

    When the queue manager restarts, check the queue manager log for all warnings that are associated with the restart. The log files are located in /var/mqm/qmgrs/queue_manager_name/errors, where queue_manager_name is the name of the queue manager that you restarted.

    When the queue manager restarts successfully, the changes that you made to qm.ini are applied.
  6. Windows platformStop then restart the queue manager to apply the changes.
    To stop and restart the queue manager, enter the following commands, where queue_manager_name is the name of the queue manager:
    endmqm queue_manager_name
    strmqm -si queue_manager_name

    When the queue manager restarts, check the queue manager log for all warnings that are associated with the restart. The log files are located in /var/mqm/qmgrs/queue_manager_name/errors, where queue_manager_name is the name of the queue manager that you restarted.

    When the queue manager restarts successfully, the changes that you made are applied.

Results

Oracle is now configured for global coordination with the integration node queue manager coordinating transactions.

What to do next

You can deploy globally coordinated message flows to the integration node.