Getting Started with Berkeley DB

Legal Notice

This documentation is distributed under an open source license. You may review the terms of this license at: http://www.oracle.com/technetwork/database/berkeleydb/downloads/oslicense-093458.html

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

Other names may be trademarks of their respective owners.

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

9/14/2011


Table of Contents

Preface
Conventions Used in this Book
For More Information
Contact Us
1. Introduction to Berkeley DB
About This Manual
Berkeley DB Concepts
Access Methods
Selecting Access Methods
Choosing between BTree and Hash
Choosing between Queue and Recno
Database Limits and Portability
Environments
Error Returns
Getting and Using DB
2. Databases
Opening Databases
Closing Databases
Database Open Flags
Administrative Methods
Error Reporting Functions
Managing Databases in Environments
Database Example
3. Database Records
Using Database Records
Reading and Writing Database Records
Writing Records to the Database
Getting Records from the Database
Deleting Records
Data Persistence
Using C Structures with DB
C Structures with Pointers
Database Usage Example
4. Using Cursors
Opening and Closing Cursors
Getting Records Using the Cursor
Searching for Records
Working with Duplicate Records
Putting Records Using Cursors
Deleting Records Using Cursors
Replacing Records Using Cursors
Cursor Example
5. Secondary Databases
Opening and Closing Secondary Databases
Implementing Key Extractors
Working with Multiple Keys
Reading Secondary Databases
Deleting Secondary Database Records
Using Cursors with Secondary Databases
Database Joins
Using Join Cursors
Secondary Database Example
Secondary Databases with example_database_load
Secondary Databases with example_database_read
6. Database Configuration
Setting the Page Size
Overflow Pages
Locking
IO Efficiency
Page Sizing Advice
Selecting the Cache Size
BTree Configuration
Allowing Duplicate Records
Setting Comparison Functions

List of Examples

2.1. The stock_db Structure
2.2. The stock_db Utility Functions
2.3. open_database() Function
2.4. The databases_setup() Function
2.5. The databases_close() Function
3.1. VENDOR Structure
3.2. example_database_load
4.1. example_database_read