⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 create.so

📁 berkeley db 4.6.21的源码。berkeley db是一个简单的数据库管理系统
💻 SO
字号:
m4_comment([$Id: create.so,v 10.30 2005/09/23 16:22:42 bostic Exp $])m4_ref_title(Environment,    Creating a database environment,    database @environment, env/intro, env/open)m4_p([dnlThe m4_db environment is created and described by the m4_ref(dbenv_create)and m4_ref(dbenv_open) interfaces.  In situations where customization isdesired, such as storing log files on a separate disk drive or selectionof a particular cache size, applications must describe the customizationby either creating an environment configuration file in the environmenthome directory or by arguments passed to other m4_ref(DbEnv) handle methods.])m4_p([dnlOnce an environment has been created, database files specified usingrelative pathnames will be named relative to the home directory.  Usingpathnames relative to the home directory allows the entire environmentto be easily moved, simplifying restoration and recovery of a databasein a different directory or on a different system.])m4_p([dnlApplications first obtain an environment handle using them4_refT(dbenv_create), then call the m4_refT(dbenv_open) which createsor joins the database environment.  There are a number of options youcan set to customize m4_ref(dbenv_open) for your environment.  Theseoptions fall into four broad categories:])m4_tagbeginm4_tag([Subsystem Initialization:], [dnlThese flags indicate which m4_db subsystems will be initialized for theenvironment, and what operations will happen automatically whendatabases are accessed within the environment.  The flags includem4_ref(DB_INIT_CDB), m4_ref(DB_INIT_LOCK), m4_ref(DB_INIT_LOG),m4_ref(DB_INIT_MPOOL), and m4_ref(DB_INIT_TXN).  The m4_ref(DB_INIT_CDB)flag does initialization for m4_cam applications.  (Seem4_link(M4RELDIR/ref/cam/intro, Building m4_cam applications) for moreinformation.)  The rest of the flags initialize a single subsystem; thatis, when m4_ref(DB_INIT_LOCK) is specified, applications reading andwriting databases opened in this environment will be using locking toensure that they do not overwrite each other's changes.])m4_tag([Recovery options:], [dnlThese flags, which include m4_ref(DB_RECOVER) andm4_ref(DB_RECOVER_FATAL), indicate what recovery is to be performed onthe environment before it is opened for normal use.])m4_tag([Naming options:], [dnlThese flags, which include m4_ref(DB_USE_ENVIRON) andm4_ref(DB_USE_ENVIRON_ROOT), modify how file naming happens in theenvironment.])m4_tag([Miscellaneous:], [dnlFinally, there are a number of miscellaneous flags, for example,m4_ref(DB_CREATE) which causes underlying files to be created asnecessary.  See the m4_ref(dbenv_open) manual pages for furtherinformation.])m4_tagendm4_p([dnlMost applications either specify only the m4_ref(DB_INIT_MPOOL) flag orthey specify all four subsystem initialization flags(m4_ref(DB_INIT_MPOOL), m4_ref(DB_INIT_LOCK), m4_ref(DB_INIT_LOG), andm4_ref(DB_INIT_TXN)).  The former configuration is for applications thatsimply want to use the basic Access Method interfaces with a sharedunderlying buffer pool, but don't care about recoverability afterapplication or system failure.  The latter is for applications that needrecoverability.  There are situations in which other combinations ofthe initialization flags make sense, but they are rare.])m4_p([dnlThe m4_ref(DB_RECOVER) flag is specified by applications that want toperform any necessary database recovery when they start running.  Thatis, if there was a system or application failure the last time they ran,they want the databases to be made consistent before they start runningagain.  It is not an error to specify this flag when no recovery needsto be done.])m4_p([dnlThe m4_ref(DB_RECOVER_FATAL) flag is more special-purpose.  It performscatastrophic database recovery, and normally requires that some initialarrangements be made; that is, archived log files be brought back intothe filesystem.  Applications should not normally specify this flag.Instead, under these rare conditions, the m4_ref(db_recover) utilityshould be used.])m4_p([dnlThe following is a simple example of a function that opens a databaseenvironment for a transactional program.])include(ref/env/create.cs)m4_page_footer

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -