Running against a transaction log.
dbtran [ options ] transaction-log [ SQL-file ]
Running against a database server.
dbtran [ options ]
Option |
Description |
---|---|
–a |
Include uncommitted transactions |
–c "keyword=value; …" |
Supply database connection parameters—cannot be used with a transaction log name |
–d |
Display output in chronological order |
–ek key |
Specify encryption key |
–ep |
Prompt for encryption key |
–f |
Output only since the last checkpoint |
–g |
Include audit records in output |
–ir offset1,offset2 |
Include only the portion of the log between the two specified offsets |
–is source,… |
Include only rows originating from the specified sources |
–it user.table,… |
Include only operations on specified tables by specifying a comma-delimited list of user.table |
–j date/time |
Output from the last checkpoint prior to the given time |
–m |
Specify transaction logs
directory (requires |
–n filename |
Output SQL file, when used against a database server |
–o filename |
Log output messages to a file |
–q |
Run quietly, do not print messages |
–r |
Remove uncommitted transactions (default) |
–rsu username,… |
Override default Replication Server user names |
–s |
Produce ANSI standard SQL UPDATE transactions |
–sr |
Generate SQL Remote comments |
–t |
Include trigger-generated transactions in output |
–u userid,… |
Translate transactions for listed users only |
–x userid,… |
Exclude transactions for listed users |
–y |
Replace file without confirmation |
–z |
Include trigger-generated transactions as comments only |
Transaction-log |
Log file to be translated—cannot
be used together with |
SQL-file |
Output file containing the translated information—for use with transaction-log only |
The dbtran utility takes the information in a transaction log and places it as a set of SQL statements and comments into an output file. The utility can be run in the following ways:
Against
a database server Run in this way, the utility is a standard client application.
It connects to the database server using the connection string specified
following the -c
option,
and places output in a file specified with the -n
option. DBA authority is required to run in
this way.
The following command translates log information from the server asiqdemo and places the output in a file named asiqdemo.SQL.
dbtran -c "eng=asiqdemo;dbn=asiqdemo;uid=DBA;pwd=SQL" -n asiqdemo.sql
Against a transaction log file Run in this way, the utility acts directly against a transaction log file. You should protect your transaction log file from general access if you wish to prevent users from having the capability of running this statement.
dbtran asiqdemo.log asiqdemo.sql
When the dbtran utility runs, it displays the earliest log offset in the transaction log. This can be an effective method for determining the order in which multiple log files were generated.
Exit codes are 0 (success) or non-zero (failure).
For more information about the Log translation utility options, see “Log translation utility options”.
This utility accepts @filename parameters. For more information, see “Server command-line options”.