美文网首页
Bekerley DB CLI - 操作伯克利数据库

Bekerley DB CLI - 操作伯克利数据库

作者: 偷油考拉 | 来源:发表于2022-06-22 11:11 被阅读0次

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())

相关文章

网友评论

      本文标题:Bekerley DB CLI - 操作伯克利数据库

      本文链接:https://www.haomeiwen.com/subject/rqcyjrtx.html