Examining Berkeley DB files from the CLI

前端 未结 8 1860
野趣味
野趣味 2020-12-23 12:35

I have a set of Berkeley DB files on my Linux file system that I\'d like to examine.

What useful tools exist for getting a quick overview of the contents? I can writ

8条回答
  •  一整个雨季
    2020-12-23 13:13

    Use the db_dump program. It is contained in the package core/db (Arch), db-util (Debian, Ubuntu), sys-libs/db (Gentoo, note that here the binary is called db4.8_dump or whatever version you are using).

    On some systems the man pages are not installed, in that case the documentation can be found here. By default, db_dump outputs some hex numbers, which is not really useful if you are trying to analyse the content of a database. Use the -p argument to change this.

    Show everything that’s in the file database.db:

    db_dump -p database.db
    

    List the databases in the file database.db:

    db_dump -l database.db
    

    Show only the content of the database mydb in the file database.db:

    db_dump -p -s mydb database.db
    

提交回复
热议问题