1<!--$Id: xa_config.so,v 10.23 2003/06/27 17:38:24 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB Reference Guide: Configuring Berkeley DB with the Tuxedo System</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<a name="2"><!--meow--></a>
12<table width="100%"><tr valign=top>
13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Distributed Transactions</dl></b></td>
14<td align=right><a href="../xa/xa_intro.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../xa/faq.html"><img src="../../images/next.gif" alt="Next"></a>
15</td></tr></table>
16<p align=center><b>Configuring Berkeley DB with the Tuxedo System</b></p>
17<p>This information assumes that you have already installed the Berkeley DB
18library.</p>
19<p>First, you must update the resource manager file in Tuxedo.  For the
20purposes of this discussion, assume that the Tuxedo home directory is in</p>
21<blockquote><pre>/home/tuxedo</pre></blockquote>
22In that case, the resource manager file will be located in
23<blockquote><pre>/home/tuxedo/udataobj/RM</pre></blockquote>
24Edit the resource manager file, adding the line
25<blockquote><pre>BERKELEY-DB:db_xa_switch:-L${DB_INSTALL}/lib -ldb \
26	-lsocket -ldl -lm</pre></blockquote>
27<p>where ${DB_INSTALLHOME} is the directory into which you installed the Berkeley DB
28library.</p>
29<p><b>Note that the previous load options are for a Sun Microsystems
30Solaris 5.6 Sparc installation of Tuxedo, and may not be correct for
31your system.</b></p>
32<p>Next, you must build the transaction manager server.  To do this, use the
33Tuxedo <b>buildtms</b>(1) utility.  The buildtms utility will create
34the Berkeley-DB resource manager in the directory from which it was run.
35The parameters to buildtms should be</p>
36<blockquote><pre>buildtms -v -o DBRM -r BERKELEY-DB</pre></blockquote>
37<p>This will create an executable transaction manager server, DBRM, which is
38called by Tuxedo to process begins, commits, and aborts.</p>
39<p>Finally, you must make sure that your TUXCONFIG environment variable
40identifies an ubbconfig file that properly identifies your resource
41managers.  In the GROUPS section of the ubb file, you should identify the
42group's LMID and GRPNO, as well as the transaction manager server name
43"TMSNAME=DBRM."  You must also specify the OPENINFO parameter, setting it
44equal to the string</p>
45<blockquote><pre>rm_name:dir</pre></blockquote>
46<p>where rm_name is the resource name specified in the RM file (that is,
47BERKELEY-DB) and dir is the directory for the Berkeley DB home environment
48(see <a href="../../api_c/env_open.html">DB_ENV-&gt;open</a> for a discussion of Berkeley DB environments).</p>
49<p>Because Tuxedo resource manager startup accepts only a single string
50for configuration, any environment customization that might have been
51done via the config parameter to <a href="../../api_c/env_open.html">DB_ENV-&gt;open</a> must instead be done
52by placing a <a href="../../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file in the Berkeley DB environment directory.
53See <a href="../../ref/env/naming.html">Berkeley DB File Naming</a> for further
54information.</p>
55<p>Consider the following configuration.  We have built a transaction
56manager server, as described previously.  We want the Berkeley DB environment
57to be <b>/home/dbhome</b>, our database files to be maintained in
58<b>/home/datafiles</b>, our log files to be maintained in
59<b>/home/log</b>, and we want a duplexed server.</p>
60<p>The GROUPS section of the ubb file might look like the following</p>
61<blockquote><pre>group_tm LMID=myname GRPNO=1 TMSNAME=DBRM TMSCOUNT=2 \
62	OPENINFO="BERKELEY-DB:/home/dbhome"</pre></blockquote>
63<p>There would be a <a href="../../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> configuration file in the directory
64<b>/home/dbhome</b> that contained the following two lines:</p>
65<blockquote><pre>set_data_dir	/home/datafiles
66set_lg_dir	/home/log</pre></blockquote>
67<p>Finally, the ubb file must be translated into a binary version using
68Tuxedo's <b>tmloadcf</b>(1) utility, and then the pathname of that
69binary file must be specified as your TUXCONFIG environment variable.</p>
70<p>At this point, your system is properly initialized to use the Berkeley DB
71resource manager.</p>
72<p>See <a href="../../api_c/db_class.html">db_create</a> for further information on accessing data files
73using XA.</p>
74<table width="100%"><tr><td><br></td><td align=right><a href="../xa/xa_intro.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../xa/faq.html"><img src="../../images/next.gif" alt="Next"></a>
75</td></tr></table>
76<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
77</body>
78</html>
79