DBMS_DG

The DBMS_DG package gives you tools to manage Oracle Data Guard broker configurations programmatically.

With procedures for creating, modifying, and removing configurations, handling failover and switchover, setting properties, and monitoring health, you can automate routine Data Guard tasks using scripts and custom tools.

In addition, there is also functionality to allow applications to notify the primary database or the fast-start failover target database in an Oracle Data Guard broker environment to initiate a fast-start failover when the application encounters a condition that warrants a failover.

This chapter contains the following topics:

Note: A multitenant container database is the only supported architecture in Oracle Database 21c and later releases. While the documentation is being revised, legacy terminology may persist. In most cases, “database” and “non-CDB” refer to a CDB or PDB, depending on context. In some contexts, such as upgrades, “non-CDB” refers to a non-CDB from a previous release.

Note: If you are working in a multitenant container database (CDB), then functions within DBMS_DG are only executed at the root level. Ensure you are connected at the root level, not at the individual pluggable database (PDB) level.

See Also: Oracle Data Guard Broker

DBMS_DG Security Model

The DBMS_DG package runs with invoker’s rights and requires the SYSDBA privilege.

Oracle Data Guard DBMS_DG API Summary

The Oracle Data Guard DBMS_DG APIs allow you to manage a broker configuration.

Table 1 DBMS_DG API Summary

API Effect
ADD_DATABASE Adds a standby database to the Data Guard broker configuration.
ADD_FAR_SYNC Adds a far sync instance to the Data Guard broker configuration.
ADD_RECOVERY_APPLIANCE Adds a Zero Data Loss Recovery Appliance to the Data Guard broker configuration.
CONVERT_TO_PHYSICAL Used to convert a snapshot standby database to a physical standby database.
CONVERT_TO_SNAPSHOT Converts a snapshot standby database to a physical standby database.
CREATE_CONFIGURATION Used to create a Data Guard broker configuration.
DISABLE Used to disable a configuration member.
DISABLE_CONFIGURATION This function is used to disable broker management of a configuration.
DISABLE_FS_FAILOVER Used to to disable fast-start failover.
DISABLE_FS_FAILOVER_CONDITION Used to remove conditions for which a fast-start failover should be performed.
ENABLE This function is used to to enable broker management of the specified member.
ENABLE_CONFIGURATION Enables broker management of a configuration..
ENABLE_FS_FAILOVER Is used to enable fast-start failover..
ENABLE_FS_FAILOVER_CONDITION Can be used to specify additional conditions for which a fast-start failover should be performed.
FAILOVER This function can be used to perform a database failover.
GET_CONFIGURATION_PROPERTY Is used to get the value of a configuration property.
GET_CONFIGURATION_TAG Retrieves the value of a configuration tag.
GET_MEMBER_TAG Retrieves the value of a member tag.
GET_PROPERTY Is used to get the value of a member property.
HEALTH_CHECK Is used to get the broker to evaluate the health of all configuration members.
INITIATE_FS_FAILOVER Is used to specify a condition string that, when encountered by an application, allows the application to request that a fast-start failover be invoked.
REINSTATE Can be used to reinstate a database after a failover operation.
REMOVE Is used to remove a member the Data Guard broker configuration.
REMOVE_CONFIGURATION Is used to remove the Data Guard broker configuration.
REMOVE_CONFIGURATION_TAG Removes a configuration tag.
REMOVE_CONFIGURATION_TAG_ALL Removes all configuration tags.
REMOVE_MEMBER_TAG Removes a member tag.
REMOVE_MEMBER_TAG_ALL Removes all member tags.
REMOVE_INSTANCE Can be used to remove an instance from a member the Data Guard broker configuration.
RESET_CONFIGURATION_PROPERTY Is used to reset a configuration property to its default value.
RESET_PROPERTY Can be used to reset a member configurable property to its default value.
SET_CONFIGURATION_PROPERTY Can be used to set a value for a configuration property.
SET_CONFIGURATION_TAG Sets a value of a configuration tag.
SET_MEMBER_TAG Sets a value of a member tag. If the key doesn’t exist, a new key is created.
SET_PROPERTY Can be used to set a value for a member configurable property.
SET_PROTECTION_MODE Can be used to set the configuration protection mode.
SET_STATE_APPLY_OFF Is used to set the apply state to off for a logical or physical standby database.
SET_STATE_APPLY_ON Is used to set the apply state to onfor a logical or physical standby database..
SET_STATE_TRANSPORT_OFF Used to set the redo transport state to off for a primary database.
SET_STATE_TRANSPORT_ON Can be used to set the redo transport state to on for a primary database.
STOP_OBSERVER used to stop fast-start failover observers in a Data Guard broker configuration.
SWITCHOVER Is used to perform a database switchover.
WAIT Is used to wait for various Data Guard broker events to occur.

ADD_DATABASE

The ADD_DATABASE function can be used to add a standby database to the Data Guard broker configuration.

ADD_DATABASE Function

Format

DBMS_DG.ADD_DATABASE (
     database_name          IN VARCHAR2,
     database_ci            IN VARCHAR2,
     severity               OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
database_name The name that will be used by the broker to refer to this standby database. It must match (case-insensitive) the value of the corresponding database DB_UNIQUE_NAME initialization parameter.
database_ci A fully specified connect descriptor or a name to be resolved by an Oracle Net Services naming method (for example, TNS). The value you specify is also used as the initial value of the DGConnectIdentifier database property.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The standby database was successfully added to the Data Guard broker configuration.
Other The Data Guard broker was unable to add the standby database to the configuration and the return value will indicate the reason for this failure.

ADD_FAR_SYNC

The ADD_FAR_SYNC function can be used to add a far sync instance to the Data Guard broker configuration. To use this command, Oracle wallet-based authentication must be configured and you must connect with SYSDBA privilege.

ADD_FAR_SYNC Function

Format

DBMS_DG.ADD_FAR_SYNC (
     far_sync_name          IN VARCHAR2,
     far_sync_ci            IN VARCHAR2,
     severity               OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
far_sync_name The name that will be used by the broker to refer to this far sync instance. It must match (case-insensitive) the value of the corresponding database DB_UNIQUE_NAME initialization parameter.
far_sync_ci A fully specified connect descriptor or a name to be resolved by an Oracle Net Services naming method (for example, TNS). The value you specify is also used as the initial value of the DGConnectIdentifier database property.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The far sync instance was successfully added to the Data Guard broker configuration.
Other The Data Guard broker was unable to add the far sync instance to the configuration and the return value will indicate the reason for this failure.

ADD_RECOVERY_APPLIANCE

The ADD_FAR_SYNC function can be used to add a Zero Data Loss Recovery Appliance to the Data Guard broker configuration.

ADD_RECOVERY_APPLIANCE Function

Format

DBMS_DG.ADD_RECOVERY_APPLIANCE (
     ra_name          IN VARCHAR2,
     ra_ci            IN VARCHAR2,
     severity         OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
ra_name The name that will be used by the broker to refer to this Zero Data Loss Recovery Appliance. It must match (case-insensitive) the value of the corresponding database DB_UNIQUE_NAME initialization parameter.
ra_ci A fully specified connect descriptor or a name to be resolved by an Oracle Net Services naming method (for example, TNS). The value you specify is also used as the initial value of the DGConnectIdentifier property.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The Zero Data Loss Recovery Appliance was successfully added to the Data Guard broker configuration.
Other The Data Guard broker was unable to add the Zero Data Loss Recovery Appliance to the configuration and the return value will indicate the reason for this failure.

CONVERT_TO_PHYSICAL

The CONVERT_TO_PHYSICAL function can be used to convert a snapshot standby database to a physical standby database.

CONVERT_TO_PHYSICAL Function

Format

DBMS_DG.CONVERT_TO_PHYSICAL (
     db_name          IN VARCHAR2,
     severity         OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
db_name The DB_UNIQUE_NAME initialization parameter value of the snapshot standby database to be converted to a physical standby database.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The snapshot standby database was successfully converted to a physical standby database.
ORA-16540: invalid argument The name specified for the database was not a valid DB_UNIQUE_NAME value.
ORA-16732: Oracle Clusterware is restarting the database instance Oracle Clusterware is restarting the database to the mode required by the broker to convert the snapshot standby database to a physical standby database. Wait for the database to complete restarting and then retry this function call.
ORA-16897: start database to mount mode The conversion to physical standby could not be performed because the snapshot standby database was not running in mount mode. Restart the database to mount mode and retry this function call.
ORA-16899: Operation requires a connection to the primary database. This function must be called while connected to the primary database to complete. Reconnect to the primary database and retry this function call.
Other The Data Guard broker was unable to convert the database and the return value will indicate the reason for this failure.

CONVERT_TO_SNAPSHOT

The CONVERT_TO_SNAPSHOT function can be used to convert a snapshot standby database to a physical standby database.

CONVERT_TO_SNAPSHOT Function

Format

DBMS_DG.CONVERT_TO_SNAPSHOT (
     db_name          IN VARCHAR2,
     severity         OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
db_name The DB_UNIQUE_NAME initialization parameter value of the physical standby database to be converted to a snapshot standby database.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The database was successfully converted to a snapshot standby database.
ORA-16540: invalid argument The name specified for the database was not a valid DB_UNIQUE_NAME value.
Other The Data Guard broker was unable to convert the database and the return value will indicate the reason for this failure.

CREATE_CONFIGURATION

The CREATE_CONFIGURATION function can be used to create a Data Guard broker configuration. The primary database will be automatically added to the configuration. The value of the primary database’s DB_UNIQUE_NAME initialization parameter value will be fetched from the database.

CREATE_CONFIGURATION Function

DBMS_DG.CREATE_CONFIGURATION (
     config_name          IN VARCHAR2,
     primary_ci           IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
config_name A user-friendly name for the configuration you are creating. Valid names contain any alphanumeric characters. If spaces are included in the name, the name must be enclosed in double or single quotation marks. The name must consist of 30 or fewer bytes.
primary_ci A fully specified connect descriptor or a name to be resolved by an Oracle Net Services naming method (for example, TNS). The value you specify is also used as the initial value of the DGConnectIdentifier database property.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The Data Guard broker configuration was created and the primary database has been added to the configuration.
Other The Data Guard broker was unable to convert the database and the return value will indicate the reason for this failure.

DISABLE

The DISABLE function can be used to convert a snapshot standby database to a physical standby database.

DISABLE Function

DBMS_DG.DISABLE (
     member_name          IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
member_name The DB_UNIQUE_NAME initialization parameter value of the member to be disabled.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Error Description
ORA-00000: normal, successful completion The member was successfully disabled.
ORA-16540: invalid argument The name specified for the member was not a valid DB_UNIQUE_NAME value.
Other The Data Guard broker was unable to disable the member and the return value will indicate the reason for this failure.

DISABLE_CONFIGURATIO N

The DISABLE_CONFIGURATION function can be used to disable broker management of a configuration so that the so that the configuration and all of its databases are no longer managed by the broker.

DISABLE Function

DBMS_DG.DISABLE_CONFIGURATION (
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The member was successfully disabled.
Other The Data Guard broker was unable to disable the member and the return value will indicate the reason for this failure.

DISABLE_FS_FAILOVER

The DISABLE_FS_FAILOVER function can be used to to disable fast-start failover. Using this function will prevent the observer from initiating a failover to the target standby.

DISABLE_FS_FAILOVER Function

DBMS_DG.DISABLE_FS_FAILOVER (
     force           IN BOOLEAN DEFAULT FALSE,
     severity        OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
force A boolean value to indicate whether fast-start failover should be disabled with the FORCE option. A value of TRUE will cause this function to disable fast-start failover on the member the session is connected. A value of FALSE will cause this function to disable fast-start failover on the primary and current target standby. If both databases cannot disable fast-start failover, it will remain enabled.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Errors Description
ORA-00000: normal, successful completion Fast-start failover was disabled according to the value specified by the force parameter.
Other The Data Guard broker was unable to disable fast-start failover.

DISABLE_FS_FAILOVER_CONDITION

The DISABLE_FS_FAILOVER_CONDITION function can be used to remove conditions for which a fast-start failover should be performed.

DISABLE_FS_FAILOVER_CONDITION Function

DBMS_DG.DISABLE_FS_FAILOVER_CONDITION (
     condition            IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
condition A fast-start failover condition to disable.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Health Condition Description
“Datafile Write Errors” If fast-start failover is enabled and the Datafile Write Errors condition is specified, then a fast-start failover is initiated if write errors are encountered in any data files, including temp files, system data files, and undo files.
“Corrupted Controlfile” Corrupted controlfile. This condition is enabled by default.
“Corrupted Dictionary” Dictionary corruption of a critical database object. This condition is enabled by default.
“Inaccessible Logfile” LGWR is unable to write to any member of a log group due to an I/O error.
“Stuck Archiver” Archiver is unable to archive a redo log because device is full or unavailable.
Error Description
ORA-00000: normal, successful completion Fast-start failover condition was disabled.
Other The Data Guard broker was unable to disable fast-start failover condition.

ENABLE

The ENABLE function can be used to to enable broker management of the specified member..

ENABLE Function

DBMS_DG.ENABLE (
     member_name          IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
member_name The DB_UNIQUE_NAME initialization parameter value of the member to be enabled.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The member was successfully disabled.
ORA-16540: invalid argument The name specified for the member was not a validDB_UNIQUE_NAME value.
Other The Data Guard broker was unable to enable the member and the return value will indicate the reason for this failure.

ENABLE_CONFIGURATION

The ENABLE_CONFIGURATION function can be used to to enable broker management of a configuration.

ENABLE_CONFIGURATION Function

DBMS_DG.ENABLE_CONFIGURATION (
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The configuration was successfully enabled.
Other The Data Guard broker was unable to enable the configuration and the return value will indicate the reason for this failure.

ENABLE_FS_FAILOVER

The ENABLE_FS_FAILOVER function can be used to enable fast-start failover. This enables the broker to fail over to a specifically-chosen standby database in the event of loss of the primary database, without requiring any manual steps..

ENABLE_FS_FAILOVER Function

DBMS_DG.ENABLE_FS_FAILOVER (
     observe_only    IN BOOLEAN DEFAULT FALSE,
     severity        OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
observe_only A boolean value to indicate whether fast-start failover should be enabled in observer-only mode. A value of TRUE will cause this function to enable fast-start failover in observe-only mode. A value of FALSE will cause this function to enable fast-start failover without observe-only mode. In observe-only mode, the observer will print information about when a fast-failover would have been initiated without actually doing a failover to the target standby database.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Note: Oracle also recommends Flashback Database be enabled on both the primary and standby databases to allow for reinstatement of the old primary database after a failover.

Return Values

Error Description
ORA-00000: normal, successful completion Fast-start failover was disabled according to the value specified by the force parameter.
Other If the severity returned was ORA-16501, the Data Guard broker was unable to enable fast-start failover and the return value will indicate the reason. If the severity returned was ORA-16501, the Data Guard broker was able to enable fast-start failover and the return value will indicate information about how fast-start failover was enabled.

ENABLE_FS_FAILOVER_CONDITION

The ENABLE_FS_FAILOVER_CONDITION function can be used to specify additional conditions for which a fast-start failover should be performed.

ENABLE_FS_FAILOVER_CONDITION Function

DBMS_DG.ENABLE_FS_FAILOVER_CONDITION (
     condition            IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
condition A fast-start failover condition to enable.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Health Condition Description
“Datafile Write Errors” If fast-start failover is enabled and the Datafile Write Errors condition is specified, then a fast-start failover is initiated if write errors are encountered in any data files, including temp files, system data files, and undo files.
“Corrupted Controlfile” Corrupted controlfile. This condition is enabled by default.
“Corrupted Dictionary” Dictionary corruption of a critical database object. This condition is enabled by default.
“Inaccessible Logfile” LGWR is unable to write to any member of a log group due to an I/O error.
“Stuck Archiver” Archiver is unable to archive a redo log because device is full or unavailable.

Return Values

Error Description
ORA-00000: normal, successful completion Fast-start failover condition was enabled.
Other The Data Guard broker was unable to enable the fast-start failover condition and the return value will indicate the reason for this failure.

FAILOVER

The FAILOVER function can be used to perform a database failover.

FAILOVER Function

DBMS_DG.FAILOVER (
     db_name              IN VARCHAR2,
     failover_type,       IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
db_name The DB_UNIQUE_NAME initialization parameter value of the standby database to be fail over to.
failover_type The type of failover to perform. Accepted keywords are:
  • COMPLETE: complete failover where the target standby database applies all redo data it has received from the primary database before performing the failover operation.
  • IMMEDIATE: the failover operation is performed immediately without first applying any unapplied redo data. This option will most likely result in a data loss failover operation
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Error Description
ORA-00000: normal, successful completion The failover completed successfully.
Other The Data Guard broker was unable to complete the failover operation and the return value will indicate the reason for this failure.

GET_CONFIGURATION_PROPERTY

The GET_CONFIGURATION_PROPERTY function can be used to get the value of a configuration property.

GET_CONFIGURATION_PROPERTY Function

DBMS_DG.GET_CONFIGURATION_PROPERTY (
     property_name        IN VARCHAR2,
     value                OUT VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
property_name The name of the configuration property whose value is to be fetched.
value The value of the specified configuration property is returned in this output parameter.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The value of the property was successfully fetched.
Other The Data Guard broker was unable to fetch the configuration property value and the return value will indicate the reason for this failure.

GET_CONFIGURATION_TAG

The GET_CONFIGURATION_TAG function retrieves the value of a configuration tag.

GET_CONFIGURATION_TAG Function

DBMS_DG.GET_CONFIGURATION_TAG (
     config_name          IN VARCHAR2,
     tag_name             IN VARCHAR2,
     value                OUT VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
config_name The name of a configuration file. NULL for local configuration.
tag_name The name of a tag.

Usage Notes

Return Values

Error Description
value The value of the tag.
severity The severity associated with the status returned by this function.

GET_MEMBER_TAG

The GET_MEMBER_TAG function retrieves the value of a member tag.

GET_MEMBER_TAG Function

DBMS_DG.GET_MEMBER_TAG (
     config_name          IN VARCHAR2,
     member_name          IN VARCHAR2,
     tag_name             IN VARCHAR2,
     value                OUT VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
config_name The name of a configuration file. NULL for local configuration.
member_name The name of a member configuration file.
tag_name The name of a tag.

Usage Notes

Return Values

Error Description
value The value of the tag.
severity The severity associated with the status returned by this function.

GET_PROPERTY

The GET_PROPERTY function can be used to get the value of a member property.

GET_PROPERTY Function

DBMS_DG.GET_PROPERTY (
     member_name          IN VARCHAR2,
     property_name        IN VARCHAR2,
     value                OUT CLOB,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
member_name The DB_UNIQUE_NAME initialization parameter value of the member to be whose property value is to be fetched.
property_name The name of the configuration property whose value is to be fetched.
value The value of the specified configuration property is returned in this output parameter.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Error Description
ORA-00000: normal, successful completion The value of the property was successfully fetched.
Other The Data Guard broker was unable to fetch the property value and the return value will indicate the reason for this failure.

HEALTH_CHECK

The HEALTH_CHECK function can be used to get the broker to evaluate the health of all configuration members..

HEALTH_CHECK Function

DBMS_DG.HEALTH_CHECK
RETURN BINARY_INTEGER;

Parameters

None

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The health check was successfully initiated.
Other The Data Guard broker was unable to perform the health check and the return value will indicate the reason for this failure.

INITIATE_FS_FAILOVER Procedure

Use this procedure to specify a condition string that, when encountered by an application, allows the application to request that a fast-start failover be invoked.

Syntax

DBMS_DG.INITIATE_FS_FAILOVER (
     condstr          IN VARCHAR2)
RETURN BINARY_INTEGER;

Parameters

Table 2 INITIATE_FS_FAILOVER Procedure Parameters

Parameter Description
condstr Specifies the condition string for which a fast-start failover should be requested. If no condition string argument is supplied, the default string of “Application Failover Requested” will be logged in the broker log file and in the database alert log of the database on which the procedure was called.

Usage Notes

There are conditions detectable by applications running outside of the Oracle database that may warrant the Oracle Data Guard broker to perform a fast-start failover. Because the range of possible conditions is virtually unlimited, it is left to the applications to determine which conditions warrant a fast-start failover.

When such conditions occur, the application calls the DBMS_DG.INITIATE_FS_FAILOVER procedure to alert either the primary or fast-start failover target standby database that the application wants a fast-start failover to occur immediately. The database on which the procedure was called then notifies the observer, which immediately initiates a fast-start failover as long as the standby database is in a valid fast-start failover state (“observed” and either “synchronized” or “within lag”) to accept a failover.If the configuration is not in a valid fast-start failover state, the INITIATE_FS_FAILOVER subprogram returns an ORA error message (it will not signal an exception) to inform the calling application that a fast-start failover could not be performed.

Errors

Table 3 INITIATE_FS_FAILOVER Procedure Errors

Error Description
ORA-00000: normal, successful completion The request to initiate a fast-start failover has been posted to the observer.
ORA-16646: fast-start failover is disabled Either a broker configuration does not exist or fast-start failover has not been enabled.
ORA-16666: unable to initiate fast-start failover on a bystander standby database DBMS_DG.INITIATE_FS_FAILOVER was invoked on a bystander standby database. That is, it was not invoked on the primary or on the fast-start failover target standby database.
ORA-16817: unsynchronized fast-start failover configuration DBMS_DG.INITIATE_FS_FAILOVER was invoked in a maximum available fast-start failover configuration when the configuration was not synchronized.
ORA-16819: fast-start failover observer not started DBMS_DG.INITIATE_FS_FAILOVER was invoked but an observer had not yet been started.
ORA-16820: fast-start failover observer is no longer observing this database DBMS_DG.INITIATE_FS_FAILOVER was invoked but the configuration detects that the observer may not be running.
ORA-16829: lagging fast-start failover configuration DBMS_DG.INITIATE_FS_FAILOVER was invoked in a maximum performance fast-start failover configuration when the configuration was not in the user-specified redo lag limit.

Example

In this example, the program attempts to initiate a fast-start failover when fast-start failover is disabled. To use this example, connect as user SYS with SYDDBA privileges.

set serveroutput on

declare
status integer;

begin
status := dbms_dg.initiate_fs_failover(''Failover Requested'');

dbms_output.put_line(''Fast-Start Failover is disabled: Expected status = ORA-16646'');
dbms_output.put_line(''                  Actual Status = ORA-'' || status);

end;
/
exit;

REINSTATE

The REINSTATE function can be used to reinstate a database after a failover operation.

REINSTATE Function

DBMS_DG.REINSTATE (
     db_name              IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
db_name The DB_UNIQUE_NAME initialization parameter value of the database to be reinstated.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The database was successfully reinstated.
ORA-16540: invalid argument The name specified for the database was not a valid DB_UNIQUE_NAME value.
ORA-16732: Oracle Clusterware is restarting the database instance Oracle Clusterware is restarting the database to the mode required by the broker. Once the database has been restarted, retry this function call.
ORA-16897: start database to mount mode Reinstatement was not performed because the database was not running in mount mode. Restart the database to mount mode and retry this function call.
ORA-16899: Operation requires a connection to the primary database. A connection to the primary database is required to call this function.
Other The Data Guard broker was unable to reinstate the specified database and the return value will indicate the reason for this failure.

REMOVE

The REMOVE function can be used to remove a member the Data Guard broker configuration.

REMOVE Function

DBMS_DG.REMOVE (
     member_name          IN VARCHAR2,
     preserve_destination IN BOOLEAN DEFAULT FALSE,
     severity              OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
member_name The DB_UNIQUE_NAME initialization parameter value of the database to be reinstated.
preserve_destination A boolean value to indicate whether the log_archive_dest initialization parameter setting should be preserved or clear when removing member from the configuration. A value of TRUE indicates that the parameter setting will not be cleared. A value of FALSE indicates the parameter setting will be cleared.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The member was successfully removed.
Other The Data Guard broker was unable to remove the member from the configuration and the return value will indicate the reason for this failure.

REMOVE_CONFIGURATION

The REMOVE_CONFIGURATION function can be used to remove the Data Guard broker configuration.

REMOVE_CONFIGURATION Function

DBMS_DG.REMOVE_CONFIGURATION (
     preserve_destinations IN BOOLEAN DEFAULT FALSE,
     severity              OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
preserve_destination A boolean value to indicate whether the log_archive_dest initialization parameter setting should be preserved or clear when removing member from the configuration. A value of TRUE indicates that the parameter setting will not be cleared. A value of FALSE indicates the parameter setting will be cleared.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The configuration was successfully removed.
Other The Data Guard broker was unable to remove the configuration and the return value will indicate the reason for this failure.

REMOVE_CONFIGURATION_TAG

The REMOVE_CONFIGURATION_TAG function removes a configuration tag.

REMOVE_CONFIGURATION_TAG Function

DBMS_DG.REMOVE_CONFIGURATION_TAG (
     config_name          IN VARCHAR2,
     tag_name             IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
config_name The name of a configuration file. NULL for local configuration.
tag_name The name of a tag.

Usage Notes

Return Values

Error Description
severity The severity associated with the status returned by this function.

REMOVE_CONFIGURATION_TAG_ALL

The REMOVE_CONFIGURATION_TAG_ALL function removes all configuration tags.

REMOVE_CONFIGURATION_TAG_ALL Function

DBMS_DG.REMOVE_CONFIGURATION_TAG_ALL (
     config_name          IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
config_name The name of a configuration file. NULL for local configuration.

Usage Notes

Return Values

Error Description
severity The severity associated with the status returned by this function.

REMOVE_INSTANCE

The REMOVE_INSTANCE function can be used to remove an instance from a member the Data Guard broker configuration.

REMOVE_INSTANCE Function

DBMS_DG.REMOVE_INSTANCE (
     member_name           IN VARCHAR2,
     instance_name         IN VARCHAR2,
     severity              OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
member_name The DB_UNIQUE_NAME initialization parameter value of the member whose instance is to be removed.
instance_name The name of the instance (SID) that you want to remove the broker configuration.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The configuration was successfully removed.
Other The Data Guard broker was unable to remove the configuration and the return value will indicate the reason for this failure.

REMOVE_MEMBER_TAG

The REMOVE_MEMBER_TAG function removes a member tag.

REMOVE_MEMBER_TAG Function

DBMS_DG.REMOVE_MEMBER_TAG(
     config_name          IN VARCHAR2,
     member_name          IN VARCHAR2,
     tag_name             IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
config_name The name of a configuration file. NULL for local configuration.
member_name The name of a member configuration file.
tag_name The name of a tag.

Usage Notes

Return Values

Error Description
severity The severity associated with the status returned by this function.

REMOVE_MEMBER_TAG_ALL

The REMOVE_MEMBER_TAG_ALL function removes all member tags.

REMOVE_MEMBER_TAG_ALL Function

DBMS_DG.REMOVE_MEMBER_TAG_ALL(
     config_name          IN VARCHAR2,
     member_name          IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
config_name The name of a configuration file. NULL for local configuration.
member_name The name of a member configuration file.

Usage Notes

Return Values

Error Description
severity The severity associated with the status returned by this function.

RESET_CONFIGURATION_PROPERTY

The RESET_CONFIGURATION_PROPERTY function can be used to reset a configuration property to its default value.

RESET_CONFIGURATION_PROPERTY Function

DBMS_DG.RESET_CONFIGURATION_PROPERTY (
     property_name         IN VARCHAR2,
     severity              OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
property_name The name of the configuration property whose value is to be reset to its default value.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The configuration was successfully removed.
Other The Data Guard broker was unable to remove the configuration and the return value will indicate the reason for this failure.

RESET_PROPERTY

The RESET_PROPERTY function can be used to reset a member configurable property to its default value.

RESET_PROPERTY Function

DBMS_DG.RESET_PROPERTY (
     member_name           IN VARCHAR2,
     property_name         IN VARCHAR2,
     severity              OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
member_name The DB_UNIQUE_NAME initialization parameter value of the member whose configurable property value is to be reset to its default value.
property_name The name of the configuration property whose value is to be reset to its default value.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The specified configurable property’s value was successfully reset to its default value.
Other The Data Guard broker was unable to reset the specified configurable property to its default value and the return value will indicate the reason for this failure.

SET_CONFIGURATION_PROPERTY

The SET_CONFIGURATION_PROPERTY function can be used to set a value for a configuration property.

SET_CONFIGURATION_PROPERTY Function

DBMS_DG.SET_CONFIGURATION_PROPERTY (
     property_name IN VARCHAR2,
     value         IN VARCHAR2,
     severity      OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
property_name The name of the configuration property whose value is to be set.
value The value to set the specified configuration property to.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The specified configurable property’s value was successfully reset to its default value.
Other The Data Guard broker was unable to reset the specified configurable property to its default value and the return value will indicate the reason for this failure.

SET_CONFIGURATION_TAG

The SET_CONFIGURATION_TAG function sets a value of a configuration tag. If the tag doesn’t exist, a new tag is created.

SET_CONFIGURATION_TAG Function

DBMS_DG.SET_CONFIGURATION_TAG (
     config_name          IN VARCHAR2,
     tag_name             IN VARCHAR2,
     value                IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
config_name The name of a configuration file. NULL for local configuration.
tag_name The name of a tag.
value The value for the tag.

Usage Notes

Return Values

Error Description
severity The severity associated with the status returned by this function.

SET_MEMBER_TAG

The SET_MEMBER_TAG function sets a value of a member tag. If the key doesn’t exist, a new key is created.

SET_MEMBER_TAG Function

DBMS_DG.SET_MEMBER_TAG (
     config_name          IN VARCHAR2,
     member_name          IN VARCHAR2,
     tag_name             IN VARCHAR2,
     value                IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
config_name The name of a configuration file. NULL for local configuration.
member_name The name of a member.
tag_name The name of a tag.
value The value for the tag.

Usage Notes

Return Values

Error Description
severity The severity associated with the status returned by this function.

SET_PROPERTY

The SET_CONFIGURATION_PROPERTY function can be used to set a value for a member configurable property.

SET_PROPERTY Function

DBMS_DG.SET_PROPERTY (
     member_name           IN VARCHAR2,
     property_name         IN VARCHAR2,
     value                 IN VARCHAR2,
     severity              OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
member_name The DB_UNIQUE_NAME initialization parameter value of the member whose configurable property value is to be set.
property_name The name of the configurable property whose value is to be set.
value The value to set the specified configurable property to.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The specified configurable property’s value was successfully reset to its default value.
Other The Data Guard broker was unable to reset the specified configurable property to its default value and the return value will indicate the reason for this failure.

SET_PROTECTION_MODE

The SET_PROTECTION_MODE function can be used to set the configuration protection mode.

SET_PROTECTION_MODE Function

DBMS_DG.SET_PROTECTION_MODE (
     protection_mode IN VARCHAR2,
     severity        OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
protection_mode A character string containing the protection mode to be set. Valid values include:
  • MAXPERFORMANCE
  • MAXAVAILABILITY
  • MAXPROTECTION
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The configuration protection mode was successfully changed.
Other The Data Guard broker was unable to change the protection mode and the return value will indicate the reason for this failure.

SET_STATE_APPLY_OFF

The SET_STATE_APPLY_OFF function can be used to set the apply state to off for a logical or physical standby database.

SET_STATE_APPLY_OFF Function

DBMS_DG.SET_STATE_APPLY_OFF (
     member_name           IN VARCHAR2,
     severity              OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
member_name The DB_UNIQUE_NAME initialization parameter value of the standby database whose apply state should be set to OFF.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Error Description
ORA-00000: normal, successful completion The apply state for the specified standby database was successfully set to OFF.
Other The Data Guard broker was unable to set the apply state to OFF for the specified standby database and the return value will indicate the reason for this failure.

SET_STATE_APPLY_ON

The SET_STATE_APPLY_ON function can be used to set the apply state to on for a logical or physical standby database.

SET_STATE_APPLY_ON Function

DBMS_DG.SET_STATE_APPLY_ON (
     member_name           IN VARCHAR2,
     apply_instance        IN VARCHAR2 DEFAULT NULL,
     severity              OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
member_name The DB_UNIQUE_NAME initialization parameter value of the standby database whose apply state should be set to ON.
apply_instance A character string containing the SID of the instance you want to become the apply instance if this is an Oracle RAC standby database.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The apply state for the specified standby database was successfully set to ON.
Other The Data Guard broker was unable to set the apply state to ON for the specified standby database and the return value will indicate the reason for this failure.

SET_STATE_TRANSPORT_OFF

The SET_STATE_TRANSPORT_OFF function can be used to set the redo transport state to off for a primary database.

SET_STATE_TRANSPORT_OFF Function

DBMS_DG.SET_STATE_TRANSPORT_OFF (
     member_name           IN VARCHAR2,
     severity              OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
member_name The DB_UNIQUE_NAME initialization parameter value of the primary database.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The transport state for the primary database was successfully set to OFF.
Other The Data Guard broker was unable to set the transport state to OFF and the return value will indicate the reason for this failure.

SET_STATE_TRANSPORT_ON

The SET_STATE_TRANSPORT_ON function can be used to set the redo transport state to on for a primary database.

SET_STATE_TRANSPORT_ON Function

DBMS_DG.SET_STATE_TRANSPORT_ON (
     member_name           IN VARCHAR2,
     severity              OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
member_name The DB_UNIQUE_NAME initialization parameter value of the primary database.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The transport state for the primary database was successfully set to ON.
Other The Data Guard broker was unable to set the transport state to ON and the return value will indicate the reason for this failure.

STOP_OBSERVER

The STOP_OBSERVER function can be used to stop fast-start failover observers in a Data Guard broker configuration.

STOP_OBSERVER Function

DBMS_DG.STOP_OBSERVER (
     ob_name               IN VARCHAR2,
     severity              OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
ob_name A character string containing the name of the observer to be stopped. Valid values are:
  • An observer name. See V$FS_FAILOVER_OBSERVERS for a list of all registered observers.
  • NULL or the empty string if only one observer is registered.
  • ALL to stop all registered observers.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The specified observer was successfully stopped.
Other The Data Guard broker was unable to stop the specified observer and the return value will indicate the reason for this failure.

SWITCHOVER

The SWITCHOVER function can be used to perform a database switchover.

SWITCHOVER Function

DBMS_DG.SWITCHOVER (
     db_name              IN VARCHAR2,
     severity             OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
db_name The DB_UNIQUE_NAME initialization parameter value of the standby database to switch over to.
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The switchover completed successfully.
ORA-16540: invalid argument The name specified for the database was not a valid DB_UNIQUE_NAME value.
ORA-16600: not connected to target standby database This function cannot be called when connected to the primary database. Call this function while connected to the target standby database.
ORA-16732: Oracle Clusterware is restarting the database instance Oracle Clusterware is restarting the database to the mode required by the broker. Once the database has been restarted, retry this function call.
ORA-16897: start database to mount mode The switchover was completed successfully and the client must restart the old primary database to the mount mode.
ORA-16897: start database to open mode The switchover was completed successfully and the client must restart the old primary database to the open mode.
Other The Data Guard broker unable to complete the switchover and the return value will indicate the reason for this failure.

WAIT

The WAIT function can be used to wait for various Data Guard broker events to occur.

WAIT Function

DBMS_DG.WAIT (
     wait_event            IN BINARY_INTEGER
     wait_time             IN BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
wait_event A Data Guard broker wait event. This can be one of:
  • DBMS_DG.WAIT_START_BROKER: Wait for Data Guard broker to start and finish initialization. Specifying this wait event will also cause the DG_BROKER_START initialization parameter to be set to TRUE.
  • DBMS_DG.WAIT_STOP_BROKER: Wait for Data Guard broker to stop. Specifying this wait event will also cause the DG_BROKER_START initialization parameter to be set to FALSE.
wait_time The number of seconds to wait for the specified wait event to occur.

Usage Notes

Return Values

Error Description
ORA-00000: normal, successful completion The event for which to wait on occurred within the number of seconds specified by the wait_time parameter.
ORA-16509: request timed out The event for which to wait on did not occur within the number of seconds specified by the wait_time parameter.
Other The Data Guard broker unable to wait for the specified wait event and the return value will indicate the reason for this failure.