Why not using SYSCS_UTIL.SYSCS_BACKUP_DATABASE? I have been using similar procedure in Cloudscape (derby's predecessor) for years and it creates consistent copy of the database.
What's worked for me (although anyone else feel free to correct me) is:
1) checkpoint the database by running SYSCS_UTIL.SYSCS_CHECKPOINT_DATABASE()
2) freeze the database by running SYSCS_UTIL.SYSCS_FREEZE_DATABASE()
3) copy your log files (_all_ files in log dir)
4) unfreeze the database by running SYSCS_UTIL.SYSCS_UNFREEZE_DATABASE()
#1 will flush cached data to disk
#2 will ensure that no write activity is taking place whilst you copy the files, so all should be consistent.
From: aspect1958 [mailto:firstname.lastname@example.org]
Sent: 30 June 2008 21:38
Subject: Backing up transactions logs
My issue is that I am trying to create a backup procedure that would limit my data loss exposure.
Currently a complete backup is performed each morning at 4:30am
The logs reside in the database under logs.
On the hour I am using system commands to copy the logs with the archive
flag set and the logctrl file, to the BackupDir/logs directory. On the
theory that my exposure to a disk crash is limited to 1 hour.
But when ever I attempt to recover the database with roll forward with "rollForwardRecoveryFrom='BackupDir'
I get a message like;
Page Page(9,Container(0, 144)) is at version 2,613,545, the log file contains change version 2,621,080, either there are log records of this page missing, or this page did not get written out to disk properly.
ij version 10.2
Is this a difference between the actual logs and the logctrl?
Is my only other option to move the log file location to 'BackupDir'
Thanks for any thoughts on this.
View this message in context: http://www.nabble.com/Backing-up-transactions-logs-tp18203847p18203847.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.