BDB Installation
BDB Installation
12c Release 1
Legal Notice
Published 6/18/2015
Table of Contents
Preface ..................................................................................................... xii
Conventions Used in this Book ................................................................... xii
For More Information .............................................................................. xii
Contact Us .................................................................................... xii
1. Introduction .............................................................................................. 1
Installation Overview ................................................................................ 1
Supported Platforms ................................................................................ 1
2. System Installation Notes ............................................................................ 3
File utility /etc/magic information ............................................................... 3
Magic information ............................................................................. 3
Big-endian magic information ............................................................... 4
Little-endian magic information ............................................................ 7
Building with multiple versions of Berkeley DB ................................................ 9
3. Debugging Applications .............................................................................. 11
Introduction to debugging ........................................................................ 11
Compile-time configuration ...................................................................... 11
Run-time error information ....................................................................... 12
Reviewing Berkeley DB log files ................................................................. 12
Augmenting the Log for Debugging ....................................................... 16
Extracting Committed Transactions and Transaction Status ........................... 16
Extracting Transaction Histories ........................................................... 16
Extracting File Histories .................................................................... 16
Extracting Page Histories ................................................................... 16
Other log processing tools ................................................................. 17
4. Building Berkeley DB for Android ................................................................... 18
Building the Drop-In Replacement for Android ................................................ 18
Migrating from SQLite to Berkeley DB ................................................... 19
Building the Android JDBC Driver ............................................................... 20
Android Configuration Options ................................................................... 25
Using the JDBC Driver in ADF Mobile for Android ............................................. 26
5. Building Berkeley DB for Windows ................................................................ 29
Building Berkeley DB for 32 bit Windows ...................................................... 29
Visual C++ .NET 2012 ........................................................................ 29
Visual C++ .NET 2010 ........................................................................ 29
Visual C++ .NET 2008 ........................................................................ 30
Visual C++ .NET 2005 ........................................................................ 30
Build results .................................................................................. 30
Building Berkeley DB for 64-bit Windows ...................................................... 31
x64 build with Visual Studio 2005 or newer ............................................. 31
Building Berkeley DB with Cygwin ............................................................... 31
Building the C++ API ............................................................................... 31
Building the C++ STL API ......................................................................... 31
Building the Java API .............................................................................. 32
Building the C# API ................................................................................ 33
Building the SQL API ............................................................................... 33
Binary Compatibility With SQLite ......................................................... 33
6/18/2015
DB Installation Guide
Page iii
6/18/2015
DB Installation Guide
Page iv
6/18/2015
DB Installation Guide
62
64
65
65
66
66
66
66
67
67
67
68
68
69
70
71
72
73
74
75
75
78
80
80
81
81
82
82
84
84
86
87
87
87
87
88
88
88
88
92
92
92
92
92
92
92
93
93
93
Page v
6/18/2015
DB Installation Guide
Page vi
6/18/2015
DB Installation Guide
105
106
106
106
106
106
106
107
107
107
107
107
107
107
108
108
109
109
109
109
110
110
110
110
111
111
111
112
112
112
112
113
113
113
114
114
115
115
115
115
115
115
115
115
116
116
116
116
116
Page vii
6/18/2015
DB Installation Guide
116
117
117
117
117
117
117
118
118
118
118
118
118
119
119
119
120
120
121
122
122
122
122
122
123
123
123
123
123
124
124
124
124
124
124
124
124
125
125
125
126
126
127
127
127
127
127
128
128
Page viii
6/18/2015
DB Installation Guide
128
128
128
128
128
128
129
129
129
130
130
130
130
131
131
131
131
131
131
132
132
132
133
134
134
134
135
136
136
136
136
137
137
137
137
138
138
138
138
139
139
139
139
139
139
139
139
139
141
Page ix
6/18/2015
DB Installation Guide
141
141
142
142
142
143
143
144
144
145
145
145
145
146
146
146
146
147
147
147
147
148
148
148
148
148
148
149
149
149
149
149
151
152
152
152
153
154
155
155
155
155
156
156
156
156
157
157
158
Page x
6/18/2015
DB Installation Guide
Page xi
Preface
Welcome to Berkeley DB (DB). This document describes how to build, install and upgrade
Berkeley DB
This document reflects Berkeley DB 12c Release 1, which provides DB library version 12.1.6.1.
Note
Finally, notes of interest are represented using a note block such as this.
Contact Us
You can post your comments and questions at the Oracle Technology (OTN) forum for
6/18/2015
DB Installation Guide
Page xii
For sales or support information, email to: [email protected] You can subscribe
to a low-volume email announcement list for the Berkeley DB product family by sending email
to: [email protected]
6/18/2015
DB Installation Guide
Page xiii
Chapter 1. Introduction
Welcome to the Berkeley DB. This manual describes how to configure, build and install
Berkeley DB. Installation of DB for all of the platforms it officially supports is described in
this manual. Upgrade instructions and release notes for newer versions of this product are
described here. For infomation on upgrading from historical versions, see the Berkeley DB
Upgrade Guide.
Note that some operating systems and distributions might provide DB, either by default or
as part of an installation option. If so, those platforms will have installation instructions for
DB specific to them. In this situation, you should see the documentation for your operating
system or distribution provider for information on how to get DB on your platform.
Installation Overview
Berkeley DB is an open-source product, and as such it is usually offered in source-code format.
This means that placing DB on your platform requires you to configure the build scripts,
compile it, and then install the product onto your host system. The exception to this are
Microsoft Windows platforms for which a binary installer is available. Note that for Windows
platforms, you can still compile the product from source if you desire.
For *nix systems, including the BSD and Linux systems, the usual configure, make and make
install installation process is used to place DB on your platform.
For information on building and installing Berkeley DB on:
Microsoft Windows, see Building Berkeley DB for Windows (page 29) or Building Berkeley
DB for Windows Mobile (page 48).
Unix/POSIX including Linux, BSD, Apple iOS (known as iPhone OS previously), and Mac OS
X see Building Berkeley DB for UNIX/POSIX (page 55).
VxWorks, see Building Berkeley DB for VxWorks (page 87).
Supported Platforms
You can install Berkeley DB on the following platforms:
Most versions of Linux (x86-64 and x86) including:
Oracle Linux 4, 5, and 6
Red Hat
Ubuntu
Wind River
MontaVista Embedded Linux version 6.0
Oracle Solaris versions 9 and 10 on x86_64, x86, and SPARC.
6/18/2015
DB Installation Guide
Page 1
Introduction
FreeBSD
Microsoft Windows (x86-64 and x86).
XP (SP2, SP3)
Vista
Windows 7
Server 2008
Windows Mobile (6.x)
Apple Mac OS X 10.5 and 10.6.
IBM AIX version 5 and 6.
VxWorks 6.x
QNX Neutrino/POSIX version 6
Android
Apple iOS (previously known as iPhone OS)
Apart from those mentioned in the list above, you can install Berkeley DB on most other
systems which are POSIX-compliant. When there is a need to run Berkeley DB on a platform
that is currently not supported, DB is distributed in source code form that you can use as
base source to port Berkeley DB to that platform. For more information on porting to other
platforms, see the Berkeley DB Porting Guide.
6/18/2015
DB Installation Guide
Page 2
Magic information
#
#
#
#
#
#
#
#
Berkeley DB
Ian Darwin's file /etc/magic files: big/little-endian version.
Hash 1.85/1.86 databases store metadata in network byte order.
Btree 1.85/1.86 databases store the metadata in host byte order.
Hash and Btree 2.X and later databases store the metadata in
host byte order.
6/18/2015
DB Installation Guide
Page 3
Berkeley DB
System V /etc/magic files: big-endian version.
Hash 1.85/1.86 databases store metadata in network byte order.
Btree 1.85/1.86 databases store the metadata in host byte order.
Hash and Btree 2.X and later databases store the metadata in
host byte order.
0 long
0x00053162 Berkeley DB 1.85/1.86 (Btree,
>4 long 0x00000002 version 2,
>4 long 0x00000003 version 3,
6/18/2015
DB Installation Guide
Page 4
6/18/2015
DB (Hash,
4,
5,
6,
7,
8,
DB Installation Guide
Page 5
6/18/2015
DB (Log,
1,
2,
3,
DB Installation Guide
Page 6
>16
>16
>16
>16
>16
>16
>16
>16
>16
>16
>16
>16
>12
long
long
long
long
long
long
long
long
long
long
long
long
long
0x04000000
0x05000000
0x06000000
0x07000000
0x08000000
0x09000000
0x0a000000
0x0b000000
0x0c000000
0x0d000000
0x0e000000
0x0f000000
0x88090400
version 4,
version 5,
version 6,
version 7,
version 8,
version 9,
version 10,
version 11,
version 12,
version 13,
version 14,
version 15,
little-endian)
Berkeley DB
System V /etc/magic files: little-endian version.
Hash 1.85/1.86 databases store metadata in network byte order.
Btree 1.85/1.86 databases store the metadata in host byte order.
Hash and Btree 2.X and later databases store the metadata in
host byte order.
6/18/2015
DB (Btree,
4,
5,
6,
7,
8,
DB Installation Guide
Page 7
6/18/2015
DB (Queue,
1,
2,
3,
4,
5,
6,
DB Installation Guide
Page 8
>16
>16
>16
>12
long
long
long
long
0x07000000
0x08000000
0x09000000
0x53220400
version 7,
version 8,
version 9,
big-endian)
6/18/2015
DB Installation Guide
Page 9
To create a Berkeley DB library whose symbols won't collide with other Berkeley DB libraries
(or other application or library modules, for that matter), configure Berkeley DB using the
--with-uniquename=NAME configuration option, and then build Berkeley DB as usual. (Note
that --with-uniquename=NAME only affects the Berkeley DB C language library build; loading
multiple versions of the C++ or Java APIs will require additional work.) The modified symbol
names are hidden from the application in the Berkeley DB header files, that is, there is
no need for the application to be aware that it is using a special library build as long as it
includes the appropriate Berkeley DB header file.
If "NAME" is not specified when configuring with --with-uniquename=NAME, a default value
built from the major and minor numbers of the Berkeley DB release will be used. It is rarely
necessary to specify NAME; using the major and minor release numbers will ensure that only
one copy of the library will be loaded into the application unless two distinct versions really
are necessary.
When distributing any library software that uses Berkeley DB, or any software which will
be recompiled by users for their systems, we recommend two things: First, include the
Berkeley DB release as part of your release. This will insulate your software from potential
Berkeley DB API changes as well as simplifying your coding because you will only have to code
to a single version of the Berkeley DB API instead of adapting at compile time to whatever
version of Berkeley DB happens to be installed on the target system. Second, use --withuniquename=NAME when configuring Berkeley DB, because that will insure that you do not
unexpectedly collide with other application code or a library already installed on the target
system.
6/18/2015
DB Installation Guide
Page 10
Compile-time configuration
There are three compile-time configuration options that assist in debugging Berkeley DB and
Berkeley DB applications:
--enable-debug
If you want to build Berkeley DB with -g as the C and C++ compiler flag, enter
--enable-debug as an argument to configure. This will create Berkeley DB with
debugging symbols, as well as load various Berkeley DB routines that can be called
directly from a debugger to display database page content, cursor queues, and so
forth. (Note that the -O optimization flag will still be specified. To compile with only
the -g, explicitly set the CFLAGS environment variable before configuring.)
6/18/2015
DB Installation Guide
Page 11
Debugging Applications
--enable-diagnostic
If you want to build Berkeley DB with debugging run-time sanity checks and with
DIAGNOSTIC #defined during compilation, enter --enable-diagnostic as an argument to
configure. This will cause a number of special checks to be performed when Berkeley
DB is running. This flag should not be defined when configuring to build production
binaries because it degrades performance.
--enable-umrw
When compiling Berkeley DB for use in run-time memory consistency checkers (in
particular, programs that look for reads and writes of uninitialized memory), use -enable-umrw as an argument to configure. This guarantees, among other things, that
Berkeley DB will completely initialize allocated pages rather than initializing only the
minimum necessary amount.
6/18/2015
DB Installation Guide
Page 12
Debugging Applications
The opening numbers in square brackets are the log sequence number (LSN) of the log record
being displayed. The first number indicates the log file in which the record appears, and the
second number indicates the offset in that file of the record.
The first character string identifies the particular log operation being reported. The log
records corresponding to particular operations are described following. The rest of the line
consists of name/value pairs.
The rec field indicates the record type (this is used to dispatch records in the log to
appropriate recovery functions).
The txnid field identifies the transaction for which this record was written. A txnid of 0 means
that the record was written outside the context of any transaction. You will see these most
frequently for checkpoints.
Finally, the prevlsn contains the LSN of the last record for this transaction. By following
prevlsn fields, you can accumulate all the updates for a particular transaction. During
normal abort processing, this field is used to quickly access all the records for a particular
transaction.
After the initial line identifying the record type, each field of the log record is displayed, one
item per line. There are several fields that appear in many different records and a few fields
that appear only in some records.
The following table presents each currently written log record type with a brief description of
the operation it describes. Any of these record types may have the string "_debug" appended
if they were written because DB_TXN_NOT_DURABLE was specified and the system was
configured with --enable-diagnostic.
6/18/2015
Description
bam_adj
bam_cadjust
bam_cdel
bam_curadj
bam_merge
bam_pgno
bam_rcuradj
bam_relink
bam_repl
bam_root
DB Installation Guide
Page 13
Debugging Applications
6/18/2015
Description
bam_rsplit
bam_split
crdel_inmem_create
crdel_inmem_remove
crdel_inmem_rename
crdel_metasub
db_addrem
db_big
db_cksum
db_debug
db_noop
db_ovref
db_pg_alloc
db_pg_free
db_pg_freedata
db_pg_init
db_pg_sort
dbreg_register
fop_create
fop_file_remove
fop_remove
fop_rename
fop_write
DB Installation Guide
Page 14
Debugging Applications
6/18/2015
Description
ham_chgpg
ham_copypage
ham_curadj
ham_groupalloc
ham_insdel
ham_metagroup
ham_newpage
ham_replace
ham_splitdata
heap_addrem
heap_pg_alloc
heap_trunc_meta
heap_trunc_page
qam_add
qam_del
qam_delext
qam_incfirst
qam_mvptr
txn_child
txn_ckp
Transaction checkpoint.
txn_recycle
DB Installation Guide
Page 15
Debugging Applications
Description
txn_regop
txn_xa_regop
6/18/2015
DB Installation Guide
Page 16
Debugging Applications
6/18/2015
DB Installation Guide
Page 17
Note
A drop in replacement refers to replacing all instances of SQLite in an Android OS
build with Berkeley DB SQL. All databases will be created in the Berkeley DB SQL
format including any created with the Java SQLite.* API. This solution requires that
users re-compile a custom Android OS image (it is only relevant for platform/device
vendors).
1.
2.
3.
4.
6/18/2015
Tuning parameters.
DB Installation Guide
Page 18
The configuration options for performance tuning can be added/edited in the Android.mk
file by modifying LOCAL_CFLAGS located in the build libsqlite replacement section.
For more information, see Android Configuration Options (page 25).
It is also possible to change these settings using PRAGMA commands or through the
DB_CONFIG file.
5.
cd <root>
. build/envsetup.sh
make clean-libsqlite
mmm -B external/sqlite/dist
make snod
6/18/2015
DB Installation Guide
Page 19
-DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_FTS3 \
-DSQLITE_ENABLE_FTS3_BACKWARDS -DTHREADSAFE=1"
CFLAGS="${CFLAGS} -I${INCLUDE}"
LDFLAGS="-ldl -nostdlib -Wl,--gc-sections -lc -llog -lgcc \
-Wl,--no-undefined,-z,nocopyreloc ${LIB}/crtend_android.o \
${LIB}/crtbegin_dynamic.o -L${LIB} -Wl,-rpath,${LIB}"
${CC} -DANDROID -DOS_ANDROID --sysroot="${SYSROOT}" -mandroid \
-fvisibility=hidden -ffunction-sections -fdata-sections \
-fPIC ${LDFLAGS} ${CFLAGS} \
sqlite3.c shell.c -o sqlite3orig
Ensure you adjust the variables as per your actual Android environment. This script is
suited for Android 2.2.
2.
Execute the build_sqlite3_shell.sh script and to get the static sqlite3 shell utility sqlite3orig.
3.
Note
To open the database in the SQLite format use the sqlite3orig command.
Download and install the Android SDK. The installation instructions can be found here:
http://developer.android.com/sdk/installing/index.html
2.
6/18/2015
DB Installation Guide
Page 20
http://developer.android.com/tools/sdk/ndk/index.html
3.
If you do not already have it, download the Berkeley DB package from here:
http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/
downloads/index.html
Note that you must be using a 5.3.x or higher version of the product in order for
these instructions to work. Once you have the package, unpack it:
$ tar zxvf db-x.y.z.tar.gz
$ cd db-x.y.z
Where x.y.z the major, minor, and point release version of the Berkeley DB
distribution which you are using.
Also, note that in the following instructions, the directory denoted by db-x.y.z,
above, is referred to as <db>.
b.
Build an x86/x64 JDBC package. This is required because the building process will
generate target files which are required to build Android NDK. Also, the built JAR
file can be imported by eclipse, which will then convert it to the Android Dalvik JAR
format.
To do this, edit <db>/lang/sql/jdbc/SQLit/Database.java and
replace all instances of System.loadLibrary("sqlite_jni") with
System.loadLibrary("oracle-jdbc").
Once you have done this, configure and make the library. The following example
shows the minimum configuration options that you need to use in order to configure
the Berkeley DB JDBC driver. For your particular installation, other configuration
options might be interesting to you. See Configuring Berkeley DB (page 56) and
Android Configuration Options (page 25) for more information.
cd <db>/build_unix
../dist/configure --enable-jdbc && make
4.
6/18/2015
DB Installation Guide
Page 21
# ./dbsql test.db
dbsql> pragma key="xyzzy";
dbsql> .tables
t1
5.
Having built the JDBC driver, you can now use it with your project. You can do this using
Eclipse and the ADT plugin, which you can get from here:
http://developer.android.com/tools/sdk/eclipse-adt.html
To make sure everything is working:
1.
2.
This results in an empty code file. Copy and paste the following example code into that
file:
package example.testjdbc;
import SQLite.*;
import java.io.*;
import
import
import
import
android.app.Activity;
android.os.Bundle;
android.widget.TextView;
java.sql.*;
6/18/2015
DB Installation Guide
Page 22
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("App Started");
setContentView(tv);
System.out.println("Appstart: ");
String url =
"jdbc:sqlite://data/data/example.testjdbc/example.db";
Connection con;
String dropString = "drop table if exists COFFEES";
String createString;
createString = "create table COFFEES "
+ "(COF_NAME varchar(32), "
+ "SUP_ID int, " + "PRICE float, " + "SALES int, "
+ "TOTAL int)";
String insertString = "drop table COFFEES if exisits";
String query = "select COF_NAME, PRICE from COFFEES";
Statement stmt;
try {
Class.forName("SQLite.JDBCDriver");
} catch (java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try {
con =
DriverManager.getConnection(url, "myLogin", "myPW");
stmt = con.createStatement();
stmt.executeUpdate(dropString);
stmt.executeUpdate(createString);
stmt.close();
stmt = con.createStatement();
stmt.executeUpdate("insert into COFFEES "
+ "values('Colombian', 00101, 7.99, 0, 0)");
stmt.executeUpdate("insert into COFFEES "
+ "values('French_Roast', 00049, 8.99, 0, 0)");
stmt.executeUpdate("insert into COFFEES "
+ "values('Espresso', 00150, 9.99, 0, 0)");
stmt.executeUpdate("insert into COFFEES "
6/18/2015
DB Installation Guide
Page 23
4.
Back in Eclipse, right click the project name, and select the refresh option to reload the
project from the directory. The two new files that were copied into place in the previous
step are now included in the project view.
5.
6.
6/18/2015
a.
b.
c.
d.
Choose Property -> Android and select any one of the usable build targets.
b.
DB Installation Guide
Page 24
7.
Verify your installation. After a short pause (depending on the speed of your system), the
application logo is displayed. Use the Android adb command line application to make sure
the application is running as expected:
$ cd <android-sdk>/platform-tools
$ ./adb logcat
I/System.out( 539): Appstart:
I/System.out( 539): Coffee Break Coffees and Prices:
I/System.out( 539): Colombian
7.99
I/System.out( 539): French_Roast
8.99
I/System.out( 539): Espresso
9.99
I/System.out( 539): Colombian_Decaf
8.99
I/System.out( 539): French_Roast_Decaf
9.99
You can also check if the database (example.db) exists in the emulator:
$ ./adb shell ls /data/data/example.testjdbc
example.db
example.db-journal
lib
Finally, check the database using the BDB SQL shell:
$ ./adb push <db>/build_android/jdbc/libs/armeabi/dbsql \
/data/data/example.testjdbc
326 KB/s (1293760 bytes in 3.865s)
$ ./adb shell
root@android:/ # cd /data/data/example.testjdbc
root@android:/data/data/example.testjdbc # ./dbsql example.db
Berkeley DB 11g Release 2, library version 11.2.5.2.36
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
dbsql> .tables
COFFEES
dbsql> select * from COFFEES;
Colombian|101|7.99|0|0
French_Roast|49|8.99|0|0
Espresso|150|9.99|0|0
Colombian_Decaf|101|8.99|0|0
French_Roast_Decaf|49|9.99|0|0
dbsql> .quit
6/18/2015
DB Installation Guide
Page 25
This option enables to convert SQLite database to BDB SQL database format. See Migrating
from SQLite to Berkeley DB (page 19) for more information.
BDBSQL_SHARE_PRIVATE
This flag is enabled by default and keeps all the region files in memory instead of the disk.
This flag also implements database-level locking.
SQLITE_DEFAULT_CACHE_SIZE
SQLite provides an in-memory cache which you size according to the maximum number of
database pages that you want to hold in memory at any given time. See Changing Compile
Options (page 64).
SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT
For SQLite, this pragma identifies the maximum size that the journal file is allowed to be.
Berkeley DB does not have a journal file, but it writes and uses log files. A new log file is
created when the current log file has reached the defined maximum size. This flag defines
the maximum size for a log file. Default value is 10 MB for Berkeley DB SQL interface.
SQLITE_HAS_CODEC
Causes the Berkeley DB SQL interface to be built with encryption support. See SQL
Encryption in the Berkeley DB Getting Started with the SQL APIs guide for usage details.
Hard-coded numbers in the build can be adjusted using the following SQLite PRAGMA
commands:
PRAGMA cache_size
PRAGMA journal_size_limit
You can configure most aspects of your Berkeley DB environment by using the DB_CONFIG file.
2.
6/18/2015
DB Installation Guide
Page 26
c.
3.
4.
Download the ADF Mobile in JDeveloper by selecting Help -> Check for Updates.
The ADF Mobile extension will be downloaded in jdev_install/jdeveloper/jdev/
extensions/oracle.adf.mobile.
b.
c.
d.
5.
6/18/2015
Migrate the database file from SQLite to BDB by the following commands:
DB Installation Guide
Page 27
$ cd HR_SAMPLE/.adf/META-INF
$ mv HR.db HR.db.orig
$ mv hr.sql hr.sql.orig
$ vi hr.sql (Remove all lines with "COMMIT" and "REM") $
BDB_HOME/build_unix/dbsql HR.db
.read hr.sql
.exit
b.
6.
6/18/2015
Configure the ADF Mobile preferences for Android. Select Tools -> Preferences ->
ADF Mobile -> Platforms -> Android. Specify the locations of Android SDK, Android
platform, and the keystore in the Release mode which is used to sign on the
application.
b.
Create a deployment profile. Select Application -> Deploy -> New Deployment Profile.
Choose ADF Mobile for Android as profile type. In the form of deployment profile
properties, choose Release Mode.
c.
Launch the Android SDK Manager and start the AVD emulator.
d.
e.
DB Installation Guide
Page 28
Description
Berkeley_DB.sln
*.vcproj
Berkeley_DB_vs2010.sln
*.vcxproj
These project files can be used to build Berkeley DB for Windows Server 2008, Windows Vista,
Windows 7, Windows Server 2008 R2, and Windows 8.
Choose File -> Open -> Project/Solution.... In the build_windows directory, select
Berkeley_DB_vs2010.sln and click Open.
2.
The Update VC++ Compiler and Libraries dialog box will open automatically. Click Update
and wait for the projects to be converted.
3.
Choose the desired project configuration from the drop-down menu on the tool bar
(either Debug or Release).
4.
Choose the desired platform configuration from the drop-down menu on the tool bar
(usually Win32 or x64).
5.
6/18/2015
1.
Choose File -> Open -> Project/Solution.... In the build_windows directory, select
Berkeley_DB_vs2010.sln and click Open.
2.
Choose the desired project configuration from the drop-down menu on the tool bar
(either Debug or Release).
3.
Choose the desired platform configuration from the drop-down menu on the tool bar
(usually Win32 or x64).
DB Installation Guide
Page 29
4.
Choose File -> Open -> Project/Solution.... In the build_windows directory, select
Berkeley_DB.sln and click Open.
2.
The Visual Studio Conversion Wizard will open automatically. Click the Finish button.
3.
4.
Choose the desired project configuration from the drop-down menu on the tool bar
(either Debug or Release).
5.
Choose the desired platform configuration from the drop-down menu on the tool bar
(usually Win32 or x64).
6.
Choose File -> Open -> Project/Solution.... In the build_windows directory, select
Berkeley_DB.sln and click Open
2.
Choose the desired project configuration from the drop-down menu on the tool bar
(either Debug or Release).
3.
Choose the desired platform configuration from the drop-down menu on the tool bar
(usually Win32 or x64).
4.
Build results
The results of your build will be placed in one of the following Berkeley DB subdirectories,
depending on the configuration that you chose:
build_windows\Win32\Debug
build_windows\Win32\Release
build_windows\Win32\Debug_static
build_windows\Win32\Release_static
When building your application during development, you should normally use compile options
"Debug Multithreaded DLL" and link against build_windows\Debug\libdb61d.lib.
Note
Building your application with the debug configuration will create a Berkeley DB
library and utilities with debugging symbols, as well as load various routines that can
6/18/2015
DB Installation Guide
Page 30
be called from a debugger to display pages, cursor queues, and so forth. If installed,
the utilities will not be stripped. This configuration should not be specified when
building production binaries.
You can also build using a release version of the Berkeley DB libraries and tools, which will be
placed in build_windows\Win32\Release\libdb61.lib. When linking against the release
build, you should compile your code with the "Release Multithreaded DLL" compile option. You
will also need to add the build_windows directory to the list of include directories of your
application's project, or copy the Berkeley DB include files to another location.
Follow the build instructions for your version of Visual Studio, as described in Building
Berkeley DB for 32 bit Windows (page 29).
2.
3.
Right click on Solution 'Berkeley_DB' in the Solution Explorer, and select Build Solution
6/18/2015
DB Installation Guide
Page 31
And you need to include the STL API header files in your application code. If you are using the
Berkeley DB source tree, the header files are in <Berkeley DB Source Root >/stl directory; If
you are using the pre-built installed version, these header files are in < Berkeley DB Installed
Directory>/include, as well as the db.h and db_cxx.h header files.
2.
3.
Set the build type to Release or Debug in the drop-down on the tool bar.
4.
5.
To build, right-click on db_java and select Build. This builds the Java support library
for Berkeley DB and compiles all the java files, placing the resulting db.jar and
dbexamples.jar files in one of the following Berkeley DB subdirectories, depending on
the configuration that you chose:
build_windows\Win32\Debug
6/18/2015
DB Installation Guide
Page 32
build_windows\Win32\Release
6/18/2015
DB Installation Guide
Page 33
Berkeley DB equivalent. For information on migrating data from standard SQLite databases to
a Berkeley DB SQL database, see the Berkeley DB Getting Started with the SQL APIs guide.
Warning
Rename your dlls and executables to the standard SQLite names with extreme care.
Doing this will cause all existing tools to break that currently have data stored in a
standard SQLite database.
For best results, rename your dlls and command line tool to use the standard SQLite
names only if you know there are no other tools on your production platform that
rely on standard SQLite.
Setting Encryption
To enable encryption in the Berkeley DB SQL API, specify SQLITE_HAS_CODEC in Preprocessor
Definitions of the db_sql project. See SQL Encryption in the Berkeley DB Getting Started with
the SQL APIs guide for usage details.
6/18/2015
DB Installation Guide
Page 34
BDBSQL_OMIT_LOG_REMOVE
Berkeley DB automatically removes log files that are no longer required That is, files
that are older than the most recent checkpoint. To disable this functionality, specify
the BDBSQL_OMIT_LOG_REMOVE flag. It is necessary to provide this flag if you are
using replication with Berkeley DB SQL.
BDBSQL_OMIT_SHARING
To create a private environment rather than a shared environment, specify the
BDBSQL_OMIT_SHARING flag. That is, the cache and other region files will be created
in memory rather than using file backed shared memory. For more information, see
the DB_PRIVATE flag of DB_ENV->open()
BDBSQL_SINGLE_THREAD
To disable locking and thread safe connections, specify the BDBSQL_SINGLE_THREAD
flag. If an application is going to use Berkeley DB from a single thread and a single
process, enabling this flag can deliver significant performance advantages.
SQLITE_DEFAULT_CACHE_SIZE
SQLite provides an in-memory cache which you size according to the maximum
number of database pages that you want to hold in memory at any given time.
Berkeley DB's in-memory cache feature performs the same function as SQLite. To
specify the suggested maximum number of pages of disk cache that will be allocated
per open database file specify the SQLITE_DEFAULT_CACHE_SIZE flag. Default value
is 2000 pages. For more information, see the SQLite documentation on PRAGMA
default_cache_size.
SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT
For SQLite, this pragma identifies the maximum size that the journal file is
allowed to be. Berkeley DB does not have a journal file, but it writes and uses
log files. A new log file is created when the current log file has reached the
defined maximum size. To define this maximum size for a log file, specify the
SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT flag. Default value is 10 MB for the Berkeley DB
SQL interface.
Enabling Extensions
The Berkeley DB SQL API provides extensions such as full text search and R-Tree index. To
enable these extensions, do the following:
1.
2.
3.
See the SQLite Documentation for more information on full text search and R-Tree.
6/18/2015
DB Installation Guide
Page 35
Note
Note that disabling log record checksums is meant to only be used with the SQL
interface. However, disabling checksums for the SQL interface also disables checksums
for the non-SQL interfaces.
To disable log checksums, before you build the library edit the build_windows/db_config.h
file, and delete the following line:
#define HAVE_LOG_CHECKSUM 1
Configure your build environment. For information on how to configure to build Java
applications, see Building the Java API (page 32).
2.
3.
4.
To enable encryption in the Berkeley DB SQL JDBC driver, make sure the db_dql project
is built with encryption enabled and specify HAVE_SQLITE3_KEY in Preprocessor
Definitions of the db_sql_jdbc project. See SQL Encryption in the Berkeley DB Getting
Started with the SQL APIs guide for usage details.
5.
You can test the build by entering the following commands from the db\build_windows
\Win32\Debug directory:
javac -cp ".;jdbc.jar" -d . ..\..\..\lang\sql\jdbc\test3.java
6/18/2015
DB Installation Guide
Page 36
Unzip the file containing the sample code to a new directory (for example, jdbc_ex).
2.
Substitute jdbc:sqlite:/<db-file-name> for the generic JDBC URL that appears in the
code. That is, put jdbc:sqlite:/<db-file-name> between the quotation marks in the
line:
String url = "jdbc:mySubprotocol:myDataSource";
Note: The <db-file-name> can either be an absolute path name like "jdbc:sqlite:/D:
\\jdbc_ex_db\\myDataSource", or a relative path-file-name like "jdbc:sqlite:/..
\\jdbc_ex_db\myDataSource", or a file name, like "jdbc:sqlite:/myDataSource",
in which the database file will be stored at the current directory. Note that all path
arguments require a leading slash, even in the case of relative paths or a database in the
local directory. Please refer to the above examples.
3.
4.
Substitute the username and password you use for your database in the following:
"myLogin", "myPassword".
This is optional.
5.
If your JDK version is above 1.5, change the variable name enum in OutputApplet.java
to some other variable name because, as of JDK release 5 enum is a keyword and can not
be used as an identifier.
6/18/2015
DB Installation Guide
Page 37
After you run the CreateCoffees example, use the dbsql executable to open the
myDataSource database file and check if the table COFFEES has been successfully created
in the database.
$ dbsql myDataSourcedbsql> .tables
COFFEES
dbsql> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE COFFEES (COF_NAME varchar(32),/
SUP_ID int, PRICE float, SALES int, TOTAL int);
COMMIT;
dbsql>
3.
Build the JDBC driver. For more information, see Building the JDBC Driver (page 36) .
Ensure that the Java environment used to build the JDBC driver is same as used in ADF/
JDeveloper.
Include JDBC driver path in the system CLASSPATH and LD_LIBRARY_PATH.
2.
Create BDB JDBC Database Connection in JDeveloper. ADF accesses the database by
Database Connection. As long as the database file exists and has tables, you can see all
tables located by the database connection in the project application resources panel.
Select File -> New -> General -> Connections -> Database Connection.
a.
b.
In the "Generic JDBC Settings" section, select "New" to register a JDBC driver.
6/18/2015
a.
b.
In the library information form, select User -> New to create a library.
DB Installation Guide
Page 38
c.
Enter "DBSQL_JDBC" for "Library Name," and add the path of the JDBC driver to
the Class Path.
d.
3.
a.
Configure the JDBC URL with jdbc:sqlite:/<db-file-name>. The <db-filename> should include the database file path which must be absolute.
b.
Apply BDB JDBC Database Connection in the ADF application. After successfully creating
the database connection, you can create and initialize ADF BC component with it. During
initialization, choose "SQL92" as SQL Platform and "Java" as Data Type Map for the
connection.
You can define the ADF BC component by adding entity objects, view objects etc. and the
database connection takes charge of accessing the database. For more information, see
the example lang/sql/adf/EX_ADF.
Download and install the latest SQLite ODBC driver Windows installer package for 32 bit
Windows or 64 bit Windows.
2.
Download and install the latest Microsoft Data Access Components (MDAC) SDK . The
MDAC SDK is only required for testing the installation.
6/18/2015
1.
Build the SQL project in Release mode. See Building the SQL API (page 33).
2.
3.
4.
5.
6.
7.
Select build_windows.
DB Installation Guide
Page 39
8.
9.
Select db_sql_odbc.vcproj and add it to the Berkeley_DB solution. This adds the
db_sql_odbc Visual Studio project to the Berkeley_DB solution file.
10. Build the db_sql_odbc project. This can be done by right-clicking the db_sql_odbc
project in the project explorer panel, and selecting build.
The db_sql_odbc61.dll, libdb_sql61.dll and libdb61.dll files are now built.
Installing the Library
Rename db_sql_odbc61.dll to sqlite3odbc.dll and copy the dll files built in the Building
the Library section to the Windows system folder.
The Windows system folder is different on different systems, but is often C:\WINDOWS
\System32.
Testing the ODBC Install
The steps to verify that the installed driver works are as follows:
1.
Open the Unicode ODBCTest application. On Windows: Windows start -> Microsoft Data
Access SDK 2.8 -> ODBCTest (Unicode, x86).
2.
3.
4.
5.
Enter CREATE TABLE t1(x); in the Statement text box and click OK.
6.
6/18/2015
DB Installation Guide
Page 40
1.
2.
3.
Set the build type to Release or Debug in the drop-down on the tool bar.
4.
To build, right-click on db_tcl and select Build. This builds the Tcl support library for
Berkeley DB, placing the result into one of the following Berkeley DB subdirectories,
depending upon the configuration that you chose:
build_windows\Win32\Debug\libdb_tcl61d.dll
build_windows\Win32\Release\libdb_tcl61.dll
If you use a version different from Tcl 8.5.x you will need to change the name of the Tcl
library used in the build (for example, tcl85.lib) to the appropriate name. To do this, right
click on db_tcl, go to Properties -> Linker -> Input -> Additional dependencies and change
tcl85.lib to match the Tcl version you are using.
Distributing DLLs
When distributing applications linked against the DLL (not static) version of the library, the
DLL files you need will be found in one of the following Berkeley DB subdirectories, depending
upon the configuration that you chose:
build_windows\Win32\Debug
build_windows\Win32\Release
build_windows\Win32\Debug_static
build_windows\Win32\Release_static
build_windows\x64\Debug
build_windows\x64\Release
build_windows\x64\Debug_static
6/18/2015
DB Installation Guide
Page 41
build_windows\x64\Release_static
You may also need to redistribute DLL files needed for the compiler's runtime. Generally,
these runtime DLL files can be installed in the same directory that will contain your installed
Berkeley DB DLLs. This directory may need to be added to your System PATH environment
variable. Check your compiler's license and documentation for specifics on redistributing
runtime DLLs.
6/18/2015
DB Installation Guide
Page 42
should not share database environments with applications built without this option. The
DIAGNOSTIC option should not be specified when configuring to build production binaries
because it degrades performance.
/D UMRW
Rational Software's Purify product and other software analysis run-time tools complain
about uninitialized reads/writes of structure fields whose only purpose is padding, as well
as when heap memory that was never initialized is written to disk. Specify this option
during configuration to mask these errors. The UMRW option should not be specified when
configuring to build production binaries.
Note
If your library has stripped messages, you can get an idea of what text should be
issued for a given error message by using the Berkeley DB Message Reference Guide .
In general on Windows systems, you will want to evaluate the size of the final application, not
the library build. The Microsoft LIB file format (like UNIX archives) includes copies of all of
the object files and additional information. The linker rearranges symbols and strips out the
overhead, and the resulting application is much smaller than the library. There is also a Visual
C++ optimization to "Minimize size" that will reduce the library size by a few percent.
A Visual C++ project file called db_small is provided for this small memory configuration.
During a build, static libraries are created in Release or Debug, respectively. The library
name is libdb_small60sd.lib for the debug build, or libdb_small60s.lib for the release
build.
For assistance in further reducing the size of the Berkeley DB library, or in building small
memory footprint libraries on other systems, please contact Berkeley DB support.
6/18/2015
DB Installation Guide
Page 43
2.
3.
Right click the db_tcl project in the Solution Explorer, and select Build.
4.
Right click the db_test project in the Solution Explorer, and select Build.
cd build_windows
2.
run d:\tcl\bin\tclsh85.exe, or the equivalent name of the Tcl shell for your system.
You should get a "%" prompt.
3.
% source ../test/tcl/test.tcl
If no errors occur, you should get a "%" prompt.
You are now ready to run tests in the test suite; see Running the test suite for more
information.
6/18/2015
DB Installation Guide
Page 44
Before building for SQL tests, build the db_tcl and db_sql_testfixture projects. This requires
Tcl 8.5 or above. If you are using a later version of Tcl, edit the Tcl library that db_tcl and
db_sql_testfixture link to.
To do this right click the db_tcl/db_sql_testfixture project, select Properties -> Configuration
Properties -> Linker -> Input -> Additional Dependencies and edit the Tcl library, tcl85.lib, to
match the version you are using.
Building the db_sql_testfixture project builds the testfixture.exe program in ../
build_windows/Win32/Debug. It also builds the projects db and db_sql, on which it depends.
Visual Studio 2005 or newer
To build for testing, perform the following steps:
1.
2.
3.
Right click the db_tcl project in the Solution Explorer, and select Build.
4.
Right click the db_sql_testfixture project in the Solution Explorer, and select Build.
Windows notes
If a system memory environment is closed by all processes, subsequent attempts to open
it will return an error. To successfully open a transactional environment in this state,
recovery must be run by the next process to open the environment. For non-transactional
environments, applications should remove the existing environment and then create a new
database environment.
6/18/2015
1.
Berkeley DB does not support the Windows XP, Windows 2003 or earlier Windows
platforms.
2.
On Windows, system paging file memory is freed on last close. For this reason, multiple
processes sharing a database environment created using the DB_SYSTEM_MEM flag must
arrange for at least one process to always have the environment open, or alternatively
that any process joining the environment be prepared to re-create it.
3.
When using the DB_SYSTEM_MEM flag, Berkeley DB shared regions are created without
ACLs, which means that the regions are only accessible to a single user. If wider sharing
is appropriate (for example, both user applications and Windows/NT service applications
need to access the Berkeley DB regions), the Berkeley DB code will need to be modified
to create the shared regions with the correct ACLs. Alternatively, by not specifying
DB Installation Guide
Page 45
the DB_SYSTEM_MEM flag, filesystem-backed regions will be created instead, and the
permissions on those files may be directly specified through the DB_ENV->open() method.
4.
Applications that operate on wide character strings can use the Windows function
WideCharToMultiByte with the code page CP_UTF8 to convert paths to the form expected
by Berkeley DB. Internally, Berkeley DB calls MultiByteToWideChar on paths before calling
Windows functions.
5.
Various Berkeley DB methods take a mode argument, which is intended to specify the
underlying file permissions for created files. Berkeley DB currently ignores this argument
on Windows systems.
It would be possible to construct a set of security attributes to pass to CreateFile that
accurately represents the mode. In the worst case, this would involve looking up user and
all group names, and creating an entry for each. Alternatively, we could call the _chmod
(partial emulation) function after file creation, although this leaves us with an obvious
race.
Practically speaking, however, these efforts would be largely meaningless on a FAT file
system, which only has a "readable" and "writable" flag, applying to all users.
Windows FAQ
1.
My Win* C/C++ application crashes in the Berkeley DB library when Berkeley DB calls
fprintf (or some other standard C library function).
You should be using the "Debug Multithreaded DLL" compiler option in your application
when you link with the build_windows\Debug\libdb60d.lib library (this .lib file is actually
a stub for libdb60d.DLL). To check this setting in Visual C++, choose the Project/Settings
menu item and select Code Generation under the tab marked C/C++; and see the box
marked Use runtime library. This should be set to Debug Multithreaded DLL. If your
application is linked against the static library, build_windows\Debug\libdb60sd.lib; then,
you will want to set Use runtime library to Debug Multithreaded.
Setting this option incorrectly can cause multiple versions of the standard libraries to be
linked into your application (one on behalf of your application, and onle on behalf of the
Berkeley DB library). That violates assumptions made by these libraries, and traps can
result.
Also, using different Visual Studio compilers in the application and libraries can lead to a
crash. So rebuild the application with the same Visual C++ version as that of the library.
2.
Why are the build options for DB_DLL marked as "Use MFC in a Shared DLL"? Does
Berkeley DB use MFC?
Berkeley DB does not use MFC at all. It does however, call malloc and free and other
facilities provided by the Microsoft C runtime library. We found in our work that many
applications and libraries are built assuming MFC, and specifying this for Berkeley DB
solves various interoperation issues, and guarantees that the right runtime libraries are
selected. Note that because we do not use MFC facilities, the MFC library DLL is not
marked as a dependency for libdb.dll, but the appropriate Microsoft C runtime is.
6/18/2015
DB Installation Guide
Page 46
3.
4.
6/18/2015
DB Installation Guide
Page 47
Description
Berkeley_DB.sln
*.vcproj
These project files can be used to build Berkeley DB for the Windows Mobile platform.
Choose File -> Open Workspace.... Navigate to the build_wince directory, select
Berkeley_DB and click Open.
2.
Select the desired target platform from the platform drop-down menu.
3.
Build results
The results of your build will be placed in any one of the following Berkeley DB subdirectories,
depending on the configuration that you chose:
build_wince\(Platform)\Debug
build_wince\(Platform)\Release
build_wince\(Platform)\Debug_static
build_wince\(Platform)\Release_static
When building your application during development, you must link against
libdb_small61sd.lib or against libdb_sql61sd.lib for SQL features. You can also build
using a release version of the Berkeley DB libraries and tools, which will be placed in the
build_wince\(Platform)\Release_static directory. You must add the build_wince
directory to the list of include directories of your application's project, or copy the Berkeley
DB include files to a location in your Visual Studio include path.
6/18/2015
DB Installation Guide
Page 48
Project
Default Output
Default Configuration
db_small_static
libdb_small61s.lib
Static Library
db_static
libdb61s.lib
Static Library
db_sql
libdb_sql61.dll
Dynamic Library
db_sql_static
libdb_sql61s.lib
Static Library
To change a project configuration type in Visual Studio 2005, select a project and do the
following:
1.
2.
Under Project Defaults, change the Configuration Type to your desired type.
Note: After this change, the output file names change to the Visual Studio 2005 defaults based
on the project name.
6/18/2015
1.
Choose File -> Open Workspace.... Navigate to the build_wince directory, select
Berkeley_DB and click Open.
2.
From the Solution explorer window, right-click the Solution Berkeley_DB and select
Configuration manager...
3.
4.
From the Type or select the new platform drop-down box, select a configuration
from the ones available and click OK.
5.
6.
The target platform drop-down now contains the platform just added.
7.
DB Installation Guide
Page 49
2.
3.
The C++ API is not supported on Windows Mobile. The file stream and exception handling
functionality provided by the Berkeley DB C++ API are not supported by Windows Mobile.
It is possible to build a C++ application against the Berkeley DB C API.
2.
3.
4.
Berkeley DB is shipped with support for the Pocket PC 2003 and Smartphone 2003 target
platforms. It is possible to build Berkeley DB for different target platforms using Visual
Studio's Configuration Manager.
This can be done using the following steps:
a.
b.
c.
d.
Select the desired target platform (you must have the desired Microsoft Platform SDK
installed for it to appear in the list). Choose to copy settings from either the Pocket
PC 2003 or Smartphone 2003 platforms.
Before building the wce_tpcb sample application for the new platform, you will need to
complete the following steps:
a.
Open the project properties page for wce_tpcb. Do this by: Right click wce_tpcb in
the Solution Explorer then select Properties
b.
c.
NOTE: These steps are based on Visual Studio 2005, and might vary slightly depending on
which version of Visual Studio being used.
6/18/2015
DB Installation Guide
Page 50
You can manually disable the truncate functionality from the build.
Do that by opening the db-X.X.X/build_wince/db_config.h file, and change the line
that reads
#define HAVE_FTRUCATE 1
to read
#undef HAVE_FTRUNCATE
Making this change disables DB->compact() for btree databases.
2.
3.
4.
5.
6/18/2015
DB Installation Guide
Page 51
b.
c.
d.
6.
7.
I see a file mapping error when opening a Berkeley DB environment or database. What
is wrong?
The default behavior of Berkeley DB is to use memory mapped files in the environment.
Windows Mobile does not allow memory mapped files to be created on flash storage.
There are two workarounds:
6/18/2015
a.
Configure the Berkeley DB environment not to use memory mapped files. The options
are discussed in detail in Shared memory region.
b.
Page 52
Description
Berkeley_DB.sln
*.vcproj
These project files can be used to build Berkeley DB for the Windows Embedded Compact 7
platform.
2.
Choose File -> Open Project/Solution.... Navigate to the build_wince directory, select
Berkeley_DB and click Open. Wait for the project conversion to finish.
3.
Select the desired target platform from the platform drop-down menu.
4.
Build results
The results of your build will be placed in any one of the following Berkeley DB subdirectories,
depending on the configuration that you chose:
build_wince\(Platform)\Debug
build_wince\(Platform)\Release
build_wince\(Platform)\Debug_static
build_wince\(Platform)\Release_static
When building your application during development, you must link against
libdb_small61sd.lib or against libdb_sql61sd.lib for SQL features. You can also build
using a release version of the Berkeley DB libraries and tools, which will be placed in the
build_wince\(Platform)\Release_static directory. You must add the build_wince
directory to the list of include directories of your application's project, or copy the Berkeley
DB include files to a location in your Visual Studio include path.
6/18/2015
DB Installation Guide
Page 53
Project
Default Output
Default Configuration
db_small
libdb_small61s.lib
Static Library
db
libdb61s.lib
Static Library
db_sql
libdb_sql61.dll
Dynamic Library
To change a project configuration type in Visual Studio 2008, select a project and do the
following:
1.
2.
Under Project Defaults, change the Configuration Type to your desired type.
Note: After this change, the output file names change to the Visual Studio 2008 defaults based
on the project name.
2.
3.
4.
6/18/2015
DB Installation Guide
Page 54
6/18/2015
DB Installation Guide
Page 55
../dist/configure --enable-sql
make
This creates a library, libdb_sql, and a command line tool, dbsql. You can create and
manipulate SQL databases using the dbsql shell.
You can optionally provide the --enable-sql_compat argument to the configure script.
In addition to creating libdb_sql and dbsql this causes a thin wrapper library called
libsqlite3 and a command line tool called sqlite3 to be built. This library can be used as
a drop-in replacement for SQLite. The sqlite3 command line tool is identical to the dbsql
executable but is named so that existing scripts for SQLite can easily work with Berkeley DB.
../dist/configure --enable-sql_compat
make
There are several arguments you can specify when configuring the Berkeley DB SQL Interface.
See Configuring the SQL Interface (page 62) for more information.
Configuring Berkeley DB
There are several arguments you can specify when configuring Berkeley DB. Although only the
Berkeley DB-specific ones are described here, most of the standard GNU autoconf arguments
are available and supported. To see a complete list of possible arguments, specify the --help
flag to the configure program.
The Berkeley DB specific arguments are as follows:
--disable-largefile
Some systems, notably versions of Solaris, require special compile-time options in order to
create files larger than 2^32 bytes. These options are automatically enabled when Berkeley
DB is compiled. For this reason, binaries built on current versions of these systems may
not run on earlier versions of the system because the library and system calls necessary for
large files are not available. To disable building with these compile-time options, enter -disable-largefile as an argument to configure.
--disable-shared, --disable-static
On systems supporting shared libraries, Berkeley DB builds both static and shared libraries
by default. (Shared libraries are built using the GNU Project's Libtool distribution, which
supports shared library builds on many (although not all) systems.) To not build shared
libraries, configure using the --disable-shared argument. To not build static libraries,
configure using the --disable-static argument.
--disable-heap
Disables the Heap access method so that it cannot be used by Berkeley DB applications.
--enable-compat185
6/18/2015
DB Installation Guide
Page 56
To compile or load Berkeley DB 1.85 applications against this release of the Berkeley DB
library, enter --enable-compat185 as an argument to configure. This will include Berkeley
DB 1.85 API compatibility code in the library.
--enable-cxx
To build the Berkeley DB C++ API, enter --enable-cxx as an argument to configure.
--enable-debug
To build Berkeley DB with -g as a compiler flag and with DEBUG #defined during
compilation, enter --enable-debug as an argument to configure. This will create a Berkeley
DB library and utilities with debugging symbols, as well as load various routines that can
be called from a debugger to display pages, cursor queues, and so forth. If installed, the
utilities will not be stripped. This argument should not be specified when configuring to
build production binaries.
--enable-debug_rop
To build Berkeley DB to output log records for read operations, enter --enable-debug_rop as
an argument to configure. This argument should not be specified when configuring to build
production binaries.
--enable-debug_wop
To build Berkeley DB to output log records for write operations, enter --enable-debug_wop
as an argument to configure. This argument should not be specified when configuring to
build production binaries.
--enable-diagnostic
To build Berkeley DB with run-time debugging checks, enter --enable-diagnostic as an
argument to configure. This causes a number of additional checks to be performed when
Berkeley DB is running, and also causes some failures to trigger process abort rather than
returning errors to the application. Applications built using this argument should not share
database environments with applications built without this argument. This argument should
not be specified when configuring to build production binaries.
--enable-dump185
To convert Berkeley DB 1.85 (or earlier) databases to this release of Berkeley DB, enter -enable-dump185 as an argument to configure. This will build the db_dump185 utility, which
can dump Berkeley DB 1.85 and 1.86 databases in a format readable by the Berkeley DB
db_load utility.
The system libraries with which you are loading the db_dump185 utility must already
contain the Berkeley DB 1.85 library routines for this to work because the Berkeley DB
distribution does not include them. If you are using a non-standard library for the Berkeley
DB 1.85 library routines, you will have to change the Makefile that the configuration step
creates to load the db_dump185 utility with that library.
6/18/2015
DB Installation Guide
Page 57
--enable-error_history
Causes more detailed error messages to be displayed for most error messages. The
additional information includes the process and thread identifiers, timestamp, and certain
previous unusual conditions detected during the API call. Stack traces are also displayed,
where they are supported.
This option is available only for Unix-like platforms which support the pthread_getspecific()
thread local storage functions.
--enable-failchk_broadcast
Enable the mode of the DB_ENV->failchk() feature which causes processes in the
environment to be notified of an application failure as soon as possible. When this
feature is enabled threads waiting on a mutex owned by a crashed process will return
a DB_RUNRECOVERY error. Without this feature, those processes may hang until
intervention by some other entity, such as a "watcher process" as mentioned in Architecting
Transactional Data Store applications or a user interrupting the program.
--enable-java
To build the Berkeley DB Java API, enter --enable-java as an argument to configure. To build
Java, you must also build with shared libraries. Before configuring, you must set your PATH
environment variable to include javac. Note that it is not sufficient to include a symbolic
link to javac in your PATH because the configuration process uses the location of javac to
determine the location of the Java include files (for example, jni.h). On some systems,
additional include directories may be needed to process jni.h; see Changing compile or load
options (page 70) for more information.
Note
The --enable-java option may not be specified at the same time as --enablesmallbuild or --disable-statistics.
--enable-posixmutexes
To force Berkeley DB to use the POSIX pthread mutex interfaces for underlying mutex
support, enter --enable-posixmutexes as an argument to configure. This is rarely necessary:
POSIX mutexes will be selected automatically on systems where they are the preferred
implementation.
The --enable-posixmutexes configuration argument is normally used in two ways:
First, when there are multiple mutex implementations available and the POSIX mutex
implementation is not the preferred one (for example, on Solaris where the LWP mutexes
are used by default). Second, by default the Berkeley DB library will only select the
POSIX mutex implementation if it supports mutexes shared between multiple processes,
as described for the pthread_condattr_setpshared and pthread_mutexattr_setpshared
interfaces. The --enable-posixmutexes configuration argument can be used to force the
selection of POSIX mutexes in this case, which can improve application performance
significantly when the alternative mutex implementation is a non-blocking one (for example
test-and-set assembly instructions). However, configuring to use POSIX mutexes when the
6/18/2015
DB Installation Guide
Page 58
implementation does not have inter-process support will only allow the creation of private
database environments, that is, environments where the DB_PRIVATE flag is specified to the
DB_ENV->open() method.
Specifying the --enable-posixmutexes configuration argument may require that applications
and Berkeley DB be linked with the -lpthread library.
--enable-pthread_api
To configure Berkeley DB for a POSIX pthreads application (with the exception that POSIX
pthread mutexes may not be selected as the underlying mutex implementation for the
build), enter --enable-pthread_api as an argument to configure. The build will include the
Berkeley DB replication manager interfaces and will use the POSIX standard pthread_self
and pthread_yield functions to identify threads of control and yield the processor. The -enable-pthread_api argument requires POSIX pthread support already be installed on your
system.
Specifying the --enable-pthread_api configuration argument may require that applications
and Berkeley DB be linked with the -lpthread library.
--enable-sql
To build the command tool dbsql, enter --enable-sql as an argument to configure. The
dbsql utility provides access to the Berkeley DB SQL interface. See Configuring the SQL
Interface (page 62) for more information.
--enable-sql_compat
To build the command tool sqlite3, enter --enable-sql_compat as an argument to configure.
Sqlite3 is a command line tool that enables you to manually enter and execute SQL
commands. It is identical to the dbsql executable but named so that existing scripts for
SQLite can easily work with Berkeley DB. See Configuring the SQL Interface (page 62) for
more information.
--enable-sql_codegen
To build the command line tool db_sql_codegen, enter --enable-sql_codegen as an argument
to configure. The db_sql_codegen utility translates a schema description written in a SQL
Data Definition Language dialect into C code that implements the schema using Berkeley
DB.
--enable-smallbuild
To build a small memory footprint version of the Berkeley DB library, enter --enablesmallbuild as an argument to configure. The --enable-smallbuild argument is equivalent
to individually specifying --with-cryptography=no, --disable-hash, --disable-heap, -disable-queue, --disable-replication, --disable-statistics and --disable-verify, turning off
cryptography support, the Hash, Heap and Queue access methods, database environment
replication support and database and log verification support. See Building a small memory
footprint library (page 69) for more information.
--enable-stl
6/18/2015
DB Installation Guide
Page 59
To build the Berkeley DB C++ STL API, enter --enable-stl as an argument to configure.
Setting this argument implies that --enable-cxx is set, and the Berkeley DB C++ API will be
built too.
There will be a libdb_stl-X.X.a and libdb_stl-X.X.so built, which are the static and shared
library you should link your application with in order to make use of Berkeley DB via its STL
API.
If your compiler is not ISO C++ compliant, the configure may fail with this argument
specified because the STL API requires standard C++ template features. In this case, you will
need a standard C++ compiler. So far gcc is the best choice, we have tested and found that
gcc-3.4.4 and all its newer versions can build the Berkeley DB C++ STL API successfully.
For information on db_stl supported compilers, see the Portability section in the
Programmer's Reference Guide.
And you need to include the STL API header files in your application code. If you are
using the Berkeley DB source tree, the header files are in <Berkeley DB Source Root >/stl
directory; If you are using the installed version, these header files are in < Berkeley DB
Installed Directory>/include, as well as the db.h and db_cxx.h header files.
--enable-tcl
To build the Berkeley DB Tcl API, enter --enable-tcl as an argument to configure. This
configuration argument expects to find Tcl's tclConfig.sh file in the /usr/local/lib
directory. See the --with-tcl argument for instructions on specifying a non-standard location
for the Tcl installation. See Loading Berkeley DB with Tcl for information on sites from which
you can download Tcl and which Tcl versions are compatible with Berkeley DB. To build Tcl,
you must also build with shared libraries.
--enable-test
To build the Berkeley DB test suite, enter --enable-test as an argument to configure. To run
the Berkeley DB test suite, you must also build the Tcl API. This argument should not be
specified when configuring to build production binaries.
--enable-uimutexes
To force Berkeley DB to use the UNIX International (UI) mutex interfaces for underlying
mutex support, enter --enable-uimutexes as an argument to configure. This is rarely
necessary: UI mutexes will be selected automatically on systems where they are the
preferred implementation.
The --enable-uimutexes configuration argument is normally used when there are multiple
mutex implementations available and the UI mutex implementation is not the preferred one
(for example, on Solaris where the LWP mutexes are used by default).
Specifying the --enable-uimutexes configuration argument may require that applications and
Berkeley DB be linked with the -lthread library.
--enable-umrw
6/18/2015
DB Installation Guide
Page 60
Rational Software's Purify product and other run-time tools complain about uninitialized
reads/writes of structure fields whose only purpose is padding, as well as when heap
memory that was never initialized is written to disk. Specify the --enable-umrw argument
during configuration to mask these errors. This argument should not be specified when
configuring to build production binaries.
--enable-dtrace [--enable-perfmon-statistics]
To build Berkeley DB with performance event monitoring probes add --enable-dtrace to
the configuration options. Both native DTrace (on Solaris and Mac OS X) and the Statically
Defined Tracing compatibility layer in Linux SystemTap version 1.1 or better are supported.
That compatibility package may be called systemtap-sdt-devel; it includes sys/sdt.h.
If --enable-perfmon-statistics is combined with --enable-dtrace then additional probes are
defined for the tracking variables from which DB's statistics are obtained. They allow DTrace
and SystemTap access to these values when they are updated, are the basis of the statistics
as displayed db_stat and the API functions that return statistics.
The --enable-dtrace option may not be specified at the same time as --disable-statistics.
For information on Berkeley DB Performance Event Monitoring, see the Performance Event
Monitoring section in the Programmer's Reference Guide.
--enable-localization
Enable localized error message text, if available. This option should not be used when -enable-stripped_messages is in use.
--enable-stripped_messages
Causes all error messages to be stripped of their textual information. Instead, only error
return codes are used. This option should not be used when --enable-localization is in
use. Use of this build option can reduce your library foot print by up to 44KB (.so) or 50KB
(.a).
If you use this configuration option, you can get an idea of what text should be issued for a
given error message by using the Berkeley DB Message Reference Guide.
--with-cryptography
Enter --with-cryptography=yes|no to build Berkeley DB libraries with or without
cryptography support. By default, cryptography is enabled for Berkeley DB base libraries,
and disabled when building the optional Berkeley DB SQL and JDBC libraries.
To build Berkeley DB with support for cryptography using Intel's Performance Primitive (IPP)
library, enter --with-cryptography=ipp as an argument to configure. Additionally, set the
following arguments:
-L/path/to/ipp/sharedlib to LDFLAGS
-I/path/to/ipp/include to CPPFLAGS
6/18/2015
DB Installation Guide
Page 61
6/18/2015
DB Installation Guide
Page 62
--enable-sql
Causes the dbsql command line interpreter to be built. Along with dbsql, this
argument also builds the libdb_sqlXX.{so|la} library, a C API library that mirrors the
SQLite C API.
--enable-sql_compat
Causes the sqlite3 command line tool to be built. This tool is identical to the dbsql
command line tool, except that it has the same name as the command line tool that
comes with standard SQLite.
In addition, the libsqlite3.{so|la} C API library is built if this option is specified. This
library is identical to the libdb_sqlXX.{so|la} library that is normally built for Berkeley
DB's sql interface, except that it has the same name as the library which is built for
standard SQLite.
Warning
Use this compatibility option with extreme care. Standard SQLite is used by
many programs and utilities on many different platforms. Some platforms,
such as Mac OS X, come with standard SQLite built in because default
applications for the platform use that library.
Use of this option on platforms where standard SQLite is in production use
can cause unexpected runtime errors either for your own application, or
for applications and utilities commonly found on the platform, depending
on which library is found first in the platform's library search path.
Use this option only if you know exactly what you are doing.
This option is provided so that there is an easy upgrade path for legacy SQLite tools
and scripts that want to use BDB SQL without rewriting the tool or script. However,
data contained in standard SQLite databases must be manually migrated from the
old database to your BDB SQL database even if you use this option. See the Berkeley
DB Getting Started with the SQL APIs guide for information on migrating data from
standard SQLite to BDB SQL databases.
Note that in addition to the renamed command line tool and library, this option also
causes versions of the command line tool and library to be built that use the normal
BDB SQLite names (dbsql and libdb_sqlXX.{so|la}).
--enable-test
Cause the Berkeley DB SQL interface test suite to be built. This argument can also be
used with either --enable-sql or --enable-sql_compat to build the SQLite Tcl test
runner.
--enable-jdbc
Causes the JDBC driver to be built. Setting this option implies that --enable-sql is
set, which means that the Berkeley DB SQL API will be built too.
--with-cryptography
Enables encryption support for the Berkeley DB SQL interface. See SQL Encryption in
the Berkeley DB Getting Started with the SQL APIs guide for usage details.
6/18/2015
DB Installation Guide
Page 63
6/18/2015
DB Installation Guide
Page 64
in memory rather than using file backed shared memory. For more information, see
the DB_PRIVATE flag of DB_ENV->open().
BDBSQL_SINGLE_THREAD
To disable locking and thread safe connections, specify the BDBSQL_SINGLE_THREAD
flag. If an application is going to use Berkeley DB from a single thread and a single
process, enabling this flag can deliver significant performance advantages.
SQLITE_DEFAULT_CACHE_SIZE
SQLite provides an in-memory cache which you size according to the maximum
number of database pages that you want to hold in memory at any given time.
Berkeley DB's in-memory cache feature performs the same function as SQLite. To
specify the suggested maximum number of pages of disk cache that will be allocated
per open database file specify the SQLITE_DEFAULT_CACHE_SIZE flag. Default value
is 2000 pages. For more information, see the SQLite documentation on PRAGMA
default_cache_size.
SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT
For SQLite, this pragma identifies the maximum size that the journal file is
allowed to be. Berkeley DB does not have a journal file, but it writes and uses
log files. A new log file is created when the current log file has reached the
defined maximum size. To define this maximum size for a log file, specify the
SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT flag. Default value is 10 MB for the Berkeley DB
SQL interface.
Enabling Extensions
The Berkeley DB SQL API provides extensions such as full text search and R-Tree index.
By default, these extensions are disabled. To enable an extension in the Berkeley DB SQL
interface, specify the related option as an argument to the configure script using the standard
environment variable, CPPFLAGS.
SQLITE_ENABLE_FTS3
Enable building the Berkeley DB full text search layer
SQLITE_ENABLE_RTREE
Enables the Berkeley DB R-Tree layer.
See the SQLite Documentation for more information on full text search and R-Tree.
6/18/2015
DB Installation Guide
Page 65
Unzip the file containing the sample code to a new directory (for example, jdbc_ex).
2.
Substitute jdbc:sqlite:/<db-file-name> for the generic JDBC URL that appears in the
code. That is, put jdbc:sqlite:/<db-file-name> between the quotation marks in the
line:
String url = "jdbc:mySubprotocol:myDataSource";
Note: The <db-file-name> can either be an absolute path name like "jdbc:sqlite://
jdbc_ex_db/myDataSource", or a relative path-file-name like "jdbc:sqlite:/../
jdbc_ex_db/myDataSource", or a file name, like "jdbc:sqlite:/myDataSource", in
which case the database file will be stored at the current directory. Note that all path
arguments require a leading slash, even in the case of relative paths or a database in the
local directory. Please refer to the above examples.
3.
4.
Optionally substitute the username and password you use for your database in the
following: "myLogin", "myPassword".
5.
If your JDK version is above 1.5, change the variable name enum in OutputApplet.java
to some other variable name because, as of JDK release 5 enum is a keyword and can not
be used as an identifier.
6/18/2015
DB Installation Guide
Page 66
2.
3.
After you run the CreateCoffees example, use the dbsql executable to open the
myDataSource database file and check if the table COFFEES has been successfully created
in the database.
$ dbsql myDataSourcedbsql> .tables
COFFEES
dbsql> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE COFFEES (COF_NAME varchar(32),\
SUP_ID int, PRICE float, SALES int, TOTAL int);
COMMIT;
dbsql>
4.
Download and install the latest unixODBC if ODBC is not already installed on your system.
2.
Configure the ODBC server to work with SQLite databases. Follow these instructions from
Christian Werner.
6/18/2015
cd db-6.1.XX/build_unix
CFLAGS="-fPIC" ../dist/configure --enable-sql_compat --disable-shared
make
cd ../lang/sql/odbc
CFLAGS="-D_HAVE_SQLITE_CONFIG_H \
-I../../../build_unix -I../../../build_unix/sql \
-I../../../src/dbinc -I../sqlite/src" \
LDFLAGS="../../../build_unix/libdb-6.1.a" \
./configure --with-sqlite3=../generated
DB Installation Guide
Page 67
$ make
The libsqlite3odbc.so library containing a statically linked version of Berkeley DB SQL is
now built.
NOTE: The final make command above is known to generate a warning when using GCC. The
warning states: Warning: Linking the shared library libsqlite3odbc.la against
the static library ../../build_unix/libdb-6.1.a is not portable!. It is generally
safe to ignore the warning when using the generated library.
Testing the ODBC Driver
The steps to verify that the installed driver works are as follows:
1.
2.
Create a data source, and launch a data source viewer application by doing the following:
$ mkdir ~/databases
$ cd ~/databases
$ /path/to/Berkeley DB/build_unix/sqlite3 mytest.db
dbsql> CREATE TABLE t1(x);
dbsql> .quit
$ DataManager
The final step opens a GUI application that displays ODBC data sources on a system. You
should be able to find the mytest.db data source just created.
6/18/2015
DB Installation Guide
Page 68
$ export LD_LIBRARY_PATH=$PWD:$DBSQL_DIR/lib
$ ./bfile_example_sql
# for SQL expressions interface
$ ./bfile_example_capi
# for C-functions API
For more information on using the BFILE extension, see the Berkeley DB Getting Started with
the SQL APIs guide.
Note
--disable-cryptography and --enable-cryptography are deprecated in
the Berkeley DB 11gR2 release. Use --with-cryptography=no and --withcryptography=yes instead.
6/18/2015
DB Installation Guide
Page 69
The following configuration options will increase the size of the Berkeley DB library
dramatically and are only useful when debugging applications:
--enable-debug
Build Berkeley DB with symbols for debugging.
--enable-debug_rop
Build Berkeley DB with read-operation logging.
--enable-debug_wop
Build Berkeley DB with write-operation logging.
--enable-diagnostic
Build Berkeley DB with run-time debugging checks.
In addition, static libraries are usually smaller than shared libraries. By default Berkeley DB
will build both shared and static libraries. To build only a static library, configure Berkeley DB
with the Configuring Berkeley DB (page 56) option.
The size of the Berkeley DB library varies depending on the compiler, machine architecture,
and configuration options. As an estimate, production Berkeley DB libraries built with GNU
gcc version 4.X compilers have footprints in the range of 600KB to 1.4MB on 32-bit x86
architectures, and in the range of 700KB to 1.6MB on 64-bit x86 architectures.
For assistance in further reducing the size of the Berkeley DB library, or in building small
memory footprint libraries on other systems, please contact Berkeley DB support.
6/18/2015
DB Installation Guide
Page 70
Cross-Compiling on Unix
The purpose of cross-compiling is to build a Berkeley DB library on one platform that is to be
used on a different platform. This section demonstrates how to build a library compatible with
the ARM platform from a 32-bit x86 Linux platform. You will need to adjust the build tools and
options to match your particular platforms.
1.
Download, install, and test a toolchain that can build the desired target binaries. In this
example, we use the arm-linux-gnueabi-gcc package.
2.
Decide on your configuration options, and set up your environment to use the appropriate
compiler and compiler tools. It is often easiest to set this up as a small shell script. For
example:
#!/bin/sh -f
env \
CC=/usr/bin/arm-linux-gnueabi-gcc \
STRIP=/usr/bin/arm-linux-gnueabi-strip \
../dist/configure \
--build=i686-pc-linux-gnu \
--host=arm-linux-gnueabi \
--enable-java \
--enable-sql \
--enable-jdbc \
--enable-smallbuild \
--enable-shared \
6/18/2015
DB Installation Guide
Page 71
--enable-stripped_messages \
--prefix=$HOME/ARM-linux/install \
$*
The --build flag indicates the system on which you are compiling and the --host flag
indicates the target platform. Adjust or omit the --enable and --prefix flag settings as
dictated by your own needs.
3.
4.
In your build directory, configure by executing your script, then make and make install.
Review any compiler warnings and fix if necessary, repeating the configure and
make steps until you are satisfied. The resulting libraries and executables can then be
transferred to your target system.
Installing Berkeley DB
Berkeley DB installs the following files into the following locations, with the following default
values:
Configuration Variables
Default value
--prefix
/usr/local/BerkeleyDB.Major.Minor
--exec_prefix
$(prefix)
--bindir
$(exec_prefix)/bin
--includedir
$(prefix)/include
--libdir
$(exec_prefix)/lib
docdir
$(prefix)/docs
Files
Default location
include files
$(includedir)
libraries
$(libdir)
utilities
$(bindir)
documentation
$(docdir)
With one exception, this follows the GNU Autoconf and GNU Coding Standards installation
guidelines; please see that documentation for more information and rationale.
The single exception is the Berkeley DB documentation. The Berkeley DB documentation is
provided in HTML format, not in UNIX-style man or GNU info format. For this reason, Berkeley
DB configuration does not support --infodir or --mandir. To change the default installation
location for the Berkeley DB documentation, modify the Makefile variable, docdir.
When installing Berkeley DB on filesystems shared by machines of different architectures,
please note that although Berkeley DB include files are installed based on the value
6/18/2015
DB Installation Guide
Page 72
of $(prefix), rather than $(exec_prefix), the Berkeley DB include files are not always
architecture independent.
To move the entire installation tree to somewhere besides /usr/local, change the value of
prefix.
To move the binaries and libraries to a different location, change the value of exec_prefix.
The values of includedir and libdir may be similarly changed.
Any of these values except for docdir may be set as part of the configuration:
prompt: ../dist/configure --bindir=/usr/local/bin
Any of these values, including docdir, may be changed when doing the install itself:
prompt: make prefix=/usr/contrib/bdb install
The Berkeley DB installation process will attempt to create any directories that do not already
exist on the system.
6/18/2015
DB Installation Guide
Page 73
Warning: some UNIX installations may have an already existing /usr/lib/libdb.so, and this
library may be an incompatible version of Berkeley DB.
We recommend that applications link against libdb.so (for example, using -ldb). Even though
the linker uses the file named libdb.so, the executable file for the application remembers the
library's SONAME (libdb-major.minor.so). This has the effect of marking the applications with
the versions they need at link time. Because applications locate their needed SONAMEs when
they are executed, all previously linked applications will continue to run using the library they
were linked with, even when a new version of Berkeley DB is installed and the file libdb.so is
replaced with a new version.
Applications that know they are using features specific to a particular Berkeley DB release can
be linked to that release. For example, an application wanting to link to Berkeley DB major
release "3" can link using -ldb-3, and applications that know about a particular minor release
number can specify both major and minor release numbers; for example, -ldb-3.5.
If you want to link with Berkeley DB before performing library installation, the "make"
command will have created a shared library object in the .libs subdirectory of the build
directory, such as build_unix/.libs/libdb-major.minor.so. If you want to link a file
against this library, with, for example, a major number of "3" and a minor number of "5", you
should be able to do something like the following:
cc -L BUILD_DIRECTORY/.libs -o testprog testprog.o -ldb-3.5
env LD_LIBRARY_PATH="BUILD_DIRECTORY/.libs:$LD_LIBRARY_PATH" ./testprog
where BUILD_DIRECTORY is the full directory path to the directory where you built Berkeley
DB.
The libtool program (which is configured in the build directory) can be used to set the shared
library path and run a program. For example, the following runs the gdb debugger on the
db_dump utility after setting the appropriate paths:
libtool gdb db_dump
Libtool may not know what to do with arbitrary commands (it is hardwired to recognize
"gdb" and some other commands). If it complains the mode argument will usually resolve the
problem:
libtool --mode=execute my_debugger db_dump
On most systems, using libtool in this way is exactly equivalent to setting the
LD_LIBRARY_PATH environment variable and then executing the program. On other systems,
using libtool has the virtue of knowing about any other details on systems that don't behave in
this typical way.
6/18/2015
DB Installation Guide
Page 74
the tclsh utility included in the Tcl installation with which Berkeley DB was configured to run
the test suite, and further assumes that the test suite will be run with the libraries prebuilt in
the Berkeley DB build directory. If either of these assumptions are incorrect, you will need to
edit the include.tcl file and change the following line to correctly specify the full path to
the version of tclsh with which you are going to run the test suite:
set tclsh_path ...
You may also need to change the following line to correctly specify the path from the
directory where you are running the test suite to the location of the Berkeley DB Tcl library
you built:
set test_path ...
It may not be necessary that this be a full path if you have configured your system's shared
library mechanisms to search the directory where you built or installed the Tcl library.
All Berkeley DB tests are run from within tclsh. After starting tclsh, you must source the file
test.tcl in the test directory. For example, if you built in the build_unix directory of the
distribution, this would be done using the following command:
% source ../test/tcl/test.tcl
If no errors occur, you should get a "%" prompt.
You are now ready to run tests in the test suite; see Running the test suite for more
information.
2.
6/18/2015
When compiling with gcc, I get unreferenced symbols; for example the following:
DB Installation Guide
Page 75
4.
I get unexpected results and database corruption when running threaded programs.
I get error messages that mutex (for example, pthread_mutex_XXX or mutex_XXX)
functions are undefined when linking applications with Berkeley DB.
On some architectures, the Berkeley DB library uses the ISO POSIX standard pthreads
and UNIX International (UI) threads interfaces for underlying mutex support; Solaris is an
example. You can specify compilers or compiler flags, or link with the appropriate thread
library when loading your application to resolve the undefined references:
cc ... -lpthread ...
cc ... -lthread ...
xlc_r ...
cc ... -mt ...
See the appropriate architecture-specific Reference Guide pages for more information.
On systems where more than one type of mutex is available, it may be necessary for
applications to use the same threads package from which Berkeley DB draws its mutexes.
For example, if Berkeley DB was built to use the POSIX pthreads mutex calls for mutex
6/18/2015
DB Installation Guide
Page 76
support, the application may need to be written to use the POSIX pthreads interfaces
for its threading model. This is only conjecture at this time, and although we know of no
systems that actually have this requirement, it's not unlikely that some exist.
In a few cases, Berkeley DB can be configured to use specific underlying mutex interfaces.
You can use the --enable-posixmutexes and --enable-uimutexes configuration options to
specify the POSIX and Unix International (UI) threads packages. This should not, however,
be necessary in most cases.
In some cases, it is vitally important to make sure that you load the correct library.
For example, on Solaris systems, there are POSIX pthread interfaces in the C library, so
applications can link Berkeley DB using only C library and not see any undefined symbols.
However, the C library POSIX pthread mutex support is insufficient for Berkeley DB, and
Berkeley DB cannot detect that fact. Similar errors can arise when applications (for
example, tclsh) use dlopen to dynamically load Berkeley DB as a library.
If you are seeing problems in this area after you confirm that you're linking with the
correct libraries, there are two other things you can try. First, if your platform supports
interlibrary dependencies, we recommend that you change the Berkeley DB Makefile to
specify the appropriate threads library when creating the Berkeley DB shared library, as
an interlibrary dependency. Second, if your application is using dlopen to dynamically
load Berkeley DB, specify the appropriate thread library on the link line when you load
the application itself.
5.
6.
I get reports of uninitialized memory reads and writes when running software analysis
tools (for example, Rational Software Corp.'s Purify tool).
For performance reasons, Berkeley DB does not write the unused portions of database
pages or fill in unused structure fields. To turn off these errors when running software
analysis tools, build with the --enable-umrw configuration option.
7.
8.
6/18/2015
DB Installation Guide
Page 77
following, it means the db.h include file being loaded is not a Berkeley DB 1.85 version
include file:
db_dump185.c: In function `main':
db_dump185.c:210: warning: assignment makes pointer from integer
without a cast
db_dump185.c:212: warning: assignment makes pointer from integer
without a cast
db_dump185.c:227: structure has no member named `seq'
db_dump185.c:227: `R_NEXT' undeclared (first use in this function)
If the build errors look something like the following, it means that the Berkeley DB 1.85
code was not found in the standard libraries:
cc -o db_dump185 db_dump185.o
ld:
Unresolved:
dbopen
To build the db_dump185 utility, the Berkeley DB version 1.85 code must already been
built and available on the system. If the Berkeley DB 1.85 header file is not found in a
standard place, or if the library is not part of the standard libraries used for loading, you
will need to edit your Makefile, and change the following lines:
DB185INC=
DB185LIB=
So that the system Berkeley DB 1.85 header file and library are found; for example:
DB185INC=/usr/local/include
DB185LIB=-ldb185
AIX
1.
2.
6/18/2015
DB Installation Guide
Page 78
3.
On AIX 4.3.2 (or before) I see duplicate symbol warnings when building the C++ shared
library and when linking applications.
We are aware of some duplicate symbol warnings with this platform, but they do not
appear to affect the correct operation of applications.
4.
5.
6.
7.
a.
Avoid including the problematical system include files in source code files which also
include Berkeley DB include files and call into the Berkeley DB API.
b.
Before building Berkeley DB, modify the generated include file db.h to itself include
the problematical system include files.
c.
I see the error "Redeclaration of lseek64" when building Berkeley DB with the -enable-sql and --enable-test options.
In some releases of AIX, the system include files (most commonly unistd.h) redefine
lseek to lseek64 when large-file support is enabled even though lseek may have
6/18/2015
DB Installation Guide
Page 79
already been defined when the _LARGE_FILE_API macro is on. To work around this
problem, do either one of the following:
a.
b.
Edit db.h manually after running the configure command, and remove the line that
includes unistd.h.
FreeBSD
1.
2.
I see fsync and close system call failures when accessing databases or log files on NFSmounted filesystems.
Some FreeBSD releases are known to return ENOLCK from fsync and close calls on NFSmounted filesystems, even though the call has succeeded. The Berkeley DB code should
be modified to ignore ENOLCK errors, or no Berkeley DB files should be placed on NFSmounted filesystems on these systems.
6/18/2015
DB Installation Guide
Page 80
make
The steps to build BDB in an iPhone device are as follows:
export CFLAGS="-arch armv6 -pipe -Os -gdwarf-2\
-no-cpp-precomp -mthumb -isysroot $SDKROOT "
export CXXFLAGS="-arch armv6 -pipe -Os -gdwarf-2\
-no-cpp-precomp -mthumb -isysroot $SDKROOT "
cd $BDB_HOME/build_unix
../dist/configure --host=arm-apple-darwin9\
--prefix=$SDKROOT ...
make
Both sets of commands create the BDB dynamic library - libdb-6.1.dylib. To build the static
library, libdb-6.1.a, add the --enable-shared=no option while configuring.
IRIX
1.
Linux
1.
2.
3.
6/18/2015
DB Installation Guide
Page 81
Mac OS X
1.
When trying to link multiple Berkeley DB language interfaces (for example, Tcl, C++,
Java, Python) into a single process, I get "multiple definitions" errors from dyld.
To fix this problem, set the environment variable MACOSX_DEPLOYMENT_TARGET to 10.3
(or your current version of OS X), and reconfigure and rebuild Berkeley DB from scratch.
See the OS X ld(1) and dyld(1) man pages for information about how OS X handles symbol
namespaces, as well as undefined and multiply-defined symbols.
2.
When trying to use system-backed shared memory on OS X I see failures about "too
many open files".
The default number of shared memory segments on OS X is too low. To fix this problem,
create a file named /etc/sysctl.conf, containing the variable assignments:
kern.sysv.shmmax=134217728
kern.sysv.shmmin=1
kern.sysv.shmmni=32
kern.sysv.shmseg=32
kern.sysv.shmall=1024
and then reboot the system.
Check the version of OS X carefully because some versions require all five parameters to
be set.
The SHMMAX variable should be set to a value that is an exact multiple of 4096. Some
versions of OS X ignore the value if it is not an exact multiple.
Please check and verify with the OS X documentation on the proper setting of these
parameters. In some cases a reboot is necessary and in others it is possible to change
them dynamically using sysctl.
The /etc/sysctl.conf file exists in OS X 10.3.9 and later. If you are running a version
of OS X previous to 10.3.x, edit the /etc/rc file and change the values in the following
commands:
sysctl -w kern.sysv.shmmax=134217728
sysctl -w kern.sysv.shmseg=32
and then reboot the system.
OS X system updates will overwrite /etc/rc so any changes to the file must be redone
after sytem updates.
QNX
1.
6/18/2015
DB Installation Guide
Page 82
Berkeley DB has been ported to the QNX Neutrino technology which is commonly referred
to as QNX RTP (Real-Time Platform). Berkeley DB has not been ported to earlier versions
of QNX, such as QNX 4.25.
2.
3.
4.
What are the implications of QNX's requirement to use shm_open(2) in order to use
mmap(2)?
QNX requires that files mapped with mmap(2) be opened using shm_open(2). There are
other places in addition to the environment shared memory regions, where Berkeley DB
tries to memory map files if it can.
The memory pool subsystem normally attempts to use mmap(2) even when using private
memory, as indicated by the DB_PRIVATE flag to DB_ENV->open(). In the case of QNX, if an
application is using private memory, Berkeley DB will not attempt to map the memory and
will instead use the local cache.
5.
6/18/2015
DB Installation Guide
Page 83
6.
The make clean command fails to execute when building the Berkeley DB SQL
interface.
Remove the build directory manually to clean up and proceed.
SCO
1.
If I build with gcc, programs such as db_dump and db_stat core dump immediately
when invoked.
We suspect gcc or the runtime loader may have a bug, but we haven't tracked it down. If
you want to use gcc, we suggest building static libraries.
Solaris
1.
2.
I've installed gcc on my Solaris system, but configuration fails because the compiler
doesn't work.
On some versions of Solaris, there is a cc executable in the user's path, but all it does is
display an error message and fail:
% which cc
/usr/ucb/cc
% cc
/usr/ucb/cc: language optional software package not installed
Because Berkeley DB always uses the native compiler in preference to gcc, this is a fatal
error. If the error message you are seeing is the following, then this may be the problem:
checking whether the C compiler (cc -O) works... no
configure: error: installation or configuration problem: C compiler
cannot create executables.
The simplest workaround is to set your CC environment variable to the system compiler
and reconfigure; for example:
env CC=gcc ../dist/configure
If you are using the --configure-cxx option, you may also want to specify a C++ compiler,
for example the following:
6/18/2015
DB Installation Guide
Page 84
I see the error "libc internal error: _rmutex_unlock: rmutex not held", followed by a
core dump when running threaded or JAVA programs.
This is a known bug in Solaris 2.5 and it is fixed by Sun patch 103187-25.
4.
I see error reports of nonexistent files, corrupted metadata pages and core dumps.
Solaris 7 contains a bug in the threading libraries (-lpthread, -lthread), which causes the
wrong version of the pwrite routine to be linked into the application if the thread library
is linked in after the C library. The result will be that the pwrite function is called rather
than the pwrite64. To work around the problem, use an explicit link order when creating
your application.
Sun Microsystems is tracking this problem with Bug Id's 4291109 and 4267207, and patch
106980-09 to Solaris 7 fixes the problem:
Bug Id: 4291109
Duplicate of: 4267207
Category: library
Subcategory: libthread
State: closed
Synopsis: pwrite64 mapped to pwrite
Description:
When libthread is linked after libc, there is a table of functions in
libthread that gets "wired into" libc via _libc_threads_interface().
The table in libthread is wrong in both Solaris 7 and on28_35 for the
TI_PWRITE64 row (see near the end).
5.
I see corrupted databases when doing hot backups or creating a hot failover archive.
The Solaris cp utility is implemented using the mmap system call, and so writes are
not blocked when it reads database pages. See Berkeley DB recoverability for more
information.
6.
Performance is slow and the application is doing a lot of I/O to the disk on which the
database environment's files are stored.
By default, Solaris periodically flushes dirty blocks from memory-mapped files to the
backing filesystem. This includes the Berkeley DB database environment's shared memory
regions and can affect Berkeley DB performance. Workarounds include creating the
shared regions in system shared memory (DB_SYSTEM_MEM) or application private memory
(DB_PRIVATE), or configuring Solaris to not flush memory-mapped pages. For more
information, see the "Solaris Tunable Parameters Reference Manual: fsflush and Related
Tunables".
7.
6/18/2015
DB Installation Guide
Page 85
8.
a.
Avoid including the problematical system include files in source code files which also
include Berkeley DB include files and call into the Berkeley DB API.
b.
Before building Berkeley DB, modify the generated include file db.h to itself include
the problematical system include files.
c.
I see that Berkeley DB automatically uses optimization level '-xO2' for the Sun
Workshop compiler. Can I change this to a higher level?
We have noticed some test failures when compiling with level '-xO3' and higher due to
overaggressive compiler optimizations. We do not recommend changing this setting.
SunOS
1.
6/18/2015
DB Installation Guide
Page 86
VxWorks notes
Berkeley DB currently disallows the DB_TRUNCATE flag to the DB->open() method on VxWorks
because the operations this flag represents are not fully supported under VxWorks.
The DB->sync() method is implemented using an ioctl call into the file system driver with the
FIOSYNC command. Most, but not all file system drivers support this call. Berkeley DB requires
the use of a file system that supports FIOSYNC.
6/18/2015
DB Installation Guide
Page 87
VxWorks FAQ
I get the error "Workspace open failed: This project workspace is an older format.",
when trying to open the supplied workspace on Tornado 2.0 under Windows.
This error will occur if the files were extracted in a manner that adds a CR/LF to lines
in the file. Make sure that you download the Berkeley DB ".zip" version of the Berkeley
DB distribution, and, when extracting the Berkeley DB sources, that you use an unzipper
program that will not do any conversion.
I sometimes see spurious output errors about temporary directories.
These messages are coming from the stat(2) function call in VxWorks. Unlike other
systems, there may not be a well known temporary directory on the target. Therefore, we
highly recommend that all applications use DB_ENV->set_tmp_dir() to specify a temporary
directory for the application.
How can I build Berkeley DB without using Tornado?
6/18/2015
DB Installation Guide
Page 88
The simplest way to build Berkeley DB without using Tornado is to configure Berkeley DB on
a UNIX system, and then use the Makefile and include files generated by that configuration
as the starting point for your build. The Makefile and include files are created during
configuration, in the current directory, based on your configuration decisions (for example,
debugging vs. non-debugging builds), so you'll need to configure the system for the way you
want Berkeley DB to be built.
Additionally, you'll need to account for the slight difference between the set of source
files used in a UNIX build and the set used in a VxWorks build. You can use the following
command to create a list of the Berkeley DB VxWorks files. The commands assume you are
in the build_vxworks directory of the Berkeley DB distribution:
% cat > /tmp/files.sed
s/<BEGIN> FILE_//
s/_objects//
^D
% grep FILE_ BerkeleyDB.wpj | grep _objects | sed -f /tmp/files.sed \
> /tmp/db.files
You will then have a template Makefile and include files, and a list of VxWorks-specific
source files. You will need to convert this Makefile and list of files into a form that is
acceptable to your specific build environment.
Does Berkeley DB use floating point registers?
Yes, there are a few places in Berkeley DB where floating point computations are
performed. As a result, all applications that call taskSpawn should specify the VX_FP_TASK
option.
Can I run the test suite under VxWorks?
The test suite requires the Berkeley DB Tcl library. In turn, this library requires Tcl 8.5 or
greater. In order to run the test suite, you would need to port Tcl 8.5 or greater to VxWorks.
The Tcl shell included in windsh is not adequate for two reasons. First, it is based on Tcl 8.0.
Second, it does not include the necessary Tcl components for adding a Tcl extension.
Are all Berkeley DB features available for VxWorks?
All Berkeley DB features are available for VxWorks with the exception of the DB_TRUNCATE
flag for DB->open(). The underlying mechanism needed for that flag is not available
consistently across different file systems for VxWorks.
Are there any constraints using particular filesystem drivers?
There are constraints using the dosFs filesystems with Berkeley DB. Namely, you must
configure your dosFs filesystem to support long filenames if you are using Berkeley DB
logging in your application. The VxWorks' dosFs 1.0 filesystem, by default, uses the old MSDOS 8.3 file-naming constraints, restricting to 8 character filenames with a 3 character
extension. If you have configured with VxWorks' dosFs 2.0 you should be compatible with
Windows FAT32 filesystems which supports long filenames.
6/18/2015
DB Installation Guide
Page 89
DB Installation Guide
Page 90
regions. Then, if an application fails, running recovery or explicitly removing the database
environment by calling the DB_ENV->remove() method will allow Berkeley DB to release
those previously held mutex resources. If an application specifies the DB_PRIVATE flag
(choosing not to use persistent shared memory), and then fails, mutexes allocated in that
private memory may leak their underlying system resources. Therefore, the DB_ENV->open()
flag should be used with caution on VxWorks.
6/18/2015
DB Installation Guide
Page 91
New Events
DB_EVENT_FAILCHK_PANIC
DB_EVENT_MUTEX_DIED
6/18/2015
DB Installation Guide
Page 92
New Functions
DB_ENV->repmgr_set_incoming_queue_max()
DB_ENV->repmgr_get_incoming_queue_max()
New Event
DB_EVENT_REP_INQUEUE_FULL
6/18/2015
DB Installation Guide
Page 93
Back up the database and shut down any applications accessing it.
2.
3.
Enter the dbsql shell and execute a SQL REINDEX command as follows:
dbsql <database.dbsql>
dbsql> REINDEX
dbsql> .quit
Back up the database and shut down any applications accessing it.
2.
3.
Enter the dbsql shell and execute a SQL REINDEX command as follows:
dbsql.exe <database.dbsql>
dbsql> REINDEX
dbsql> .quit
Removed C# Class
The LockDetectMode C# class has been removed as redundant. The same functionality is
available in other classes.
6/18/2015
DB Installation Guide
Page 94
Dropped Support
Berkeley DB no longer tests or certifies Windows XP or Windows 2003.
A 'salvage' (db_dump -r) no longer hangs on a corrupt database which contains a loop in an
overflow item's chain of pages. [#18550]
2.
Remove +u1 compiler flag from the HP-UX build and fixed related alignment issue.
[#23739]
3.
4.
5.
DB->open() now detects invalid pagesizes sooner, avoiding a potential floating point
exception when a purported database file has a pagesize of 0. Added a pre-verify step to
the db_dump utility. [#24217]
6.
Fixed a bug that can cause DBcursor->get to return incorrect data when
DB_GET_BOTH_RANGE flag is used. [#24220.1]
7.
8.
Aborting a transaction no longer panics if a deadlock error occurs while freeing up the
transaction's cursors. [#24223]
9.
Fixed a crash which could occur when multiple BDB SQL processes repeatedly open a
database file. [#24230]
10. Fixed a bug where db_printlog improperly handled a "No such file or directory" error
condition. [#24265]
11. Fixed a bug that could cause a master crash in the following cases: an unencrypted client
attempts to join an encrypted replication group, or an encrypted client attempts to join
an unencrypted replication group. [#24288]
12. Fixed a bug that can cause a crash when DB_ENV->memp_stat() is called. [#24298]
13. Added support for arm64. [#24312]
14. Reduced the minimum hash table size. [#24314].
15. Fixed a bug where file names were not displayed correctly when a file failed to open
during backup. [#24340]
16. Enabled cross compiling the JDBC driver. [#24347]
6/18/2015
DB Installation Guide
Page 95
17. Fixed a crash when writing to a SQL BLOB while txn_bulk is enabled. [#24351]
18. DB->open() now detects invalid bt_minkey better, avoiding a potential floating point
excetpion. [#24398]
19. Removed EnvironmentConfig.setTxnNotDurable() and Environment.getTxnNotDurable()
from the Java API. This flag cannot be set on environments. [#24416]
Fixed a bug that was preventing PRAGMA cache_size from changing the size of the cache.
[#24206]
2.
Fixed a recovery bug that could cause files to end up in the wrong directory when using
logs created in 5.3 or earlier. [#24169]
3.
Creating a table in SQL will no longer fail if the database connection was opened without
the SQLITE_OPEN_CREATE flag. [#24115]
4.
Fixed a bug where an error message was not displayed back to the user correctly when
sequence creation failed. [#24103]
5.
Fixed a bug where BDB was not handling tables with multiple BLOB columns when using
the SQL API. [#24092]
6.
SQL sequence names are now case insensitive except when surrounded by quotation
marks. [#23964]
7.
Avoid incrementing the statistic DB_LOG_STAT.st_scount ("Total log file flushes") when
DB_LOG_NOSYNC is in effect. [#23945]
8.
Fixed a bug that may lead to crash when opening multiple environments in a multithreaded program. [#23913]
9.
10. Fixed the error "BDB2074 No space available in latch table" for configurations using
plain pthreads mutexes and DB_ENV->set_thread_count(). Susceptible configurations
include the definition of HAVE_MUTEX_PTHREADS in db_config.h but do not define
HAVE_MUTEX_HYBRID. [#23831]
11. Fixed a crash when MVCC and snapshot isolation are used and the system is under heavy
load. [#23815]
12. Fixed a problem with closing a panicked environment, in which an infinite loop was
possible. [#23814]
13. Removed Java 5 targets from Windows builds and javadoc production. [#23811]
14. Support for client-to-client replication of BLOB data during internal initialization has been
disabled. [#23748]
15. Fixed a bug that may cause self-deadlock during database compaction. [#23725]
6/18/2015
DB Installation Guide
Page 96
Fixed a sqlite3odbc bug which may return an out-of-memory error when calling
SQLGetData() on empty long columns. [#22777]
2.
Enabling BLOB support and master leases will no longer result in unexpected
DB_REP_LEASE_EXPIRED errors. [#23275]
3.
Fixed a race condition when BLOB support is enabled with replication where message
handling could fail with an ENOENT error. [#23275]
4.
Existing SQL databases will have to be reindexed after upgrading to this release. No
actions are required for non-SQL databases. Check the upgrade documentation for more
details. [#23469]
5.
Fixed a known bug in SQL where ORDER BY could return results out of order if an index is
used to answer the query. [#23469]
6.
Fixed a bug that causes a crash when opening a corrupted environment with encryption
and DB_REGISTER. [#23643]
7.
Fixed a bug that causes a crash when opening a corrupted environment with DB_FAILCHK
using a BDB compiled with DIAGNOSTIC defined. [#23643]
8.
Fixed a bug where closing a panicked environment raised an access violation and crashed
the program. [#23679]
9.
Fixed a bug where db_verify did not verify multiple files correctly. [#23692]
10. Fixed a bug that causes a site joining a replication group to hang or to only partially
complete the internal steps necessary to join the replication group. [#23750]
New Features/Improvements
6/18/2015
1.
2.
Replication Manager Preferred Master is a new option for 2-site replication groups. One
site is the preferred master, which assumes the master role as much of the time as its
availability permits. A preferred master replication group guarantees that transactions
committed on the preferred master site will never be rolled back while also providing
client failover. [#20230]
3.
A new flag DB_FORCESYNCENV is provided for DB_ENV->close(), which forces flushing the
memory mapped regions before unmapping them. [#21176]
DB Installation Guide
Page 97
4.
A new API is provided to limit the Replication Manager incoming queue based on the
amount of heap memory it uses. [#21481]
5.
BLOB support is now available for environments configured for replication. [#22359]
6.
7.
8.
9.
10. Added --enable-error_history support. This diagnostic tool prints a stack trace when a
panic occurs. [#23119]
11. The new log configuration option DB_LOG_NOSYNC has been added to avoid flushing the
transaction log in order to stabilize storage. This can be useful when durability across
system crashes is unnecessary and all the transactions in the environment specify either
the DB_TXN_NOSYNC or DB_TXN_WRITE_NOSYNC flag. This configuration setting may
be made by DB_ENV->log_set_config() or a DB_CONFIG line "db_log_nosync [on|off]".
[#23191]
Fixed a problem with DB_LOCKDOWN which would cause an mlock error ENOMEM on some
operating systems. [#21379]
2.
DB_ENV->close() now detaches from the environment's mmap and shared memory
regions even when a panic error (DB_RUNRECOVERY) has been returned. DB_ENV>open(DB_REGISTER) detects whether a panic has occurred in the environment. If so it
returns DB_RUNRECOVERY. Prior to this, the panic state was not detected, which might
have caused a hang. [#22805]
3.
Ensure that the size of memory mapped backing files are a multiple of the system
pagesize. Previously the files were aligned up to 8KB boundaries, which was not adequate
for systems with a 64KB pagesize. [#23290]
4.
Improved the sizing of the environment region to better match the needs of thread
tracking as specified by DB_ENV->set_thread_count(). [#24314]
-None
6/18/2015
DB Installation Guide
Page 98
2.
Fixed a bug that occurred if the range keys did not fit within one database page during
database partition opening. [#22280]
3.
Corrected a buffer mutex deadlock involving off-page duplicate sets and less than full
transactional isolation levels. [#22532]
4.
Fixed a byte swapping bug that could corrupt the header of heap database pages.
[#23318]
API Changes
1.
Make flag checking in sequence stat print API consistent with the other stat print APIs.
[#22513]
Fixed a bug that was preventing old log files from being removed while using the SQL API.
[#22521]
2.
3.
2.
2.
3.
4.
5.
6.
Fixed a bug that partition directories could not be set correctly via Java API. [#23410]
6/18/2015
1.
The class LockDetectMode has been removed. It was duplicating functionality provided in
other classes and not being used. [#21248]
2.
DB Installation Guide
Page 99
3.
4.
5.
6.
7.
Changed definition of all structs to make SWIG 2.0.12 can generate code successfully.
[#23295]
Fixed a bug that db_stl library could not build using gcc-4.7 or later versions. [#22615]
Replication Changes
1.
Fixed a bug where, after some rare multiple-site failure scenarios including transaction
rollbacks, Replication Manager could have incorrectly determined that new transactions
fulfilled the acknowledgement policy. [#16624]
2.
Acknowledgements are counted more precisely when an unelectable client is first joining
the replication group and also when a master has been set to be unelectable. [#20825]
3.
If there is already a replication process running, do not require a flag value when calling
DB_ENV->repmgr_start() to start a subordinate process. [#20980]
4.
Fixed a bug that a site could not rejoin the replication group on Windows after being
removed from the group. [#22460]
5.
6.
Fixed a bug where a Replication Manager subordinate process could fail its
automatic takeover as the replication process because it is unnecessarily waiting for
acknowledgements from other sites before the connections to these sites are properly
established. [#22998]
7.
Fixed a bug where a client synchronization could get stuck because certain error paths
were failing to release an internal lockout. [#23169]
8.
Fixed a bug where replication group-aware log archiving might have unnecessarily kept
log files after certain connection sequences between sites. [#23420]
6/18/2015
None
DB Installation Guide
Page 100
Avoid incrementing the statistic DB_LOG_STAT.st_scount ("Total log file flushes") when
DB_LOG_NOSYNC is in effect. [#23945]
None
2.
Removed the last source files of the defunct fcntl mutex implementation. [#23119]
3.
Fix a race condition which might allow DB_ENV->failchk() to hang after it had freed a
locker ID. [#24194]
None
None
Utility Changes
1.
None
6/18/2015
1.
Fixed a bug that ex_rep_base could not quit gracefully after receiving 'exit' command.
[#16871]
2.
Extended the ex_rep_mgr Replication Manager sample application to demonstrate the use
of a thread-specific structure to associate a DB_EVENT_REP_PERM_FAILED event with its
originating transaction. [#17686]
3.
4.
Additional information about the cause of an error may now be displayed by configuring
with --enable-error_history. [#23119]
5.
6.
7.
A configuration warning 'Ignoring --with-cryptography flag value' is added for the noncrypto package. [#23333]
DB Installation Guide
Page 101
8.
9.
Extended the Mac OS X section in the chapter 7 of the installation guide. [#23388]
10. Fixed PHP module to consistently use the ZEND_REGISTER_RESOURCE macro, preventing
a build failure with PHP 5.5. Updated INSTALL file to note the changed location of sample
output. [#23391]
11. Fixed a few typos in the JDBC/ODBC sections of the Windows/Unix installation guide.
[#23404]
Example Changes
1.
Added an example using BDB SQL with the JDBC driver and ADF. [#22569]
Fixed a byte swapping bug with log file operations on blob files. [#22215]
2.
3.
Database containing BLOBS are now portable between machines of opposite endianness.
[#22455]
4.
Added a -D option to display output for db_dump and db_printlog. This value takes
priority over DB_ENV->set_data_len() if that was called to set the length. [#22485]
5.
6.
Fixed heap databases so they can work on both big and little endian machines. [#22929]
7.
8.
Properly clean up blob meta database after aborting the creation of its parent database.
[#23000]
9.
10. Fixed a byte swapping bug with heap blob log records. [#23319]
11. Fixed two race condition bugs with DB_ENV->failchk(). [#23347]
12. Fixed memory alignment issue on Solaris. [#23571]
13. Fixed a bug that using Visual Studio 2010 and JDK 1.5 could generate corrupted jar files.
[#23574]
14. Fixed a bug that specifying --with-cryptography=yes did not build the jdbc library
correctly. [#23606]
6/18/2015
DB Installation Guide
Page 102
Deprecated Features
1.
The DB_AUTO_COMMIT flag is present in the DB_SEQUENCE APIs for Java and C#. This flg
is no longer meaningful for these APIs and will be deprecated in the next release.
1.
[#23469] (Fixed in 12.1.6.1.20 -- see above.) The SQL ORDER BY command on the primary
key of a table can in rare cases return the results out of order if an index search is used
in executing the query. For example: Create a single column table. Insert two rows with
identical values. A query on the row id and the column will produce results in a different
order depending on whether an index is used.
Known Bugs
6/18/2015
DB Installation Guide
Page 103
New Functions
DBC->db_stream()
DB_STREAM->close()
DB_STREAM->read()
DB_STREAM->size()
DB_STREAM->write()
DB_ENV->set_blob_threshold()
DB_ENV->get_blob_threshold()
DB->set_blob_threshold()
DB->get_blob_threshold()
DB_ENV->set_blob_dir()
DB_ENV->get_blob_dir()
DB->set_blob_dir()
DB->get_blob_dir()
6/18/2015
DB Installation Guide
Page 104
New Pragma
PRAGMA large_record_opt[=n]
Replication Views
A replication site can now be created as a replication view by using the DB_ENV>rep_set_view() method. A replication view is a read-only copy of some or all of the
replicated databases that cannot become master, participate in elections, or contribute to
transaction durability.
New Function
DB_ENV->rep_set_view()
New Flag
DB_REPMGR_ISVIEW - A new value for the flags field of the DB_REPMGR_SITE structures
returned by the DB_ENV->repmgr_site_list() method to indicate that a site is a replication
view.
New Pragmas
PRAGMA replication_ack_policy[=all|all_available|none|one|quorum]
PRAGMA replication_ack_timeout[=n]
6/18/2015
DB Installation Guide
Page 105
PRAGMA replication_priority[=n]
PRAGMA replication_get_master
PRAGMA replication_num_sites
PRAGMA replication_perm_failed
PRAGMA replication_site_status
New Event
DB_EVENT_REP_AUTOTAKEOVER_FAILED
New Pragma
PRAGMA bdbsql_log_buffer[=n]
6/18/2015
DB Installation Guide
Page 106
License Change
Starting with the 6.0 / 12c releases, all Berkeley DB products are licensed under the GNU
AFFERO GENERAL PUBLIC LICENSE (AGPL), version 3. This license is published by the Free
Software Foundation (FSF) (1) and approved by the Open Source Initiative (2) . Please review
the terms of the license to ensure compliance before upgrading to the 12c release. Previous
releases of Berkeley DB software will continue to be distributed under the Sleepycat license.
Dropped Support
Berkeley DB no longer supports Tornado 2.0 or versions of VxWorks earlier than 6.9.
6/18/2015
DB Installation Guide
Page 107
New Features
1.
Added an alternate storage format called blobs, which improves the read and update
performance of very large data items. Interface available through C, C#, C++ and Java
APIs. [#19332]
2.
Added several pragmas to the SQL layer that configure and give information on HA SQL
applications, such as the number of sites in the replication group, or configuring election
priority of a site. [#20227]
3.
4.
When running Replication Manager in multiple processes, if the replication process quits
and there is an available subordinate process, the subordinate process automatically
takes over as the replication process. [#20969]
5.
Added replication views/partial replication feature. Feature available through C, C#, C++
and Java APIs. [#21062]
6.
7.
8.
Applications which use snapshot isolation and long-running transactions will, in many
instances, see reduced use of the cache. This leads to improved performance by reducing
the need for temporary freezer files. [#21324]
9.
6/18/2015
1.
2.
Fixed bugs when attempting to open non-DB files as if they were databases. If encryption
was active, an assertion failure would occur. If encryption was not active, the error
DB Installation Guide
Page 108
message "BDB0178 Encrypted database: no encryption flag" would incorrectly imply that a
password was required. [#21408]
None
Fixed a bug that could allocate a heap data page in a region after the region creation has
been undone. [#20939]
2.
3.
Enhance the search performance for Btree access method when the keys share a common
prefix. [#21216]
4.
Fixed bugs with the byte swapping of heap pages. Now heap databases can be moved
between little-endian and big-endian architectures. [#21387]
5.
Fix a race condition where a cursor in the process of being cleaned up could be accessed
by another thread of control. [#21714]
6.
7.
API Changes
1.
2.
Fixed a bug with the DB_MPOOLFILE->set_maxsize API. In previous releases the file was
allowed to grow one page larger than the configured limit. [#21867]
3.
Change the comparison function in DB->set_bt_compare, DB->set_dup_compare and DB>set_h_compare to accept an extra 'size_t *locp' parameter. [#22235]
6/18/2015
1.
Added the PRAGMA large_record_opt, which when enabled can improve the read and
update performance of very large records. [#19332]
2.
Added support for multi-process access to the database in SQL HA applications. [#21050]
3.
In-memory databases can now be created without passing the flag SQLITE_OPEN_CREATE.
[#21456]
4.
Fix a bug in the SQL API where setting the page size to 64 K would cause an error. Also
fixed an associated memory leak in SQL online backup. [#21460]
DB Installation Guide
Page 109
5.
6.
7.
Fixed a mutex leak with multi-prcess access to the database in SQL HA applications.
[#21714]
8.
Fixed a bug that could cause jdbc build to fail on ARM-Linux using gnueabi gcc. [#22123]
9.
2.
Fixed a bug where Database.verify() was not correctly configuring the db. [#22401]
3.
Fixed a false error message that could be printed when creating a transaction on a
replication client in Java. [#21671]
2.
Replication Changes
6/18/2015
1.
Fixed several assertion failures that could result when using failchk and replication.
[#19765]
2.
Provide an error when the local site defined during internal initialization is inconsistent
with an earlier definition. [#20870]
3.
Fixed a bug where replication clients were incorrectly flushing the log when the
DB_TXN_WRITE_NOSYNC flag was specified. [#20964]
4.
Fixed a bug where a valid invocation of the DB_ENV->repmgr_start() method would fail
after a previous invocation that supplied an invalid nthreads parameter value. A BDB3640
error was being incorrectly generated. [#21289]
5.
Fixed a bug where the calculation of the number of required master lease grants enforced
that a transaction must be present on a strict majority of replication group sites. It is
sufficient that a transaction be present on at least half of the replication group sites,
which in some cases reduces the number of required lease grants. [#21329]
DB Installation Guide
Page 110
6.
Fixed a recovery issue on the client where an incorrect checkpoint was being selected
causing recovery to go to an incorrect point. [#21342]
7.
Fixed a bug that could result in a crash due to an incorrect re-request on a site that just
won an election. [#21344]
8.
Fixed a bug where logs would never get archived if there are 2 sites and various
combinations of failures. [#21448]
9.
Fixed a bug where we were not detecting the fact that DB_TXN_SNAPSHOT was being
used with an HA client. Clients are by definition read only, so snapshot transactions are
not permitted. [#21601]
10. Fixed a bug where the determination of whether or not a site is peer was incorrectly
determined. [#21722]
11. Fixed a bug where a Replication Manager master could stop functioning after accepting an
obsolete group membership site list from another site. [#21804]
12. Reduce the multiple data streams that can sometimes occur if rerequest times are shorter
than the time it takes to switch log files or perform a checkpoint at a client site. [#21843]
13. Fixed a bug that a site is removed unexpectedly from the replication group when the
replication group loses the old master's confirmation of adding the site during a master
change. [#21875]
14. Fixed a bug where a master site could crash when removing a site if the removed site
closes its connections before the master completes its final steps of the operation.
[#22050]
15. Fixed a bug where an election never happens after the loss of the master when master
leases are in use. [#22120]
Fixed a bug that could cause a trap if a lock timeout occured while opening a database.
[#21098]
2.
Fixed a hang which could occur if there were no more space for lockers. [#21774]
3.
Fixed a potential race condition when building the deadlock detection graph which, under
rare conditions, might cause a invalid address fault. [#22261]
Fixed a bug that DB_ENV->log_get_config did not work correctly when it was called before
DB_ENV->open. [#21359]
6/18/2015
DB Installation Guide
Page 111
2.
Fixed a race condition occurring when trying to get information about a file and the file is
being extended by the OS. [#21193]
3.
4.
Fixed an undefined symbol error (MUTEX_IS_OWNED) when configuring with --enablediagnostic --disable-mutexsupport. [#21145]
2.
Fix a bug where we were not properly aligning mutexes in DB_PRIVATE regions when the
application configured an alignment. [#21491]
3.
Fix a race condition between DB_ENV->failchk() and the allocation of a mutex. [#21796]
4.
Limit the default mutex spin count to be at most 200, to avoid excessive spinning on
systems with hundreds of hyperthreads. [#21463]
None
Utility Changes
6/18/2015
1.
Fixed a bug where calling DB->set_partition with a key array required users to keep the
memory array valid until after the database was opened. [#18350]
2.
Fixed a bug that caused DB_ENV->backup to stop early if DB_BACKUP_FILES was not set
and a non-DB file was in the data directory. [#21076]
3.
4.
Fixed three problems with db_hotbackup's backup of transaction logs. A hot backup did
not use any configured log directory, but would try to open the logs in the environment
home. The second fix corrected an error path, in which the memory was freed by the
wrong function, possibly causing a guard byte error. The third fix fixed the issue that a
wrong message would be displayed when only "-l" was specified. [#21313]
5.
Fixed a spurious "No such file or directory" (ENOENT) error when running db_archive in an
environment with an empty queue database. [#21541]
6.
Fixed bugs in compaction of large keys in the upper levels of btrees. [#21569]
7.
Most utilities no longer operate on replication clients which are being automatically
initialized. The DB_REP_LOCKOUT error is now returned. [#21593]
DB Installation Guide
Page 112
8.
Fixed a resource leak in the db->verify() function for btrees. The bug would slow down
verification and possibly cause it to run out of memory. [##21917]
9.
Removed a potential hang when compacting databases with many duplicates. [#21975]
10. Fixed a bug where we were not returning an error when trying to compact a heap
database. [#22063]
11. Fixed a bug in the error handling of db_log_verify which would cause a segmenation
violation if there were not enough space to create its temporary databases. [#22187]
Fix an odbc configure issue which was causing ODBC build failure with SQL API. [#21490]
2.
Disabled encryption by default in SQL API on Linux, completed build options for
encryption in SQL and SQL JDBC on Linux, Windows and Android, and updated build
process for the three platforms in Installation Guide. [#21872]
3.
Use "-xO2" as the default optimization level for the Sun Workshop compiler. [#22057]
4.
Fix an "opcode not supported" error on MIPS platforms whose assembler defaults to the
MIPS1 instruction set. [#22065]
5.
Provide a consistent way to turn on/off encryption for db,sql,jdbc libraries on Unix.
[#22158]
6.
Added the compile option CONFIG_TEST when using debug mode in the db_csharp
Windows project, to be consistent with the db Windows project. [#22300]
Example Changes
1.
6/18/2015
1.
Fixed a race condition that could cause a crash if 2 processes opened the same SQL
database at the same time. [#21041]
2.
Fixed an assert failure in the btree comparison function which caused memory to be
allocated to the wrong thread. [#21232]
3.
Fixed a race condition in the SQL handle cache locking code. [#21265]
4.
Fixed a bug in the SQL code that prevented the table from being created when
BDBSQL_FILE_PER_TABLE is defined. [#21417]
5.
Fixed a bug that some fields of the partition key DBTs returned from DB>get_partition_keys may not be initialized. [#21474]
6.
Fixed a bug that prevented a sub-database from being created under the directory
identified in DB->set_create_dir. [#21603]
DB Installation Guide
Page 113
7.
Fixed a bug where dbenv->mp_mtxcount was not being used correctly. [#21768]
8.
Cleaned a few variable initialization problems that were causing failures on 64-bit
Windows. [#21850]
9.
Improved the randomness of the 20 byte unique fileid generator on Windows. [#22470]
10. Fixed a possible assertion failure in the XA Transaction Manager feature. [#22450]
Deprecated Features
1.
Tornado 2.0 is not supported, and VxWorks versions older than 6.9 are not supported.
[#21877]
1.
Prepared transactions may not remove databases. An error EINVAL message will be
returned by TXN->prepare() if the transaction removed any databases.
2.
Databases containing BLOBs are not portable between machines of opposite endianness.
3.
The latest version of the ADO.NET driver uses a new database connection close function
that does not clean up the database completely, leaving transactions active. In our build
projects that we distribute we added the preprocessor definition INTEROP_LEGACY_CLOSE
so the older version will be used. Removing this can cause hangs.
4.
The db_log_verify utility does not currently implement support for the "-D" option.
Also, the "-d" option does not work for an environment with multiple databases. For
environments with sub-databases, some unexpected warnings will be thrown. [#22136]
5.
6.
Using the DB_FAILCHK flag with just the DB_RECOVER flag can cause processes to hang.
DB_RECOVER will cause the environment to be rebuilt, and when DB_FAILCHK is specified,
it runs fail check as the last step in the open. It is done afer the environment has been
rebuilt. There isnt anything for fail check to really do in this case. The hang can occur if a
separate process also uses this combination which would mean the environment is rebuilt
again and it could conflict with the first process if it is doing the fail check. [#22419]
7.
A rare race condition in the XA transaction manager can return the error XAER_PROTO in a
one-phase commit. [#22450]
Known Bugs
6/18/2015
DB Installation Guide
Page 114
New Function
ReplicationManagerSiteInfo.getConnectionStatus()
New Class
ReplicationManagerConnectionStatus
Deprecated Function
ReplicationManagerSiteInfo.isConnected()
6/18/2015
DB Installation Guide
Page 115
New Functions
DB->set_lk_exclusive()
DB->get_lk_exclusive()
New Functions
DB->set_heap_regionsize()
DB->get_heap_regionsize()
New Functions
DB_ENV->backup()
DB_ENV->dbbackup()
DB_ENV->set_backup_callbacks()
DB_ENV->set_backup_config()
6/18/2015
DB Installation Guide
Page 116
DB_CREATE
DB_EXCL
DB_VERB_BACKUP
New Functions
DB_ENV->set_metadata_dir()
DB_ENV->get_metadata_dir()
6/18/2015
DB Installation Guide
Page 117
Encryption is now disabled by default in the Windows SQL API build. This makes it consistent
with builds of the SQL API on other systems. To enable encryption in Visual Studios right
click the db_sql project, and select Properties->Configuration Properties->C/C++>Preprocessor and add SQLITE_HAS_CODEC to Preprocessor Definitions.
New PRAGMAs
PRAGMA bdbsql_shared_resources[=N]
PRAGMA bdbsql_set_lock_tablesize[=N]
6/18/2015
DB Installation Guide
Page 118
the flag, DB_MULTIVERSION, and all XA managed transactions that operate on that database
will use transaction snapshots.
2.
New Features
1.
2.
Added an integer key comparison function to improve performance through the SQL API.
[#19609]
3.
4.
Added an API call so the user can specify the size of the region in a heap db. [#19914]
5.
Improved Replication Manager's ability to recover from the (perhaps rare) phenomenon
of two sites trying to connect to each other simultaneously, which used to result in loss
of both connections, requiring a retry after the CONNECTION_RETRY timeout period.
[#19980]
6.
Enhanced the interface for copying databases for a hot backup. Added configure support
for --enable-atomicfileread. [#20129]
7.
Enhaced the log reading routine to detect that a log file is missing rather than returning
that a zero length record was found. [#20130]
8.
9.
10. Improved the error handling through the SQL API. Errors can be sent to a file with the use
of the BDBSQL_ERROR_FILE pragma. [#20213]
11. Database handles can now be configured to give exclusive access to the database.
[#20331]
12. XA transactions will now use transaction snapshots if the XA databases they operate on
were configured with DB_MULTIVERSION. [#20332]
6/18/2015
DB Installation Guide
Page 119
Fixed a bug that could cause a segmentation violation when closing an environment
handle which has open database handles on partition databases. [#20281]
2.
Fixed a bug that could cause a segmentation violation if a region was extended leaving a
very small fragment at the end. [#20414]
3.
Fixed a bug were database configuration settings could be lost when the database was
opened if the open operation was blocked for any amount of time. [#20860]
2.
Fixed a bug that bulk update operations did not work correctly on compressed databases.
[#19017]
3.
Improved the log flushing performance when ftruncate() is not available on a system.
[#19725]
4.
When performing partial puts in a heap database, empty pieces will no longer be left in a
split record chain. [#20052]
5.
Fixed a bug where, on systems without FTRUNCATE, db_verify will return an error for
truncated heap databases. [#20195]
6.
Fixed a bug where BDB could run out of mutexes when many databases are renamed.
[#20228]
7.
Fixed a bug where the metadata page in hash databases would not be flushed to disk.
[#20265]
8.
Fixed a bug that could leave deleted pages from a HEAP database in the buffer cache.
[#20309]
9.
Fixed a bug where the library would fail to put records with overflow keys into hash
duplicate database. [#20329]
10. Fixed a bug in DB->compact of btrees that could cause a bad pointer reference. [#20360]
6/18/2015
DB Installation Guide
Page 120
11. Fixed a bug that could cause the last page number stored on the metadata page to be
wrong after rolling forward a db->compact operation that freed more pages than will fit
in a single log record. [#20646]
12. Fixed a bug that could cause DB->stat to block on a mutex while holding a lock on the
metadata page. [#20770]
13. Fixed a bug that could cause DB->compact of a DB_HASH database to fail to mark a page
it updated as dirty. [#20778]
14. Fixed a bug where internal HEAP structures were not rebuilt during database handle
refresh. [#20821]
15. Fixed a bug with secondary indices, off-page duplicates and DB_READ_COMMITTED which
could erroneously release the lock on the page holding a returned record. [#20853]
16. Fixed a bug that could cause a hang or improperly report an empty queue when the queue
record numbers wrapped around at 2^32. [#20956]
17. Fixed a bug on Linux or Windows that could generate a checksum error if a database file
was being opened while the meta data page happened to be flushed from the cache.
[#20996]
6/18/2015
1.
2.
Fixed a bug in the SQL API when using large blob items and multiple concurrent
connections. [#19945]
3.
To avoid a race condition that could cause a snapshot reader to see a wrong version it is
now not permitted to open a DB handle specifying DB_MULTIVERSION if that database is
currently opened by a handle which did not specify DB_MULTIVERSION. [#19940]
4.
5.
Fixed a bug in the SQL API where it was possible for a schema update to be ignored when
accessing a database from multiple processes. [#20319]
6.
7.
Fixed a bug in the SQL API where using the journal_mode pragma could cause a crash
when used as the first operation in a connection on an existing database. [#20620]
8.
Turn off the DBSQL encryption option on Windows/WinCE by default to match the
behavior on the other platforms. [#20671]
9.
DB Installation Guide
Page 121
10. Fixed a bug dealing with handle lock modes not reflecting the correct state which was
causing a deadlock in the SQL API. [#20862]
2.
Updated EID_MASTER to be "public static final" so that it would be exposed in Java docs.
[#20184]
3.
Fixed a bug where calls that return Stat objects could cause a segfault. [#20377]
Replication Changes
1.
2.
3.
Fixed a bug where the datadir structure was not maintained during an internal init.
[#19041]
4.
5.
Fixed a minor bug to handle ENOMEM when using an in-memory temp database. [#20197]
6.
Fixed a bug where multiple long running transactions across checkpoints could cause Log
Sequence errors on client systems. [#20421]
7.
Fixed a bug where multiple Replication Manager processes would sometimes not all
conform to replication-group-aware log archiving. [#20342]
Fixed a bug that could cause an early lock timeout if a previous error left a lock timeout
value set. [#19973]
Fixed a bug which could cause an incompletely written log record to be recognized as
valid, resulting in recovery failing with the message "Illegal record type <integer, usually
0> in log". [#17851]
2.
Fixed a bug where printlog would fail on in-memory heap databases. [#20269]
6/18/2015
1.
Fixed a bug which overstated the number of clean and dirty pages evicted from the
cache. [#20410]
2.
Fixed a bug that left a small fragment at the end of a region when extending. [#20414]
DB Installation Guide
Page 122
3.
Fixed a bug where the file bucket was always zero when creating a mpoolfile using the
mpool API. [#20468]
4.
Fixed a bug with multiversion concurrency control which could cause versions of pages to
remain in the cache even though they are no longer needed. [#20570]
5.
The memory pool allocator will now start freezing MVCC versions of buffers if it sees more
than 1/4 of the available buffers are taken up by versions. [#20836]
Fixed a bug in which DB_ENV->mutex_set_align() could cause DB_ENV>mutex_stat_print(dbenv, DB_STAT_ALL) to display only the first mutex. [#20522]
2.
Fixed a bug where a malloc failure could result in a segfault when doing a put on a
database with secondaries. [#20641]
Utility Changes
1.
Fixed a bug that would cause verify to call the wrong compare function if there are user
defined compare functions used and the database has multilevel off page sorted duplicate
trees. [#20284]
2.
Fixed a bug that could cause recovery to fail if DB->compact moved the meta data page
of a HASH subdatabase. [#20708]
1.
If two SQL processes are concurrently altering the schema of the same tables in a
database, there is a race condition that can cause the application to hang. [#20513]
2.
Replication groups including machines of different endianness do not support the heap
access method. [#21016]
3.
If a txn that is attempting to remove a region page from a heap database is aborted and
another txn is trying to update that same page then it can cause the original txn to abort.
This is timing dependant. [#20939]
Known Bugs
6/18/2015
DB Installation Guide
Page 123
New Flag
DB_DBT_READONLY
New Functions
DB_ENV->set_memory_init()
6/18/2015
DB Installation Guide
Page 124
DB_ENV->get_memory_init()
DB_ENV->set_memory_max()
DB_ENV->get_memory_max()
DB_ENV->set_lk_tablesize()
DB_ENV->get_lk_tablesize()
DB_ENV->mutex_set_init()
DB_ENV->mutex_get_init()
Deprecated Functions
DB_ENV->mutex_set_max()
DB_ENV->mutex_get_max()
DB_ENV->set_lk_max_lockers()
DB_ENV->get_lk_max_lockers()
DB_ENV->set_lk_max_locks()
DB_ENV->get_lk_max_locks()
DB_ENV->set_lk_max_objects()
DB_ENV->get_lk_max_objects()
DB_ENV->set_thread_count()
DB_ENV->get_thread_count()
DB_ENV->set_tx_max()
DB_ENV->get_tx_max()
6/18/2015
DB Installation Guide
Page 125
Upgrading
An existing application running a previous version of BDB can do a "live upgrade" so that only
one site at a time has to be shut down. To do this, restart each site in the group, with the
old master being shutdown last. When each site is restarted, use DB_SITE to configure the
local site with the flag DB_LEGACY, and create a DB_SITE handle with a full specification of
all the remote site addresses for all other sites currently in the group, and configure each
handle with the DB_LEGACY flag. When the old master is restarted and a new master has been
established, the new master is ready to manage membership changes, and new sites can be
added as usual. But the application must not try to add new sites, or remove existing sites,
during the mixed-version transitional phase.
To do a non-live upgrade shutdown the entire replication group. Then restart the group with
each site configured with the DB_LEGACY flag, and in DB_REP_ELECTION mode.
New Functions
DB_ENV->repmgr_site()
DB_ENV->repmgr_site_by_eid()
DB_SITE->set_config()
DB_SITE->get_config()
DB_SITE->remove()
DB_SITE->get_eid()
DB_SITE->get_address()
6/18/2015
DB Installation Guide
Page 126
DB_SITE->close()
Modified Functions
DB_ENV->rep_set_nsites() is no longer used by the Replication Manager, but is still used by
the Base API. It can now be used to change the number of sites dynamically, even when
master leases are in use.
New Events
DB_EVENT_REP_SITE_ADDED
DB_EVENT_REP_SITE_REMOVED
DB_EVENT_REP_LOCAL_SITE_REMOVED
DB_EVENT_REP_CONNECT_BROKEN
DB_EVENT_REP_CONNECT_ESTD
DB_EVENT_REP_CONNECT_TRY_FAILED
DB_EVENT_REP_INIT_DONE
Removed Functions
DB_ENV->repmgr_set_local_site()
DB_ENV->repmgr_add_local_site()
DB_ENV->repmgr_add_remote_site()
DB_ENV->repmgr_get_local_site()
New Parameters
The following new parameters are passed to DB_SITE->set_config().
DB_BOOTSTRAP_HELPER
DB_GROUP_CREATOR
DB_LEGACY
DB_LOCAL_SITE
DB_REPMGR_PEER
New Structure
DB_REPMGR_CONN_ERR encapsulates an EID and an integer system error code.
6/18/2015
DB Installation Guide
Page 127
New Functions
DB->set_heapsize()
DB->get_heapsize()
Modified Functions
DB->open() now accepts DB_HEAP as an access type.
DB->stat() now returns heap statistics in the structure DB_HEAP_STAT.
New Definition
DB_HEAP_RID is the defined heap key value.
New Pragmas
For more details on pragmas concerning Transaction Snapshots read Using Multiversion
Concurrency Control in the Berkeley DB Getting Started with the SQL APIs guide.
PRAGMA multiversion=ON|OFF;
PRAGMA snapshot_isolation=ON|OFF
6/18/2015
DB Installation Guide
Page 128
application is initially started, a specific master site must be explicitly designated. After
configuring the replication group, start replication using PRAGMA replication=ON.
To display replication statistics in the dbsql shell, use:
dbsql> .stat :rep
New Pragmas
For more details on the replication pragmas see Replication PRAGMAs in the Berkeley DB
Getting Started with the SQL APIs guide.
PRAGMA replication=ON|OFF
PRAGMA replication_initial_master=ON|OFF
PRAGMA replication_local_site="hostname:port"
PRAGMA replication_remote_site="hostname:port"
PRAGMA replication_remove_site="host:port"
PRAGMA replication_verbose_output=ON|OFF
PRAGMA replication_verbose_file=filename
New Functions
DB_ENV->repmgr_msg_dispatch()
DB_ENV->repmgr_channel()
DB_CHANNEL->send_msg()
DB_CHANNEL->send_request()
DB_CHANNEL->set_timeout()
DB_CHANNEL->close()
6/18/2015
DB Installation Guide
Page 129
New Functions
The four new functions, which have to be called as part of a SELECT statement, are describe
in more detail in Using Sequences in the Berkeley DB Getting Started with the SQL APIs guide.
create_sequence
seq_nextval
seq_currval
seq_drop_sequence.
Constraints
Applictions that use a BDB XA resource manager must now take into account the following
constraints.
No in-memory logging.
No application-level child transactions.
All database-level operations (open, close, create and the like) must be performed outside
of a global transactions (i.e., they can be performed in local BDB transactions, but not while
a distributed XA transaction is active).
Environment configuration must be done using a DB_CONFIG file.
6/18/2015
DB Installation Guide
Page 130
New Flag
DB_XA_CREATE - This flag is passed to db_create() to create a DB handle that supports XA
transactions.
Modified Function
DB->stat() now returns the field DB_TXN_STAT->DB_TXN_ACTIVE->xa_status, which
contains information on the XA transactions.
Existing database file formats were unchanged in library version 11.2.5.2. However, a new
database file format, "heap", was introduced.
2.
New Features
6/18/2015
1.
Replication Manager now manages Group Membership. This allows sites to be added
to and removed from the replication group dynamically. Replication Manager also now
automatically keeps track of the group size (nsites). [#14778]
2.
Initial allocations for various non-pagebuffer (mpool) system resources may now be
specified, as well as a total maximum of memory to use, rather than specifying a
maximum value for each resource. [#16334]
3.
4.
Added a new access method, DB_HEAP. Heap aims for efficient use (and re-use) of disk
space. Keys in a heap database are automatically generated by BDB, it is recommended
that one or more secondary indexes be used with a heap database. For full details on
DB_HEAP, see the Programmer's Reference Guide. [#17627]
5.
Added a compatible mode for 32bit and 64bit Windows environment. [#18225]
DB Installation Guide
Page 131
6.
For the SQL API, concurrency between read and write transactions can now be enabled
using "PRAGMA multiversion". Added several pragmas that can be used to configure the
Berkeley DB datastore. [#18521]
7.
Add several new pragmas to provide in-process support for replication in the SQL API.
[#18528]
8.
The Berkeley DB X/open compliant XA resource manager has been restored, including
support for multi-threaded servers. [#18701]
9.
Improved the ability to recover from an application crash on connections through the SQL
API. Berkeley DB will try to automatically clean up locks, mutexes and transactions from
the failed process. [#18713]
10. Add support for sequence usage in the SQL API using SQLite custom functions. [#19007]
11. Add a pragma in the SQL API to allow execution of a cache trickle command. [#19202]
12. Add a pragma in the SQL API to allow configuration of DB_SYSTEM_MEM environments.
[#19249]
13. The new db_env_set_win_security(SECURITY_ATTRIBUTES *) function allows an application
to specify the particular Microsoft Windows security attributes to be used by Berkeley
DB. This helps support applications which reduce their privileges after opening the
environment. [#19529]
None
None
6/18/2015
1.
Modified the queue access method so that it only uses latches on the metadata page
rather than a latch and a lock. This was done to improve performance. [#18749]
2.
Fixed several bugs that could cause an update running with MVCC to get the wrong version
of a page or improperly update the metadata last page number. [#19063]
3.
The database open code will no longer log the open and close of the master database in a
file when opening a sub database in that file. [#19071]
4.
Fixed a bug where an error during an update to a hash database with DB_NOOVERWRITE
set could return DB_KEYEXIST rather than the correct error. [#19077]
5.
Fixed a bug that could cause the wrong page number to be on a root or metadata page if
DB->compact moved the page and the operation was later rolled forward. [#19167]
6.
Fixed a bug that could cause the close of a secondary index database to fail if the
transaction doing the open aborted. [#19169]
DB Installation Guide
Page 132
7.
Fixed a bug that could prevent an update to a primary recno or queue database with
DB_NOOVERWITE set. [#19230]
8.
Fixed a bug when an update to a database with DB_NOOVERWRITE set could incorrectly
return DB_KEYEXIST rather than the correct error (e.g., DB_LOCK_DEADLOCK). [#19345]
9.
Fixed a bug preventing the use of the set_re_len and set_re_pad methods with a RECNO
database when configuring with --disable-queue. [#19367]
10. Fixed a bug in DB->compact on BTREE databases that did not check if the last page in the
database could be moved to a lower numbered page. [#19394]
11. Fixed a bug that could cause a Log Sequence Error when recovering the deallocation of a
multiple page overflow chain. [#19474]
12. Fixed a bug that could cause a diagnostic assertion if MVCC was in use and multiple levels
of a btree needed to be split. [#19481]
13. Fixed a few error paths that could cause a Panic with an "unpinned page returned" error.
[#19493]
14. Fixed a bug that closed a race condition that under heavy mult-threaded appending to a
queue database could cause some records to be lost. [#19498]
15. Fixed a bug that might cause DB->compact to mis-estimate the size of an overflow record
when merging two pages. This may cause the page to have more data than desired.
[#19562]
16. Fixed a bug in DB_ENV->fileid_reset that did not update the fileid's on the metadata
pages of subdatabases if the database file was not in native byte order. [#19608]
17. Fixed a bug that caused the first directory specified in the create of a partitioned
database to get too many partitions. [#20041]
6/18/2015
1.
Fixed a race condition that would cause a corruption error in one process when two
processes created the same SQL database. [#18929]
2.
Fixed a bug that would cause a constraint violation when updating the primary key with
the same value. [#18976]
3.
Overwriting an old backup with a new backup using the SQL online backup API will no
longer double the size of the database. [#19021]
4.
5.
Fixed a bug that could cause an undetected deadlock between a thread which moved a
metadata or root page via a DB->compact operation and another thread trying to open
the database if the old page was being removed from the file. [#19186]
6.
Fix a bug in the BDBSQL_FILE_PER_TABLE option, to allow absolute path names. [#19190]
DB Installation Guide
Page 133
7.
8.
Exclusive transactions will now block new transactions and will prevent existing
transactions from making forward progress. [#19256]
9.
Fixed a bug that would cause assert error when opening an in-memory hash database with
thread count configured when compiled with --enable-diagnostic. [#19357]
C API Changes
1.
Fixed a bug where encryption could not be enabled for individual databases in an
encrypted environment. [#18891]
2.
3.
4.
Fixed a bug in DB/DBC->get/pget that the partial flags are silently ignored with positional
flags and return inconsistent DBT. [#19540]
5.
Fixed a bug which prevented items from being deleted on a secondary database. [#19573]
6.
Fixed a bug to correctly handle the DB_BUFFER_SMALL case on delete operations when
compression is enabled. [#19660]
None.
6/18/2015
1.
2.
DB Installation Guide
Page 134
Replication Changes
1.
Replication Manager now allows differing ack policies at different sites throughout
the group, and supports dynamic changes to the ack policy. (The ack policy in force is
determined by the current master.) [#14993]
2.
3.
4.
5.
Changed election criteria so that later group transactions won't get overwritten by earlier
generations with more log. [#17815]
6.
Added changes to master lease checks that result in improved performance when using
master leases. [#18960]
7.
A log write failure on a replication master will now cause a panic since the transaction
may be committed on some clients. [#19054]
8.
9.
Change lease code so that zero priority sites do not count in lease guarantees since they
cannot be elected. [#19154]
10. Repmgr rerequest processing is moved from a dedicated thread to heartbeat messages.
Repmgr clients using heartbeats can now detect and rerequest missing final master log
records without master activity. [#19197]
11. Repmgr statistics are now included in full statistics output for an environment. [#19198]
12. Fix an inefficiency in mixed version elections. We now check if an election is won via the
EID instead of priority. [#19254]
13. Changed election LSNs to use the last txn commit LSN instead of the end of the log.
[#19278]
14. Create replication internal database files in the environment home directory rather than
the data directory so that they are in the same location as the other internal replication
files. [#19403]
15. Fix a bug that was preventing repmgr from calling an election when starting a site with
the DB_REP_ELECTION flag. [#19546]
16. Fixed a bug which could cause a segfault at a replication master if a named in-memory
database was being created around the same time as a client site were synchronizing (in
"internal init") with the master. [#19583]
6/18/2015
DB Installation Guide
Page 135
17. Adjust lease code to consider timeout length when retrying. [#19705]
18. Fixed a bug that could cause a crash in replication groups of more than 10 sites, with
multiple processes sharing each DB environment concurrently. [#19818]
19. Fix a bug where an assertion failure could happen if pages in a database were deallocated
during a client internal initialization.[#19851]
20. Fix a bug where an internal initialization of a queue database with non-contiguous extent
files could return an error. [#19925]
21. The 2SITE_STRICT replication configuration parameter is now turned on by default. It can
be turned off via a call to DB_ENV->rep_set_config(). [#19937]
22. Repmgr heartbeats can now help detect a duplicate master without the need for
application activity. [#19950]
2.
Fixed a bug where transaction timeouts could have been specified in a database
environment where the locking subsystem was disabled. [#19582]
3.
Fixed a bug in a diagnostic assertion that was improperly triggered by the removal of a
sub-database. [#19683]
4.
Fixed a bug that would cause DB_ENV->failcheck to free locks for a locker associated with
a database handle after the thread that opened the handle exited. [#19881]
Enhanced recovery so that it will not output extra checkpoint or transaction id recycle log
records if there was no activity since the last checkpoint. [#15330]
2.
Log checksums can now be disabled using the compile argument --disable-log-checksum.
This will give a performance increase at the risk of undetectable corruption in the log
records, which would make recovery impossible. [#19143]
3.
Fixed a bug that could cause a page that should have been removed from the end of a file
still be in the copy of the file in a hot backup. [#19996]
Fixed a bug in MPOOLFILE->get that did not permit the DB_MPOOL_DIRTY flag to be used
with other flags. [#19421]
6/18/2015
Fixed a bug when the mutex region needs to be larger than 4GB, the region size was
incorrectly adjusted to be slightly too small to fit the mutexes. [#18968]
DB Installation Guide
Page 136
2.
Fixed a performance problem with hybrid shared latches in which a request for exclusive
access would busy-wait (rather than put itself to sleep) if the latch were held by a shared
reader. This also fixed the timeout handling of hybrid mutexes. In some cases the timeout
would not be honored, resulting in delays for the replication "read your writes" feature
which were longer than requested. [#18982]
3.
Fixed the timeout handling of the pthreads mutexes used by the replication "read your
writes" feature. When a timeout occurred there was a race condition which might result
in a hang. [#19047]
Fixed a leak of log file ids when a database is closed before the end of a transaction that
references it. [#15957]
2.
Fixed a bug that would cause a panic if a child transaction performed a database rename,
then aborted, and then the parent transaction committed. [#18069]
3.
Fixed a bug where we released the metadata page lock too early if a non-transactional
update was being done. [#19036]
4.
Removed the possibility that checkpoints will overlap in the log, decreasing the time to
recover. [#19062]
Utility Changes
1.
Added a new utility, db_tuner, which analyzes the data in a btree database, and suggests
a reasonable pagesize. [#18910]
2.
Fixed some bugs in log_verify when there are in-memory database logs and subdb logs.
[#19157]
3.
Modified db_hotbackup to not read from the file system as required on non-UNIX systems.
Also provided the db_copy function for this purpose. [#19863]
4.
6/18/2015
1.
Changed SQL API library built on *nix to link with libpthreads when necessary. [#19098]
2.
3.
Added encryption support into the Windows CE build project for SQL API. [#19632]
4.
Fixed a bug in the STAT_INC_VERB() dtrace probe that was causing compiler warnings.
[#19707]
DB Installation Guide
Page 137
5.
Fixed a bug that could cause a trap in db_dump using salvage mode if a page was found
that was not associated with any database in the file. [#19974]
6.
On Cygwin, circumvented a bug in libtool that is exposed when building the BDB SQL API
in a directory path containing whitespace characters. [#19812]
Example Changes
1.
2.
Fixed a bug where memory copied from the Java API could leak if flags were not correctly
configured. [#19152]
Deprecated Features
1.
None
1.
The SQL API has a known issue when using a blob field with a lot of content and multiple
concurrent connections to the database. [#19945]
2.
Rollback of a dropped table in the SQL layer contains a mutex leak, which can consume
all mutex resources if enough rollbacks of table drops are performed. [#20077]
3.
The DB_CONFIG configuration parameters which specify path names currently do not
support names containing any whitespace characters. [#20158]
4.
The BFile module has a known crash issue when using BFile handle for SQL expressions
interface on 64bit platforms. [#20193]
5.
On systems without FTRUNCATE, db_verify will return an error for truncated heap
databases. This is a bug in db_verify, the database has been truncated correctly and can
be used in the future. [#20195]
6.
An application using queue extents which is append mostly could see a decrease in the
buffer pool hit rate due to the failure to remove pages from closed extents from the
buffer pool. [#20217]
Known Bugs
6/18/2015
DB Installation Guide
Page 138
The database file format was unchanged in 11gR2 library version 11.2.5.1.
2.
The log file format was unchanged in 11gR2 library version 11.2.5.1.
New Features
1.
6/18/2015
Added Performance event monitoring support for DTrace and SystemTap which can be
enabled during configuration. Static probes have been defined where statistics values
DB Installation Guide
Page 139
are updated, where mutex or transactional consistency lock waits occur, and where some
other potentially lengthy operations may be initiated. [#15605]
2.
3.
4.
5.
6.
7.
8.
Added support in Berkeley DB SQL for the vacuum and incremental vacuum pragmas
[#18545]
9.
6/18/2015
DB Installation Guide
Page 140
2.
Fixed a bug that prevented the same process from connecting to the database after
recovery is performed. [#18535]
3.
Fixed a bug which would occur when recovery checkpoint was not written because the
cache ran out of space attempting to flush the memory pool cache. The environment
would be recovered and all database where made available, but some databases would
incorrectly closed. This would cause a subsequent recovery to fail on its backward pass
with the error "PANIC: No such file or directory". [#18590]
4.
Fixed a bug that could cause recovery to fail with the error "DB_LOGC->get: log record
LSN %u/%u: checksum mismatch" if the last log file was nearly full and ended with a
partially written log record which was smaller than a checkpoint record. It now erases the
invalid partial record before switching to the new log file. [#18651]
None
6/18/2015
1.
Fixed a bug such that segementation fault does not occur if DB->set_partition_dirs is
called before DB->set_partition. [#18591]
2.
Fixed a bug such that the error "unknown path" does not occur if you put duplicate
records into a duplicated sorted HASH database with DB_OVERWRITE_DUP option.
[#18607]
3.
Added the ability to specify that data should not be logged when removing pages from
a database. This can be used if the ability to recover the data is not required after the
database has been removed. [#18666]
4.
Fixed a bug that caused an aborting transaction to fail if it aborted while a DB->compact
of the same HASH database was compacting the dynamic hash table [#18695]
5.
Fixed a bug that could cause DB->compact to loop on a DB_RECNO database or a database
with an multilevel unsorted off page duplicate tree. [#18722]
6.
Fixed a bug that could cause an illegal page type error when using a HASH database with
MVCC and the HASH table was contracted and then extended. [#18785]
7.
Fixed locking bugs: [#18789] The Db->compact method of BTREE with MVCC would return
an unpinned page. The RECNO option would fail to lock the next page when splitting a
leaf page.
8.
Fixed a bug that could cause data to not be returned in a HASH database that was one of
multiple databases in a file and was opened prior to running DB->compact method on that
database in another thread of control [#18824]
DB Installation Guide
Page 141
9.
Fixed a bug where doing a bulk insert with secondaries could return an error incorrectly.
[#18878]
10. Fixed a bug that would return DB_NOTFOUND instead of DB_BUFFER_SMALL when the first
item in a HASH database is larger than the user supplied buffer. [#18829]
API Changes
1.
Fixed various items uncovered by extending DB_CONFIG support: [#18720] - Added missing
set_cache_max method, and fixed name of log_set_config (was set_log_config). - Added
new DB_ENV->repmgr_get_local_site method. - Fixed a bug which could fail to allocate
enough mutexes when specifying a maximum cache size. - Fixed a bug that could allocate
multiple caches when a small cache size was specified.
Allowed SQL applications to attach to the same database multiple times unless shared
cache mode is explicitly requested. [#18340]
2.
Fixed a bug where auto-removal of log files after writing a checkpoint was not functioning
correctly. [#18413]
3.
Fixed a race between opening and closing SQL databases from multiple threads that
could lead to the error "DB_REGISTER limits processes to one open DB_ENV handle per
environment". [#18538]
4.
Optimized the SQL adapter for joins. Reduce the number of Berkeley DB operations in a
join by caching the maximum key in the primary. [#18566]
5.
6.
Changed how multiple connections to the same database are detected. Used a fileid so
that different paths can be used without error. [#18646]
7.
Fixed a bug where the journal (environment) directory was being created prior to the
actual environment. [#18656]
8.
Added a new PRAGMA to allow tuning of when checkpoints are run. [#18657]
9.
10. Fixed a segmentation fault that could happen when memory could not be allocated for
the index key in the SQL API.[#18783]
11. Fixed a bug causing a segfault when releasing a savepoint that was already released.
[#18784]
6/18/2015
DB Installation Guide
Page 142
2.
3.
4.
Fixed a bug such that segementation fault does not occur when putting records into
callback-partitioned database. [#18596]
5.
6.
7.
Fixed a bug by opening a write cursor for Direct Persistent Layer(DPL) entity's put
operation in the Concurrent Data Store product. [#18692]
8.
Synchronized Java persistence code and tests from Java Edition to Berkeley DB. [#18711]
9.
10. Fixed a bug in the bulk DatabaseEntry class, where it was possible to overflow the buffer.
[#18850]
11. Added LEASE_TIMEOUT field to the ReplicationTimeoutType class that enables configuring
the amount of time a client grants its Master Lease to a master. [#18867]
6/18/2015
1.
Fixed a bug in BTree prefix comparison method such that there is no problem when
the application needs to save a number larger than or equal to 2^31. The BTree prefix
comparison function now returns an unsigned int instead of a signed int. [#18481]
2.
Fixed a bug which caused the HasMultiple method to throw an exception when there were
multiple databases in a single database file. [#18483]
3.
Fixed a bug to ensure the CachePriority is set for Database and Cursor objects. [#18716]
4.
Fixed a bug that use leading to the error: "Transaction that opened the DB handle is still
active" when applications used different transactional handles in the associate and open
methods in a secondary database. [#18873]
DB Installation Guide
Page 143
All setter methods in the DPL |StoreConfig| and |EvolveConfig| now return |this| rather
than having a |void| return type. This change requires that applications using the DPL be
recompiled. [#17021]
2.
3.
Several new tuple formats and binding classes have been added in the |
com.sleepycat.bind.tuple| package:
Packed integer formats have been added that support default natural sorting. These are
intended to replace the old unsorted packed integer formats.
Two new |BigDecimal| formats have been added. One format supports default natural
sorting. The other format is unsorted, but has other advantages: trailing zeros after the
decimal place are preserved, and a more compact, faster serialization format is used.
See the |com.sleepycat.bind.tuple| package description for an overview of the new
bindings and a comparative description of all tuple bindings. [#18379]
4.
Replication Changes
6/18/2015
1.
Replication Manager now uses the standard system implementation of getaddrinfo() when
running on Windows, which means that it can support IPv6 addresses if support is present
and configured in the operating system. [#18263]
2.
Fixed a bug which caused a "full election" to fail if a majority of sites were not ready
when the election started. [#18456]
3.
Fixed a bug which could occur when using bulk transfer with Replication Manager. When
closing a DB_ENV handle, any remaining bulk buffer contents are flushed, and Replication
Manager could have tried to send the resulting messages even though its connections had
already been closed, leading in rare circumstances to spurious EBADF error reports, or
possibly even arbitrary memory corruption. [#18469]
4.
Fixed a bug which caused Replication Manager to wait for acknowledgement from client,
even if it had failed to send a log record, due to "queue limit exceeded". Replication
Manager now returns immediately, with a PERM_FAILED indication, to avoid a pointless
delay to the commit() operation. [#18682]
DB Installation Guide
Page 144
5.
Fixed a bug where changes made in one process to Replication Manager configuration
values (such as ack policy or ack timeout) were not observed in other processes sharing
the same database environment. [#18839]
6.
Fixed bugs that could prevent client synchronization from completing due to a failure to
request missing log records. [#18849]
7.
Fixed a bug where a client that had rolled back transactions to synchronize with a new
master, failed to invalidate existing database handles later used for cursor operations
based on an explicitly provided transaction. [#18862]
8.
Fixed a bug where Replication Manager called for an election after a DUPMASTER event,
even when using Master Leases. In such a case it now simply accepts the new (remote)
master. [#18864]
9.
Fixed a bug which would cause failure if client env attempted to perform sync-up
recovery to a point in the log that happened to fall exactly on a log file boundary.
[#18907]
Moved the wait mutex from the lock structure to the locker structure, reducing the
number of mutexes required in the system. [#18685]
None.
Fixed a race condition that was causing the error: "Unable to allocate space from the
buffer cache". The error can only be triggered when multiple memory pool regions are
used and there is a periodic gathering and clearing of statistics. This also fixes a second
bug where if you compile without statistics and explicitly set the memoru pool default
pagesize, other environment handles to that environment would not see the correct
memory pool default pagesize. [#18386]
2.
Fixed a bug where the get_cachesize method and the mpool_stat method returned the
initial cache size, even if the cache size had been changed. [#18706]
3.
Changed memory pool allocation so that the EIO error is returned rather than the ENOMEM
error when the memory cannot be allocated because dirty pages cannot be written.
[#18740]
6/18/2015
Fixed problems with the printed statistics for DB_MUTEX_SHARED latches. The
DB_STAT_CLEAR flag (as specified by db_stat -Z) did not clear the counts of the number of
times a shared latch either had to wait to get access or was able to get the latch without
waiting. Also, the ownership state of a test-and-set latch (not a hybrid one) was always
displayed as not owned, even when it was held. [#17585] [#18743]
DB Installation Guide
Page 145
Fixed bugs that could caused PANIC or DB_RUNRECOVERY errors when the synchronization
of the transaction log failed. [#18588]
2.
Fix javadoc to note the exception to the rule that a transaction handle may not be
accessed after commit() operaton (getCommitToken() is allowed). [#18730]
None. [#18831]
Utility Changes
1.
Modified the db_printlog and db_dump -da so that they use the same formatting. The
db_logprint utility now uses the message stream. Both db_dump -da and db_printlog
accept a -D flag to indicate the numer of bytes of data items to display. You can set this
value when calling the DB_ENV->set_data_len method or in the DB_CONFIG. [#18365]
2.
Fixed a bug that caused a segmentation violation when using the db_printlog utility.
[#18694]
3.
Fixed a bug in db_hotbackup that would cause a trap if the -D flag is used and the
DB_CONFIG file does not specify a log directory. [#18841]
2.
Fix a bug to make the configuration option --enable-debug work when CFLAGS is set.
[#18432]
3.
4.
5.
6.
Fixed Visual Studio project files so that they can load into Visual Studio 2010. [#18505]
7.
Updated Windows CE build files to be consistent with desktop Windows build files. Added
Windows Mobile 6.5.3 Professional as a target platform. [#18516]
8.
Added a fix so that an error message is displayed when the 'ar' utility is missing when
configured. [#18619]
9.
Added tighter integration of JDBC on POSIX/autoconf by including an argument --enablejdbc to configure. [#18621]
10. Fix build conflicts in log verify with other configurations. [#18658]
11. Upgraded Berkeley DB SQL to SQLite version 3.7.0 [#18857]
6/18/2015
DB Installation Guide
Page 146
Example Changes
1.
Provided a functionality on the Windows platform to choose a default page size based on
the underlying file system sector size. [#16538]
2.
3.
Changed the default permissions for files in the release tree to allow write access.
[#17974]
4.
Fixed a bug which caused database verification to hang when verifying a database in a
Concurrent Data Store environment that performs locking on an environment-wide basis
(DB_CDB_ALLDB.) [#18571]
Deprecated Features
1.
[#18871] Removed the mod_db4 PHP/Apache wrapper. It only supported Apache 1.3 and
has not been actively supported. Use php_db4 instead.
1.
None
Known Bugs
6/18/2015
DB Installation Guide
Page 147
DB_REP_CONF_NOAUTOINIT Replaced
In this release, the DB_REP_CONF_NOAUTOINIT flag is replaced by the DB_REP_CONF_AUTOINIT
flag. This option is ON by default. To turn off automatic internal initialization, call the
DB_ENV->rep_set_config method with the which parameter set to DB_REP_CONF_AUTOINIT
and the onoff parameter set to zero.
Cryptography Support
In this release, the configuration options, --disable-cryptography and --enable-cryptography
are deprecated. --disable-cryptography is replaced by --with-cryptography=no and --enablecryptography is replaced by --with-cryptography=yes.
6/18/2015
DB Installation Guide
Page 148
Dropped Support
Berkeley DB no longer supports Visual Studio 6.0. The earliest version supported is Visual
Studio 2005. The build files for Windows Visual Studio 6.0 are removed.
Berkeley DB no longer supports Win9X, Windows Me (Millenium edition), and Windows NT 4.0.
The minimum supported windows platform is Windows 2000.
6/18/2015
1.
Added Visual Studio 2010 support. Users can find Visual Studio 2010 solutions and projects
on build_windows. [#18889]
2.
Fixed a leak of log file ids when a database is closed before the end of a transaction that
references it. [#15957]
3.
Fixed a race condition that was causing an "unable to allocate space from the buffer
cache" error. The error can only be triggered when multiple mpool regions are used
DB Installation Guide
Page 149
and there is a periodic gathering and clearing of statistics. This also fixes a second bug
where if you compile without statistics and explicitly set the mpool default pagesize,
other environment handles to that environment would not see the correct mpool default
pagesize. [#18386]
4.
5.
Fix a general I/O problem on Windows where system doesn't always return ENOENT when
file is missing. [#18762]
6.
7.
Don't await ack if message not sent due to queue limit exceeded. [#18682]
8.
Fixed a bug that could cause data to not be returned in a HASH database that was one
of multiple databases in a file and it was opened prior to running DB->compact on that
database in another thread of control [#18824]
9.
Return HANDLE_DEAD on cursor creation that names a specific txn after client callback.
[#18862]
6/18/2015
DB Installation Guide
Page 150
19. Fixed several bugs that could cause an update running with MVCC to get the wrong version
of a page or improperly update the metadata last page number. [#19063]
20. Fixed a bug where an error during an update to a hash database with DB_NOOVERWRITE
set could return DB_KEYEXIST rather than the correct error. [#19077]
21. Fixed a bug where an updater supporting DB_READ_UNCOMMITED might downgrade its
lock too soon if there was an error during the update [#19155]
22. Fixed a bug that could cause the wrong page number to be on a root or metadata page if
DB->compact moved the page and the operation was later rolled forward [#19167]
23. Fixed a bug that could cause the close of a secondary index database to fail if the
transaction doing the open aborted [#19169]
24. The database open code will no longer log the open and close of the master database in a
file when opening a sub database in that file [#19071]
Fixed a bug that might cause recovery to fail if processed part of the log that had
previously been recovered and a database which was not present was opened in the log
and not closed. [#18459]
2.
Fixed a bug which could occur when using bulk transfer with Replication Manager. When
closing a DB_ENV handle, any remaining bulk buffer contents are flushed, and Replication
Manager could have tried to send the resulting messages even though its connections had
already been closed, leading in rare circumstances to spurious EBADF error reports, or
possibly even arbitrary memory corruption. [#18469]
3.
Fixed a bug in C# HasMultiple() that this function always throws exceptions when there
are multiple databases in a single db file. [#18483]
4.
5.
Fixed a bug in the Java API where populating a SecondaryDatabase on open could lead to
an OutOfMemoryException. [#18529]
6.
Fixed a bug where DB SQL reports "The database disk image is malformed" in "group by"
operations. [#18531]
7.
Fixed a bug that prevented the same process from reconnecting to the database when
DB_REGISTER is being used. [#18535]
8.
Fix a race between opening and closing SQL databases from multiple threads that
could lead to the error "DB_REGISTER limits processes to one open DB_ENV handle per
environment". [#18538]
9.
Fixed some bugs that could cause a panic or a DB_RUN_RECOVERY error if the sync of the
transaction log failed. [#18588]
10. Fixed a bug which would occur when recovery checkpoint was not written because the
cache ran out of space attempting to flush the mpool cache. The environment was
6/18/2015
DB Installation Guide
Page 151
recovered and all database where made available, but some databases were incorrectly
closed. This would cause a subsequent recovery to fail on its backward pass with the error
"PANIC: No such file or directory". [#18590]
11. Fixed a bug that segementation fault would occur if DB->set_partition_dirs was called
before DB->set_partition. [#18591]
12. Fixed a bug that the error of "unknown path" would occur if putting duplicate records to
duplicated sorted hash database with DB_OVERWRITE_DUP.[#18607]
13. Fixed a bug where DatabaseConfig.getUnsortedDuplicates() returned true when the
datbase had been configured for sorted duplicates. [#18612]
14. Fixed a bug that could cause recovery to fail with the error "DB_LOGC->get: log record
LSN %u/%u: checksum mismatch" if the last log file was nearly full and ended with a
partially written log record which was smaller than a checkpoint record. It now erases the
invalid partial record before switching to the new log file. [#18651]
15. Initialize DatabaseConfig.pageSize so that it can be queried from Java. [#18691]
16. Fixed a bug that might cause an aborting transaction to fail if it aborted while a DB>compact of the same HASH database was compacting the dynamic hash table [#18695]
1.
Replication Manager sites can specify one or more possible client-to-client peers. [#14776]
2.
3.
Added a SQL interface to the Berkeley DB library. The interface is based on - and a dropin-replacement for - the SQLite API. It can be accessed via a command line utility, a C
API, or existing APIs built for SQLite. [#16809]
4.
5.
Renamed the "db_sql" utility to "db_sql_codegen". This utility is not built by default. To
build this utility, enter --enable-sql_codegen as an argument to configure. [#18265]
6.
7.
Added the feature read-your-writes consistency that allows client application to check, or
wait for a specific transaction to be replicated from the master before reading database.
[#17323]
New Features
6/18/2015
DB Installation Guide
Page 152
8.
Added DB log verification feature, accessible via the API and a new utility. This feature
can help debugging and analysis. [#17420]
9.
Added support for applications to assign master/client role explicitly at any time.
Replication Manager can now be configured not to initiate elections. [#17484]
10. Enhanced the DB->compact method so that it can reassign metadata and root pages from
subdatabases to lower numbered pages while compacting a database file that contains
multiple databases. This feature helps to free the higher numbered pages and truncate
the file. [#17554]
11. Added system diagnostic messages that are ON by default. [#17561]
12. Added the feature to assign a priority level to transactions. When resolving a deadlock:
if the transactions have differing priority, the lowest priority transaction is aborted
if all transactions have the same priority, the same poilcy that existed before priorities
were introduced is used [#17604]
13. Added a feature in which log_archive uses group-wide information for archiving purposes
if Replication Manager is in use. [#17664]
14. Added a feature by which the Replication Manager application clients now automatically
request any missing information, even when there is no master transaction activity.
[#17665]
15. Added support for sharing logs across mixed-endian systems. [#18032]
16. Added an option to specify the first and last pages to the db_dump utility. You can do this
by providing -F and -L flags to the db_dump -d option. [#18072]
17. Added Intel Performance Primitive (IPP) AES encryption support. [#18110]
18. Removed support for the configuration option --with-mutex=UNIX/fcntl as of version 4.8.
If Berkeley DB was configured to use this type of mutex in an earlier release, switch to a
different mutex type or contact Oracle for support. [#18361]
Database Environment Changes
6/18/2015
1.
Fixed a bug to reflect the correct configuration of the logging subsystem when the
DB_ENV->log_set_config method is called with the DB_LOG_ZERO flag in a situation where
a DB_ENV handle is open and an environment exists. [#17532]
2.
Fixed a bug to prevent memory leak caused when the environment is closed by the named
in-memory database in a private database environment which has open named in-memory
databases. [#17816]
3.
Fixd a race condition in an internal directory-scanning function that returns the ENOENT
("No such file or directory") error, if a file is removed just before a call to stat() or its
eqivalent. [#17850]
DB Installation Guide
Page 153
Fixed a bug to prevent a page in the hash database from carrying the wrong header
information when a group allocation is rolled forward by recovery. [#15414]
2.
3.
Fixed a bug in the DB->compact method to ensure locking of leaf pages when merging
higher level interior nodes or when freeing interior nodes when descending to find a nonzero length key. [#17485][#16466]
4.
Fixed a bug to prevent a trap if a cursor is opened or closed when another thread is
adjusting cursors due to an update in the same database. [#17602]
5.
Fixed a bug that incorrectly lead to the error message "library build did not include
support for the Hash access method" [#17672]
6.
Fixed a bug to ensure that the DB->exists method accepts the DB_AUTO_COMMIT flag.
[#17687]
7.
In the past, removing a database from a multi-database file that was opened in an
environment always caused dirty pages in the file to be flushed from the cache. In this
release, there is no implicit flush as part of a DB->remove for handles opened in an
environment. Applications that expect the database file to be flushed will need to add an
explicit flush. [#17775]
8.
Fixed a bug so that the code does not loop if a DB->compact operation processed a 3 or
more level non-sorted off page duplicate tree. [#17831]
9.
Fixed a bug that could leave pages pinned in the cache if an allocation failed during a DB>compact operation. [#17845]
10. Fixed a bug to ensure sequences are closed when an EntityStore is closed. [#17951]
11. Fixed a bug that prevented retrieval of a non-duplicate record with DB_GET_BOTH_RANGE
in hash sorted duplicate db. In a database configured with sorted duplicate support, when
the DBcursor->get method is passed the DB_GET_BOTH_RANGE flag, the data item should
be retrieved that is the smallest value greater than or equal to the value provided by the
data parameter (as determined by the comparison function). [#17997]
12. Fixed a bug that causes the wrong file to be removed if multiple cascading renames are
done in the same transaction. [#18069]
13. Fixed a bug to prevent the DB->compact method specified with the DB_AUTO_COMMIT
flag from acquiring too many locks. [#18072]
14. Fixed a bug that might cause DB->compact on a DB_BTREE database to get a spurious
read lock on the metadata page. If the database was opened non-transactionally the lock
would get left behind. [#18257]
15. Fixed a bug that could lead to btree structure corruption if the DB->compact method ran
out of locks [#18361]
6/18/2015
DB Installation Guide
Page 154
16. Fixed a bug that would generate an error if a non-BDB file was used to create a database
and the DB_TRUNCATE flag was specified. [#18373]
17. Fixed a bug that might cause a trap reading unitialized memory when backing out a merge
of a duplicate tree leaf page during DB->compact. [#18461]
Locking Subsystem Changes
1.
Fixed a bug to ensure deadlock detection works even when there are blocked
transactions, configured with and without timeouts. [#17555]
2.
Fixed a bug to ensure a call to the DB->key_range method from outside a transaction does
not lock pages. [#17930]
3.
Fixed a bug that could cause a segmentation fault if the lock manager ran out of mutexes
[#18428]
Limited the size of a log record generated by freeing pages from a database, so that it fits
in the log file size. [#17313]
Fixed a bug to ensure mulitple versions of a buffer are not created when MVCC is not set.
[#17495]
2.
Fixed a bug to detect if cache size is being set when the cache is not configured. [#17556]
3.
Fixed a bug to ensure the error message "unable to allocate space from the buffer cache"
generated when there is still some space available, can be cleared by running recovery.
[#17630]
4.
Fixed a race condition that causes an operation to return EPERM when the buffer cache is
nearly filled with pages belonging to recently closed queue extents. [#17840]
5.
Fixed a bug that could cause a page needed by a snapshot reader to be overwritten rather
than copied when it was freed. [#17973]
6.
7.
Fixed a bug to ensure single-version or obsolete buffers were selected over any
intermediate version. [#18114]
6/18/2015
1.
2.
Fixed a race condition which could cause unnecessary retrying of btree searches when
several threads simulatenously attempted to get a shared latch. [#18078]
DB Installation Guide
Page 155
3.
Exclusive Transactions have been implemented for the SQL API. See the documentation
for details on the behavior of this feature. [#17822]
Fixed a bug in Tcl API to prevent a segmentation fault from occurring when the
get_dbname method is called to get the db name and the db handle is opened without
providing either the filename or dbname. [#18037]
2.
Fixed a bug in the C# API to make DB_COMPACT consistent with __db_compact in teh C
API. [#18246]
1.
Added the dbstl_thread_exit method to release thread specific resouces on thread exit.
[#17595]
2.
Fixed the parser to allow configuration API flags set in the DB_CONFIG file to accept an
optional ON/OFF string. The DB_REP_CONF_NOAUTOINIT flag has been removed. It is
replaced by DB_REP_CONF_AUTOINIT. However, replication's default behavior remains the
same. [#17795]
API Changes
Replication Changes
6/18/2015
1.
Fixed bug where a not-in-sync client could service a peer request. [#18279]
2.
Fixed bug where page gaps, once filled, would not immediately request the next page gap
it finds. This was already fixed for logs. [#18219]
3.
Fixed a bug so that only one thread waits for the meta-page lock during internal
initialization and broadcasts out the information rather than all threads waiting. Removed
the former retry code. [#17871]
4.
Added a feature by which the DB->open method now allows the DB_CREATE flag on a
replication client. It is ignored, but this allows a replication application to make one call
that can work on either master or client. It fixes a possible race that could develop in a
Replication Manager application if a call to DB->open is made around the same time as a
master/client role change. [#15167]
5.
6.
Fixed a bug that could occasionally lead to elections failing to complete. [#17105]
7.
8.
Added a new JOIN_FAILURE event to notify Replication Manager applications which refuse
auto-initialization. [#17319]
DB Installation Guide
Page 156
9.
Fixed a bug where a failed master lease check at a client site causes an ASSERT when
processing a master lease grant at the master site. [#17869]
10. Fixed a bug to ensure a second simultaneous call to the DB_ENV->rep_elect method does
not incorrectly clear a bit flag. [#17875]
11. Fixed a bug in client-side autoremoval of log files. [#17899]
12. Removed the likelihood of dual data streams to enhance network traffic. [#17955]
13. Fixed a bug such that non-txn dup cursors are accounted for in the replication API
lockout. [#18080]
14. Fixed a bug to ensure checking for other sync states for the rerequest thread. [#18126]
15. Fixed a bug to avoid getting stuck in an election forever. [#18151]
16. Fixed a bug where using client-to-client synchronization with Master Leases could have
resulted in failure of a new master to get initial lease grants from sufficient number of
clients, resulting in a master environment panic. [#18254]
17. Fixed a bug which had prevented Replication Manager socket operations from working on
HP/UX systems. [#18382]
18. Fixed a bug where starting as a client in multiple threads after receiving dupmaster
messages could have resulted in a failure to find a new log file, resulting in a panic.
[#18388]
19. The default thread stack size is no longer overridden by default for Berkeley DB threads.
[#18383]
Transaction Subsystem Changes
1.
Fixed a bug that caused transactions to deadlock on the mutex in the sequence object.
[#17731]
2.
Fixed a bug to ensure that the failure checking mechanism reconstructs child transactions
correctly when a process dies with active sub-transactions. [#18154]
3.
Utility Changes
6/18/2015
1.
2.
Enhanced the db_recover -v utility to display the message, "No log files found", if no logs
are present. [#17504]
3.
Modified the db_verify utility to verify all files instead of aborting on the first failure.
[#17513]
4.
DB Installation Guide
Page 157
5.
Fixed a bug in the db_sql_codegen utility where the primary key is stored in both key and
data fields. Removed it from the data field. [#17925]
Example Changes
1.
2.
3.
4.
Added new command line arguments(-h and -d) to the env examples. [#17624]
5.
6.
7.
Added a new Stl example to demo advanced feature usage. The Stl test cases referred
earlier are replaced by these new examples in the Stl reference document. [#18175]
Deprecated Features
1.
6/18/2015
1.
2.
3.
Berkeley DB no longer supports Win9X, Windows Me (Millenium edition) and NT 4.0. The
minimum supported windows platform is Win 2k.
4.
Berkeley DB no longer supports Visual Studio 6.0. The earliest version supported is Visual
Studio 2005.
5.
Added "+u1" to CFLAGS for HP ANSI C Compiler on HP-UX(IA64) to fix the alignment issue
found with the allocation functions DB->set-alloc and DB_ENV->set_alloc. [#17257]
6.
Fixed a bug such that the thread local storage (TLS) definition modifier is correctly
deduced from the m4 script on all platforms. [#17609][#17713]
7.
Fixed a bug such that TLS key is not initialized on platforms which do not support thread
local storage (TLS) keywords, such as MAC OSX, and where TLS is implemented using
pthread API. [#18001]
8.
Fixed a bug to ensure that when using Intel C++ compiler (icpc), the TLS code builds
successfully. A stricter criteria is adopted to deduce the TLS keyword, and hence pthread
API is more likely to be used to implement TLS. [#18038]
9.
Adding new configuration option, --with-cryptography={yes|no|ipp}. Using --withcryptography=yes, will give equivalent behavior to the old --enable-cryptography
DB Installation Guide
Page 158
option. Using --with-cryptography=no, will give equivalent behavior to the old --disablecryptography option. Using --with-cryptograhy=ipp will enable Intel's Performance
Primitive (IPP) encryption on linux. [#18110]
Known Bugs
6/18/2015
1.
2.
3.
Although rare, it is possible for a partial log record header at the end of a transaction log
to be erroneously accepted as if it were valid, causing the error "Illegal record type 0 in
log" during recovery. [#17851]
4.
It is possible to get the error "unable to allocate space from the buffer cache" when there
are disk errors on the freezer files used by multi-version concurrency control . [#17902]
5.
Java API does not support partitioning by keys and the C# API doesn't support partitioning.
[#18350]
6.
If a database is removed from an environment and it was still opened transactionally and
recovery is run, then a future recovery that must process that part of the log may fail.
[#18459]
7.
8.
The BTree prefix comparison function behaves slightly differently in the C API vs the C#
API. In the C# API it returns a signed int and in the C API it returns an unsigned int. This
can be a problem if the application needs to save more than 2^31 bytes.
DB Installation Guide
Page 159
6/18/2015
DB Installation Guide
Page 160
Upgrade Requirements
The log file format changed in the Berkeley DB 4.8 release.
No database formats changed in the Berkeley DB 4.8 release.
The Berkeley DB 4.8 release does not support live replication upgrade from the 4.2 or 4.3
releases, only from the 4.4 and later releases.
For further information on upgrading Berkeley DB installations, see the Berkeley DB Upgrade
Guide.
Limit the size of a log record generated by freeing pages from a database so it fits in the
log file size. [#17313]
2.
Fix a bug that could cause a file to be removed if it was both the source and target of two
renames within a transaction. [#18069]
3.
Modified how we go about selecting a usable buffer in the cache. Place more emphasis on
single version and obsolete buffers. [#18114]
6/18/2015
1.
Fixed a bug where the truncate log record could be too large when freeing too many
pages during a compact. [#17313]
2.
Fixed a bug where the deadlock detector might not run properly. [#17555]
3.
Fixed three bugs related to properly detecting thread local storage for DbStl. [#17609]
[#18001] [#18038]
4.
Fixed a bug that prevented some of our example code from running correctly in a
Windows environment. [#17627]
5.
Fixed a bug where a "unable to allocate space from buffer cache" error was improperly
generated. [#17630]
6.
Fixed a bug where DB->exists() did not accept the DB_AUTO_COMMIT flag. [#17687]
7.
Fixed a bug where DB_TXN_SNAPSHOT was not getting ignored when DB_MULTIVERSION
not set. [#17706]
8.
Fixed a bug that prevented callback based partitioning through the Java API. [#17735]
DB Installation Guide
Page 161
9.
Fixed a replication bug where log files were not automatically removed from the client
side. [#17899]
10. Fixed a bug where code generated from db_sql stored the key in both the data and key
DBTs. [#17925]
11. Fixed a bug that prevented a sequence from closing properly after the EntityStore closed.
[#17951]
12. Fixed a bug where gets fail if the DB_GET_BOTH_FLAG is specified in a hash, sorted
duplicates database.[#17997]
Fixed a bug in the C# API where applications in a 64-bit environment could hang. [#17461]
2.
Fixed a bug in MVCC where an exclusive latch was not removed when we couldn't obtain a
buffer. [#17479]
3.
4.
Fixed a bug which could trigger an assertion when performing a B-tree page split and
running out of log space or with MVCC enabled. [#17531]
5.
Fixed a bug in the repquote example that could cause the application to crash. [#17547]
6.
Fixed a couple of bugs when using the GCC 4.4 compiler to build the examples and the
dbstl API. [#17504] [#17476]
7.
New Features:
6/18/2015
1.
Improved scalability and throughput when using BTree databases especially when running
with multiple threads that equal or exceed the number of available CPUs.
2.
Berkeley DB has added support for C#. In addition to the new C# api, C# specific tests and
sample applications were also added. [#16137]
3.
Berkeley DB has added an STL API, which is compatible with and very similar to C++
Standard Template Library (STL). Tests and sample applications and documentation were
also added. [#16217]
4.
Berkeley DB has added database partitioning. BTree or Hash databases may now be
partitioned across multiple directories. Partitioned databases can be used to increase
DB Installation Guide
Page 162
Berkeley DB now supports bulk insertion and deletion of data. Similar to the bulk get
interface, the bulk put and bulk delete allow the developer to populate a buffer of keyvalue pairs and then pass it to the BDB library with a single API call.
6.
7.
Berkeley DB introduces a new utility named db_sql which replaces db_codegen. Similar
to db_codegen, db_sql accepts an input file with DDL statements and generates a
Berkeley DB application using the C API that creates and performs CRUD operations on the
defined tables. The developer can then use that code as a basis for further application
development.
8.
The Replication Manager now supports shared access to the Master database environment
from multiple processes. In earlier versions, multiple process support on the Master
required use of the Base Replication API. [#15982]
9.
Fixed a bug that could cause an allocation error while trying to allocate thread tracking
information for the DB_ENV->failcheck system. [#16300]
2.
Fixed a bug that could cause a trap if an environment open failed and failchk thread
tracking was enabled.[#16770]
6/18/2015
1.
Fixed a bug where doing an insert with secondary indices and the NOOVERWRITE flag
could corrupt the secondary index. [#15912]
2.
Fixed a possible file handle leak that occurred while aborting the create of a database
whose metadata page was not initialized. [#16359]
3.
Fixed a bug so that we now realloc the filename buffer only if we need it to grow.
[#16385] [#16219]
4.
DB Installation Guide
Page 163
5.
Added missing get methods for the DB and DB_ENV classes where there already was a
corresponding set method. [#16505]
6.
Fixed a bug to now ensure that DB_STAT_SUBSYSTEM is distinct from other stat flags.
[#16798]
7.
Fixed a bug related to updating multiple secondary keys (using DB_MULTIPLE). [#16885]
8.
Fixed a bug so that verify (db->verify, db_verify) will now report when it cannot read a
page rather than just saying the database is bad. [#16916]
9.
Fixed a bug that could cause memory corruption if a transaction allocating a page aborted
while DB->compact was running on that database. [#16862]
10. Fixed a bug where logging was occurring during remove of an in-memory database when
the DB_TXN_NOT_DURABLE flag was set. [#16571]
11. Fixed a bug to remove a race condition during database/file create. [#17020]
12. Fixed a bug where a call to DB->verify and specifying DB_SALVAGE could leak memory
when the call returned. [#17161]
13. Fixed a bug to avoid accessing freed memory during puts on primaries with custom
comparators. [#17189]
14. Fixed a bug that could cause old versions of pages to be written over new versions if an
existing database is opened with the DB_TRUNCATE flag. [#17191]
2.
Fixed a bug that caused Db->compact to loop if run on an empty RECNO database when
there were pages in the free list. [#16778]
3.
Added a new flag, DB_OVERWRITE_DUP, to DB->put and DBC->put. This flag is equivalent
to DB_KEYLAST in almost all cases: the exception is that with sorted duplicates, if a
matching key/data pair exists, we overwrite it rather than returning DB_KEYEXIST.
[#16803]
6/18/2015
1.
Fixed a bug to now force a group allocation that rolls forward to reinit all the pages.
Otherwise a previous aborted allocation may change the header. [#15414]
2.
Fixed a bug to now return the expected buffer size on a DB_BUFFER_SMALL condition.
[#16881]
DB Installation Guide
Page 164
Fixed a bug that would cause the LSN reset functionality to not process queue extents.
[#16213]
2.
Fixed a bug that prevented a partial put on a queue database with secondaries
configured. [#16460]
3.
Fixed a bug to now prevent an unpinned page to be returned if a delete from a HASH
database deadlocked. [#16371]
4.
Fixed a bug that could cause a queue extent to be recreated if an application deleted a
record that was already deleted in that extent. [#17004]
5.
Added the DB_CONSUME flag to DB->del and DBC->del to force adjustment of the head of
the queue. [#17004]
Fixed a bug which could cause DB->compact of a RECNO database to loop if the number of
pages on the free list was reduced by another thread while compact was active. [#16199]
2.
Fixed a bug that occurs when deleting from a Recno database and using
DB_READ_UNCOMMITTED where we could try to downgrade a lock twice. [#16347]
3.
Fixed a bug to now disallow passing DB_DUP and DB_RECNUM together to __db_set_flags.
[#16585]
Add get functions for each set functions of DB and DB_ENV structures which didn't have
one.[#16505]
2.
Add get functions for each set functions of Db and DbEnv classes which didn't have one.
[#16505]
3.
6/18/2015
1.
Fixed a bug where the replication finer-grained verbose flags were not available in the
Java API. [#15419]
2.
Fixed a bug in the BTree prefix compression API when called from the Java API. DBTs were
not properly initialized. [#16417]
3.
Fixed a bug so that LogCursor will work correctly from the Java API. [#16827]
DB Installation Guide
Page 165
4.
Fixed a bug so that position(), limit() and capacity() of ByteBuffers are obeyed by
DatabaseEntry objects. [#16982]
2.
3.
4.
Several validation checks have been added or corrected having to do with entity
subclasses, which are @Persistent classes that extend an @Entity class. [#16077]
5.
6.
The StoredMap class now implements the Java 1.5 ConcurrentMap interface. [#16218]
7.
Fix a DPL bug that caused exceptions when using a class Converter for an instance
containing non-simple fields. [#16233]
8.
9.
6/18/2015
DB Installation Guide
Page 166
created EntityStore contains an entity with a secondary key definition in which the key
name has been overridden and is different than the field name. [#16819]
16. Key cursors have been optimized to significantly reduce I/O when the
READ_UNCOMMITTED isolation mode is used. See EntityIndex.keys for more information.
[#16859]
17. Report a meaningful IllegalArgumentException when NULLIFY is used with a
@SecondaryKey and the field is a primitive type. Before, the confusing message Key field
object may not be null was reported. [#17011]
18. Enum fields may now be used as DPL keys, including primary keys, secondary keys, and
fields of composite key classes. Comparators are supported for composite key classes
containing enum fields. [#17140]
19. Fix a bug that prevented the use of custom key comparisons (composite key classes that
implement Comparable) for secondary keys defined as ONE_TO_MANY or MANY_TO_MANY.
[#17207]
20. The db.jar file now contains a Premain class which enables bytecode enhancement
using the JVM instrumentation commands. The built-in proxy classes are also now
enhanced in the db.jar file, which enables off-line bytecode enhancement. For more
information on DPL bytecode enhancement and how to use both instrumentation and offline enhancement, please see the com.sleepycat.persist.model.ClassEnhancer javadoc.
[#17233]
Replication Changes:
6/18/2015
1.
Improved testing of initial conditions for rep and repmgr APIs and added heartbeat
timeouts to rep_get_timeout.[#14977]
2.
3.
4.
Fixed a bug where opening a cursor from a database handle failed to check whether
the database handle was still fresh. If the database handle had been invalidated by a
replication client synchronizing with a new master, it could point to invalid information.
[#15990]
5.
Fixed a bug so that if LOG_REQ gets an archived LSN, replication sends VERIFY_FAIL.
[#16004]
DB Installation Guide
Page 167
6.
7.
Fixed a bug where, in very rare circumstances, two repmgr sites could connect to each
other at the exact same time, the connection attempts "collide" and fail, and the same
collision repeats in time synchronization indefinitely. [#16114]
8.
Fixed a bug where a missing database file (FILE_FAIL error condition) can interrupt a
client synchronization without restarting it. [#16130]
9.
10. Fixed a bug to not return HOLDELECTION if we are already in the middle of an election.
Updated the egen so the election thread will notice. [#16270]
11. Fixed a bug in buffer space computation, which could have led to memory corruption in
rare circumstances, when using bulk transfer. [#16357]
12. Fixed a bug that prevented replication clients from opening a sequence. The sequence is
opened for read operations only. [#16406]
13. Fixed a bug by removing an assertion about priority in elections. It is not correct because
it could have changed by then. Remove unused recover_gen field. [#16412]
14. Fixed a bug to now ignore a message from client if it is an LSN not recognized in a
LOG_REQ. [#16444]
15. Fixed a bug so that on POSIX systems, repmgr no longer restores default SIGPIPE action
upon env close, if it was necessary to change it during start-up. This allows remaining
repmgr environments within the same process, if any, to continue operating after one of
them is closed. [#16454]
16. After a replication client restarts with recovery, any named in-memory databases are
now re-materialized from the rest of the replication group upon synchronization with the
master. [#16495]
17. Fixed a bug by adding missing rep_get_config flags. [#16527]
18. Instead of sleeping if the bulk buffer is in transmission, return so that we can send as a
singleton. [#16537]
19. Fixed a bug by changing __env_refresh to not hit assert on -private -rep env with an inmemory database. [#16546]
20. Fixed a bug in the Windows implementation of repmgr where a large number of commit
threads concurrently awaiting acknowledgments could result in memory corruption, and
leaking Win32 Event Objects. [#16548]
21. Fixed a bug by changing repmgr to count a dropped connection when noticing a lacking
heartbeat; fixed hearbeat test to check for election, rather than connection drop count,
and more reasonable time limit; fixed test to poll until desired result, rather than always
sleeping max possible time. [#16550]
6/18/2015
DB Installation Guide
Page 168
22. Fixed "master changes" stat to count when local site becomes master too. [#16562]
23. Fixed a bug where a c2c client would send UPDATE_REQ to another client [#16592]
24. Removed code to proactively expire leases when we don't get acks. Leases maintain their
own LSNs to know. [#16494]
25. Fixed a bug where a client may not sync pages during internal init. [#16671]
26. Fixed a bug where a client that received and skipped a log record from the master during
an election, then won the election, could then try to request a copy of the skipped log
record. The result was an attempt to send a request to the local site, which is invalid:
this could confuse a replication Base API application, or cause the Replication Manager to
crash. [#16700]
27. Fixed a bug which could have caused data loss or corruption (at the client only) if a
replication client rolled back existing transactions in order to synchronize with a new
master, and then crashed/recovered before a subsequent checkpoint operation had been
replicated from the master. [#16732]
28. Fixed a bug so that replication now retries on DB_LOCK_NOTGRANTED. [#16741]
29. Fixed a potential deadlock in rep_verify_fail. [#16779]
30. Fixed a bug so that an application will no longer segv if nsites given was smaller than
number of sites that actually exists. [#16825]
The XA Resource Manager has been removed from Berkeley DB. [#6459]
6/18/2015
1.
Fixed a bug to prevent unlocking a mutex twice if we ran out of transactional locks.
[#16285]
2.
Fixed a bug to prevent a segmentation trap in __lock_open if there were an error during
the opening of an environment. [#16307]
3.
Fixed a bug to now avoid a deadlock if user defined locks are used only one lock partition
is defined.[#16415]
4.
5.
Fixed a bug that could cause a panic if a transaction which updated a database that was
supporting READ_UNCOMMITED readers aborted and it hit a race with a thread running the
deadlock detector. [#16490]
6.
Fixed a race condition in deadlock detection that could overwrite heap. [#16541]
7.
Fixed a bug so that DB_STAT_CLEAR now restores the value of st_partitions. [#16701]
DB Installation Guide
Page 169
Fixed a bug so that the header checksum is only ignored when the log is from a previous
version [#16281]
2.
Fixed a bug by removing a possible race condition with logc_get(DB_FIRST) and log
archiving. [#16387]
3.
Fixed a bug that could cause a recovery failure of a create of a database that was
aborted. [#16824]
4.
Fixed a bug that occurred after all open handles on a file are closed. Needed to clear the
TXN_NOT_DURABLE flag (if set) and mark the file as DURABLE_UNKNOWN in the memory
pool. [#16091]
2.
Fixed a possible race condition between dirtying and freeing a buffer that could result in
a panic or corruption. [#16530]
3.
Fixed a memory leak where allocated space for temporary file names are not released.
[#16956]
6/18/2015
1.
Fixed a bug when using mutexes for SMP MIPS/Linux systems. [#15914]
2.
3.
4.
5.
Fixed a bug that would cause a mutex to be unlocked a second time if we ran out of space
while tracking pinned pages. [#16228]
6.
Fixed a bug Sparc/GCC when using test-and-set mutexes. They are now aligned on an 8byte boundary. [#16243]
7.
Fixed a bug to now prevent a thread calling DB_ENV->failcheck to hang on a mutex held
by a dead thread. [#16446]
8.
Fixed a bug so that __db_pthread_mutex_unlock() now handles the failchk case of finding
a busy mutex which was owned by a now-dead process. [#16557]
9.
Removed support for the mutex implementation based on the "fcntl" system call. Anyone
configuring Berkeley DB to use this type of mutex in an earlier release will need to either
switch to a different mutex type or contact Oracle for support. [#17470]
DB Installation Guide
Page 170
Fixed a bug when using failchk(), where a mutex was not released. [#15982]
2.
3.
4.
5.
6.
Fixed a bug to now clean up stray handles when rep_verify doesn't work. [#16390]
7.
Fixed a bug to avoid db_reptest passing the wrong flag to repmgr_start when there is
already a master. [#16475]
8.
Added new tests for abbreviated internal init. Fixed test not to expect in-memory
database to survive recovery. [#16495]
9.
Fix a bug, to add page size for txn014 if the default page size is too small. Move files
instead of renaming directory for env015 on QNX. [#16627]
10. Added new rep088 test for log truncation integrity. [#16732]
11. Fixed a bug by adding a checkpoint in rep061 to make sure we have messages to process.
Otherwise we could hang with client stuck in internal init, and no incoming messages to
trigger rerequest. [#16781]
2.
Fixed a bug to remove a potential hang condition in replication os_yield loops when
DB_REGISTER used with replication by adding PANIC_CHECKS. [#16502]
3.
Fix a bug to now release mutex obtained before special condition returns in
__db_cursor_int and __txn_record_fname. [#16665]
4.
Fixed a leak in the transaction region when a snapshot update transaction accesses more
than 4 databases. [#16734]
5.
6.
Utility Changes:
1.
6/18/2015
The db_stat utility with the -RA flags will now print a list of known remote replication
flags when using repmgr. [#15484]
DB Installation Guide
Page 171
2.
Restructured DB salvage to walk known leaf pages prior to looping over all db pages.
[#16219]
3.
4.
Fixed a bug so that now db_load consistently returns >1 on failure. [#16765]
5.
The db_dump utility now accepts a "-m" flag to dump information from a named inmemory database. [#16896]
6.
Fixed a bug that would cause db_hotbackup to fail if a database file was removed while it
was running. [#17234]
Fixed a bug to now use the correct Perl include path. [#16058]
2.
3.
Upgraded the Visual Studio build files to be based on Visual Studio 8 (2005+). The build is
now simplified. Users can still upgrade the Visual Studio 6.0 project files, if they want to
use Visual Studio .NET (7.1) [#16108]
4.
Expanded the ex_rep example with checkpoint and log archive threads, deadlock
detection, new options for acknowledgment policy and bulk transfer, and use of
additional replication features and events. [#16109]
5.
Fixed a bug so that optimizations on AIX are re-enabled, avoiding incorrect code
generation. [#16141]
6.
Removed a few compiler warnings and three type redefinitons when using vxworks and
the GNU compiler. [#16341]
7.
8.
9.
Fixed lock_get and lock_vec examples from the Java (and C#) API. Updated the Java lock
example. [#16506]
10. Fixed a bug to correctly handle the TPC-B history record on 64-bit systems. [#16709]
11. Add STL API to Linux build. Can be enabled via the --enable-stl flag. [#16786]
12. Add STL API to Windows build, by building the db_stl project in the solution. There are
also stl's test and examples projects in this solution. [#16786]
13. Add support to build dll projects for WinCE, in order to enable users to build DB into a dll
in addition to a static library.[#16625]
6/18/2015
DB Installation Guide
Page 172
14. Fixed a weakness where several malloc/realloc return values are not checked before use.
[#16664]
15. Enabled DB->compact for WinCE.[#15897]
16. HP-UX 10 is no longer supported.
6/18/2015
DB Installation Guide
Page 173
6/18/2015
DB Installation Guide
Page 174
Test Suite
To run an individual test, such as insert.test, execute the following command in the ../
build_unix/sql directory:
./textfixture ../../sql/sqlite/test/insert.test
The test suite has been running for over a day. What's wrong?
The test suite can take anywhere from some number of hours to several days to run,
depending on your hardware configuration. As long as the run is making forward progress
and new lines are being written to the ALL.OUT files, everything is probably fine.
6/18/2015
DB Installation Guide
Page 175