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