ACE Director Alum Daniel Morgan, founder of Morgan's Library, is scheduling
complimentary technical Workshops on Database Security for the first 30
Oracle Database customers located anywhere in North America, EMEA, LATAM, or
APAC that send an email to
asra_us@oracle.com. Request a Workshop for
your organization today.
Purpose
Provides subprograms for configuring and managing a Data Guard Logical Standby database
Sets the values of various parameters that configure and maintain SQL Apply
dbms_logstdby.apply_set(
inname IN VARCHAR,
value IN VARCHAR);
Parameter
Description
APPLY_SERVERS
The number of APPLIER processes used to apply changes
DEST_ALL
Recorded all events in DBA_LOGSTDBY_EVENTS and in alert log
DEST_EVENTS_TABLE
All events that contain information about user data will be recorded only in the DBA_LOGSTDBY_EVENTS view
LOG_AUTO_DEL_RETENTION_TARGET
Only meaningful if LOG_AUTO_DELETE has been set to TRUE. The value you supply for this parameter controls how long (in minutes) a remote archived log that is received
from the primary database will be retained at the logical standby database once all redo records contained in the log have been applied at the logical standby database. The default value is 1440 minutes.
LOG_AUTO_DELETE
Automatically deletes archived redo log files once they have been applied on the logical standby database
MAX_EVENTS_RECORDED
Number of recent events that will be visible through the DBA_LOGSTDBY_EVENTS view.
To record all events encountered by SQL Apply, use the DBMS_LOGSTDBY.MAX_EVENTS constant as the number value. The default value is 10,000.
MAX_SERVERS
Number of processes that SQL Apply uses to read and apply redo. The default value is 9. The maximum number allowed is 2048.
MAX_SGA
Number of megabytes from shared pool in System Global Area (SGA) that SQL Apply will use.
The default value is 30 megabytes or one quarter of the value set for SHARED_POOL_SIZE, whichever is lower. The maximum size allowed is 4095 megabytes.
PREPARE_SERVERS
Controls the number of PREPARER processes used to prepare changes.
The maximum number allowed is 1024, provided the MAX_SERVERS parameter is set to accommodate this.
PRESERVE_COMMIT_ORDER
TRUE: Transaction are applied to the logical standby database in the exact order in which they were committed on the primary database. This is the default parameter setting.
FALSE: Transactions are applied out of order from how they were committed on the primary database, and no attempt is made to provide read-consistent results.
Regardless of the level chosen, modifications done to the same row are always applied in the same order as they happened in the primary database. See the Usage Notes for details and recommendations.
You cannot modify this parameter while SQL Apply is running.
RECORD_APPLIED_DDL
Controls whether DDL statements that have been applied to the logical standby database are recorded in the location specified by the EVENT_LOG_DEST parameter.Specify one of the following values:
TRUE: Indicates that DDL statements applied to the logical standby database are recorded in the DBA_LOGSTDBY_EVENTS table and the alert log.
FALSE: Indicates that applied DDL statements are not recorded. This is the default parameter setting.
RECORD_SKIP_DDL
Controls whether skipped DDL statements are recorded in the location specified by the EVENT_LOG_DEST parameter. Specify one of the following values:
TRUE: Skipped DDL statements are recorded in the DBA_LOGSTDBY_EVENTS table and the alert log. This is the default parameter setting.
FALSE: Skipped DDL statements are not recorded in the DBA_LOGSTDBY_EVENTS table and the alert log.
RECORD_SKIP_ERRORS
Controls whether skipped errors (as described by the SKIP_ERROR procedure) are recorded in the location specified by the EVENT_LOG_DEST parameter. Specify one of the following values:
TRUE: Skipped errors are recorded in the DBA_LOGSTDBY_EVENTS table and the alert log. This is the default parameter setting.
FALSE: Skipped errors are not recorded in the DBA_LOGSTDBY_EVENTS table and the alert log.
RECORD_UNSUPPORTED_OPERATIONS
Captures information about transactions running on the primary database that will not be supported by a logical standby database. This procedure records its information as events in the DBA_LOGSTDBY_EVENTS table.
For Extended Datatype Support on logical standby. By calling this procedure on the primary first and then the standby, tables with extended datatypes can be supported on a logical standby.
dbms_logstdby.eds_add_table(
table_owner IN VARCHAR2,
table_name IN VARCHAR2,
p_dblink IN VARCHAR2 DEFAULT NULL);
Enables or disables the automated EDS evolve infrastructure whereby EDS objects are automatically evolved in response to DDL done on an EDS-maintained table
dbms_logstdby.eds_evolve_automatic(options IN VARCHAR2); -- options are ENABLE/DISABLE
Extended Datatype Support on a logical standby. Can be invoked on the primary or the standby. If invoked on the primary, its actions will be replicated by way of an AUTO pragma.
If invoked from the standby it will only drop EDS on that standby.
dbms_logstdby.eds_remove_table(
table_owner IN VARCHAR2,
table_name IN VARCHAR2);
After failover ensures a local logical standby not involved in the failover has not processed more redo than the new primary database and reports the set of archive redo log files that must be replaced to ensure consistency
dbms_logstdby.prepare_for_new_primary(
former_standby_type IN VARCHAR2,
dblink IN VARCHAR2);
Records relevant metadata in the redo stream in case a database that has recently changed its role to a primary database following a failed failover operation
Specifies rules that control database operations that should not be applied to the logical standby database
dbms_logstdby.skip(
stmt IN VARCHAR2,
schema_name IN VARCHAR2 DEFAULT NULL,
object_name IN VARCHAR2 DEFAULT NULL,
proc_name IN VARCHAR2 DEFAULT NULL,
use_like IN BOOLEAN DEFAULT TRUE,
esc IN CHAR1 DEFAULT NULL);
CREATE OR REPLACE PROCEDURE sys.handle_tbs_ddl (
old_stmt IN VARCHAR2,
stmt_typ IN VARCHAR2,
schema IN VARCHAR2,
name IN VARCHAR2,
xidusn IN NUMBER,
xidslt IN NUMBER,
xidsqn IN NUMBER,
action OUT NUMBER,
new_stmt OUT VARCHAR2) AS
BEGIN
-- All primary file specification that contains a directory
-- /usr/orcl/primary/dbs should go to /usr/orcl/stdby directory
-- specification
new_stmt = REPLACE(old_stmt,'/usr/orcl/primary/dbs', '/usr/orcl/stdby');
action := DBMS_LOGSTDBY.SKIP_ACTION_REPLACE;
EXCEPTION
WHEN OTHERS THEN
action := dbms_logstdby.skip_action_error;
new_stmt := NULL;
END handle_tbs_ddl;
/
Specifies rules regarding what action to take upon encountering errors
dbms_logstdby.skip_error(
stmt IN VARCHAR2,
schema_name IN VARCHAR2 DEFAULT NULL,
object_name IN VARCHAR2 DEFAULT NULL,
proc_name IN VARCHAR2 DEFAULT NULL,
use_like IN BOOLEAN DEFAULT TRUE,
esc IN CHAR1 DEFAULT NULL); -- note: CHAR1 is not an error
CREATE OR REPLACE PROCEDURE handle_error_ddl(
old_stmt IN VARCHAR2,
stmt_type IN VARCHAR2,
schema IN VARCHAR2,
name IN VARCHAR2,
xidusn IN NUMBER,
xidslt IN NUMBER,
xidsqn IN NUMBER,
error IN VARCHAR2,
new_stmt OUT VARCHAR2) AS
BEGIN
-- default to what we already have
new_stmt := old_stmt;
-- ignore any GRANT errors on SYS or UWCLASS schemas
IF INSTR(UPPER(old_stmt),'GRANT') > 0 THEN
IF schema IS NULL
OR (schema IS NOT NULL AND (UPPER(schema) = 'SYS'
OR UPPER(schema) = 'UWCLASS') THEN
new_stmt := NULL;
-- record the fact that an error was skipped
NULL;
END IF;
END IF;
END handle_error_ddl;
/