1<!--$Id: system.so,v 11.5 2000/03/18 21:43:20 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: Release 2.0: system integration</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<table width="100%"><tr valign=top> 12<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Upgrading Berkeley DB Applications</dl></b></td> 13<td align=right><a href="../upgrade.2.0/intro.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade.2.0/convert.html"><img src="../../images/next.gif" alt="Next"></a> 14</td></tr></table> 15<p align=center><b>Release 2.0: system integration</b></p> 16<ol> 17<p><li>It is possible to maintain both the Berkeley DB 1.85 and Berkeley DB version 2 18libraries on your system. However, the <b>db.h</b> include file that 19was distributed with Berkeley DB 1.85 is not compatible with the <b>db.h</b> 20file distributed with Berkeley DB version 2, so you will have to install them 21in different locations. In addition, both the Berkeley DB 1.85 and Berkeley DB 22version 2 libraries are named <b>libdb.a</b>. 23<p>As the Berkeley DB 1.85 library did not have an installation target in the 24Makefile, there's no way to know exactly where it was installed on the 25system. In addition, many vendors included it in the C library instead 26of as a separate library, and so it may actually be part of libc and the 27<b>db.h</b> include file may be installed in <b>/usr/include</b>.</p> 28<p>For these reasons, the simplest way to maintain both libraries is to 29install Berkeley DB version 2 in a completely separate area of your system. 30The Berkeley DB version 2 installation process allows you to install into a 31standalone directory hierarchy on your system. See the 32<a href="../../ref/build_unix/intro.html">Building for UNIX systems</a> 33documentation for more information and instructions on how to install the 34Berkeley DB version 2 library, include files and documentation into specific 35locations.</p> 36<p><li>Alternatively, you can replace Berkeley DB 1.85 on your system with Berkeley DB 37version 2. In this case, you'll probably want to install Berkeley DB version 382 in the normal place on your system, wherever that may be, and delete 39the Berkeley DB 1.85 include files, manual pages and libraries. 40<p>To replace 1.85 with version 2, you must either convert your 1.85 41applications to use the version 2 API or build the Berkeley DB version 2 library 42to include Berkeley DB 1.85 interface compatibility code. Whether converting 43your applications to use the version 2 interface or using the version 1.85 44compatibility API, you will need to recompile or relink your 1.85 45applications, and you must convert any persistent application databases 46to the Berkeley DB version 2 database formats.</p> 47<p>If you want to recompile your Berkeley DB 1.85 applications, you will have to 48change them to include the file <b>db_185.h</b> instead of 49<b>db.h</b>. (The <b>db_185.h</b> file is automatically installed 50during the Berkeley DB version 2 installation process.) You can then recompile 51the applications, linking them against the Berkeley DB version 2 library.</p> 52<p>For more information on compiling the Berkeley DB 1.85 compatibility code into 53the Berkeley DB version 2 library, see <a href="../../ref/build_unix/intro.html">Building for UNIX platforms</a>.</p> 54<p>For more information on converting databases from the Berkeley DB 1.85 formats 55to the Berkeley DB version 2 formats, see the <a href="../../utility/db_dump.html">db_dump185</a> and 56<a href="../../utility/db_load.html">db_load</a> documentation.</p> 57<p><li>Finally, although we certainly do not recommend it, it is possible to 58load both Berkeley DB 1.85 and Berkeley DB version 2 into the same library. 59Similarly, it is possible to use both Berkeley DB 1.85 and Berkeley DB version 2 60within a single application, although it is not possible to use them from 61within the same file. 62<p>The name space in Berkeley DB version 2 has been changed from that of previous 63Berkeley DB versions, notably version 1.85, for portability and consistency 64reasons. The only name collisions in the two libraries are the names used 65by the historic <a href="../../api_c/dbm.html">dbm</a>, <a href="../../api_c/dbm.html">ndbm</a> and <a href="../../api_c/hsearch.html">hsearch</a> interfaces, 66and the Berkeley DB 1.85 compatibility interfaces in the Berkeley DB version 2 67library.</p> 68<p>If you are loading both Berkeley DB 1.85 and Berkeley DB version 2 into a single 69library, remove the historic interfaces from one of the two library 70builds, and configure the Berkeley DB version 2 build to not include the Berkeley DB 711.85 compatibility API, otherwise you could have collisions and undefined 72behavior. This can be done by editing the library Makefiles and 73reconfiguring and rebuilding the Berkeley DB version 2 library. Obviously, if 74you use the historic interfaces, you will get the version in the library 75from which you did not remove them. Similarly, you will not be able to 76access Berkeley DB version 2 files using the Berkeley DB 1.85 compatibility interface, 77since you have removed that from the library as well.</p> 78</ol> 79<table width="100%"><tr><td><br></td><td align=right><a href="../upgrade.2.0/intro.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade.2.0/convert.html"><img src="../../images/next.gif" alt="Next"></a> 80</td></tr></table> 81<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 82</body> 83</html> 84