HP 3000 Manuals

Audit Elements [ ALLBASE/Replicate User's Guide ] MPE/iX 5.0 Documentation


ALLBASE/Replicate User's Guide

Audit Elements 

ALLBASE/Replicate not only allows you to specify what tables will be
replicated and to where, it also allows you to specify what types of
transactions will generate audit log records for replication.

If you want to see where these elements are used in the START DBE NEW and
START DBE NEWLOG statements, see Figure 2-3  and Figure 2-4  in the
section, "ALLBASE/SQL Statements that Support ALLBASE/Replicate," later
in this chapter.

The type of database activity that will generate audit records is
controlled by the use of AUDIT ELEMENTS that are specified in the START
DBE NEW or START DBE NEWLOG statements.[REV BEG] Once set, these AUDIT
ELEMENTS can be changed using the START DBE NEWLOG statement.[REV END]

The audit elements that may be specified are:  CHECKPOINT, COMMENT, DATA,
DEFINITION, STORAGE, AUTHORIZATION, SECTION, and ALL.

CHECKPOINT 

   *   The CHECKPOINT audit element is necessary for both master and
       slave ALLBASE/Replicate DBEnvironments.  It causes the generation
       of data structures (Synchronization Checkpoint Record Array (SCR 
       Array) that are used to record, on both master and slave, the
       transaction identifier for the most recently committed transaction
       in each partition.  This information is used to insure that all
       transactions committed on the master are sequentially committed on
       the slave, without losing any transactions in the process.
       (Synchronization Checkpoint Records, or SCRs, are discussed in
       detail later.)

   *   On the slave, the CHECKPOINT element is the only audit element
       required if operating only in slave mode (there is no master
       activity in the DBEnvironment).  It must be explicitly specified
       in the START DBE NEW or START DBE NEWLOG statement.[REV BEG] The
       SCR is updated by applied transactions, but no audit log records
       are generated if CHECKPOINT is the only audit element specified.
       Use only the CHECKPOINT audit element for DBEnvironments that are
       used only as slaves.[REV END]

One or more of the following audit elements may also be specified on the
master (or on a DBEnvironment acting as both slave and master), and, if
they are, the CHECKPOINT element is automatically placed into effect.

COMMENT 

   *   Specify the COMMENT audit element if you want to use the LOG
       COMMENT statement for placing user comments in the log file during
       audit logging.  For example, you might audit all changes made by a
       particular user.  An error message will be generated if you use
       the LOG COMMENT statement without specifying the COMMENT audit
       element.

   *   Specify the CommentPartitionNumber in the appropriate START DBE
       statement to enable comment logging.

DATA 

   *   The DATA audit element must be used, explicitly or implicitly, in
       all master ALLBASE/Replicate DBEnvironments.  When DATA is
       specified, all ALLBASE/SQL INSERT, UPDATE, and DELETE statements
       executed against all specified partitions will generate audit log
       records.  Audit records will be generated for transactions
       executed against tables in the NONE partition, but they will not
       be replicated.

   *   The DATA audit element is implicitly enabled by default if the
       AUDIT LOG parameter is specified in the START DBE or START DBE NEW
       statement, and no audit elements are specified in the AUDIT
       ELEMENTS clause.

The following audit elements are useful only if you want audit log
records generated for DDL (Data Definition Language) statements.  DDL
statements are those that change the actual structure of the
DBEnvironment.

   *   The DEFINITION audit element generates audit log records for all
       DDL statements executed against the DBEnvironment which create,
       alter or destroy database objects, such as CREATE TABLE, CREATE
       INDEX, and ALTER TABLE.

   *   The STORAGE audit element generates audit log records for
       statements allocating storage, such as CREATE DBEFILESET and
       CREATE DBEFILE statements.

   *   The AUTHORIZATION audit element generates audit log records for
       all statements granting or revoking privileges such as granting
       SELECT authorization for a table to a user.
       [REV BEG]

   *   The SECTION audit element generates audit log records for
       statements that create or delete permanent sections, such as those
       generated when you are preprocessing a program.[REV END]

   *   The ALL audit element causes the generation of audit log records
       for all of the above described audit elements.

The scope of these elements is DBEnvironment wide.  All specified
structural changes generate audit log records, regardless of the
partition.  Therefore, these audit elements are only useful in cases
where you are replicating an entire master DBEnvironment to a dedicated
slave DBEnvironment.

If you are replicating only a subset of a DBEnvironment, these elements
could cause log records to be generated for changes to structures that
would be of no interest to the slave DBEnvironment.  However, if you do
not specify these elements, you are responsible for ensuring that changes
to the structure of the portions of the master DBEnvironment you are
replicating, are somehow duplicated on the slave.  If using two-way
replication (previously described in configuration 4), you must be sure
that any DDL changes made to one DBEnvironment are immediately made to
the other DBEnvironment.  This is a user-defined process that you must
develop for your own environment.  The timing of the manually entered DDL
changes is important.  See the section, "Manually Replicated DDL
Activities -- Timing Issues," in chapter 5.



MPE/iX 5.0 Documentation