This procedure describes the steps for recovering from media failure if the only file that you lost is the database.
Make an extra backup copy of the current transaction log. Since the database file is unavailable, the transaction log contains the only record of the changes that have been made since the last backup.
Create a recovery directory to hold the files you use during recovery.
Copy the database file from the last full backup to the recovery directory.
Apply the transactions held in the backed up transaction logs to the recovery database. Use one of the following methods.
To apply each transaction log manually, for each log file, chronologically, do the following:
Copy the log file into the recovery directory.
Start the database server with the apply transaction log (-a) option, to apply the transaction log:
dbeng12 database-name.db -a log-name.log |
The database server shuts down automatically once the transactions are applied.
Once you have applied all the backed up transaction logs, copy the online transaction log into the recovery directory.
Apply the transactions from the online transaction log to the recovery database.
dbeng12 database-name.db -a log-name.log |
If you want the database server to determine the correct order of the transaction logs and apply them automatically, do the following:
Copy the offline and online transaction log files into the recovery directory.
Start the database server with the -ad option, to specify the location of the transaction logs. The database server determines the correct order in which to apply the transaction logs based on the log offsets:
dbeng12 database-name.db -ad log-directory |
The database server shuts down automatically once the transactions are applied.
Perform validity checks on the recovery database.
See Validate a database.
Make a backup.
Move the database file to the production directory.
Notify users that they can access the production database.
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |