Auditing the Transaction Log

Examining the Transaction Log should form part of the testing of almost any program that updates a DP4 database. It can also prove very useful when trying to track down problems in a live system.

The transaction log records each database transaction since the last backup, provided that you have transaction logging switched on in your system setup. You can use the Transaction log auditor utility (AUDITOR) to view the information.

You can also view before-images of amended records, provided you enable the Record "before-images" option in Console/Transaction Logging.

  1. On the DP4 System menu, select the Backup and Recovery option

  2. On the Database Backup, Recovery and Check menu, select the Auditor option. The Transaction Log Audit menu is displayed

  3. Select the File option, and enter the database name. Enter the Log file path, as in this example

    Transaction log audit   Database         SALESORD    Search table                                   
    Log file path D:\DP4\DB\

    The transaction log entries are displayed. For example:

    In this screen, the keys you can use are:

    Keys Action

    <Cursor>

    Moves between the entries

    <End>

    Moves to the bottom of the current screen

    <End> twice

    Moves to the end of the list

    <V>

    Selects the View option to toggle between three modes of viewing the transaction log:

    • Multi-record display showing transaction log entries
    • Single-record display with field headings, which allows you to view the 'amended'/'before image' of a table record
    • Single-record display as previously, but displays fieldnames instead of field headings. (You need to know the fieldnames for formulas in conditional searches)

    <S>

    Selects the Search option to specify the table whose entries you wish to browse using the Last and Next options

    <C>

    Selects the Cond option to apply a condition for searching the search table

    <N>

    Selects the Next option to move to the next entry for the search table

    <L>

    Selects the Last option to move to the previous entry for the search table


    The standard information format is explained here:

    Column Description
    Number

    The number of the action in the log file. You can go directly to a transaction record using the action bar Goto option

    Process number

    The process number of program that initiated the transaction. These are not automatically tied to user names. However if you include the username information in at least one database update you will be able to tie process numbers to particular users.

    Action

    The action description

    Table

    The table affected by the change

    Date and time

    The date and time of the action


  4. Move to a transaction log action line and press <V> to view the amended or 'before-state' of the record. The field headings are displayed on the left, and the record content is displayed on the right

Searching For Log Entries

To find all the transactions made on a particular table:

  1. Select the Search option

  2. Enter the name of the table to be searched and press <Enter>

Use the <Next> and <Last> options to browse through the log entries of the table, relative to your current position

Conditional Searches

You can further refine table searches by applying a condition to the search table:

  1. With a search table selected, select the Cond option and enter the search condition. For example, if the search table is CUSTOMER, to find customers belonging to the East Anglian region, enter:
    region_code._="ANG"

    If you are unsure about the names of fields, use the View option to toggle the display

  2. Use the <Next> and <Last> options to browse the records that meet the condition