Howard Chu wrote:
Peter Mogensen wrote:
Hi,
I've been going all documentation I can find (FAQ/bdb-docs..) and I still have some doubt whether I understand this correctly.
All of your questions are answered in the official BDB docs.
http://www.oracle.com/technology/documentation/berkeley-db/db/ref/transapp/a...
Well... yes... I suppose so, but as I said, they left me in doubt.
No, "db_recover -c" is for recovering from a catastrophic failure. It's not for creating a backup.
? When reading the docs it seems to me like db_recover -c is an integral part of making a hot backup??
From the BDB doc page above:
To minimize the archival space needed for log files when doing a hot backup, run db_archive to identify those log files which are not in use. Log files which are not in use do not need to be included when creating a hot backup, and you can discard them or move them aside for use with previous backups (whichever is appropriate), before beginning the hot backup. <<
Yes... but I thought that statement was contradicted by other statements like that deleting unused log files will make recovery impossible. What happens if your environment should crash after you have discarded these log files, but before you begin your hot backup ?
Could anyone list a step-by-step procedure to create a snapshot for backup and prune the log files from the active environment?
The docs/ref/transapp/archival.html file that SleepyCat bundles in the BerkeleyDB installation provides all the steps.
I've read that file several times and now again. Let me try to describe what I think I read then:
To perform a backup and prune unused logfiles from your active environment: ============= WARNING: Only my guess 1) Run "db_archive" on you active environment to identify unused log files. Copy them somewhere to keep while doing the backup. 2) Run "db_archive -s" to indentify database files and copy them to your backup location. 3) Run "db_archive -l" on you active environment to indentify all log files and copy them to your backup location. 4) Run "db_recover -c" on your backup to make it consistent. 5) Since the backup is offline you can safely delete the unused log files from it. ("db_archive -d") 6) The log files copied in step 1) can now safely be discarded so they don't exist anywhere - including the active environment.
Then it's my impression that in case the active environment should crash you should be able to continue from the backup + the logfiles from the active environment with minimal data loss ??? ============== End guess =========
I might have misunderstood a lot, but I tried to take into account all the hints and fragments of advice I've found in the docs to arrive at way to get rid (for good) of very old log files and only keeping backups of the dababases files with a few relevant logs. ... if this is at all possible?
regards, Peter