Installing Oracle Berkeley DB on Ubuntu Linux
BerkeleyDB:According to oracle.com,
"Oracle Berkeley DB is the industry-leading open source, embeddable database engine that provides developers with fast, reliable, local persistence with zero administration. Oracle Berkeley DB is a library that links directly into your application. Your application makes simple function calls, rather than sending messages to a remote server, eliminating the performance penalty of client-server architectures. Oracle Berkeley DB eliminates the overhead of SQL query processing, enabling applications with predictable access patterns to run faster."
Before starting, please check to see if there is a latest version available to download. Visit http://www.oracle.com/technology/products/berkeley-db/db/index.html to find out about the available versions. IMPORTANT: See "Configuring Ubuntu Linux After Installation" to install the development tools required to compile and install BerkeleyDB from source code.
Steps to download, compile, and install are as follows. Note: Replace 4.3.29 with your version number:
Downloading Berkeley DB:
Run the command below,
wget http://downloads.sleepycat.com/db-4.3.29.tar.gzAlso, download the MD5 hash to verify the integrity of the downloaded file. In the same folder, where you downloaded the Oracle Berkeley DB file, do the following:
The last two commands (above) generate two strings of alpha-numeric characters. Check to see if both strings are identical or not. If not, repeat the steps above from "Downloading Berkeley DB". If yes, your file has been downloaded properly. Please note that if you are using Berkeley DB for a highly secure/critical setup (or for any other reason) then you should also check the PGP signatures (not covered in this tutorial for simplicity).
Extracting files from the downloaded package:
tar –xvzf db-4.3.29.tar.gzNow, enter the directory where the package is extracted.
Configuring Berkeley DB:Steps below are mandatory for installation on POSIX systems (linux, mac os x etc.). You should also read the documentation that comes in the folder "docs" of Berkeley DB.
cd build_unixReplace "/usr/local/berkeleydb" above with the directory path where you want to copy the files and folders. Note: check for any error message.
../dist/configure --prefix=/usr/local/berkeleydb --enable-compat185 --enable-cxx --enable-debug_rop --enable-debug_wop --enable-rpc
Compiling Berkeley DB:
Note: check for any error message.
Installing Berkeley DB:
As root (for privileges on destination directory), run the following.With sudo,
sudo make installWithout sudo,
Note: check for any error messages.
echo '/usr/local/berkeleydb/lib/' >> /etc/ld.so.conf
That’s it. Berkeley DB has been successfully installed.
Please feel free to use the comments form below if you have any questions or need more explanation on anything. I recommend thoroughy testing on a production-like test system first before moving to production. Use the icons below to share this tutorial with your friends.