Contents IndexThe ISQL utility The Open Server Gateway

User's Guide
   Part VI. SQL Anywhere Reference
     Chapter 39. SQL Anywhere Components
      The Log Translation utility

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:

Top of page


Translating a transaction log in Sybase Central

To translate a transaction log into a command file:

  1. Open the Database Utilities folder in the left panel.
  2. Double-click Translate Log in the right panel. The Translate Log Wizard is displayed
  3. Follow the instructions in the Wizard.

Top of page


Translating a transaction log from the ISQL Database Tools window

To use the Log Translation utility from the ISQL Database Tools window:

  1. Select Database Tools from the Window menu.
  2. Click Translate Transaction Log to SQL on the Tools list.
  3. Enter the transaction log filename (with path).
  4. Click Translate, and select from the options in the dialog.
  5. Click OK to translate the selected transaction log file to a SQL command file.

Top of page


Translating a transaction log using the DBTOOL statement

Syntax

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 ]

Top of page


The DBTRAN command-line utility

Syntax

     dbtran[switches] transaction-log [sql-log]

Windows 3.x syntax

     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".

Top of page


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.

Top of page


Contents IndexThe ISQL utility The Open Server Gateway