I've used dbbackup and dblog for quite awhile. Mostly to make copies of our main database for testing. Lately, I've run into an error when dblogging, "The database quit abnormally the last time it was used. Database recovery must be performed before proceeding." I've run into this error before but it just seemed to go away, say when I tried to run dblog the next day. Never worried about it. I've googled this error and reviewed some other questions related to dblog in this forum and I'm coming to understand that there is more to running a dbbackup/dblog sequence then just running that sequence. Such as using dbvalid at some point. Wondering if anyone could provide detail on properly running this sequence: dbbackup then dblog. Again, I'm using dbbackup and dblog to:
Appreciate the help. |
I think your backup command line is wrong, I would use dbbackup -c "dsn=xx" -r C:BackupDirectory -t is transaction log only for incremental backups in ASA9 I use -y -r -n -t -o "LogFileName" -c "Connection Parms" "Backup Directory" I wouldn't dblog -n the database, instead I would use -t without a path. Finally if you ever need to use this database to recover you won't be able to if you start it without it being set to read only. Jim |
What exactly are you using DBLOG for?
Note, in order to take backups, there absolutely no need to use DBLOG - if you just want to make a backup of the transaction log (and not of the database file), this can be done with DBBACKUP -t (in combination with further options to rename/truncate the existing log).
DBLOG is usually only necessary if you want to move the log to a different location, stop (or restart) using a log or stop (or restart) using a mirror log.
I run dbbackup as such: dbbackup -d -r -t -c "dsn=**" c:temp
This produces a db file and log file. The log file is still tied to the live database and directory. When I try to dbeng the database I get errors. So, I use dblog. When I dblog it says "was using [log file name and location] and is now not using [log file]". Then I can run dbeng.
I run dblog as such: dblog -n -ir -is c:tempdatabase.db
May it be that your transaction log file is specified with an absolute path within your database - what does "DBLOG Yourdatabase.db" reveal?
If it does contain an absolute (or relative) path but should stay within the same directory as the database file, then I would recommend to use DBLOG once to change the location of the log (to be specified just as a file name without a path). After that, your database should be startable in any arbitrary directory and should expect its log file just there.
I use a equal setup where the log file is on a separate disk/partition. I use this to reduce the file fragmentation on the db and the log files. When the database backup is finished my script automatically runs dblog to remove the log file path of the backup copy. These makes the handling easier.