Database Design Issues [ ALLBASE/Replicate User's Guide ] MPE/iX 5.0 Documentation
ALLBASE/Replicate User's Guide
Database Design Issues
As you design the DBEnvironments to use with ALLBASE/Replicate, consider
additional issues beyond those considered for other environments. This
may be easy when one entire master DBEnvironment is being replicated to a
dedicated slave, however with more complex configurations there are
additional issues.
If you are replicating an entire DBEnvironment to a dedicated slave, you
can use the DDL audit elements (DEFINITION, STORAGE, AUTHORIZATION,
SECTION, or ALL) to replicate changes in the structure of the master
DBEnvironment to the slave.
If you are replicating a subset of a master DBEnvironment to a slave, you
may not use the DDL audit elements. You must develop applications or
organizational procedures to insure that changes made to the master
DBEnvironment(s) are made to the slave when needed. (See the section,
"Manually Replicated DDL Activities -- Timing Issues," in chapter 5.)
Partition design needs to be included in a careful database design.
Consider whether a dedicated slave should have the same partitions as the
master to facilitate switchover in case of failure of the master. Design
partition schemas that will facilitate switchover from master to slave in
more complicated configurations.
Design Issues for User Written Applications
You may design applications that run against the master DBEnvironment,
but can easily be switched to the slave in the event that the master
fails. They can be switched back when the master is again in service.
This may be easy in the configuration where one entire DBEnvironment is
being replicated to a dedicated slave. However, this may require careful
design for more complex configurations. There may be several possible
slaves. Maybe only a subset of a master is being replicated to a slave
that is consolidating subsets of information from several master
DBEnvironments.
[REV BEG]
You might design your application to test environment variables, check
error messages to trigger the switch, or to require the user to manually
switch to another DBEnvironment.[REV END]
Using the START DBE NEW Statement
Options that control the generation of audit log records need to be
specified for both DBEnvironments. You can perform this task for each
DBEnvironment with the ALLBASE/SQL START DBE NEW statement.
The six ALLBASE/Replicate DBEnvironment-wide options that pertain to
audit logging are listed below. The AUDIT LOG parameter causes the other
five parameters to be in effect. If you do not also specify the AUDIT
LOG parameter, when you enter any of the other five, audit logging is not
in effect. You can specify the needed parameters in START DBE NEW, but
delay the production of audit log records (until after you have created
the DBEnvironment) by omitting AUDIT LOG from the START DBE NEW
statement, and including it in the START DBE NEWLOG statement.
AUDIT LOG causes the ALLBASE/Replicate parameters listed
below to be in effect. This option actually
enables audit logging on the DBEnvironment.
AUDIT NAME identifies the DBEnvironment where the
transaction originated in the log file.
DEFAULT PARTITION identifies the default partition number in the
DBEnvironment.
COMMENT PARTITION identifies the comment partition number that is
used when a LOG COMMENT statement is executed
against the DBEnvironment.
MAXPARTITIONS specifies the maximum possible number of
partitions in an ALLBASE/Replicate system.
AUDIT ELEMENTS specifies the ALLBASE/SQL statement types to be
replicated:
CHECKPOINT causes an SCR to be
maintained with transaction
information in memory for
each partition with at
least one committed
transaction.
COMMENT allows use of the LOG
COMMENT statement that
generates a comment audit
log record.
DATA generates audit log records
for inserts, updates, and
deletes to user tables; the
default.
DEFINITION generates audit log records
for DDL statements. For
example, creating and
dropping tables.
STORAGE generates audit log records
for file and storage
statements. For example,
creating DBEFiles.
AUTHORIZATION generates audit log records
for authorization
statements. For example,
granting and revoking
privileges.
SECTION generates audit log records
for the creation and
deletion of permanent
sections.
ALL specifies generation of
audit log records for all
audit elements.
The master and slave DBEnvironments must each have a unique AUDIT NAME.
The other required ALLBASE/Replicate options are DEFAULT PARTITION and
MAXPARTITIONS. Chose the value specified for MAXPARTITIONS based on the
audit logging or replicating activity a DBEnvironment performs. An SCR
array element is not created for a partition until a transaction in that
partition is committed. COMMENT PARTITION and AUDIT ELEMENTS are
optional.
The full description of the AUDIT ELEMENTS options are in the
descriptions of the START DBE NEW and START DBE NEWLOG in chapter 6,
"ALLBASE/Replicate Statement Syntax Reference." AUDIT ELEMENTS defaults
to DATA AUDIT ELEMENTS if not specified. DATA AUDIT ELEMENTS specifies
that statements that change data (INSERT, UPDATE, and DELETE) are
replicated. Specifying other AUDIT ELEMENTS causes other statement types
to generate audit log records. DEFINITION, STORAGE, AUTHORIZATION, and
SECTION AUDIT ELEMENTS should only be specified if slave DBEnvironment
has the same schema as the master.
MPE/iX 5.0 Documentation