Contents Index Recovery with a single transaction log Backup procedures at remote databases

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

Recovery with multiple transaction logs

If you have a set of transaction logs, the procedure is different. We assume 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. In the temporary directory, start the database, applying the old logs using the -a option, applying the named transaction logs in the correct order.

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

  5. Start the database in your normal way. Any new activity will be appended to the current transaction log.

Example 

Suppose you have a consolidated database file named c:\dbdir\cons.db. The transaction log file c:\dbdir\cons.log is mirrored to d:\mirdir\cons.mlg.

Assume that you perform full backups weekly, and you perform incremental backups daily using the following command:

dbbackup -c "uid=DBA;pwd=SQL" -r -t E:\BACKDIR

This command backs up the transaction log cons.log to the directory e:\backdir. The transaction log file is then renamed to datexx.log, where date is the current date and xx is the next set of letters in sequence, and a new transaction log is started. The directory e:\backdir is then backed up using a third-party utility.

In this scenario you would be running the Message Agent with the optional directory to point to the renamed transaction log files. The Message Agent command line would be

dbremote -c "uid=DBA;pwd=SQL" C:\DBDIR

On the third day following the weekly backup the database file gets corrupted because of a bad disk block.

To recover from media failure on the C drive

  1. Backup the mirrored transaction log d:\mirdir\cons.mlg.

  2. Create a temporary directory to perform the recovery in. We will call it c:\recover.

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

  4. Apply the renamed transaction logs in order, as follows

    dbeng9 -a C:\DBDIR\date00.LOG C:\RECOVER\CONS.DB
    dbeng9 -a C:\DBDIR\date01.LOG C:\RECOVER\CONS.DB
  5. Copy the current transaction log, c:\dbdir\cons.log to the recovery directory, giving c:\recover\cons.log.

  6. Start the database using the following command:

    dbeng9 C:\RECOVER\CONS.DB
  7. Shutdown the database server.

  8. Backup 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 as normal.


Contents Index Recovery with a single transaction log Backup procedures at remote databases