### Berkeley DB Reference Guide: Distributed Transactions |

# Configuring Berkeley DB with the Tuxedo System

This information assumes that you have already installed the Berkeley DB library.

First, you must update the resource manager file in Tuxedo. For the purposes of this discussion, assume that the Tuxedo home directory is in

>     /home/tuxedo

In that case, the resource manager file will be located in

>     /home/tuxedo/udataobj/RM

Edit the resource manager file, adding the line

>     BERKELEY-DB:db_xa_switch:-L${DB_INSTALL}/lib -ldb \
>     	-lsocket -ldl -lm

where ${DB_INSTALLHOME} is the directory into which you installed the Berkeley DB library.

Note that the previous load options are for a Sun Microsystems Solaris 5.6 Sparc installation of Tuxedo, and may not be correct for your system.

Next, you must build the transaction manager server. To do this, use the Tuxedo buildtms(1) utility. The buildtms utility will create the Berkeley-DB resource manager in the directory from which it was run. The parameters to buildtms should be

>     buildtms -v -o DBRM -r BERKELEY-DB

This will create an executable transaction manager server, DBRM, which is called by Tuxedo to process begins, commits, and aborts.

Finally, you must make sure that your TUXCONFIG environment variable identifies an ubbconfig file that properly identifies your resource managers. In the GROUPS section of the ubb file, you should identify the group's LMID and GRPNO, as well as the transaction manager server name "TMSNAME=DBRM." You must also specify the OPENINFO parameter, setting it equal to the string

>     rm_name:dir

where rm_name is the resource name specified in the RM file (that is, BERKELEY-DB) and dir is the directory for the Berkeley DB home environment (see DB_ENV->open for a discussion of Berkeley DB environments).

Because Tuxedo resource manager startup accepts only a single string for configuration, any environment customization that might have been done via the config parameter to DB_ENV->open must instead be done by placing a DB_CONFIG file in the Berkeley DB environment directory. See Berkeley DB File Naming for further information.

Consider the following configuration. We have built a transaction manager server, as described previously. We want the Berkeley DB environment to be /home/dbhome, our database files to be maintained in /home/datafiles, our log files to be maintained in /home/log, and we want a duplexed server.

The GROUPS section of the ubb file might look like the following

>     group_tm LMID=myname GRPNO=1 TMSNAME=DBRM TMSCOUNT=2 \
>     	OPENINFO="BERKELEY-DB:/home/dbhome"

There would be a DB_CONFIG configuration file in the directory /home/dbhome that contained the following two lines:

>     set_data_dir	/home/datafiles
>     set_log_dir	/home/log

Finally, the ubb file must be translated into a binary version using Tuxedo's tmloadcf(1) utility, and then the pathname of that binary file must be specified as your TUXCONFIG environment variable.

At this point, your system is properly initialized to use the Berkeley DB resource manager.

See db_create for further information on accessing data files using XA.

Copyright Sleepycat Software