Berkeley DB Installation and Build Guide

Legal Notice

This documentation is distributed under an open source license. You may review the terms of this license at: http://www.oracle.com/technology/software/products/berkeley-db/htdocs/oslicense.html

Oracle, Berkeley DB, and Sleepycat are trademarks or registered trademarks of Oracle. All rights to these marks are reserved. No third-party use is permitted without the express prior written consent of Oracle.

Other names may be trademarks of their respective owners.

To obtain a copy of this document's original source code, please submit a request to the Oracle Technology Network forum at: http://forums.oracle.com/forums/forum.jspa?forumID=271

3/30/2010


Table of Contents

Preface
Conventions Used in this Book
For More Information
1. Introduction
Installation Overview
2. System Installation Notes
File utility /etc/magic information
Magic information
Big-endian magic information
Little-endian magic information
Building with multiple versions of Berkeley DB
3. Debugging Applications
Introduction to debugging
Compile-time configuration
Run-time error information
Reviewing Berkeley DB log files
Augmenting the Log for Debugging
Extracting Committed Transactions and Transaction Status
Extracting Transaction Histories
Extracting File Histories
Extracting Page Histories
Other log processing tools
4. Building Berkeley DB for Windows
Building Berkeley DB for 32 bit Windows
Visual C++ .NET 2008
Visual C++ .NET 2005
Build results
Building Berkeley DB for 64-bit Windows
x64 build with Visual Studio 2005 or newer
Building Berkeley DB with Cygwin
Building the C++ API
Building the C++ STL API
Building the Java API
Building the C# API
Building the SQL API
Binary Compatibility With SQLite
Enabling Extensions
Building the JDBC Driver
Building the ODBC Driver
Building the Tcl API
Distributing DLLs
Building a small memory footprint library
Running the test suite under Windows
Building the software needed by the tests
Running the test suite under Windows
Building the software needed by the SQL tests
Windows notes
Windows FAQ
5. Building Berkeley DB for Windows Mobile
Building for Windows Mobile
Building Berkeley DB for Windows Mobile
Changing Build Configuration Type
Building Berkeley DB for different target platforms
Windows Mobile notes
Windows Mobile FAQ
6. Building Berkeley DB for UNIX/POSIX
Building for UNIX/POSIX
Building the Berkeley DB SQL Interface
Configuring Berkeley DB
Configuring the SQL Interface
Enabling Extensions
Building the JDBC Driver
Building the ODBC Driver
Building a small memory footprint library
Changing compile or load options
Installing Berkeley DB
Dynamic shared libraries
Running the test suite under UNIX
Building SQL Test Suite on Unix
Architecture independent FAQ
AIX
FreeBSD
HP-UX
IRIX
Linux
Mac OS X
OSF/1
QNX
SCO
Solaris
SunOS
Ultrix
7. Building Berkeley DB for VxWorks
Building for VxWorks 5.4 and 5.5
Building With Tornado 2.0 or Tornado 2.2
Building for VxWorks 6.x
Building With Wind River Workbench using the Makefile
VxWorks notes
Building and Running the Demo Program
Building and Running the Utility Programs
VxWorks 5.4/5.5: shared memory
VxWorks 5.4/5.5: building a small memory footprint library
Support for Replication Manager
VxWorks FAQ
8. Upgrading from previous versions of Berkeley DB
Library version information
Upgrading Berkeley DB installations
9. Upgrading Berkeley DB 4.8 applications to Berkeley DB 11gR2
Introduction
db_sql Renamed to db_sql_codegen
DB_REP_CONF_NOAUTOINIT Replaced
Support for Multiple Client-to-Client Peers
Cryptography Support
DB_NOSYNC Flag to Flush Files
Dropped Support
Changing Stack Size
Berkeley DB 11g Release 2 Change Log
Database or Log File On-Disk Format Changes
New Features
Database Environment Changes
Access Method Changes
Locking Subsystem Changes
Logging Subsystem Changes
Memory Pool Subsystem Changes
Mutex Subsystem Changes
Tcl-specific API Changes
C#-specific API Changes
API Changes
Replication Changes
Transaction Subsystem Changes
Utility Changes
Example Changes
Deprecated Features
Configuration, Documentation, Sample Apps, Portability and Build Changes
Known Bugs
10. Upgrading Berkeley DB 4.7 applications to Berkeley DB 4.8
Introduction
Registering DPL Secondary Keys
Minor Change in Behavior of DB_MPOOLFILE->get
Dropped Support for fcntl System Calls
Upgrade Requirements
Berkeley DB 4.8.28 Change Log
Changes between 4.8.26 and 4.8.28:
Known bugs in 4.8
Changes between 4.8.24 and 4.8.26:
Changes between 4.8.21 and 4.8.24:
Changes between 4.7 and 4.8.21:
Database or Log File On-Disk Format Changes:
New Features:
Database Environment Changes:
Concurrent Data Store Changes:
General Access Method Changes:
Btree Access Method Changes:
Hash Access Method Changes:
Queue Access Method Changes:
Recno Access Method Changes:
C-specific API Changes:
C++-specific API Changes:
Java-specific API Changes:
Direct Persistence Layer (DPL), Bindings and Collections API:
Tcl-specific API Changes:
RPC-specific Client/Server Changes:
Replication Changes:
XA Resource Manager Changes:
Locking Subsystem Changes:
Logging Subsystem Changes:
Memory Pool Subsystem Changes:
Mutex Subsystem Changes:
Test Suite Changes
Transaction Subsystem Changes:
Utility Changes:
Configuration, Documentation, Sample Application, Portability and Build Changes:
11. Upgrading Berkeley DB 4.6 applications to Berkeley DB 4.7
Introduction
Run-time configuration
Replication API
Tcl API
DB_ENV->set_intermediate_dir
Log configuration
Upgrade Requirements
Berkeley DB 4.7.25 Change Log
Database or Log File On-Disk Format Changes:
New Features:
Database Environment Changes:
Concurrent Data Store Changes:
General Access Method Changes:
Btree Access Method Changes:
Hash Access Method Changes:
Queue Access Method Changes:
Recno Access Method Changes:
C-specific API Changes:
Java-specific API Changes:
Direct Persistence Layer (DPL), Bindings and Collections API:
Tcl-specific API Changes:
RPC-specific Client/Server Changes:
Replication Changes:
XA Resource Manager Changes:
Locking Subsystem Changes:
Logging Subsystem Changes:
Memory Pool Subsystem Changes:
Mutex Subsystem Changes:
Transaction Subsystem Changes:
Utility Changes:
Configuration, Documentation, Sample Application, Portability and Build Changes:
12. Upgrading Berkeley DB 4.5 applications to Berkeley DB 4.6
Introduction
C API cursor handle method names
DB_MPOOLFILE->put
B_MPOOLFILE->set
Replication Events
DB_REP_FULL_ELECTION
Verbose Output
DB_VERB_REPLICATION
Windows 9X
Upgrade Requirements
Berkeley DB 4.6.21 Change Log
4.6.21 Patches:
4.6.19 Patches
Database or Log File On-Disk Format Changes:
New Features:
Database Environment Changes:
Concurrent Data Store Changes:
General Access Method Changes:
Btree Access Method Changes:
Hash Access Method Changes:
Queue Access Method Changes:
Recno Access Method Changes:
C++-specific API Changes:
Java-specific API Changes:
Java collections and bind API Changes:
Tcl-specific API Changes:
RPC-specific Client/Server Changes:
Replication Changes:
XA Resource Manager Changes:
Locking Subsystem Changes:
Logging Subsystem Changes:
Memory Pool Subsystem Changes:
Transaction Subsystem Changes:
Utility Changes:
Configuration, Documentation, Portability and Build Changes:
13. Upgrading Berkeley DB 4.4 applications to Berkeley DB 4.5
Introduction
deprecated interfaces
DB->set_isalive
DB_ENV->rep_elect
Replication method naming
Replication events
Memory Pool API
DB_ENV->set_paniccall
DB->set_pagesize
Collections API
--enable-pthread_self
Recno backing text source files
Application-specific logging
Upgrade Requirements
Berkeley DB 4.5.20 Change Log
Database or Log File On-Disk Format Changes:
New Features:
Database Environment Changes:
Concurrent Data Store Changes:
General Access Method Changes:
Btree Access Method Changes:
Hash Access Method Changes:
Queue Access Method Changes:
Recno Access Method Changes:
C++-specific API Changes:
Java-specific API Changes:
Java collections and bind API Changes:
Tcl-specific API Changes:
RPC-specific Client/Server Changes:
Replication Changes:
XA Resource Manager Changes:
Locking Subsystem Changes:
Logging Subsystem Changes:
Memory Pool Subsystem Changes:
Transaction Subsystem Changes:
Utility Changes:
Configuration, Documentation, Portability and Build Changes:
14. Upgrading Berkeley DB 4.3 applications to Berkeley DB 4.4
Introduction
DB_AUTO_COMMIT
DB_DEGREE_2, DB_DIRTY_READ
DB_JOINENV
mutexes
DB_MPOOLFILE->set_clear_len
lock statistics
Upgrade Requirements
Berkeley DB 4.4.16 Change Log
Database or Log File On-Disk Format Changes:
New Features:
Database Environment Changes:
Concurrent Data Store Changes:
General Access Method Changes:
Btree Access Method Changes:
Hash Access Method Changes:
Queue Access Method Changes:
Recno Access Method Changes
C++-specific API Changes:
Java-specific API Changes:
Java collections and bind API Changes:
Tcl-specific API Changes:
RPC-specific Client/Server Changes:
Replication Changes:
XA Resource Manager Changes:
Locking Subsystem Changes:
Logging Subsystem Changes:
Memory Pool Subsystem Changes:
Transaction Subsystem Changes:
Utility Changes:
Configuration, Documentation, Portability and Build Changes:
Berkeley DB 4.4.20 Change Log
Changes since Berkeley DB 4.4.16:
15. Upgrading Berkeley DB 4.2 applications to Berkeley DB 4.3
Introduction
Java
DB_ENV->set_errcall, DB->set_errcall
DBcursor->c_put
DB->stat
DB_ENV->set_verbose
Logging
DB_FILEOPEN
ENOMEM and DbMemoryException
Replication
Run-time configuration
Upgrade Requirements
Berkeley DB 4.3.29 Change Log
Database or Log File On-Disk Format Changes:
New Features:
Database Environment Changes:
Concurrent Data Store Changes:
General Access Method Changes:
Btree Access Method Changes:
Hash Access Method Changes:
Queue Access Method Changes:
Recno Access Method Changes
C++-specific API Changes:
Java-specific API Changes:
Tcl-specific API Changes:
RPC-specific Client/Server Changes:
Replication Changes:
XA Resource Manager Changes:
Locking Subsystem Changes:
Logging Subsystem Changes:
Memory Pool Subsystem Changes:
Transaction Subsystem Changes:
Utility Changes:
Configuration, Documentation, Portability and Build Changes:
16. Upgrading Berkeley DB 4.1 applications to Berkeley DB 4.2
Introduction
Java
Queue access method
DB_CHKSUM_SHA1
DB_CLIENT
DB->del
DB->set_cache_priority
DB->verify
DB_LOCK_NOTGRANTED
Replication
Replication initialization
Database methods and replication clients
DB_ENV->rep_process_message()
Client replication environments
Tcl API
Upgrade Requirements
Berkeley DB 4.2.52 Change Log
Database or Log File On-Disk Format Changes:
New Features:
Database Environment Changes:
Concurrent Data Store Changes:
General Access Method Changes:
Btree Access Method Changes:
Hash Access Method Changes:
Queue Access Method Changes:
Recno Access Method Changes:
C++-specific API Changes:
Java-specific API Changes:
Tcl-specific API Changes:
RPC-specific Client/Server Changes:
Replication Changes:
XA Resource Manager Changes:
Locking Subsystem Changes:
Logging Subsystem Changes:
Memory Pool Subsystem Changes:
Transaction Subsystem Changes:
Utility Changes:
Configuration, Documentation, Portability and Build Changes:
17. Upgrading Berkeley DB 4.0 applications to Berkeley DB 4.1
Introduction
DB_EXCL
DB->associate, DB->open, DB->remove, DB->rename
DB_ENV->log_register
st_flushcommit
DB_CHECKPOINT, DB_CURLSN
DB_INCOMPLETE
DB_ENV->memp_sync
DB->stat.hash_nelem
Java exceptions
C++ exceptions
Application-specific logging and recovery
Upgrade Requirements
Berkeley DB 4.1.24 and 4.1.25 Change Log
Database or Log File On-Disk Format Changes:
Major New Features:
General Environment Changes:
General Access Method Changes:
Btree Access Method Changes:
Hash Access Method Changes:
Queue Access Method Changes:
Recno Access Method Changes:
C++-specific API Changes:
Java-specific API Changes:
Tcl-specific API Changes:
RPC-specific Client/Server Changes:
Replication Changes:
XA Resource Manager Changes:
Locking Subsystem Changes:
Logging Subsystem Changes:
Memory Pool Subsystem Changes:
Transaction Subsystem Changes:
Utility Changes:
Configuration, Documentation, Portability and Build Changes:
Berkeley DB 4.1.25 Change Log
18. Upgrading Berkeley DB 3.3 applications to Berkeley DB 4.0
Introduction
db_deadlock
lock_XXX
log_XXX
memp_XXX
txn_XXX
db_env_set_XXX
DB_ENV->set_server
DB_ENV->set_lk_max
DB_ENV->lock_id_free
Java CLASSPATH environment variable
C++ ostream objects
application-specific recovery
Upgrade Requirements
4.0.14 Change Log
Major New Features:
General Environment Changes:
General Access Method Changes:
Btree Access Method Changes:
Hash Access Method Changes:
Queue Access Method Changes:
Recno Access Method Changes:
C++ API Changes:
Java API Changes:
Tcl API Changes:
RPC Client/Server Changes:
XA Resource Manager Changes:
Locking Subsystem Changes:
Logging Subsystem Changes:
Memory Pool Subsystem Changes:
Transaction Subsystem Changes:
Utility Changes:
Database or Log File On-Disk Format Changes:
Configuration, Documentation, Portability and Build Changes:
19. Upgrading Berkeley DB 3.2 applications to Berkeley DB 3.3
introduction
DB_ENV->set_server
DB->get_type
DB->get_byteswapped
DB->set_malloc, DB->set_realloc
DB_LOCK_CONFLICT
memp_fget, EIO
txn_prepare
--enable-dynamic, --enable-shared
--disable-bigfile
Upgrade Requirements
20. Upgrading Berkeley DB 3.1 applications to Berkeley DB 3.2
introduction
DB_ENV->set_flags
DB callback functions, app_private field
Logically renumbering records
DB_INCOMPLETE
DB_ENV->set_tx_recover
DB_ENV->set_mutexlocks
Java and C++ object reuse
Java java.io.FileNotFoundException
db_dump
Upgrade Requirements
21. Upgrading Berkeley DB 3.0 applications to Berkeley DB 3.1
introduction
DB_ENV->open, DB_ENV->remove
DB_ENV->set_tx_recover
DB_ENV->set_feedback, DB->set_feedback
DB_ENV->set_paniccall, DB->set_paniccall
DB->put
identical duplicate data items
DB->stat
DB_SYSTEM_MEM
log_register
memp_register
txn_checkpoint
environment configuration
Tcl API
DB_TMP_DIR
log file pre-allocation
Upgrade Requirements
22. Upgrading Berkeley DB 2.X applications to Berkeley DB 3.0
introduction
environment open/close/unlink
function arguments
DB_ENV structure
database open/close
db_xa_open
DB structure
DBINFO structure
DB->join
DB->stat
DB->sync and DB->close
lock_put
lock_detect
lock_stat
log_register
log_stat
memp_stat
txn_begin
txn_commit
txn_stat
DB_RMW
DB_LOCK_NOTHELD
EAGAIN
EACCES
db_jump_set
db_value_set
DbEnv class for C++ and Java
Db class for C++ and Java
additional C++ changes
additional Java changes
Upgrade Requirements
23. Upgrading Berkeley DB 1.85 or 1.86 applications to Berkeley DB 2.0
Introduction
System Integration
Converting Applications
Upgrade Requirements
24. Test Suite
Running the test suite
Running SQL Test Suite on Unix
Running SQL Test Suite on Windows
Test suite FAQ