Difference between revisions of "SET JOURNAL"

From Recital Documentation Wiki
Jump to: navigation, search
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
Table Organization
 
 
 
 
==Purpose==
 
==Purpose==
 
Enable after image journaling and audit trail for the active table
 
Enable after image journaling and audit trail for the active table
Line 23: Line 19:
  
  
{| class="wikitable"
+
{| class="wikitable"  width="100%"
 
!Field||Type||Display ||Storage||Description
 
!Field||Type||Display ||Storage||Description
 
|-
 
|-
Line 43: Line 39:
  
  
{| class="wikitable"
+
====AUD_CMD====
 +
 
 +
{| class="wikitable"  width="100%"
 
!Command||Number
 
!Command||Number
 
|-
 
|-
|DELETE||14
+
|APPEND||5
|-
+
|RECALL||36
+
|-
+
|REPLACE||41
+
 
|-
 
|-
 
|BROWSE||6
 
|BROWSE||6
 
|-
 
|-
 
|CHANGE||8
 
|CHANGE||8
 +
|-
 +
|DELETE||14
 
|-
 
|-
 
|EDIT||17
 
|EDIT||17
 
|-
 
|-
 
|INSERT||26
 
|INSERT||26
|-
 
|APPEND||5
 
 
|-
 
|-
 
|READ||35
 
|READ||35
 +
|-
 +
|RECALL||36
 +
|-
 +
|REPLACE||41
 +
|-
 +
|BLANK||91
 +
|-
 +
|SQL DELETE||5022
 +
|-
 +
|SQL INSERT||5042
 +
|-
 +
|SQL UPDATE||5082
 
|-
 
|-
 
|}
 
|}
Line 79: Line 85:
  
 
==Example==
 
==Example==
<pre>
+
<code lang="recital">
 
// Open journal file
 
// Open journal file
 
set exclusive off
 
set exclusive off
 
use payroll
 
use payroll
set journal to payroll</pre>
+
set journal to payroll</code>
  
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 
[[Category:Set_Commands|JOURNAL]]
 
[[Category:Set_Commands|JOURNAL]]

Latest revision as of 09:18, 31 March 2015

Purpose

Enable after image journaling and audit trail for the active table


Syntax

SET JOURNAL TO [<.dbj filename> | (<expC>)]

SET JOURNAL ON | OFF | (<expL>)


See Also

COPY FILE, DELETE, RECOVER, SET MEMOEXT, SET MEMOJOURNAL, ZAP


Description

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:


Field Type Display Storage Description
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.


AUD_CMD

Command Number
APPEND 5
BROWSE 6
CHANGE 8
DELETE 14
EDIT 17
INSERT 26
READ 35
RECALL 36
REPLACE 41
BLANK 91
SQL DELETE 5022
SQL INSERT 5042
SQL UPDATE 5082


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.


Example

// Open journal file
set exclusive off
use payroll
set journal to payroll


Products

Recital Server, Recital