To maintain the integrity of your data when you use dbtran to translate multiple transaction logs, you must specify both the -m and -n options. The -m option instructs the Log Translation utility (dblog) to generate a file (named by -n) containing all the transactions from the logs in the specified directory.
You need to use -m because any transactions that span transaction log files could be rolled back if you translate each log individually using dbtran. When dbtran translates a log, it adds a ROLLBACK statement to the end of the log to undo any uncommitted transactions. In cases where a transaction spans two logs, the COMMIT for the transaction occurs in the second log file. Operations at the end of the first log file would be rolled back by dbtran because the file does not contain a COMMIT for the transaction. Translating all the transaction log files in a directory using -m ensures that all of your transactions are translated. See Transaction Log utility (dblog).
Run the Log Translation utility (dbtran) against the directory containing the transaction log files and output the resulting SQL statements into a .sql file.
Start the backup copy of your database.
Apply the .sql file generated by dbtran in step 1 to the backup copy of your database from Interactive SQL.
The following example uses the dbtran utility to apply the backup and current transaction logs to the backup copy of the database.
Run the Log Translation utility against the c:|backup directory and output the SQL statements into a file called recoverylog.sql:
dbtran -m "c:\backup" -n recoverylog.sql
Start the backup copy of the database called backupdemo.db:
Apply the recoverylog.sql file to the database from Interactive SQL:
dbisql -c "UID=DBA;PWD=sql;ENG=backupdemo" READ recoverylog.sql
|Discuss this page in DocCommentXchange.
Send feedback about this page using email.
|Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1|