Difference between revisions of "SET JOURNAL"
|Line 63:||Line 63:|
Latest revision as of 09:18, 31 March 2015
Enable after image journaling and audit trail for the active table
SET JOURNAL TO [<.dbj filename> | (<expC>)]
SET JOURNAL ON | OFF | (<expL>)
The SET JOURNAL TO <.dbj filename> associates a transaction journal file with the active table. If the specified journal file does not exist, it will be created. The filename can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename. If no file extension is specified, ’.dbj’ is used. The <.dbj filename> is a standard table. It contains seven fields that are specific to a journal file, followed by the first 249 fields of the associated table.
The first seven fields in the journal are:
|AUD_DATE||Date||10||4||The date on which the transaction was performed.|
|AUD_TIME||Character||8||8||The time at which the transaction was performed, in the format HH:MM:SS.|
|AUD_TERM||Character||12||12||The name of the terminal from which the transaction was performed|
|AUD_UID||Short||5||2||The ID of the user who performed the transaction.|
|AUD_GID||Short||5||2||The group ID of the user who performed the transaction.|
|AUD_CMD||Short||4||2||The command number of the transaction performed from the command table below|
|AUD_RECNO||Integer||7||4||The record number in the associated table which the transaction was performed on.|
The SET JOURNAL TO command without a <.dbj filename> specified closes the active journal file. The SET JOURNAL ON | OFF command enables or disables transaction journaling. This command is primarily used in applications where journaling can be disabled for a certain class of operations. The journaling features are mainly used with shared tables. It should be noted that there is an overhead in enabling transaction journaling, as records updated in a table are also written to the journal file.
When records are appended into a journal file, locking is automatically performed so that multiple users can update the journal concurrently. The associated table must be opened shareable for this to occur. Each table can have a journal file associated with it. Since journal files are standard Recital tables, you can use standard Recital commands such as the REPORT command to print audit trails, transaction logs, etc.
The RECOVER command works in conjunction with the SET JOURNAL TO <.dbj filename> command to recover after a fatal disk error. See the RECOVER command for full details. For RECOVER to work successfully, all journal files should be removed with the DELETE or ZAP commands after making backups of the tables.
When specifying a journal file, it is recommended that the journal file is stored on a different disk than that which the table is stored on, so that if a fatal disk error occurs, then the journal file will not be lost along with the table. By default, JOURNAL is OFF.
NOTE: Only the first 249 fields of a table can be journalled: subsequent fields are ignored.
// Open journal file set exclusive off use payroll set journal to payroll
Recital Server, Recital