dbTalk Databases Forums  

database portability

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss database portability in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default database portability - 05-01-2006 , 06:44 PM






Hi,

I have a question regarding the db in the transactional environment.

At the end of the session, before exiting, my application performs a
checkpoint, closes db, and closes the environment. The environment is
configured to auto-remove logs. Despite that, one log file is always
present after application cleanly exits.

It appears that simply moving this database file to another location
without an accompanying log file leads to corruption sometimes. Now,
the db4.4 has the DB_ENV->lsn_reset function to take care of this.

Is there anything I can do with earlier bsddb versions to this extent?
Is DB_ENV->remove going to reset the logs sequence number? Any solution
to make db portable on clean exit is greatly appreciated.

Alex


Reply With Quote
  #2  
Old   
Ron
 
Posts: n/a

Default Re: database portability - 05-02-2006 , 10:56 AM






Quote:
At the end of the session, before exiting, my application performs a
checkpoint, closes db, and closes the environment. The environment is
configured to auto-remove logs. Despite that, one log file is always
present after application cleanly exits.
There must be at least one log file even after the application exits
cleanly.
If you have active transactions in log files that have not ended
(either commit or abort) then those log files will not be archived
either.

db_stat -t can help you monitor this.

Quote:
It appears that simply moving this database file to another location
without an accompanying log file leads to corruption sometimes. Now,
the db4.4 has the DB_ENV->lsn_reset function to take care of this.
Is there anything I can do with earlier bsddb versions to this extent?
Is DB_ENV->remove going to reset the logs sequence number? Any solution
to make db portable on clean exit is greatly appreciated.
In the Berkeley DB 4.3 release, you can use the -r option to
the db_load utility:

http://www.sleepycat.com/docs/utility/db_load.html

Alternatively, you can overwrite the first 8 bytes of all of
the database pages with nul bytes.

https://iweb.sleepycat.com/db/4.2.52...nsapp/faq.html

Ron Cohen
Berkeley DB
Oracle Corporation



Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: database portability - 05-02-2006 , 04:43 PM



Ron,

Thanks for your reply!

The case I am talking about is when there's no active transactions: all
transactions have committed, checkpoint made, and everything cleanly
closed. The db_load is not really an option for me, because I am using
python bindings for bsddb.

Is there any way to do the same from the API? What about 4.2 release? I
was hoping there's a call I can make on closing the application.

If not, how do I access the first 8 bytes of every page?

Thanks a lot for your help,
Alex


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.