Berkeley DB C API Reference
|  | Next

# Berkeley DB C API Reference

DB C API | Description
--- | ---
DB->associate() | Associate a secondary index
DB->associate_foreign() | Associate a foreign index
DB->close() | Close a database
db_create | Create a database handle
DB->compact() | Compact a database
DB->del() | Delete items from a database
DB->err() | Error message
DB->exists() | Return if an item appears in a database
DB->fd() | Return a file descriptor from a database
DB->get() | Get items from a database
DB->get_byteswapped() | Return if the underlying database is in host order
DB->get_dbname() | Return the file and database name
DB->get_multiple() | Return if the database handle references multiple databases
DB->get_open_flags() | Returns the flags specified to DB->open
DB->get_type() | Return the database type
DB->join() | Perform a database join on cursors
DB->key_range() | Return estimate of key location
DB->open() | Open a database
DB->put() | Store items into a database
DB->remove() | Remove a database
DB->rename() | Rename a database
DB->set_alloc() | Set local space allocation functions
DB->set_append_recno() | Set record append callback
DB->set_bt_compare() | Set a Btree comparison function
DB->set_bt_compress() | Set Btree compression functions
DB->set_bt_minkey(), DB->get_bt_minkey() | Set/get the minimum number of keys per Btree page
DB->set_bt_prefix() | Set a Btree prefix comparison function
DB->set_cachesize(), DB->get_cachesize() | Set/get the database cache size
DB->set_create_dir(), DB->get_create_dir() | Set/get the directory in which a database is placed
DB->set_dup_compare() | Set a duplicate comparison function
DB->set_encrypt(), DB->get_encrypt_flags() | Set/get the database cryptographic key
DB->set_errcall() | Set error message callback
DB->set_errfile(), DB->get_errfile() | Set/get error message FILE
DB->set_errpfx(), DB->get_errpfx() | Set/get error message prefix
DB->set_feedback() | Set feedback callback
DB->set_flags(), DB->get_flags() | Set/get general database configuration
DB->set_h_compare() | Set a Hash comparison function
DB->set_h_ffactor(), DB->get_h_ffactor() | Set/get the Hash table density
DB->set_h_hash() | Set a hashing function
DB->set_h_nelem(), DB->get_h_nelem() | Set/get the Hash table size
DB->set_lorder(), DB->get_lorder() | Set/get the database byte order
DB->set_msgcall() | Set informational message callback
DB->set_msgfile(), DB->get_msgfile() | Set/get informational message FILE
DB->set_pagesize(), DB->get_pagesize() | Set/get the underlying database page size
DB->set_partition() | Set database partitioning
DB->set_partition_dirs(), DB->get_partition_dirs() | Set/get the directories used for database partitions
DB->set_priority(), DB->get_priority() | Set/get cache page priority
DB->set_q_extentsize(), DB->get_q_extentsize() | Set/get Queue database extent size
DB->set_re_delim(), DB->get_re_delim() | Set/get the variable-length record delimiter
DB->set_re_len(), DB->get_re_len() | Set/get the fixed-length record length
DB->set_re_pad(), DB->get_re_pad() | Set/get the fixed-length record pad byte
DB->set_re_source(), DB->get_re_source() | Set/get the backing Recno text file
DB->stat() | Database statistics
DB->stat_print() | Display database statistics
DB->sync() | Flush a database to stable storage
DB->truncate() | Empty a database
DB->upgrade() | Upgrade a database
DB->verify() | Verify/salvage a database
DB->cursor() | Create a cursor handle
DBcursor->close() | Close a cursor handle
DBcursor->cmp() | Compare two cursors for equality.
DBcursor->count() | Return count of duplicates for current key
DBcursor->del() | Delete current key/data pair
DBcursor->dup() | Duplicate the cursor handle
DBcursor->get() | Retrieve by cursor
DBcursor->put() | Store by cursor
DBcursor->set_priority(), DBcursor->get_priority() | Set/get the cursor's cache priority
DB_MULTIPLE_INIT | Initialize bulk get retrieval
DB_MULTIPLE_NEXT | Next bulk get retrieval
DB_MULTIPLE_KEY_NEXT | Next bulk get retrieval
DB_MULTIPLE_RECNO_NEXT | Next bulk get retrieval
DB_MULTIPLE_WRITE_INIT | Initialize a bulk buffer to hold key/data pairs
DB_MULTIPLE_WRITE_NEXT | Append a data item to a bulk buffer
DB_MULTIPLE_RESERVE_NEXT | Reserve space for a data item in a bulk buffer
DB_MULTIPLE_KEY_WRITE_NEXT | Append a key / data pair to a bulk buffer
DB_MULTIPLE_KEY_RESERVE_NEXT | Reserve space for a key / data pair in a bulk buffer
DB_MULTIPLE_RECNO_WRITE_INIT | Initialize a bulk buffer to hold recno/data pairs
DB_MULTIPLE_RECNO_WRITE_NEXT | Append a record number / data pair to a bulk buffer
DB_MULTIPLE_RECNO_RESERVE_NEXT | Reserve space for a record number / data pair in a bulk buffer
DB->get_env() | Return the DB's underlying DB_ENV handle
DB_ENV->add_data_dir() | add an environment data directory
DB_ENV->close() | Close an environment
db_env_create | Create an environment handle
DB_ENV->dbremove() | Remove a database
DB_ENV->dbrename() | Rename a database
DB_ENV->err() | Error message
DB_ENV->failchk() | Check for thread failure
DB_ENV->fileid_reset() | Reset database file IDs
db_full_version | Return full version information
DB_ENV->get_home() | Return environment's home directory
DB_ENV->get_open_flags() | Return flags with which the environment was opened
DB_ENV->log_verify() | Verify log files of an environment.
DB_ENV->lsn_reset() | Reset database file LSNs
DB_ENV->open() | Open an environment
DB_ENV->remove() | Remove an environment
DB_ENV->set_alloc() | Set local space allocation functions
DB_ENV->set_app_dispatch() | Configure application recovery callback
DB_ENV->set_data_dir(), DB_ENV->get_data_dirs() | Set/get the environment data directory
DB_ENV->set_create_dir(), DB_ENV->get_create_dir() | add an environment data directory
DB_ENV->set_encrypt(), DB_ENV->get_encrypt_flags() | Set/get the environment cryptographic key
DB_ENV->set_event_notify() | Set event notification callback
DB_ENV->set_errcall() | Set error message callbacks
DB_ENV->set_errfile(), DB_ENV->get_errfile() | Set/get error message FILE
DB_ENV->set_errpfx(), DB_ENV->get_errpfx() | Set/get error message prefix
DB_ENV->set_feedback() | Set feedback callback
DB_ENV->set_flags(), DB_ENV->get_flags() | Environment configuration
DB_ENV->set_intermediate_dir_mode(), DB_ENV->get_intermediate_dir_mode() | Set/get intermediate directory creation mode
DB_ENV->set_isalive() | Set thread is-alive callback
DB_ENV->set_msgcall() | Set informational message callback
DB_ENV->set_msgfile(), DB_ENV->get_msgfile() | Set/get informational message FILE
DB_ENV->set_shm_key(), DB_ENV->get_shm_key() | Set/get system memory shared segment ID
DB_ENV->set_thread_count(), DB_ENV->get_thread_count() | Set/get approximate thread count
DB_ENV->set_thread_id() | Set thread of control ID function
DB_ENV->set_thread_id_string() | Set thread of control ID format function
DB_ENV->set_timeout(), DB_ENV->get_timeout() | Set/get lock and transaction timeout
DB_ENV->set_tmp_dir(), DB_ENV->get_tmp_dir() | Set/get the environment temporary file directory
DB_ENV->set_verbose(), DB_ENV->get_verbose() | Set/get verbose messages
DB_ENV->stat_print() | Environment statistics
db_strerror | Error strings
db_version | Return version information
DB_ENV->set_lk_conflicts(), DB_ENV->get_lk_conflicts() | Set/get lock conflicts matrix
DB_ENV->set_lk_detect(), DB_ENV->get_lk_detect() | Set/get automatic deadlock detection
DB_ENV->set_lk_max_lockers(), DB_ENV->get_lk_max_lockers() | Set/get maximum number of lockers
DB_ENV->set_lk_max_locks(), DB_ENV->get_lk_max_locks() | Set/get maximum number of locks
DB_ENV->set_lk_max_objects(), DB_ENV->get_lk_max_objects() | Set/get maximum number of lock objects
DB_ENV->set_lk_partitions(), DB_ENV->get_lk_partitions() | Set/get number of lock partitions
DB_ENV->set_lk_priority(), DB_ENV->get_lk_priority() | Set/get a locker's deadlock priority
DB_ENV->lock_detect() | Perform deadlock detection
DB_ENV->lock_get() | Acquire a lock
DB_ENV->lock_id() | Acquire a locker ID
DB_ENV->lock_id_free() | Release a locker ID
DB_ENV->lock_put() | Release a lock
DB_ENV->lock_stat() | Return lock subsystem statistics
DB_ENV->lock_stat_print() | Print lock subsystem statistics
DB_ENV->lock_vec() | Acquire/release locks
DB_ENV->log_archive() | List log and database files
DB_ENV->log_cursor() | Create a log cursor handle
DB_ENV->log_file() | Map Log Sequence Numbers to log files
DB_ENV->log_flush() | Flush log records
DB_ENV->log_printf() | Append informational message to the log
DB_ENV->log_put() | Write a log record
DB_ENV->log_set_config(), DB_ENV->log_get_config() | Configure the logging subsystem
DB_ENV->log_stat() | Return log subsystem statistics
DB_ENV->log_stat_print() | Print log subsystem statistics
DB_ENV->set_lg_bsize(), DB_ENV->get_lg_bsize() | Set/get log buffer size
DB_ENV->set_lg_dir(), DB_ENV->get_lg_dir() | Set/get the environment logging directory
DB_ENV->set_lg_filemode(), DB_ENV->get_lg_filemode() | Set/get log file mode
DB_ENV->set_lg_max(), DB_ENV->get_lg_max() | Set/get log file size
DB_ENV->set_lg_regionmax(), DB_ENV->get_lg_regionmax() | Set/get logging region size
The DB_LOGC Handle | A log cursor handle
DB_LOGC->close() | Close a log cursor
DB_LOGC->get() | Retrieve a log record
log_compare | Compare two Log Sequence Numbers
DB->get_mpf() | Return the DB_MPOOLFILE for a DB
DB_ENV->memp_fcreate() | Create a memory pool file handle
DB_ENV->memp_register() | Register a custom file type
DB_ENV->memp_stat() | Return cache statistics
DB_ENV->memp_stat_print() | Print cache statistics
DB_ENV->memp_sync() | Flush all pages from the cache
DB_ENV->memp_trickle() | Flush some pages from the cache
DB_ENV->set_cache_max(), DB_ENV->get_cache_max() | Set/get the maximum cache size
DB_ENV->set_cachesize(), DB_ENV->get_cachesize() | Set/get the environment cache size
DB_ENV->set_mp_max_openfd(), DB_ENV->get_mp_max_openfd() | Set/get the maximum number of open file descriptors
DB_ENV->set_mp_max_write(), DB_ENV->get_mp_max_write() | Set/get the maximum number of sequential disk writes
DB_ENV->set_mp_mmapsize(), DB_ENV->get_mp_mmapsize() | Set/get maximum file size to memory map when opened read-only
DB_ENV->set_mp_pagesize(), DB_ENV->get_mp_pagesize() | Set/get page size to configure the buffer pool
DB_ENV->set_mp_tablesize(), DB_ENV->get_mp_tablesize() | Set/get the hash table size
DB_MPOOLFILE->close() | Close a file in the cache
DB_MPOOLFILE->get() | Get page from a file in the cache
DB_MPOOLFILE->open() | Open a file in the cache
DB_MPOOLFILE->put() | Return a page to the cache
DB_MPOOLFILE->sync() | Flush pages from a file from the cache
DB_MPOOLFILE->set_clear_len(), DB_MPOOLFILE->get_clear_len() | Set/get number of bytes to clear when creating a new page
DB_MPOOLFILE->set_fileid(), DB_MPOOLFILE->get_fileid() | Set/get file unique identifier
DB_MPOOLFILE->set_flags(), DB_MPOOLFILE->get_flags() | Set/get file options
DB_MPOOLFILE->set_ftype(), DB_MPOOLFILE->get_ftype() | Set/get file type
DB_MPOOLFILE->set_lsn_offset(), DB_MPOOLFILE->get_lsn_offset() | Set/get file log-sequence-number offset
DB_MPOOLFILE->set_maxsize(), DB_MPOOLFILE->get_maxsize() | Set/get maximum file size
DB_MPOOLFILE->set_pgcookie(), DB_MPOOLFILE->get_pgcookie() | Set/get file cookie for pgin/pgout
DB_MPOOLFILE->set_priority(), DB_MPOOLFILE->get_priority() | Set/get cache file priority
DB_ENV->mutex_alloc() | Allocate a mutex
DB_ENV->mutex_free() | Free a mutex
DB_ENV->mutex_lock() | Lock a mutex
DB_ENV->mutex_set_align(), DB_ENV->mutex_get_align() | Configure mutex alignment
DB_ENV->mutex_set_increment(), DB_ENV->mutex_get_increment() | Configure number of additional mutexes
DB_ENV->mutex_set_max(), DB_ENV->mutex_get_max() | Configure total number of mutexes
DB_ENV->mutex_set_tas_spins(), DB_ENV->mutex_get_tas_spins() | Configure test-and-set mutex spin count
DB_ENV->mutex_stat() | Mutex statistics
DB_ENV->mutex_stat_print() | Print mutex statistics
DB_ENV->mutex_unlock() | Unlock a mutex
DB_ENV->rep_elect() | Hold a replication election
DB_ENV->rep_process_message() | Process a replication message
DB_ENV->rep_set_clockskew(), DB_ENV->rep_get_clockskew() | Configure master lease clock adjustment
DB_ENV->rep_set_config(), DB_ENV->rep_get_config() | Configure the replication subsystem
DB_ENV->rep_set_limit(), DB_ENV->rep_get_limit() | Limit data sent in response to a single message
DB_ENV->rep_set_nsites(), DB_ENV->rep_get_nsites() | Configure replication group site count
DB_ENV->rep_set_priority(), DB_ENV->rep_get_priority() | Configure replication site priority
DB_ENV->rep_set_request(), DB_ENV->rep_get_request() | Configure replication client retransmission requests
DB_ENV->rep_set_timeout(), DB_ENV->rep_get_timeout() | Configure replication timeouts
DB_ENV->rep_set_transport() | Configure replication transport callback
DB_ENV->rep_start() | Start replication
DB_ENV->rep_stat() | Replication statistics
DB_ENV->rep_stat_print() | Print replication statistics
DB_ENV->rep_sync() | Replication synchronization
DB_ENV->repmgr_add_remote_site() | Specify the Replication Manager's remote sites
DB_ENV->repmgr_set_ack_policy(), DB_ENV->repmgr_get_ack_policy() | Specify the Replication Manager's client acknowledgement policy
DB_ENV->repmgr_set_local_site() | Specify the Replication Manager's local site
DB_ENV->repmgr_site_list() | List the sites and their status
DB_ENV->repmgr_start() | Start the Replication Manager
DB_ENV->repmgr_stat() | Replication Manager statistics
DB_ENV->repmgr_stat_print() | Print Replication Manager statistics
DB_ENV->txn_applied() | Check if a transaction has been replicated
DB_TXN->set_commit_token() | Set a commit token
db_sequence_create | Create a sequence handle
DB_SEQUENCE->close() | Close a sequence
DB_SEQUENCE->get() | Get the next sequence element(s)
DB_SEQUENCE->get_dbp() | Return a handle for the underlying sequence database
DB_SEQUENCE->get_key() | Return the key for a sequence
DB_SEQUENCE->initial_value() | Set the initial value of a sequence
DB_SEQUENCE->open() | Open a sequence
DB_SEQUENCE->remove() | Remove a sequence
DB_SEQUENCE->set_cachesize(), DB_SEQUENCE->get_cachesize() | Set/get the cache size of a sequence
DB_SEQUENCE->set_flags(), DB_SEQUENCE->get_flags() | Set/get the flags for a sequence
DB_SEQUENCE->set_range(), DB_SEQUENCE->get_range() | Set/get the range for a sequence
DB_SEQUENCE->stat() | Return sequence statistics
DB_SEQUENCE->stat_print() | Print sequence statistics
DB->get_transactional() | Does the DB have transaction support
DB_ENV->cdsgroup_begin() | Get a locker ID in Berkeley DB Concurrent Data Store
DB_ENV->set_tx_max(), DB_ENV->get_tx_max() | Set/get maximum number of transactions
DB_ENV->set_tx_timestamp(), DB_ENV->get_tx_timestamp() | Set/get recovery timestamp
DB_ENV->txn_recover() | Distributed transaction recovery
DB_ENV->txn_begin() | Begin a transaction
DB_ENV->txn_checkpoint() | Checkpoint the transaction subsystem
DB_ENV->txn_stat() | Return transaction subsystem statistics
DB_ENV->txn_stat_print() | Print transaction subsystem statistics
DB_TXN->abort() | Abort a transaction
DB_TXN->commit() | Commit a transaction
DB_TXN->discard() | Discard a prepared but not resolved transaction handle
DB_TXN->id() | Return a transaction's ID
DB_TXN->prepare() | Prepare a transaction for commit
DB_TXN->set_name(), DB_TXN->get_name() | Associate a string with a transaction
DB_TXN->set_priority(), DB_TXN->get_priority() | Set/get transaction's priority
DB_TXN->set_timeout() | Set transaction timeout
db_archive | Archival utility
db_checkpoint | Transaction checkpoint utility
db_deadlock | Deadlock detection utility
db_dump | Database dump utility
db_hotbackup | Hot backup utility
db_load | Database load utility
db_log_verify | Log verification utility
db_printlog | Transaction log display utility
db_recover | Recovery utility
db_sql_codegen | SQL schema to Berkeley DB code in C
dbsql | Command line interface to libdb_sql
db_stat | Statistics utility
db_upgrade | Database upgrade utility
db_verify | Verification utility
sqlite3 | Command line tool for wrapper library libsqlite3
dbm/ndbm | Compatibility for applications written to the historic dbm or hdbm interfaces
hsearch | Compatibility for applications written to the historic hsearch interface
db_env_set_func_close | Replace Berkeley DB calls to close() with the identified function.
db_env_set_func_dirfree | Specify function used to free memory obtained due to a directory walk.
db_env_set_func_dirlist | Specify function used to free memory obtained due to a directory list.
db_env_set_func_exists | Specify function used to determine whether a file exists.
db_env_set_func_file_map | Specify function used to map a file into memory.
db_env_set_func_free | Specify function used to free memory.
db_env_set_func_fsync | Specify function used to sync a file to disk.
db_env_set_func_ftruncate | Specify function used to truncate a file.
db_env_set_func_ioinfo | Specify function used to determine file characteristics.
db_env_set_func_malloc | Specify function used to allocate memory.
db_env_set_func_open | Specify function used to open a file.
db_env_set_func_pread | Specify function used to read data from an object.
db_env_set_func_pwrite | Specify function used to write data to an object.
db_env_set_func_read | Specify function used to read data from an object.
db_env_set_func_realloc | Specify function used to change the size of memory pointed to by a pointer.
db_env_set_func_region_map | Specify function used to created shared memory regions.
db_env_set_func_rename | Specify function used to change the name of a file.
db_env_set_func_seek | Specify function used to specify a location in a file.
db_env_set_func_unlink | Specify function used to delete a file.
db_env_set_func_write | Specify function used to write data to an object.
db_env_set_func_yield | Specify function used to yield the processor to another thread of control.

Legal Notice

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

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

Other names may be trademarks of their respective owners.

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

3/30/2010

|  | Next
|  | Preface