SQL Remote User's Guide
Administering SQL Remote for Adaptive Server Anywhere
Transaction log and backup management
Recovery from database media failure for consolidated databases
In this case, we assume that there is a single transaction log file, which has existed since the database was created. Also, we assume previous backups of the database file have been made and are available, for example on tape.
To recover the database
Make a copy of the database and log file.
Restore the database (.db) file, not the log file, from tape into a temporary directory.
Start the database using the existing transaction log and the -a
option, to apply the transactions and bring the database file up to date.
Start the database in your normal way. Any new activity will be appended to the current transaction log.
This example illustrates recovery using a mirrored transaction log.
Suppose you have a consolidated database file named consol.db in a directory c:\dbdir, and a transaction log file c:\logdir\consol.log which is mirrored to d:\mirdir\consol.mlg.
To recover from media failure on the C drive
Backup the mirrored transaction log d:\mirdir\consol.mlg.
Replace the failed hardware and re-install all affected software.
Create a temporary directory to perform the recovery in (for example, c:\recover)
Restore the most recent backup of the database file, consol.db, to c:\recover\consol.db.
Copy the mirror transaction log, d:\mirdir\consol.mlg, to the recovery directory with a .log extension, giving c:\recover\consol.log.
Start the database using the following command line:
dbeng9 -a C:\RECOVER\CONSOL.DB
Shutdown the database server.
Backup the recovered database and transaction log from c:\recover.
Copy the files from c:\recover to the appropriate production directories:
Copy c:\recover\consol.db to c:\dbdir\consol.db
Copy c:\recover\consol.log to c:\dbdir\consol.lOG, and to d:\mirdir\consol.mlg.
Restart your system normally.