http://www.jinbuguo.com/lfs/lfs62/chapter06/db.html

安装的程序: db_archive, db_checkpoint, db_deadlock, db_dump, db_hotbackup, db_load, db_printlog, db_recover, db_stat, db_upgrade, db_verify

安装的库: libdb.{so,ar}and libdb_cxx.r{o,ar}

简要描述

db_archive

打印出不再使用的日志文件路径名

db_checkpoint

监视和检查数据库日志的守护进程

db_deadlock

当死锁发生时,退出锁定要求

db_dump

把数据库文件转换成 db_load 能认出的文本文件

db_hotbackup

创建 "hot backup" 或者是 "hot failover" 的 Berkeley DB 数据库镜像。

db_load

从db_dump产生的文本文件中创建出数据库文件

db_printlog

把数据库日志文件转换成人能读懂的文本

db_recover

在发生错误后,把数据库恢复到一致的状态

db_stat

显示数据库环境统计

db_upgrade

把数据库文件转换成新版本的Berkley DB格式

db_verify

对数据库文件进行一致性检查

libdb.{so,a}

包含db处理相关函数的C库

libdb_cxx.{so,a}

包含db处理相关函数的C++库

删除冗余的log.xxxxxx
1)DB_CONFIG set_flags DB_LOG_AUTOREMOVE 是否有关系?为什么不能自动删除?
2)db_checkpoint -1
3)db_archive -d
=================================================
Provided by:  libdb2-util_2.7.7.0-10_i386  

NAME

       db_checkpoint - the DB database checkpoint utility

SYNOPSIS

       db_checkpoint [-1v] [-h home] [-k kbytes] [-L file] [-p min]

DESCRIPTION

       The  db_checkpoint  utility  is  a  daemon  process  that  monitors thedatabase log and periodically calls txn_checkpoint(3) to checkpoint it.The options are as follows:-1   Checkpoint the log once, and then exit.-h   Specify a home directory for the database.-k   Checkpoint  the  database at least as often as every kbytes of logfile are written.-L   Log the execution of the db_checkpoint utility  to  the  specifiedfile in the following format, where ‘‘###’’ is the process ID, andthe date is the time the utility starting running.db_checkpoint: ### Wed Jun 15 01:23:45 EDT 1995This file will be  removed  if  the  db_checkpoint  utility  exitsgracefully.-p   Checkpoint the database at least every min minutes.-v   Write the time of each checkpoint to the standard output.At least one of the -1, -k and -p options must be specified.The  db_checkpoint  utility  attaches  to DB shared memory regions.  Inorder to avoid region corruption, it should always be given the  chanceto  detach  and  exit  gracefully.   To cause db_checkpoint to clean upafter itself and exit, send it an interrupt signal (SIGINT).The db_checkpoint utility exits 0  on  success,  and  >0  if  an  erroroccurs.

ENVIRONMENT VARIABLES

       The   following   environment   variables   affect   the  execution  ofdb_checkpoint:DB_HOMEIf the -h option is not specified  and  the  environment  variableDB_HOME  is  set,  it is used as the path of the database home, asdescribed in db_appinit(3).

SEE ALSO

       The DB library is a family of  groups  of  functions  that  provides  amodular  programming interface to transactions and record-oriented fileaccess.   The  library  includes  support  for  transactions,  locking,logging  and  file  page  caching,  as  well  as various indexed accessmethods.  Many of the functional groups (e.g., the  file  page  cachingfunctions)  are  useful independent of the other DB functions, althoughsome functional groups are explicitly based on other functional  groups(e.g., transactions and logging).db_archive(1), db_checkpoint(1), db_deadlock(1), db_dump(1),db_load(1), db_recover(1), db_stat(1),
http://docs.oracle.com/cd/E17275_01/html/api_reference/C/db_archive.html

d db_archive

db_archive [-adlsVv] [-h home] [-P password]  

实用程序打印不再使用的日志文件路径名(例如,不再参与活动事务),到标准输出,每行一个路径名。应该将这些日志文件备份到媒体上为数据库崩溃提供恢复(还需要数据库的快照文件),但他们可能会被删除从系统回收磁盘空间。

The db_archive utility writes the pathnames of log files that are no longer in use (for example, no longer involved in active transactions), to the standard output, one pathname per line. These log files should be written to backup media to provide for recovery in the case of catastrophic failure (which also requires a snapshot of the database files), but they may then be deleted from the system to reclaim disk space.

The options are as follows:

  • -a  绝对路径

    Write all pathnames as absolute pathnames, instead of relative to the database home directory.

  • -d 删除不再需要的日志文件,删除后数据崩溃时将不可恢复.

    Remove log files that are no longer needed; no filenames are written. This automatic log file removal is likely to make catastrophic recovery impossible.

  • -h 

    Specify a home directory for the database environment; by default, the current working directory is used.

  • -l 列出所有日志文件,包括正在使用的.

    Write out the pathnames of all the database log files, whether or not they are involved in active transactions.

  • -P 指定密码

    Specify an environment password. Although Berkeley DB utilities overwrite password strings as soon as possible, be aware there may be a window of vulnerability on systems where unprivileged users can see command-line arguments or where utilities are not able to overwrite the memory containing the command-line arguments.

  • -s

    Write the pathnames of all the database files that need to be archived in order to recover the database from catastrophic failure. If any of the database files have not been accessed during the lifetime of the current log files, db_archive will not include them in this output.

    It is possible that some of the files to which the log refers have since been deleted from the system. In this case, db_archive will ignore them. Whendb_recover is run, any files to which the log refers that are not present during recovery are assumed to have been deleted and will not be recovered.

  • -V

    Write the library version number to the standard output, and exit.

  • -v

    Run in verbose mode.

Log cursor handles (returned by the DB_ENV->log_cursor() method) may have open file descriptors for log files in the database environment. Also, the Berkeley DB interfaces to the database environment logging subsystem (for example, DB_ENV->log_put() and DB_TXN->abort() may allocate log cursors and have open file descriptors for log files as well. On operating systems where filesystem related system calls (for example, rename and unlink on Windows/NT) can fail if a process has an open file descriptor for the affected file, attempting to move or remove the log files listed by db_archive may fail. All Berkeley DB internal use of log cursors operates on active log files only and furthermore, is short-lived in nature. So, an application seeing such a failure should be restructured to close any open log cursors it may have, and otherwise to retry the operation until it succeeds. (Although the latter is not likely to be necessary; it is hard to imagine a reason to move or rename a log file in which transactions are being logged or aborted.)

The db_archive utility uses a Berkeley DB environment (as described for the -h option, the environment variable DB_HOME, or because the utility was run in a directory containing a Berkeley DB environment). In order to avoid environment corruption when using a Berkeley DB environment, db_archive should always be given the chance to detach from the environment and exit gracefully. To cause db_archive to release all environment resources and exit cleanly, send it an interrupt signal (SIGINT).

The DB_ENV->log_archive() method is the underlying method used by the db_archive utility. See the db_archive utility source code for an example of using DB_ENV->log_archive() in an IEEE/ANSI Std 1003.1 (POSIX) environment.

The db_archive utility exits 0 on success, and >0 if an error occurs.

Environment Variables

DB_HOME

If the -h option is not specified and the environment variable DB_HOME is set, it is used as the path of the database home, as described in the DB_ENV->open()method.

Berkeley DB 的内容相关推荐

  1. berkeley db mysql_BDB:源自 Berkeley DB,事务型数据库

    数据库存储引擎是数据库底层软件组件,数据库管理系统使用数据引擎进行创建.查询.更新和删除数据操作.不同的存储引擎提供不同的存储机制.索引技巧.锁定水平等功能,使用不同的存储引擎还可以获得特定的功能. ...

  2. Java那些事之Berkeley DB

    最近一直在使用java,随着使用时间的加长,对java也有了更深入的了解.从今天开始,我会写一些关于java的专题内容,希望大家喜欢,也希望各位多多讨论指正. 这一次先介绍一下Berkeley DB的 ...

  3. Berkeley DB基础教程

    一.Berkeley DB的介绍 (1)Berkeley DB是一个嵌入式数据库,它适合于管理海量的.简单的数据.如Google使用其来保存账户信息,Heritrix用其来保存froniter. (2 ...

  4. Berkeley DB Java Edition

    一. 简介Berkeley DB Java Edition (JE)是一个完全用JAVA写的,它适合于管理海量的,简单的数据.l 能够高效率的处理1到1百万条记录,制约JE数据库的往往是硬件系统,而不 ...

  5. Berkeley DB(BDB)介绍

    Berkeley DB是一个开放源代码的内嵌式数据库管理系统,能够为应用程序提供高性能的数据管理服务.应用它程序员只需要调用一些简单的API就可以完成对数据的访问和管理.与常用的数据库管理系统(如My ...

  6. Berkeley DB(BDB)

    Berkeley DB(BDB)是一个高性能的,嵌入数据库编程库,和C语言,C++,Java,Perl,Python,Tcl以及其他很多语言都有应用程序编程界面.Berkeley DB可以保存任意类型 ...

  7. Berkeley db 数据库

    开发Berkeley DB原因: DB最初开发的目的是以新的HASH访问算法来代替旧的hsearch函数和大量的dbm实现(如AT&T的dbm,Berkeley的ndbm,GNU项目的gdbm ...

  8. [转]Berkeley DB实现分析

    计划实现一个开源的KV数据库--Simple DB 实现一个开源KV数据库的想法来源于对目前项目中所使用的K-V数据库使用情况的不满意. 先介绍一下我们的目前项目,作为本文的背景: 较为底层的分布式运 ...

  9. Berkeley DB JE 学习笔记

    本篇是在学习BDB JE的使用.阅读源码并参读文档后的笔记,涉及到内部实现细节,写的比较零散,也有很多疏漏,仅作为笔记待查. Berkeley DB JE简介及主要特点 Java版Berkeley D ...

最新文章

  1. TechEd 2012奥兰多!
  2. php 下载限制,php实现限制文件下载速度的代码实例
  3. Java 8 Friday:让我们弃用那些旧版库
  4. php生成红包数组,PHP 生成微信红包代码简单
  5. ReplaceAll()和Replace的实战用法
  6. Mac下启动和停止Mysql服务
  7. java修改request的paramMap
  8. Redis Cluster集群的配置
  9. php_D3_“简易聊天室 ”实现的关键技术 详解
  10. 基于大数据架构实现景点游客数据分析平台,全国景点游客数据管理系统
  11. zib机器人怎么_ZIB智伴机器人好不好 ZIB智伴机器人使用测评
  12. 网吧服务器网络维护教程,高效维护网吧局域网网络的方法
  13. 360路由器虚拟服务器怎么设置,路由器端口映射设置步骤
  14. 红米k30至尊纪念版和小米10青春版哪个好
  15. jason by gson复习
  16. xp计算机退出家庭组,win7电脑中如何退出加入的家庭组?
  17. 嵌入式芯片加密防抄板技巧简析
  18. matlab:变计算精度函数vpa,digits
  19. ABAQUS粘弹性边界及地震荷载施加的简单实现(Matlab生成input文件)
  20. 134.如何进行实时计算

热门文章

  1. 石头剪刀布游戏(Rock-Paper-Scissors)
  2. 时间序列数据趋势分析 Cox-Stuart、Mann-Kendall、Dickey-Fuller
  3. 制作特斯拉汽车自有监控优盘
  4. cobol- STRING语句
  5. 计算机技术中本聪,中本聪Satoshi Nakamoto
  6. ip 华三secondary_IP FRR实现概述
  7. 搭建MT4/MT5必须知道的事
  8. Java8特性 stream流常用方法
  9. 2020-11-16 css使用颜色渐变绘制梯形
  10. 连接远程数据库,并通过SQL来获取数据;