Retrieving auditing information

You can use Sybase Central or the Log Translation utility (dbtran) to retrieve audit information from the transaction log. Before attempting to retrieve audit information, ensure that you are connected to your database as a user with DBA, Remote, or Backup authority.

To retrieve auditing information (Sybase Central)

  1. Select the database.

  2. Click the Auditing tab.

  3. Click Retrieve Audit Messages.

    A window appears displaying the dbtran messages. Ignore the warning about chronological ordered output.

  4. Click Close.

    The auditing information appears on the Auditing tab in the right pane.

  5. Use the filter options to control which audit information you want to display.

    You can choose to display all audit information, or to show only errors, or only audit messages containing the text you specify.

  6. Select an entry in the audit entries table to display details about the entry.

  7. To retrieve up-to-date auditing information, press F5, and then follow all of the previous steps.

For more information, see Auditing example.

Retrieving auditing information using the dbtran utility

You can access the dbtran utility from Sybase Central or from a command prompt. The dbtran utility uses the specified transaction log to produce a SQL script that contains all of the transactions, along with some information about what user executed each command. By using the -g option, dbtran includes more comments containing the auditing information. The -g option is equivalent to specifying the following options:

  • -d   Display output in chronological order.

  • -t   Include trigger-generated operations in the output.

  • -a   Include rolled back transactions in the output.

For more information about these options, see Log Translation utility (dbtran).

You can run the dbtran utility against a running database server or against a database log file.

To retrieve auditing information from a running database server

  • With the database server running, run the following command:

    dbtran -g -c connection-string -n SQL-file

    For example:

    dbtran -g -c "UID=DBA;PWD=sql" -n demo.sql

    A readable version of the transaction log is saved to your current directory. In the example, the auditing information is saved to the demo.sql file, and the file contains information about the sample database.

    For more information about connection strings, see Connection parameters.

To retrieve auditing information from a transaction log file

  1. Shut down the database server to ensure the transaction log file is available.

  2. Run the following command:

    dbtran -g transaction-log SQL-file

For example:

dbtran -g demo.log demo.sql

In the example, the auditing information from the transaction log file demo.log is placed into the file demo.sql.

For more information, see Log Translation utility (dbtran).