Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Remote » Administering SQL Remote » Transaction log and backup management » Recovery from database media failure for consolidated databases

Recovery from database media failure for consolidated databases Next Page

Recovery with a single transaction log

The following steps assume that there is a single transaction log file, which has existed since the database was created. They also assume that previous backups of the database file have been made and are available, for example on tape.

To recover the database
  1. Make a copy of the database and log file.

  2. Restore the database (.db) file, not the log file, from tape into a temporary directory.

  3. Start the database using the existing transaction log and the -a option, to apply the transactions and bring the database file up to date.

  4. Start the database in your normal way.

    Any new activity is appended to the current transaction log.

The transaction log operations are applied to the database.

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 that is mirrored to d:\mirdir\consol.mlg.

To recover from media failure on the C drive
  1. Back up the mirrored transaction log d:\mirdir\consol.mlg.

  2. Replace the failed hardware and re-install all affected software.

  3. Create a temporary directory to perform the recovery in (for example, c:\recover).

  4. Restore the most recent backup of the database file, consol.db, to c:\recover\consol.db.

  5. Copy the mirror transaction log, d:\mirdir\consol.mlg, to the recovery directory with a .log extension, giving c:\recover\consol.log.

  6. Start the database using the following command:

    dbeng10 -a c:\recover\consol.log C:\recover\consol.db
  7. Shut down the database server.

  8. Back up the recovered database and transaction log from c:\recover.

  9. Copy the files from c:\recover to the appropriate production directories:

  10. Restart your system normally.