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 procedures to perform rolling upgrade-related tasks. All the procedures are executed at the current primary database, which eliminates the potential confusion of moving between remote databases to perform various upgrade operations.
If necessary, all the procedures can be re-called to resume the rolling upgrade after an error or interruption.
The package also provides a procedure that allows you to return a Data Guard configuration back to its original, pre-upgrade state in the event users wish to abandon the rolling upgrade.
The actual execution of a rolling upgrade has been reduced to three steps (excluding the upgrade of the database software itself and the on-disk setup of the new Oracle binaries). The number of steps remains the same regardless of the size of the Data Guard configuration.
Needless to say it will not be easy to produce demos with this package prior to being in a position to perform an upgrade ... which will require that one be released.
Either builds a complete upgrade plan or modifies the remaining unprocessed portion of an existing plan. The build procedure interprets the configured rolling upgrade parameters to produce a customized upgrade plan
Executes the FINISH phase instructions in the upgrade plan
-- called after the START_UPGRADE and SWITCHOVER phase instructions have completed, and the user has restarted the original primary and physical standbys of the primary on their higher version binaries.
Upon completion of this procedure, the original primary and its physical standbys will have completed recovery of the ugprade redo.
The first procedure that must be called to prepare for a DBMS_ROLLING administered rolling upgrade.
Communicates with the complete set of databases in the DG_CONFIG, and creates a default set of rolling upgrade parameters for building a rolling upgrade plans.
dbms_rolling.init_plan(future_primary IN VARCHAR2);
Rolls back the group of administered PDBs to their initial state. The package creates an initial set of guaranteed restore points for all participating PDBs.
This proc will flashback all PDBs in the leading change group to their respective restore points if the switchover has not been performed.
Called to set and unset rolling upgrade parameters. Changes to the plan parameters do not take effect until the user re-invokes the BUILD procedure to reconstruct the upgrade plan.
Overload 1
dbms_rolling.set_parameter(
scope IN VARCHAR2,
name IN VARCHAR2,
value IN VARCHAR2);
Parameter Name
Global
Description
Default
AFFINITY
No
Affinity of the standby database. Valid values are PRIMARY, TRANSIENT, or NONE.
A value of PRIMARY indicates that a standby will protect the primary database. A value of TRANSIENT indicates that a standby will protect the transient logical standby.
A value of NONE indicates that a standby will protect its current database but not be configured after the switchover.
PRIMARY
DBNAME
No
The DB_UNIQUE_NAME of a database in the configuration. This parameter is derived during execution of the INIT_PLAN procedure when the DG_CONFIG is parsed, and is not modifiable.
NULL
FAILOVER_EVENT
Yes
Automatically attempt to resolve parameters as a result of a failover event. Valid values are TRUE or FALSE.
FALSE
FUTURE_PRIMARY
Yes
The DB_UNIQUE_NAME of the future primary (transient logical standby).
NULL
FUTURE_VERSION
Yes
Target database version of the future primary.
NULL
IGNORE_BUILD_WARN
Yes
Ignore warnings which would otherwise raise exceptions during execution of the BUILD_PLAN procedure. Valid values are TRUE or FALSE.
TRUE
IGNORE_LAST_ERROR
Yes
Ignore last encountered error upon startup of next rolling upgrade operation. Valid values are TRUE or FALSE.
FALSE
INVOLVEMENT
No
Involvement level of the associated database. Valid values are MANDATORY, OPTIONAL, and NONE.
A value of MANDATORY indicates the database must participate in the rolling upgrade. A value of OPTIONAL indicates failures on a database will be tolerated. A value of NONE indicates a database will not be managed during the rolling upgrade.
MANDATORY
LOG_LEVEL
Yes
Logging level for the DBMS_ROLLING PL/SQL package. Valid values are NONE, MINIMAL, and FULL.
MINIMAL
ROLE
No
Database role associated with a given DB_UNIQUE_NAME.
This parameter is derived during the INIT_PLAN procedure, and must be manually set after a role change. Valid values are: PRIMARY, PHYSICAL, TRANSIENT, or LOGICAL.
NULL
SESSION_SHUTDOWN
Yes
Whether sessions should be shut down during switchover at the original primary.
If TRUE, then active sessions are immediately killed to expedite the switchover. Valid values are TRUE or FALSE.
TRUE
STATPOLL_INTERVAL
Yes
Seconds which must elapse before a new request is issued to gather statistics from a remote database. Value must be non-zero and is expressed in seconds.
5
SWITCH_PRIMARY_LAG
Yes
The apply lag limit, in seconds, at the transient logical standby.
If the apply lag goes below the specified value, then the DBMS_ROLLING.SWITCHOVER procedure is permitted to initiate a switchover. Value must be non-zero and expressed in seconds.
600
SWITCH_TRANSIENT_LAG
Yes
The apply lag limit, in seconds, between the transient logical standby and physicals of the transient logical standby.
If the apply lag goes below the specified value, then the DBMS_ROLLING.SWITCHOVER procedure is permitted to initiate a switchover. Must be non-zero.
3600
SWITCH_LAG_TIMEOUT
Yes
The number of minutes to wait before raising an error due to SWITCH_PRIMARY_LAG or SWITCH_TRANSIENT_LAG not being reached. Value must be non-zero and expressed in seconds.
1800
SWITCH_IMMEDIATE
Yes
Switchover should not wait for apply lag to drop below SWITCH_PRIMARY_LAG or SWITCH_TRANSIENT_LAG during switchover. Valid values are TRUE or FALSE.
Executes the START phase instructions in the upgrade plan. It is the first procedure that is called to initiate the rolling upgrade. Upon completion of this phase, the future primary will be ready to be upgraded.
Executes the SWITCHOVER phase instructions in the upgrade plan. It is called once the START procedure has completed execution of all START phase instructions.
SELECT COUNT(dbun) ROLLING_PARTICIPANTS
FROM dba_rolling_databases
WHERE participant = 'YES';
Get the number of physicals of the original primary
SELECT COUNT(scope) ORIG_PRIMARIES
FROM dba_rolling_parameters
WHERE name = 'PROTECTS'
AND curval = 'PRIMARY'
AND scope IN (
SELECT dbun
FROM dba_rolling_databases
WHERE participant = 'YES'
AND role = 'PHYSICAL');
Get the number of physicals of the future primary
SELECT COUNT(scope) FUTURE_PRIMARIES
FROM dba_rolling_parameters
WHERE name = 'PROTECTS'
AND curval = 'TRANSIENT'
AND scope IN (
SELECT dbun
FROM dba_rolling_databases
WHERE participant = 'YES'
AND role = 'PHYSICAL');
Get the number of logical standbys
SELECT COUNT(dbun) LOGICAL_STANDBYS
FROM dba_rolling_databases
WHERE participant = 'YES'
AND role = 'LOGICAL'
AND dbun != (
SELECT future_primary
FROM dba_rolling_status);
Get number of Far Sync Standbys
SELECT COUNT(*) FAR_SYNC_STANDBYS
FROM v$archive_dest_status
WHERE status = 'VALID'
AND type = 'FAR SYNC';