With the Log Translation utility you can translate a transaction log into a SQL command file.
You can access the Log Translation utility in the following ways:
The syntax for the Log Translation utility from the ISQL DBTOOL statement is as follows:
DBTOOL TRANSLATE [ TRANSACTION ] LOG FROM logname
... [ TO sqlfile ] [ WITH ROLLBACKS ]
... | [ USERS u1, u2, ... , un ] |
| [ EXCLUDE USERS u1, u2, ... , un ] |
... [ LAST CHECKPOINT ] [ ANSI ] [ NOCONFIRM ]
dbtran[switches] transaction-log [sql-log]
dbtranw[switches] transaction-log [sql-log]
Switch | Description |
---|---|
-a | Include rollback transactions in output |
-f | Output from most recent transaction |
-jdate/time | Output from checkpoint prior to given date |
-r | Remove uncommitted transactions (default) |
-s | Produce ANSI standard SQL UPDATE transactions |
-t | Include trigger-generated transactions in output |
-uuserid,... | Translate transactions for listed users |
-xuserid,... | Exclude transactions for listed users |
-y | Replace file without confirmation |
-z | Include trigger-generated transactions as comments |
The sql-log filename defaults to the transaction log name with the extension SQL.
When the DBTRAN command-line utility is run, it displays the earliest log offset contained in the transaction log being translated. This can be an effective method for determining the order in which multiple log files where generated.
For more information about log offset numbers please see "The SQL Remote message tracking system"
For more information about the command-line switches, see "Log translation utility options".
Include uncommitted transactions (-a ) The transaction log contains any changes made before the most recent COMMIT by ANY transaction. Changes made after the most recent commit are not present in the transaction log.
Translate from last checkpoint only (-f ) Only those transactions completed since the last checkpoint are translated.
Output from checkpoint prior to given date (-j ) Only transactions from the most recent checkpoint prior to the given date and/or time are translated. The user-provided argument can be a date, time or date and time enclosed in quotes. If the time is omitted, the time is assumed to be the beginning of the day of the given date. If the date is omitted, the current day is assumed. The following is an acceptable format for the date and time: "YY/MMM/DD HH:MM". line switch.
Do not include uncommitted transactions (-r ) Remove any transactions that were not committed and the default operation.
Generate ANSI standard SQL UPDATE (-s ) For cases where there is no primary key or unique index on a table, the Translation utility generates UPDATE statements with a non-standard FIRST keyword, in case of duplicate rows. The ANSI standard UPDATE flag does not output this keyword.
Include transactions generated by triggers (-t ) By default, actions carried out by triggers are not included in the command file. If the matching trigger is in place in the database, then when the command file is run against the database, the trigger will carry out the actions automatically. Trigger actions should be included in the case that the matching trigger does not exist in the database against which the command file is to be run.
Translate transactions for listed users only (-u )
Translate transactions except for listed users (-x )
Operate without confirming actions (-y ) Without this option, you are prompted to confirm the replacement of an existing command file.
Include transactions generated by triggers as comments only (-z ) Transactions generated by triggers will be included only as comments in the output file.