Appendix 1. Berkeley DB Command Line Utilities (oracle.com)
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
Python
from bsddb3 import db
import collections
d = db.DB()
d.open('./file.dat', 'dbname', db.DB_BTREE, db.DB_THREAD | db.DB_RDONLY)
d.keys()
collections.OrderedDict((k, d[k]) for k in d.keys())
网友评论