 |
|
log_archive_dest valid_for Tips
Oracle Database Tips by Donald BurlesonDecember 19, 2015
|
Oracle Data Guard - VALID_FOR Attribute
One method of approaching this challenge was by
using the symmetrical initialization parameter file as explained in
Chapter 3, "Implementing Standby Databases". Some DBAs keep two
versions of the initialization parameter file to cater different
database roles. Oracle10g has removed the need to alter the log
management related initialization parameters during role transition
by introducing a new attribute of the log_archive_dest_n
parameter called VALID_FOR. This attribute is defined using two
arguments redo_log_type and database_role as shown
below:
LOG_ARCHIVE_DEST_n='SERVICE=service_name
VALID_FOR=(redo_log_type,database_role)'
These two arguments identify the role of the
database specified by the log_archive_dest_n parameter and
the type of redo log file used at that destination.
-
The valid values of redo_log_type are
ONLINE_LOGFILE, STANDBY_LOGFILE and ALL_LOGFILES.
-
The second argument, database_role, can
take the value of the PRIMARY_ROLE, the STANDBY_ROLE or ALL_ROLES.
VALID_FOR Attribute
Combining these two arguments give nine
possible values for the attribute VALID_FOR. However, the
combination (STANDBY_LOGFILE, PRIMARY_ROLES) is not acceptable,
because there cannot be active standby redo log files on the primary
database. The default combination is (ALL_LOGFILES, ALL_ROLES). The
following snippet from the init.ora file shows an example of
the VALID_FOR attribute:
LOG_ARCHIVE_DEST_1='LOCATION=/oracle/appsdb/arch VALID_FOR=(ONLINE_LOGFILE,
ALL_ROLE)'
LOG_ARCHIVE_DEST_2='SERVICE=phystdydb VALID_FOR=(ONLINE_LOGFILE,
PRIMARY_ROLE)'
LOG_ARCHIVE_DEST_3='SERVICE=logstdbydb VALID_FOR=(ONLINE_LOGFILE,
PRIMARY_ROLE)'
LOG_ARCHIVE_DEST_4='LOCATION=/oracle/appsdb/archSRL VALID_FOR
(STANDBY_LOGFILE,STANDBY_ROLE)'
In the example given above,
log_archive_dest_1 is valid only for the primary database role
and the logical Oracle instance
role.
On the logical standby site, the redo data
generated from the logical Oracle instance
will be archived in this
location. It will not contain the archived standby redo log files.
On the physical standby site, this destination
will not play any part because the RFS process decides the archival
destination based on the standby_archive_dest parameter, and
the MRP uses the archived log files from this location.
log_archive_dest_2 and log_archive_dest_3 are only valid
when the database is operating in the primary role.
VALID_FOR Attribute
A proper Oracle Net configuration as detailed
in Chapter 3, "Implementing Standby Databases", is the key to the
seamless use of the VALID_FOR attribute during role transition.
log_archive_dest_4 is only valid if the standby databases have
standby redo log files configured.
Do not use (ALL_LOGFILES, ALL_ROLES)
for log archival destination that is a logical standby database.
This may overwrite the online log files local to the logical standby
database.
|