Environment Configuration
This chapter describes how to configure Tmax environment and use MultipleRM server.
1. Tmax Environment Configuration
Since a MultipleRM server supports multiple RMs, it cannot use the existing configuration that only allows a single RM per server group. To support MultipleRM, add 'MTMAX' and 'STMAX' to the SVGTYPE item and add the SVGLIST and RMID fields.
MTMAX is a group of STMAX server groups. The servers that belong to MTMAX become MultipleRM servers, and so they can use RMs of the STMAXs specified in the SVGLIST.
For example, if Tibero and Oracle must run in the same process and be included in a single transaction, add Tibero and Oracle to the STMAX server groups. To enable MultipleRM, create a MTMAX server group, add the STMAX server groups to SVGLIST, and then add a server that belongs to the MTMAX server group to SERVER.
The following is an example of the previous environment configuration.
*SVRGROUP svg_s1 NODENAME = hahehihol, DBNAME = ORACLE, OPENINFO="Oracle_Xa+SqlNet=KOR04+Acc=P/scott/tiger+SesTm=60", TMSNAME = tms_ora, SVGTYPE = STMAX svg_s2 NODENAME = hahehihol, DBNAME = TIBERO, OPENINFO ="TIBERO_XA:user=scott,pwd=tiger, sestm=60,db=kor01_tibero", TMSNAME = tms_tbr, SVGTYPE = STMAX svgm1 NODENAME = hahehihol, SVGLIST = "svg_s1,svg_s2", SVGTYPE = MTMAX
-
STMAX configuration items
The following is the required STMAX configuration items.
Item Description NODENAME
Node name.
DBNAME
RM name. Currently 'TIBERO', 'ORACLE', 'DB2_STATIC', and 'MQ' are supported. RM for other databases can be added, and another DBNAME and library name can be used.
If the $TMAXDIR/config/RM file contains an item that matches the DBNAME in the Tmax Configuration, the corresponding library can be used.
The following is an RM file example.
ORACLE:oras DB2_STATIC:db2s_static MQ:mqs TIBERO:tbs
OPENINFO
OPENINFO of STMAX. STMAX is a group of XA servers.
TMSNAME
TMS process name that manages the server group’s database.
SVGTYPE
Must be set to 'STMAX'.
RMID
Identifier used to distinguish between STMAXs of a single MTMAX that use the same RM. Not needed if different RMs are used.
In the previous example, RMID is not set because all STMAXs use different RMs. For more information about the RMID configuration, refer to Environment Configuration.
-
MTMAX configuration items
The following are the required MTMAX configuration items.
Item Description NODENAME
Node name.
SVGLIST
STMAX server group names. Use a comma(,) as a separator.
SVGTYPE
Must be set to 'MTMAX'.
2. Server Usage
MultipleRM server can be used similar to TCS and UCS servers. Except for some functions used in TCS and UCS, all APIs can be used on MultipleRM server and the program structure is the same.
Program components can vary depending on the server type as follows.
-
TCS, UCS server
To build TCS and UCS:
User Code + libsvr(ucs) + db_stub(nodb) library
-
MultipleRM server
To configure MultipleRM:
User Code + libsvr(ucs) + libnodb
3. RM File
Extracting a library list
When extracting a list from a library, the library list is extracted from the setting with the same name as the DBNAME entry in the SERVERGROUP clause of the RM configuration file. You can define one or more libraries to be dynamically loaded.
If the RM file is missing or does not have a setting identical to the DBNAME entry in the SERVERGROUP clause, the list of internally defined libraries is extracted.
The following is an example of extracting the library name by DBNAME provided by default.
{"ORACLE","liboras.so"}, {"TIBERO","libtbs.so"}, {"DB2_64","libdb2_64s.so"}, {"SYBASE","libsybs.so"}, {"INFOMIX","libinfs.so"}, {"ALTIBASE","libaltbs.so"}, {"DB2_STATIC","libdb2s_static.so"}, {"MQ","libmqs.so"}
Using definitions in the configuration file
The following describes how to follow the definitions in the ${TAXMDIR}/config/RM configuration file. If the RM file contains an entry that matches the DBNAME of the Tmax environment settings, the corresponding library is dynamically loaded and used.
Each line is written as follows.
DBNAME:library[,library]
Set to the same name as defined in the DBNAME entry of the SERVERGROUP clause.
Below is an example RM file that specifies the names of the libraries to load.
ORACLE:oras ORACLE_ALL:clntsh,oras ORACLE_FULL:libclntsh.so,liboras.so ORACLE_PATH:/ORACLE_HOME/lib/libclntsh.so,/TMAXDIR/lib64/liboras.so TIBERO:tbs TIBERO_ALL:tbxa,tbs TIBERO_FULL:libtbxa.so,libtbs.so TIBERO_PATH:/TB_HOME/lib/libtbxa.so,/TMAXDIR/lib64/libtbs.so
-
When loading more than one library, define multiple libraries using commas (,).
-
Dynamic loading is performed sequentially from the front with the dlopen(RTLD_NOW|RTLD_GLOBAL) option.
-
If you specify an xa stub library (e.g. liboras.so), specify it last.
-
The library name supports the following three formats, and if it is not an absolute path, the LIBRARY PATH environment variable or an equivalent setting must be specified.
-
Absolute path: /opt/oracle/client/lib/libclntsh.so
-
Relative path: libclntsh.so, liboras.so
-
Simple name format: clntsh, oras (This format is provided for backward compatibility. In this case, the library is loaded by prepending {lib} and appending {.so}, resulting in names like libclntsh.so and liboras.so.)
-