Examining Berkeley DB files from the CLI

前端 未结 8 1879
野趣味
野趣味 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:06

    I found @strickli's answer to be the most helpful, as I didn't want to add any new packages to the machine with the database I was on. However, the db file I was reading was of type btree, not hash, so I had to use bsddb

    # file foo.db
    foo.db: Berkeley DB (Btree, version 9, native byte-order)
    
    # python
    >>> import bsddb
    >>> for k, v in bsddb.btopen("**").iteritems():
    ...     print k,v
    ...
    

提交回复
热议问题