Table of Contents Previous Next PDF


Using Tuxedo with Oracle Real Application Clusters (RAC)

Using Tuxedo with Oracle Real Application Clusters (RAC)
This chapter includes the following sections.
This release also supports the following RAC features added in previous releases.
Instance Awareness
For the servers associated with Oracle Database, Tuxedo uses customized callback to retrieve Oracle Database instance information.
Tuxedo uses customized callback to retrieve Oracle Database instance information by static callback registration for XA servers.
Tuxedo uses customized callback to retrieve Oracle Database instance information by dynamic callback registration for non-XA servers with the following requirements.
$TUXDIR/lib/tuxociucb.so.1.0 package should be deployed in $ORACLE_HOME/lib.
ORA_OCI_UCBPKG environment variable must include the package name.
It is necessary to deploy the package into $ORACLE_HOME/lib before running a non-XA server that needs instance awareness; otherwise, the server that uses dynamic callback registration will fail.
Non-XA server tries to automatically set the environment variable ORA_OCI_UCBPKG when booting up. If the server fails to do so, an error message will occur in ULOG and the instance awareness will be disabled in the server.
Using Tuxedo with XA Affinity
This section contains the following topics.
Overview
Oracle RAC environments have a one-to-many relationship between database and instances. Servers or groups of a Tuxedo application running on an Oracle RAC may connect to different instances.
It is XA Affinity that ensures all database operations to connect the same RAC instance when possible (no matter if those operations are in one global transaction branch or in different branches of one global transaction) and automatically exchanges the affinity information between Tuxedo domain and WebLogic Server via WTC (WebLogic Tuxedo Connector).
XA Affinity Priority
Tuxedo server selection rules are listed as below, in high to low priority order.
GWTDOMAIN Transaction routing
If XA Affinity is enabled, the Oracle RAC routing rule that environment variable TUXRACGROUPS specifies will be disabled.
Note:
XA Affinity Policy
In the first place, Tuxedo selects the server that is associated with the same instance name, DB name, and service name. If this attempt fails, Tuxedo follows the following policies to find the server.
Note:
Prerequisites
Software Requirements
The feature can be run on all Oracle Tuxedo supported platforms, except for Oracle Tuxedo 32-bit on Microsoft Windows platforms.
For specific platform software requirements, refer to Oracle Tuxedo 12c Release 2 (12.1.3) Platform Data Sheets.
Installation Notes
The Oracle Tuxedo must be 12c Release 2 (12.1.3) Rolling Patch 040 or above.
Configurations
As long as the option EECS in OPTIONS of UBBCONFIG *RESOURCES section is specified, XA Affinity feature is enabled by default. A new option, NO_XAAFFINITY, is introduced to RMOPTIONS of UBBCONFIG *RESOURCES section to explicitly disable XA Affinity.
RMOPTIONS {[...|NO_XAAFFINITY],*}
Listing 6‑1 shows an example to configure EECS; Listing 6‑2 lists an example to explicitly disable XA Affinity.
Listing 6‑1 Example to Configure EECS
* RESOURCES
OPTIONS EECS
 
Listing 6‑2 Example to Explicitly Disable XA Affinity
* RESOURCES
OPTIONS EECS
RMOPTIONS NO_XAAFFINITY
 
This flag can also be specified in T_DOMAIN class via TM_MIB, when the tuxedo application is inactive. For more information, see File Formats, Data Descriptions, MIBs, and System Processes Reference.
Note:
Limitations
Using Tuxedo with Common XID
This section contains the following topics.
Overview
In general, for global transactions, each participating group has its own transaction branch, and a distinguished transaction branch identifier (XID) identifies each branch. If a global transaction involves multiple groups, Oracle Tuxedo adopts two-phase commit on each branch, taking the first participating group as the coordinator.
However, with common XID feature in this release, Oracle Tuxedo shares the coordinator group transaction branch with all other groups within the same transaction. The groups that connect to the same Oracle Database instance through the same service use the coordinator branch directly. For those groups, XA committing operations are not required and are saved.
In the most extreme case, where all groups in a global transaction use the coordinator branch directly, Oracle Tuxedo adopts one-phase commit instead of two-phase commit; no TLOG is written.
Typical Scenario
Assume there are two groups GRP1 and GRP2 in a Tuxedo application domain DOM1. Server SERV1 belongs to GRP1 and offers service SVC1 while server SERV2 belongs to GRP2 and offers service SVC2. Both SERV1 and SERV2 connect to the same instance.
Then a native client begins a global transaction at first, invokes SVC1 followed by SVC2, and commits the transaction.
If common XID functionality is enabled in the above case, Tuxedo invokes one-phase commit on the transaction and no TLOG is written; otherwise, two-phase commit is invoked.
Users are allowed to trace the above behaviors through TMTRACE. Please refer to TMTRACE for more information.
Prerequisites
Software Requirements
The feature can be run on all Oracle Tuxedo supported platforms, except for Oracle Tuxedo 32-bit on Microsoft Windows platforms.
For specific platform software requirements, refer to Oracle Tuxedo 12c Release 2 (12.1.3) Platform Data Sheets.
Installation Notes
The Oracle Tuxedo must be 12c Release 2 (12.1.3) Rolling Patch 040 or above.
Configurations
As long as the option EECS in OPTIONS of UBBCONFIG *RESOURCES section is specified, common XID feature is enabled by default. A new option, NO_COMMONXID, is introduced to RMOPTIONS of UBBCONFIG *RESOURCES section to explicitly disable common XID.
RMOPTIONS {[...|NO_COMMONXID],*}
Listing 6‑1, ?$paratext>,? on page 6‑4 shows an example to configure EECS; Listing 6‑3 lists an example to explicitly disable common XID.
Listing 6‑3 Example to Explicitly Disable Common XID
* RESOURCES
OPTIONS EECS
RMOPTIONS NO_COMMONXID
 
This flag can also be specified in T_DOMAIN class via TM_MIB, when the tuxedo application is inactive. For more information, see File Formats, Data Descriptions, MIBs, and System Processes Reference.
Note:
Limitations
Multi-threaded servers do not provide instance information via MIB; however, common XID still performs well on server-dispatched threads.
In two-phase commit scenarios, GWTDOMAIN is always involved to do prepare and/or commit.
If the coordinator group is the group where GWTDOMAIN locates, common XID does not work.
Using Tuxedo with Single Group Multiple Branches (SGMB)
This section contains the following topics.
Overview
In previous releases, servers in the same participated group use the same transaction branch in a global transaction. However the transaction branch would fail if these serves connect to different instances of a RAC. An XA error, XAER_AFFINITY, will be reported, meaning one branch cannot go through different instances. For this reason, the RAC service used by a Tuxedo group must be a singleton RAC service. A DTP service (if the DTP option, -x in srvctl modify service, is specified) or a service offered by only one instance could be a singleton RAC service.
In this release, using different transaction branches on different instances in a single group will solve the issue. The Tuxedo group can then use non-singleton service and take advantage of its benefits, such as load balance.
Prerequisites
Software Requirements
The feature can be run on all Oracle Tuxedo supported platforms, except for Oracle Tuxedo 32-bit on Microsoft Windows platforms.
For specific platform software requirements, refer to Oracle Tuxedo 12c Release 2 (12.1.3) Platform Data Sheets.
Installation Notes
The Oracle Tuxedo must be 12c Release 2 (12.1.3) Rolling Patch 040 or above.
Configurations
As long as the option EECS in OPTIONS of UBBCONFIG *RESOURCES section is specified, SGMB feature is enabled by default. A new option, SINGLETON, is introduced to RMOPTIONS of UBBCONFIG *RESOURCES section to explicitly disable SGMB.
RMOPTIONS {[...|SINGLETON],*}
This option indicates all RAC services used in the domain are singleton, so the SGMB feature is not necessary to work.
Listing 6‑1, ?$paratext>,? on page 6‑4 shows an example to configure EECS; Listing 6‑4 lists an example to explicitly disable SGMB.
Listing 6‑4 Example to Explicitly Disable SGMB
* RESOURCES
OPTIONS EECS
RMOPTIONS SINGLETON
 
This flag can also be specified in T_DOMAIN class via TM_MIB, when the tuxedo application is inactive. For more information, see File Formats, Data Descriptions, MIBs, and System Processes Reference.
Note:
Limitations
Read-Only optimization for XA does not work in a transaction if the preferred reserved group is a multi-branch group. If GWTDOMAIN is not the coordinator, the preferred reserved group is the coordinator group; otherwise, the preferred reserved group is the participated group coming next in the coordinator domain.
Multi-threaded servers do not provide instance information via MIB; however, SGMB still performs well on server-dispatched threads.
Using Tuxedo with Fast Application Notification (FAN)
This section contains the following topics.
Overview
Tuxedo uses Fast Application Notification (FAN) to
Prerequisites
Software Requirements
The feature can be run on all Oracle Tuxedo supported platforms, except for Oracle Tuxedo 32-bit on Microsoft Windows platforms.
For specific platform software requirements, refer to Oracle Tuxedo 12c Release 2 (12.1.3) Platform Data Sheets.
Installation Notes
The Oracle Tuxedo must be 12c Release 2 (12.1.3) Rolling Patch 040 or above.
Configurations
Configurations on DB
DB configuration includes the following topics.
ONS
On Oracle server side, ONS daemon must be enabled.
If Tuxedo is taken as a native client, ONS daemon on the client side must also be enabled. The ONS daemon configuration file is located in $ORACLE_HOME/opmn/conf/ons.config. After configuring ONS, start ONS daemon with onsctl start command. Please make sure that ONS daemon is running all the time.
If Tuxedo is taken as a remote client, ONS daemon on the client side is not used. It is the preferred mode.
Note:
Load Balancing Advisor (LBA)
The ONS may publish LBA about a service if the service has load balancing advisory goal. You can use -B option to specify the goal via srvctl when creating or modifying the service.
TAF
If TAF is enabled, all Tuxedo servers can automatically do the reconnection by TAF; otherwise, only XA servers can automatically do the reconnection.
Reconnection is finished by TAF with the following requirements for user code.
OPENINFO must include threads=t.
To monitor FAN event for the instance associated with the specific non-XA application server, $TUXDIR/lib/tuxociucb.so.1.0 should be deployed in $ORACLE_HOME/lib, and the name of this binary must be specified in ORA_OCI_UCBPKG environment variable.
-L option in the servopts must be used for a non-XA server to indicate that the server will connect to the Oracle Database. Since the ECID is enabled when -L is specified, a new option -F is introduced into servopts to close ECID. The usage is F noECID. The example is below.
*SERVERS
server1
SRVGRP=GRP1 SRVID=1 ClOPT="-L libclntsh.so -F noECID"
For TAF support, the OCI environment must be created in OCI_THREADED mode.
Pro*C users should be able to precompile with threads=yes and use the embedded SQL statement as below before creating the first executable embedded SQL statement; otherwise, only XA servers can do the reconnection.
EXEC SQL ENABLE THREADS;
Configurations on Tuxedo
It is required to configure TMFAN server in UBBCONFIG *SERVERS section and configure the option EECS in OPTIONS of UBBCONFIG *RESOURCES section. A new option, NO_FAN, is introduced to RMOPTIONS of UBBCONFIG *RESOURCES section to explicitly disable FAN.
RMOPTIONS {[...|NO_FAN],*}
Listing 6‑1, ?$paratext>,? on page 6‑4 shows an example to configure EECS; Listing 6‑5 lists an example to explicitly disable FAN.
Listing 6‑5 Example to Explicitly Disable FAN
* RESOURCES
OPTIONS EECS
RMOPTIONS NO_FAN
 
This flag can also be specified in T_DOMAIN class via TM_MIB, when the tuxedo application is inactive. For more information, see File Formats, Data Descriptions, MIBs, and System Processes Reference.
Note:
Limitations
If the customized server is going to use OCI to connect Oracle database, OCI_NO_UCB should not be set at OCI initialization time.
Using Tuxedo with Oracle Real Application Clusters (RAC)
This section contains the following topics.
Overview
The Oracle Real Application Clusters (RAC) feature supports clustering of machines that utilize replicated Oracle database services accessing the same Oracle database. Oracle RAC provides the ability to concurrently access the same Oracle database from instances physically located on multiple Oracle server machines, and offers the ability to failover unsuccessful database instances to alternate locations.
However, specific support for Oracle RAC is required by the Transaction Monitor in order to take advantage of these replication and failover features in an XA transaction environment or to obtain optimal RAC performance. This is because Oracle 10g does not allow the same database to be accessed from multiple RAC instances within the same XA transaction.
Note:
In addition, Oracle 10gR1 requires Transaction Monitor involvement when prepared transactions failover from one RAC instance to another.
Tuxedo provides Transaction Monitor support for Oracle RAC by allowing an administrator to specify lists of groups associated with different RAC instances. This allows Tuxedo to ensure that groups associated with different instances of the same RAC database do not participate in the same transaction. The Tuxedo Oracle RAC support feature also provides a way for Tuxedo transaction manager server (TMS) processes to be notified of RAC failover events which is required when using Oracle 10gR1.
Consequently, this allows the TMS to re-obtain a list of Oracle 10gR1 prepared transactions from Oracle as required for RAC failover recovery.
Note:
When using Oracle 10gR2, administrators should use an Oracle <b>DTP Service</b> to access the Oracle RAC system. This DTP service name should be specified in the OPENINFO string for the associated Tuxedo groups. Oracle 10gR2 verifies the service name, and migrates it to an alternate instance if required.
When using Oracle 12c or later release, the service name is transparently and automatically migrated to an alternate instance, if required, without any specific configuration.
Limitations
Note:
For Oracle 10gR2, patch set 10.2.0.2 or above is required due to the bug described at: https://metalink.oracle.com/metalink/plsql/f?p=130:14:3193163745563425327::::p14_database_id.
For Oracle 12c, patch set 11.1.0.6 or above is preferred. Use of Oracle 12c is highly encouraged due to significant RAC improvements.
In some instances, using Oracle RAC with the Dynamic XA switch enabled may generate a core dump and cause a system crash. Please contact Oracle Support directly if you encounter this issue and provide the following information:
Software Requirements
For specific platform software requirements, refer to Oracle Tuxedo 12c Release 2 (12.1.3) Platform Data Sheets.
Configuring Tuxedo for Oracle RAC
Tuxedo support for Oracle RAC requires two steps:
The following command and environment variables are used to exclusively configure Tuxedo for Oracle RAC support:
TUXRACGROUPS (required for Oracle 10gR1 and 10gR2, optional for Oracle 11g and later releases)
XARETRYDURATIONSECONDS (required only for Oracle 10gR1)
XARETRYINTERVAL (required only for Oracle 10gR1)
TMS_rac_refresh(1)(required only for Oracle 10gR1)
Configuring Transaction Propagation
Oracle 10gR1 does not allow the same database to be accessed from multiple RAC instances within the same XA transaction. In addition, Oracle 10gR1 requires Transaction Monitor involvement when prepared transactions failover from one RAC instance to another.
Oracle 10gR2 permits different RAC instances to operate on different transaction branches in RAC, but if transaction branches are on different instances, then they are loosely coupled and do not share locks. Also, for optimum commit performance, it is important to use only a single RAC instance within a given XA transaction.
For this reason, it is still important to associate an XA transaction with a single RAC instance in Oracle 10gR2. (For further information on using Oracle XA with RAC, refer to the "Developing Applications with Oracle XA" chapter in the Oracle Database Application Developer's Guide - Fundamentals.
The TUXRACGROUPS environment variable is used to associate Tuxedo groups with specific instances of Oracle RAC configurations so that Tuxedo does not include groups from multiple instances of the same RAC configuration within the same XA transaction.
Note:
When using Oracle 10g, a single transaction should not span multiple Oracle RAC instances. The groups that participate in a particular transaction are determined at the time the transaction is started. Each transaction is assigned to one particular instance of each RAC configuration such that the groups in each instance of a particular RAC configuration are assigned to an equal number of transactions.
Oracle 12c permits different RAC instances to operate on different transaction branches in RAC, and if transaction branches are on different instances, then they are tightly coupled and share locks and resources. So the TUXRACGROUPS environment variable is not necessary when using Oracle 12c. This environment variable still works in Oracle 12c and you can use it to associate Tuxedo groups with specific instances of Oracle RAC configurations.
TUXRACGROUPS
The TUXRACGROUPS environment variable specifies the groups that are associated with a particular RAC configuration, and will disallow sending service calls in the same transaction to two or more groups identified as different instances of the same RAC configuration.
WARNING:
If the TUXRACGROUPS environment variable is used, it must be set on all machines in a configuration, and must have the same sets of groups specified in the same order on all machines.
If this restriction is not followed, then inconsistent sets of groups can be included within a transaction. The coordinating group will notice the inconsistency at commit time, roll back the transaction, and send an error message to the userlog.
TUXRACGROUPS Syntax
The TUXRACGROUPS environment variable is used to define Oracle RAC group configurations. Its syntax is as follows:
TUXRACGROUPS="G1,G2,…,Gm;H1,H2,…,Hn[;…]:I1,I2,…,Io;J1,J2,…,Jp[;…][:…]"
Comma (,) separated list
Used to specify groups in the same instance of an Oracle RAC configuration. Multiple groups from a comma separated list can be used together in the same transaction.
Note:
Semicolon (;) separated list
Used to specify sets of groups in different instances of an oracle RAC configuration. Groups from different RAC instances from the same RAC database configuration cannot be used together in the same transaction.
Since the purpose of the TUXRACGROUPS environment variable is to specify groups associated with different instances of the same Oracle RAC configuration, all applications using the TUXRACGROUPS variable should have at least one semicolon in the environment variable value.
Colon (:) separated list
Used to separate information about one Oracle RAC configuration from information about a different Oracle RAC configuration. The colon indicates that multiple Oracle RAC database configurations are totally independent of each other.
Note:
TUXRACGROUPS Examples
This section describes four different examples for defining Oracle RAC group configurations:
Example 1: Simple Configuration
TUXRACGROUPS="G1;G2"
Figure 6‑1 shows a simple Oracle RAC configuration.
In this example, there is one Oracle database, (ORA1), two Oracle RAC instances with 1 group per each instance.
The same transaction request to both GROUP1 and GROUP2 cannot be sent because they access database services through different instances that map to the same Oracle RAC database configuration.
Figure 6‑1 (ORA1) Simple Configuration
Example 2: Oracle RAC Single Instance with Multiple Groups
TUXRACGROUPS="GROUP1;GROUP2:GROUP3;GROUP4,GROUP5"
Figure 6‑2 shows an example of adding multiple groups to a single instance.
In this example, there are two Oracle databases: ORA1 and ORA2. ORA1 offers machine-specific services ORA1SITE1 and ORA1SITE2, and ORA2 offers machine-specific services ORA2SITE1 and ORA2SITE2. The objective is to assign an approximately equal number of transactions and configure the same services to the groups associated with each instance of an Oracle RAC configuration.
The same transaction request to both GROUP1 and GROUP2 cannot be sent because they access database services through different instances that map to the same Oracle RAC database configuration. The same applies to GROUP3 and GROUP4 or GROUP3 GROUP5, the same transaction cannot be sent to both these groups.
GROUP4 and GROUP5 both access the same database service of the same Oracle RAC database configuration, so these groups would be permitted together. GROUP1 and GROUP4 would be permitted together, because they access different RAC database configurations. If there is also a GROUP6 in this configuration, it would be permitted with any other group, because GROUP6 is not an Oracle RAC group.
Note:
Figure 6‑2 (ORA2) Single Oracle RAC Instance with Multiple Groups
The *GROUPS and *SERVERS sections of the UBBCONFIG file for this configuration might look as follows in Listing 6‑6:
Listing 6‑6 UBBCONFIG File *GROUPS and *SERVERS Sections Example
*GROUPS
DEFAULT: TMSNAME=TMS_ORA TMSCOUNT=2
GROUP1 LMID=SITE1 GRPNO=1
OPENINFO="ORACLE_XA:Oracle_XA+Acc=P/scott/tiger+SqlNet=ORA1SITE1+SesTm=100+LogDir=.+MaxCur=5"
GROUP2 LMID=SITE2 GRPNO=2
OPENINFO="ORACLE_XA:Oracle_XA+Acc=P/scott/tiger+SqlNet=ORA1SITE2+SesTm=100+LogDir=.+MaxCur=5"
GROUP3 LMID=SITE1 GRPNO=3
OPENINFO="ORACLE_XA:Oracle_XA+Acc=P/scott/tiger+SqlNet=ORA2SITE1+SesTm=100+LogDir=.+MaxCur=5"
GROUP4 LMID=SITE2 GRPNO=4
OPENINFO="ORACLE_XA:Oracle_XA+Acc=P/scott/tiger+SqlNet=ORA2SITE2+SesTm=100+LogDir=.+MaxCur=5"
GROUP5 LMID=SITE2 GRPNO=5
OPENINFO="ORACLE_XA:Oracle_XA+Acc=P/scott/tiger+SqlNet=ORA2SITE2+SesTm=100+LogDir=.+MaxCur=5"
GROUP6 LMID=SITE1 GRPNO=6 TMSNAME=TMS_QM
OPENINFO="TUXEDO/QM:/home/myapplication/QUE:QSPACE"
*SERVERS
DEFAULT: RESTART=Y MAXGEN=5 REPLYQ=Y CLOPT="-A"
EMPLOYEE_SVR SRVGRP=GROUP1 SRVID=1
EMPLOYEE_SVR SRVGRP=GROUP2 SRVID=2
BANKING_SVR SRVGRP=GROUP3 SRVID=3
BANKING_SVR SRVGRP=GROUP4 SRVID=4
BANKING_SVR SRVGRP=GROUP5 SRVID=5
 
Note:
GROUP4 and GROUP5 have the same OPENINFO strings, because they both use the same database service from the same database.
The specification of the OPENINFO string for Oracle groups in the *GROUPS section is the same as when using Oracle without RAC. For information on how to specify an OPENINFO string for an Oracle group, refer to the Developing Applications with Oracle XA chapter in the Oracle Database Application Developer's Guide - Fundamentals.
Example 3: Multiple Oracle RAC Instances with Multiple Groups
TUXRACGROUPS="GROUP11,GROUP12,GROUP13;GROUP21,GROUP22:GROUP3;GROUP4, GROUP5"
Figure 6‑3 shows an example of adding multiple groups to multiple instances.
This example is similar to the previous example — except that GROUP11, GROUP12, and GROUP13 are all associated with the first RAC instance of the first RAC configuration, and GROUP21 and GROUP22 are both associated with the second RAC instance.
If the first service call in a transaction in this configuration goes to GROUP12, then it would be possible to send other service calls in this transaction to GROUP11, GROUP12, or GROUP13, but not to GROUP21 or GROUP22.
If a transactional service call is made to a service that is not advertised in any permitted groups but is available in one or more prohibited groups, the result is:
tperrno is set to TPENOENT
tperrordetail is set to the new value TPED_GROUP_FORBIDDEN
Figure 6‑3 Multiple Oracle RAC Instances with Multiple Groups
For each RAC configuration defined as part of the TUXRACGROUPS environment variable, Tuxedo determines which RAC group(s) in that configuration participate in a particular transaction when that transaction is started.
Transaction Creation Behavior Using TUXRACGROUPS
Transactions are a pinned to Oracle RAC instances for as long as they exist. This is true independently, whether the call flow for such a transaction ever reaches a Tuxedo service associated with Oracle RAC or not.
There are two ways that transactions can be created:
Transactions created in a group listed inside TUXRACGROUPS are pinned to the Oracle RAC instance configured via TUXRACGROUPS.
Transactions created in groups not listed inside TUXRACGROUPS are pinned to one of the available Oracle RAC instances in a load-balancing-like algorithm.
Data Dependent Routing Using TUXRACGROUPS
Data dependent routing has been extended to support Oracle RAC configurations. It is possible to define multiple groups for the same routing range in the UBBCONFIG *ROUTING section. Listing 6‑7 shows an example of different Tuxedo groups with the same range of values.
Listing 6‑7 Tuxedo Groups with Same Range Values
RANGES="1-5:GROUP1A, 1-5:GROUP1B, 6-10:GROUP2B, 6-10:GROUP2A, *:*"
 
In this example, GROUP1A and GROUP1B are responsible for the same data range and GROUP2A and GROUP2B are responsible for the same data range. Tuxedo routes the service request to the group associated with the Oracle RAC instance that the transaction belongs to.
Data dependent routing for transactional services offered in RAC groups achieves the desired result only if:
Since all but one of the instances in a RAC configuration are disallowed in a particular transaction, each data value must be specified for a service in each RAC instance. Otherwise, that data value will not be processed by any service in the RAC configuration for some transactions.
If all data values are processed by the same set of service instances, then there is no need to use data dependent routing.
Multiple RANGES entries for each routing value must be created for each RAC instance offering the service.
If a routing was not configured for a special RAC instance a service calls for a transaction pinned to that Oracle RAC Instance will fail with tperrno set to TPENOENT and tperror detail set to TPED_GROUP_FORBIDDEN.
When transactional routing occurs, any groups that are not permitted for the current transaction are ignored. The routing decision only considers:
If routing is performed for a non-transactional request, all groups can participate. The service is routed to the first group matching the data value listed in the UBBCONFIG file *ROUTING section RANGES field. All non-transactional requests for a special range of values are handled by one Oracle RAC instance only.
If routing is performed for a mixture of transactional and non-transactional requests, some applications may not require non-transactional request load balancing. You can vary the RAC instances listed first in your application for different data values so that non-transactional requests are balanced accordingly among services offered by different RAC instances.
There is no way to enforce load balancing between all groups associated with the same routing range for non-transactional requests. If you want to enforce one-by-one load balancing, try the following:
Calling an intermediate AUTOTRAN service (in the UBBCONFIG file *SERVICES section) to enforce that each service call is associated with a transaction.
Figure 6‑4 shows an example of routing transactional and non-transactional requests in an Oracle RAC configuration.
Figure 6‑4 Routing Transactional/Non-Transactional Requests
 
The configuration shown in the example consists of 2 Oracle RAC instances. If 1,000 transactions are created in a group not listed in TUXRACGROUPS, around 500 transactions will be pinned to Oracle RAC instance 1 and can only access GROUP1A and GROUP2A. The other 500 transactions will be pinned to Oracle RAC instance 2 and can only access GROUP1B and GROUP2B.
Listing 6‑8 shows an example of how the *SERVICES and *ROUTING sections of the UBBCONFIG file for this configuration might look:
Listing 6‑8 UBBCONFIG File *SERVICES and *ROUTING Sections Example
*SERVICES
DEPOSIT SRVGRP=GROUP1A ROUTING=MYROUTE
DEPOSIT SRVGRP=GROUP2A ROUTING=MYROUTE
DEPOSIT SRVGRP=GROUP1B ROUTING=MYROUTE
DEPOSIT SRVGRP=GROUP2B ROUTING=MYROUTE
*ROUTING
MYROUTE FIELD=”BRANCH_ID”
RANGES=”1-5:GROUP1A, 1-5:GROUP1B, 6-10:GROUP2B, 6-10:GROUP2A, *:*”
BUFTYPE=”FML32”
 
GROUP1A and GROUP2A belong to Oracle RAC instance 1. GROUP1B and GROUP2B belong to Oracle RAC instance 2. Requests with a BRANCH_ID 1 through 5 must be handled by GROUP1A or GROUP1B. Requests with a BRANCH_ID 6 through 10 must be handled by GROUP2A or GROUP2B.
For transactional requests, all transactions pinned to Oracle RAC instance 1; branches 1-5 map to GROUP1A and branches 6-10 map to GROUP2A. The other half is assigned to Oracle RAC instance 2; branches 1-5 map to GROUP1B and branches 6-10 map to GROUP2B.
For non-transactional requests, branches 1-5 map to GROUP1A, and branches 6-10 map to GROUP2B. These are the first groups specified that match the respective routing ranges. Requests with an invalid BRANCH_ID are mapped to any permitted group.
Note:
Assigning Transactions to Special Oracle RAC Instances
You may want to split your environment into multiple machines. For example, you may want a Tuxedo domain with some machines only accessing Oracle RAC instance 1 and other machines only accessing Oracle RAC instance 2 in order to enforce regional independency if Tuxedo installations and Oracle RAC installations are distributed over different buildings. The environment may be configured so that as few as possible calls should be sent outside of a building.
Figure 6‑5 shows an example with, machine 1 serving GROUP1A and GROUP2A; machine 2 serving GROUP1B and GROUP2B. In addition, calls might be made and transactions might be created from a Tuxedo /Domain Gateway, for Tuxedo /WS clients, Tuxedo Native Clients, Tuxedo /Q, or any server linked with another Resource Manager such as MQ Series.
Whenever a request is sent, the transaction should be pinned to the local machine and avoid hopping between different machines as much as possible.
Figure 6‑5 Assigning Transactions to Special Oracle RAC Instances
Listing 6‑9 shows a UBBCONFIG file example with two physical machines, TUXM1 and TUXM2, running Tuxedo. Both machines have two groups connecting to an Oracle RAC. Groups GROUP1A and GROUP2A are running on machine TUXM1 connecting to RAC instance 1. Groups GROUP1B and GROUP2B are running on machine TUXM2 connecting to RAC instance 2.
Listing 6‑9 UBBCONFIG File Example
*MACHINES
DEFAULT:
APPDIR="/path/to/appdir"
ENVFILE="/path/to/oracle.env"
TUXDIR="/path/to/tuxdir"
TUXCONFIG="/path/to/tuxconfig"
TLOGDEVICE="/path/to/TLOG"

"machine1" LMID=TUXM1

"machine2" LMID=TUXM2

*GROUPS
ADMGRPA LMID=TUXM1 GRPNO=10 OPENINFO=NONE
ADMGRPB LMID=TUXM2 GRPNO=20 OPENINFO=NONE

GROUP1A LMID=TUXM1 GRPNO=101 TMSNAME=TMS_ORA
OPENINFO="Oracle_XA:Oracle_XA+ACC=P/user/password+Sqlnet=ORA1SITE1+SesTm=100+LogDir=.+MaxCur=5"
GROUP1B LMID=TUXM2 GRPNO=102 TMSNAME=TMS_ORA
OPENINFO="Oracle_XA:Oracle_XA+ACC=P/user/password+Sqlnet=ORA1SITE2+SesTm=100+LogDir=.+MaxCur=5"

GROUP2A LMID=TUXM1 GRPNO=201 TMSNAME=TMS_ORA
OPENINFO="Oracle_XA:Oracle_XA+ACC=P/user/password+Sqlnet=ORA1SITE1+SesTm=100+LogDir=.+MaxCur=5"
GROUP2B LMID=TUXM2 GRPNO=202 TMSNAME=TMS_ORA
OPENINFO="Oracle_XA:Oracle_XA+ACC=P/user/password+Sqlnet=ORA1SITE2+SesTm=100+LogDir=.+MaxCur=5"

GROUP_TDOM_A LMID=TUXM1 GRPNO=301
GROUP_TDOM_B LMID=TUXM2 GRPNO=302

GROUP_CLIENT_A LMID=TUXM1 GRPNO=401 TMSNAME=TMS
GROUP_CLIENT_B LMID=TUXM2 GRPNO=402 TMSNAME=TMS

*SERVERS
DEFAULT: RESTART=Y MAXGEN=5 REPLYQ=Y CLOPT="-A"

TMSYSEVT SRVGRP="ADMGRPA" SRVID=10
TMUSREVT SRVGRP="ADMGRPA" SRVID=20

TMSYSEVT SRVGRP="ADMGRPB" SRVID=10 CLOPT="-A -- -S "
TMUSREVT SRVGRP="ADMGRPB" SRVID=20 CLOPT="-A -- -S "

EMPLOYEE_SVR SRVGRP=GROUP1A SRVID=1
EMPLOYEE_SVR SRVGRP=GROUP1B SRVID=2
BANKING_SVR SRVGRP=GROUP2A SRVID=3
BANKING_SVR SRVGRP=GROUP2B SRVID=4

DMADM SRVGRP="GROUP_TDOM_A" SRVID=100
GWADM SRVGRP="GROUP_TDOM_A" SRVID=110
GWTDOMAIN SRVGRP="GROUP_TDOM_A" SRVID=111 REPLYQ=Y RQADDR="GWGRP_M1"
GWADM SRVGRP="GROUP_TDOM_B" SRVID=110
GWTDOMAIN SRVGRP="GROUP_TDOM_B" SRVID=111 REPLYQ=Y RQADDR="GWGRP_M2"
 
Additionally, there is a group for administrative services, as well as one group for Tuxedo /Domain gateways and one group for native Tuxedo clients on both machines. All transactions are created by GWTDOMAIN and native clients. Even if GWTDOMAIN and the native Tuxedo clients never connect to an Oracle RAC directly, they must be included in TUXRACGROUPS as shown in Listing 6‑10 to ensure that the opened transactions belong to the correct RAC instance and are handled locally.
Note:
Native clients must set tpinfo->grpname to the local group to ensure the right behavior. For more information, see ?$paratext>? on page 6‑31.
Listing 6‑10 TUXGROUPS
TUXRACGROUPS="GROUP_TDOM_A,GROUP_CLIENT_A,GROUP1A,GROUP2A;GROUP_TDOM_B,
GROUP_CLIENT_B,GROUP1B,GROUP2B"
 
TUXRAGROUPS Transaction Use Cases
Dealing with Service Calls that are Made Outside of Transactions
As long as no transaction is involved, Tuxedo will try to handle as many requests as possible on the local machine as long as the load allows and requests will only go to remote machines if no local services are idle according to the load balancing algorithm. Summarized this means one does not have to care about requests sent to remote machines if all services are available on all machines.
What an administrator always has to ensure is that he includes all service groups into the TUXRACGROUPS environment variable that are accessed during the call flow and that are candidates for opening a new transaction even if they are not linked with the Oracle RM and/or are not physically associated with any Oracle RAC instance. The environment variable TUXRACGROUPS does not have any impact for non-transactional service calls.
Avoiding Transactions Created by a Group Handling an External Resource Manager Being Sent to a Remote Machine
If you have a Tuxedo server built with another RM such as MQSeries or another database, you can force newly started transactions to be pinned to your local machine by including this group into the TUXRACGROUPS environment variable as well.
Listing 6‑11 MQSeries Example
TUXRACGROUPS="MQSGROUPA,GROUP1A,GROUP2A;MQSGROUPB,GROUP1B,GROUP2B"
 
In this example MQSGROUPA, GROUP1A and GROUP2A are located on machine 1 and MQSGROUPB, GROUP1B and GROUP2B are located on machine 2.
If a server inside group MQSGROUPA creates a transaction, all Tuxedo service calls for services under groups GROUP1A, GROUP2A, GROUP1B and GROUP2B will only go to GROUP1A and GROUP2A. GROUP1B and GROUP2B are ignored as they belong to RAC instance 2 and the transaction was already created for RAC instance 1 via group MQSGROUPA.
Avoiding Transactions Created by GWTDOMAIN Being Sent to a Remote Machine?
Create on local Tuxedo /Domain Gateway on each machine. Set the TUXRACGROUPS environment variable as shown in Listing 6‑12.
Listing 6‑12 GWTDOMAIN Example
TUXRACGROUPS="GWTGROUPA,GROUP1A,GROUP2A;GWTGROUPB,GROUP1B,GROUP2B"
 
In this example GWTGROUPA, GROUP1A and GROUP2A are located on machine 1 and GWTGROUPB, GROUP1B and GROUP2B are located on machine 2.
If GWTDOMAIN on machine 1 creates a new transaction because it receives an external request, all Tuxedo service calls for services under groups GROUP1A, GROUP2A, GROUP1B and GROUP2B will only go to GROUP1A and GROUP2A. GROUP1B and GROUP2B are ignored as they belong to RAC instance 2 and the transaction was already created for RAC instance 1 via group GWTGROUPA.
Avoiding Transactions created by TMQFORWARD Being Sent to a Remote Machine
Create a local Tuxedo /Q configuration on each machine. Set your TUXRACGROUPS environment variable as shown in Listing 6‑13.
Listing 6‑13 TMQFORWARD Example
TUXRACGROUPS="QUEUEGROUPA,GROUP1A,GROUP2A;QUEUEGROUPB,GROUP1B,GROUP2B"
 
In this example QUEUEGROUPA, GROUP1A and GROUP2A are located on machine 1 and QUEUEGROUPB, GROUP1B and GROUP2B are located on machine 2.
If TMQFORWARD on machine 1 transactionally forwards a new message to such an Oracle service, all Tuxedo service calls for services under groups GROUP1A, GROUP2A, GROUP1B and GROUP2B will only go to GROUP1A and GROUP2A. GROUP1B and GROUP2B are ignored as they belong to RAC instance 2 and the transaction was already created for RAC instance 1 via group QUEUEGROUPA.
Avoiding Transactions Created by Tuxedo Native Clients Being Sent to a Remote Machine
You can also bind native clients to a special server group. You just have to build the client using the command buildclient -r <RM_of_the_group> -f <source_file> -o <binary_file> and initiate tpinit() with the group name that you want to use.
For example, you can create two additional groups CLIENTGROUPA and CLIENTGROUPB,and start at least two TMS in each group. Set your TUXRACGROUPS environment variable as shown in Listing 6‑14.
Listing 6‑14 Remote Machine Example
TUXRACGROUPS="CLIENTGROUPA,GROUP1A,GROUP2A;CLIENTGROUPB,GROUP1B,GROUP2B"
 
Whenever you initiate tpinit(TPINIT *tpinfo) with a TPINIT structure where tpinfo->grpname is set to CLIENTGROUPA the client is associated with CLIENTGROUPA. When tpinfo->grpname is set to CLIENTGROUPB, the client is associated with CLIENTGROUPB.
Native clients on machine 1 should always call tpinit() with tpinfo->grpname = CLIENTGROUPA; native clients on machine 2 should always call tpinit() with tpinfo->grpname = CLIENTGROUPB if CLIENTGROUPA is running on machine 1 and CLIENTGROUPB is running on machine 2. When a Tuxedo Native Client calls tpbegin(), the transaction is associated with RAC instance 1 in case of CLIENTGROUPA and with RAC instance 2 in case of CLIENTGROUPB
Avoiding Sending Transactions Created by Tuxedo /WS Clients to Remote Machines
The grpname value must be the NULL string (0-length string) for Workstation clients. You cannot set any group name and you cannot pin /WS clients to special groups. tpbegin() inside the Tuxedo /WS clients is always unspecified and the opened transaction is distributed in equal parts over all RAC instances.
The best practice to use with Tuxedo /WS Clients is to avoid transaction handling on the client side, and start the transaction with the first server that is called by the Tuxedo /WS Client. For example, you can automatically force creating a transaction when setting the AUTOTRAN parameter for the called service in the UBBCONFIG file *SERVICES section.
Configuring Transaction Recovery
TMS_rac_refresh(1), XARETRYDURATIONSECONDS, and XARETRYINTERVAL specifically handle transaction recovery issues.
TMS_rac_refresh(1)is called when an Oracle RAC group fails over to an alternate group. TMS_rac_refresh(1) should not be executed manually from the command line; the proper way to invoke TMS_rac_refresh(1) is to use Oracle Fast Application Notification (FAN).
Note:
The XARETRYDURATIONSECONDS and XARETRYINTERVAL environment variables are used to retry transaction recovery operations (xa_recover()) as required by Oracle RAC.
XARETRYDURATIONSECONDS
Specifies the time interval during which the Tuxedo Transaction Manager Server (TMS) retries xa_recover() operations when TMS_rac_refresh(1) is called. If it is not set or set to 0, then xa_recover() is performed once only.
The default value for XARETRYDURATIONSECONDS is 0.
Note:
For Oracle 10.1, it is recommended that XARETRYDURATIONSECONDS is set to 120.
XARETRYINTERVAL
Specifies the interval in seconds that xa_recover() operations are retried during the XARETRYDURATIONSECONDS interval. The XARETRYINTERVAL value is relevant only if XARETRYDURATIONSECONDS is set to a value greater than 0.
The default value for XARETRYINTERVAL is 30.
Configuring Oracle 10g Fast Application Notification (FAN)
A key process in configuring Tuxedo for Oracle RAC is setting up Oracle FAN to invoke TMS_rac_refresh(1) with the appropriate group parameter on group failover. (More group parameter and group failover information is provided in Configuring Transaction Propagation.)
More information regarding Oracle FAN can be found in the Workload Management with Oracle Real Application Clusters (PDF) White Paper
Oracle FAN Script Example
Listing 6‑15 is an example of an Oracle FAN script.
Listing 6‑15 Oracle FAN Script Example
//This File should be placed at ORA_CRS_HOME/racg/usrco//
------------------------------calout.sh-------------------------
#! /bin/ksh

#parse the event

AWK=awk
NOTIFY_EVENTTYPE=$1 # Event type is handled differently

for ARGS in $*
do
PROPERTY=`echo $ARGS|$AWK -F"=" '{print $1}'`
VALUE=`echo $ARGS|$AWK -F"=" '{print $2}'`
case ${PROPERTY} in
VERSION|version)NOTIFY_VERSION=$VALUE;;
SERVICE|service)NOTIFY_SERVICE=$VALUE;;
DATABASE|database)NOTIFY_DATABASE=$VALUE;;
INSTANCE|instance)NOTIFY_INSTANCE=$VALUE;;
HOST|host) NOTIFY_HOST=$VALUE ;;
STATUS|status) NOTIFY_STATUS=$VALUE;;
REASON|reason) NOTIFY_REASON=$VALUE;;
CARD|card) NOTIFY_CARDINALITY=$VALUE ;;
TIMESTAMP|timestamp) NOTIFY_LOGDATE=$VALUE;; # catch
event
??:??:??) NOTIFY_LOGTIME=$PROPERTY;; # catch event time
(hh24:mi:ss)
esac
done

#Set the REFRESH_DIR environment variable.
. /home/oracle/callout.env

#Make a log to record events.
FAN_LOGFILE=/home/oracle/app/products/10.1.0.3.0/db_1/calloutlog/`hostname`_upti
me.log
touch ${FAN_LOGFILE}
echo ${1} >>${FAN_LOGFILE}

#invoke the TMS_rac_refresh command.
if [ ${NOTIFY_EVENTTYPE} = "INSTANCE" -a ${NOTIFY_STATUS} = "down" ]
then
${REFRESH_DIR}/rac_refresh >> ${FAN_LOGFILE} 2>&1
fi
-----------------------------callout.sh end-----------------------------
-----------------------------callout.env----------------------------------
#! /bin/ksh
#TUXEDO and Oracle RAC server are not one the same machine.
export REFRESH_DIR=/tmp
-----------------------------callout.env end------------------------------
-----------------------------rac_refresh----------------------------------
#! /bin/ksh
#If TUXEDO and Oracle RAC server on different machine

. /home/oracle/callout.env

rsh -l ${LOGNAME} ${TUX_MASTER_MACHINE} ${REFRESH_DIR}/rac_refresh
>/tmp/run1.log 2>&1

rsh -l ${LOGNAME} ${TUX_NONMASTER_MACHINE}
${REFRESH_DIR}/rac_refresh >/tmp/run1.log 2>&1

#If TUXEDO and Oracle RAC server are on same machine
#set up environment variable
#export APPDIR=/tmp
#export ORACLE_HOME=/home/oracle/Ora10g
#export TUXDIR=/nfs/users/libo/r902/BJ/bld
#export PATH=.:${PATH}:${TUXDIR}/bin
#. $TUXDIR/tux.env
#export TUXCONFIG=${APPDIR} /tuxconfig

#invoke TMS_rac_refresh
#TMS_rac_refresh RACDBGRP1
#TMS_rac_refresh RACDBGRP3
-----------------------------rac_refresh end-----------------------------
 
Configuring Transaction Recovery for Oracle 10gR2
For Oracle 10gR2, it is much simpler to configure transaction recovery. The database services specified in the OPENINFO string for each group associated with Oracle RAC should be declared in Oracle as DTP services.
For example, in Listing 6‑6, GROUP1 accessed Oracle via service ORA1SITE1 and GROUP2 accessed Oracle via service ORA1SITE2. In Oracle 10gR2, service ORA1SITE1 should be declared with DTP=TRUE, with preferred instance SITE1, and with available instance SITE2. Service ORA1SITE2 should be declared with DTP=TRUE, with preferred instance SITE2, and with available instance SITE1. A similar process should be followed for groups GROUP3, GROUP4, and GROUP5.
By declaring different preferred instances, the application will be able to get the benefit of load balancing during normal operation when both instances are available.
The setting of the TUXRACGROUPS environment variable will ensure that different instances of the RAC configuration are not combined in the same transaction in order to obtain optimal performance. If one of the RAC instances goes down, Oracle will transfer the DTP service to the non-preferred instance while maintaining transactional integrity.
When using Oracle 10gR2 DTP services, it is not necessary and is not recommended to configure Oracle FAN, use TMS_rac_refresh(1) or set the XARETRYDURATIONSECONDS or XARETRYINTERVAL environment variables.
Configuring Transaction Recovery for Oracle 12c
For Oracle 12c, no specific configuration is needed; transaction recovery is transparent.
Specifying Environment Variables in the UBBCONFIG File
Although the Tuxedo Oracle RAC environment variables can be initiated at the operating system command line, it is highly recommended that you use the ENVFILE parameter specified in the *MACHINES section of the UBBCONFIG file to initiate these environment variables.
Apply the following syntax considerations when setting the environment variables for Oracle RAC.
When Tuxedo environment variables are set using ENVFILE, which is the preferred method, quotation marks are not permitted around the environment variable value.
If environment variables are set at the command line, quotation marks are required if environment variable values contain characters that could be interpreted as special by the command line interpreter. An example of a special character is a semicolon.
See Also
“Writing Global Transactions” in Programming an Oracle Tuxedo ATMI Application Using C

Copyright © 1994, 2017, Oracle and/or its affiliates. All rights reserved.