12 Provisioning Oracle Standby Databases
This chapter contains the following sections:
- Overview of Creating a Standby Database
- Creating a New Physical Standby Database (single-instance only)
- Creating a New Logical Standby Database (single-instance only)
- Managing an Existing Standby Database with Data Guard Broker
- Creating a Primary Database Backup Only
- Data Guard
- Fast-Start Failover REST API
Overview of Creating a Standby Database
Creating a standby database is the first thing you must do before you can manage and monitor the databases. Enterprise Manager Cloud Control provides the Add Standby Database wizard to create a broker configuration that includes a primary database and one or more standby databases.
You can create a physical or a logical standby database. Physical standby databases are physically identical to the primary database, mounted or open read-only when in recovery mode, and support all datatypes and DDL. Logical standby databases are physically different from the primary database, open read-write only when in recovery mode, can be used for data protection and reporting, and support only some databases and DDL.
The standby database creation process performs the following steps:
-
Performs an online backup (or optionally uses an existing backup) of the primary database control file, datafiles, and archived redo log files
-
Transfers the backup pieces from the primary host to the standby host
-
Creates other needed files (e.g., initialization, password) on the standby host
-
Restores the control file, datafiles, and archived redo log files to the specified locations on the standby host
-
Adds online redo log files and other files to the standby database as needed
-
Configures the recovered database as a physical or logical standby database
Creating a New Physical Standby Database (single-instance only)
To create a new physical standby database (single-instance only), follow these steps:
Note:
New physical databases will be created as single-instance databases. The Enterprise Manager Convert to Cluster Database function can be used to convert the standby database to a cluster database after it is created.
Step 1: Determine the backup type
Enterprise Manager uses Oracle Recovery Manager (RMAN) to create a single-instance standby database from a new or existing backup of the primary database. You can select one of two backup operations to use for the standby database creation:
Note:
AES 256 is the only encryption mode available when using Oracle Database 23c deployments.-
Perform a live backup of the primary database using RMAN to copy database files, or by copying the database files via staging areas.
-
Use an existing RMAN backup or an existing backup from a previous standby database creation.
Click Next.
You can click Cancel to terminate the current process and begin again at the introductory page of the Add Standby Database wizard.
Step 2: Set up the backup options
For an online backup using RMAN, enter the Degree of Parallelism (the number of parallel channels used by RMAN to copy the database files). The default number is 2.
For an online backup by copying the database files via staging areas, provide the staging area location. You can also choose if you want to retain the directory or delete it after the standby database has been created.
For an offline backup using RMAN, provide the RMAN backup location and the staging area location.
Enter the primary host credentials. You can use existing credentials or create new credentials. If you create new credentials you can save the credentials to use for another database standby creation later. To do this, check the Set As Preferred Credentials box.
Click Next.
You can click Cancel to terminate the current process and begin again at the introductory page of the Add Standby Database wizard.
Step 3: Select the Oracle home in which to create the standby database
The standby database can be created in any Oracle home that was discovered by Oracle Enterprise Manager. Only Oracle homes on hosts that match the operating system of the primary host are shown. You must select a discovered Oracle home and provide a unique instance name for the standby database. Standby host credentials are required to continue.
Step 4: Set up the location for standby database files
Since the primary and standby databases are the same host, the standby database files are placed into an Oracle Optimal Flexible Architecture (OFA) directory structure. Click Customize to modify individual file names.
In the Listener Configuration section, specify the name and port of the listener that will be used for the standby database. If a new name and port are specified that are not in use by an existing listener, a new listener using the specified port will be created.
Click Next.
You can click Cancel to terminate the current process and begin again at the introductory page of the Add Standby Database wizard.
Step 5: Provide standby database configuration parameters
Standby database configuration parameters must be set. These parameters include the database name, database unique name, target name, and standby archive location. The standby archive location can be a regular directory or a flash recovery area. The default values are based on corresponding primary database settings.
After you verify that the parameters are correct, click Next.
You can click Cancel to terminate the current process and begin again at the introductory page of the Add Standby Database wizard.
Step 6: Review the information before clicking Finish
The Add Standby Database wizard allows one last review of the data you input for the configuration and standby database. Click Finish when you are certain all of the information is correct.
You can click Cancel to terminate the current process and begin again at the introductory page of the Add Standby Database wizard.
By clicking Standby Database Storage, you can see additional information about all the standby database file locations.
Once you click Finish, the standby database creation process runs as an Oracle Enterprise Manager job. You can cancel the standby creation at any point before the job submission.
After the job is submitted, you will be returned to the Data Guard Overview page. In the Status column of the Standby Databases table, you will see Creation in progress listed. If you click that link, you can monitor the progress of the standby database creation.
Note:
To add additional standby databases after the initial creation of the configuration, click Add Standby Database to run the Add Standby Database wizard again.
Creating a New Logical Standby Database (single-instance only)
To create a new physical standby database (single-instance only), follow these steps:
Note:
New logical standby databases will be created as single-instance databases. The Enterprise Manager Convert to Cluster Database function can be used to convert the standby database to a cluster database after it is created.
-
From the Targets menu, select Databases.
-
On the Databases page, you see a list of databases. Select the primary database for which you want to create a new physical standby database.
-
On the primary database home page, click Availability and then select Add Standby Database.
-
On the Database Login page, enter your credentials. Click Login.
Note:
You need to connect to the primary database using SYSDBA credentials, if you are not yet connected.
If you log in as a user with SYSDBA privileges, you will have access to all Data Guard functionality, including all monitoring and management features. If you log in as a non-SYSDBA user, you will have access to monitoring functions only; features such as standby creation, switchover, and failover will not be available.
-
On the Add Standby Database page, select Create a new physical standby database. Click Continue.
Note:
If you choose to create a new physical or logical standby database, Data Guard checks the following when you click Continue:
-
Server parameter file (SPFILE) -- Data Guard requires that all databases in a configuration use a server parameter file (SPFILE). If the wizard encounters a primary database that does not use an SPFILE, the wizard stops and returns a message asking you to create one. You can create one with a non-default name. Data Guard only requires that the primary database uses an SPFILE.
-
NOARCHIVELOG mode -- Regardless of what method you choose to add the standby database, the primary database must be in ARCHIVELOG mode. If the primary database is in NOARCHIVELOG mode, you will be asked to exit the wizard and put the primary database into ARCHIVELOG mode.
-
-
On the database page, in the Standby Databases section, click Add Standby Database.
-
The following steps assume a broker configuration already exists with one primary database and one physical standby database, and creates a new logical standby database. It shows how the wizard takes you through additional steps to select the Oracle home for the database and to copy datafiles to the standby database.
The Add Standby Database wizard takes you through the following steps:
-
Determine the backup type.
-
Set up the backup options.
-
Select the Oracle home in which to create the standby database.
-
Set up the location for standby database files.
-
Provide standby database configuration parameters.
-
Review the information before clicking Finish.
-
Step 1: Determine the backup type
Enterprise Manager uses Oracle Recovery Manager (RMAN) to create a single-instance standby database from a new or existing backup of the primary database. You can select one of two backup operations to use for the standby database creation:
Note:
AES 256 is the only encryption mode available when using Oracle Database 23c deployments.- Perform a live backup of the primary database
- Use an existing backup of the primary database
You can click Cancel to terminate the current process and begin again at the introductory page of the Add Standby Database wizard.
Step 2: Set up the backup options
A working directory is needed to store the primary database backup files. It can optionally be retained and used to create additional standby databases in the future. Specify a location on the primary host in which the working directory can be created.
Primary host credentials are required for this step. Enter the credentials of the owner of the primary database Oracle server installation. These credentials can be saved by checking the box marked Save as Preferred Credential.
You can click Cancel to terminate the current process and begin again at the introductory page of the Add Standby Database wizard.
Step 3: Select the Oracle home in which to create the standby database
The standby database can be created in any Oracle home that was discovered by Oracle Enterprise Manager. Only Oracle homes on hosts that match the operating system of the primary host are shown. You must select a discovered Oracle home and provide a unique instance name for the standby database. Standby host credentials are required to continue.
Step 4: Set up the location for standby database files
Part of the create broker configuration process involves making the datafiles for the primary database available to the standby host. You have the option of customizing the location for the standby database files. Standby host credentials are required to continue. The following list describes your options:
-
Specify the backup file access method
Choose the method by which you want to make the primary database backup files accessible to the standby host. The two options are:
-
Transfer files from the primary host working directory to a standby host working directory
-
Directly access the primary host working directory location from the standby host using a network path name
-
-
Specify the standby database file location
Choose the locations for the standby database files. You have two options:
-
Convert to Oracle OFA (Optimal Flexible Architecture)
-
Keep file names and locations the same as the primary database
-
-
Specify the network configuration file location
Data Guard will add configuration information for the standby database to the network configuration files (listener.ora and tnsnames.ora) in the specified directory on the standby host.
You can click Cancel to terminate the current process and begin again at the introductory page of the Add Standby Database wizard.
Step 5: Provide standby database configuration parameters
Standby database configuration parameters must be set. These parameters include the database name, database unique name, target name, and standby archive location. The standby archive location can be a regular directory or a flash recovery area. The default values are based on corresponding primary database settings.
You can click Cancel to terminate the current process and begin again at the introductory page of the Add Standby Database wizard.
Step 6: Review the information before clicking Finish
The Add Standby Database wizard allows one last review of the data you input for the configuration and standby database. Click Finish when you are certain all of the information is correct.
You can click Cancel to terminate the current process and begin again at the introductory page of the Add Standby Database wizard.
By clicking Standby Database Storage, you can see additional information about all the standby database file locations.
Once you click Finish, the standby database creation process runs as an Oracle Enterprise Manager job. You can cancel the standby creation at any point before the job submission.
After the job is submitted, you will be returned to the Data Guard Overview page. In the Status column of the Standby Databases table, you will see Creation in progress listed. If you click that link, you can monitor the progress of the standby database creation.
Note:
To add additional standby databases after the initial creation of the configuration, click Add Standby Database to run the Add Standby Database wizard again.
Managing an Existing Standby Database with Data Guard Broker
To add an existing standby database, follow these steps:
Creating a Primary Database Backup Only
An additional option is to only create a primary database backup without creating a standby database. This backup can be used for future standby database creations by re-running the Add Standby Database wizard and choosing to create a standby database from an existing backup. The existing backup can be used from either the primary or standby host. Consider this option if you are not able to use the file transfer mechanism provided by Enterprise Manager to transfer the backup files from the primary to the standby hosts, and instead wish to transfer and stage the backup files on the standby host using your own mechanism.
To create a primary database backup only, follow these steps:
Data Guard
Data Guard Switchover REST API
Table 12-1 Data Guard Switchover
Feature | Description |
---|---|
URL |
|
Request header |
Authorization: basic Content-Type: application/json |
Body |
{ "primaryTargetName" : "<primary target name>", "primaryTargetType" : "oracle_database|rac_database", "standbyTargetName" : "<standby target name>", "standbyTargetType" : "oracle_database|rac_database", ["primaryDbCredsName" : "<primary database credential name>",] ["primaryHostCredsName" : "<primary database host credential name>",] ["standbyDbCredsName" : "<standby database credential name>",] ["standbyHostCredsName" : "<standby database host credential name>",] ["swapJobs" : "false|true",] ["swapThresholds" : "false|true",] ["tdeWalletCredsName" : "<transparent data encryption wallet credentials of the primary database>"] ["tdeWalletPassword" : "<transparent data encryption wallet password of the primary database>"] } |
Request method |
POST |
Sample Body |
{ "primaryTargetName" : "dbname", "primaryTargetType" : "oracle_database", "standbyTargetName" : "sdbname", "standbyTargetType" : "oracle_database", "primaryDbCredsName" : "SYS", "primaryHostCredsName" : "AIMEDB_N", "standbyDbCredsName" : "SYS", "standbyHostCredsName" : "AIMEDB_N", "swapJobs" : "true", "swapThresholds" : "true", "tdeWalletCredsName" : "WC1" } |
Sample Response |
{ "status": "Succeeded", "submissionName": "dbname_DataguardSwitchover_091418163542", "executionGUID": "75D3A124B36D1A4DE0536A8A7B0A80E0", "databaseName": "dbname", "message": "Deployment procedure for switchover to dbname:oracle_database successfully submitted." } |
Supported Since Release |
EM DB 13.3.2.0.0 |
Note:
Parameters listed within a square bracket are optional.Table 12-2 Data Guard Switchover Parameters
Parameter | Description |
---|---|
primaryTargetName |
Primary database Enterprise Manager target name. Can be either a single-instance database or a cluster database. |
primaryTargetType |
Primary database target type. Allowed values are either single-instance database (oracle_database) or cluster database (rac_database). |
standbyTargetName |
Standby database Enterprise Manager target name. Can be either a single-instance database or a cluster database. |
standbyTargetType |
Standby database target type. Allowed values Allowed values are either single-instance database (oracle_database) or cluster database (rac_database). |
primaryDbCredsName |
Primary database named credential for a user with SYSDBA or SYSDG role. If this argument is not specified, preferred credential will be used. |
primaryHostCredsName |
Primary database host named credential for an operating system user who can access the primary database Oracle home. If this argument is not specified, preferred credential will be used. |
standbyDbCredsName |
Standby database named credential for a user with SYSDBA or SYSDG role. If this argument is not specified, preferred credential will be used. |
standbyHostCredsName |
Standby database host named credential for an operating system user who can access the standby database Oracle home. |
swapJobs |
Specifies that scheduled jobs on either the primary or standby database that are of a transferable type (Backup, RMAN Script, and SQL Script) will be moved to the other database after the switchover is complete. Only jobs that use global named or preferred credentials can be transferred. Default Value: Not enabled. |
swapThresholds |
Specifies that monitoring settings will be swapped between the primary and standby databases after the switchover is complete. Default Value: Not enabled |
tdeWalletCredsName |
Transparent Data Encryption wallet credentials for the primary database. Use create_named_credential verb to create these credentials as shown below: emcli create_named_credential -cred_name=WC1 -cred_type=GenericPassword -auth_target_type='<system>' -attributes="GENERIC_PASSWORD:<Primary Database TDE Wallet Password>" |
tdeWalletPassword |
Transparent Data Encryption wallet password for the primary database. |
Convert Standby Database REST API
Table 12-3 Convert Standby Database
Feature | Description |
---|---|
URL |
|
Request header |
Authorization: basic Content-Type: application/json |
Body |
{ "dbTargetName" : "<standby target name>", "dbTargetType" : "oracle_database|rac_database", ["dbHostCredName" : "<standby database host credential name>",] ["dbCredName" : "<standby database credential name>",] ["convertToDbRole" : "PHYSICAL STANDBY|SNAPSHOT STANDBY" ] } |
Sample Body |
{ "dbTargetName": "s11gfss", "dbTargetType":"oracle_database", "dbHostCredName": "GIMAN_N", "dbCredName": "SYSDBA_CREDS", "convertToDbRole": "snapshot" } |
Sample Response |
{ "status":"Succeeded", "submissionName":"dbname_DGConvertStandby_092318020955", "executionGUID":"76815E6ABC9465F5E053C365F20A61AF", "databaseName":"dbname", "message":"Deployment procedure to convert the standby database successfully submitted." } |
Request method |
POST |
Supported Since Release |
EM DB 13.3.2.0.0 |
Table 12-4 Convert Standby Database Parameters
Parameter | Description |
---|---|
dbTargetName |
Standby database Enterprise Manager target name. Can be either a single-instance database or a cluster database. |
dbTargetType |
Standby database target type. Allowed values Allowed values are either single-instance database (oracle_database) or cluster database (rac_database). |
dbHostCredName |
Standby database host named credential for an operating system user who can access the standby database Oracle home. If this argument is not specified, preferred credential will be used. |
dbCredName |
Standby database named credential for a user with SYSDBA or SYSDG role. If this argument is not specified, preferred credential will be used. |
convertToDbRole |
Standby database role to be converted to given role. Possible values are Physical Standby and Snapshot Standby. |
Fast-Start Failover REST API
This chapter provides details of the REST APIs for Fast-Start Failover and Observers supported in Enterprise Manager. When Fast-Start Failover is enabled, the Data Guard broker automatically fails over to a synchronized standby site in the event of a disaster at the primary site, requiring no intervention by the DBA. In addition, applications are automatically notified of the role transition.
Fast-Start Failover Management REST API
Fast-Start Failover is a feature that allows the Oracle Data Guard broker to failover a failed primary database automatically to a predetermined standby database. This feature increases the availability of the database by eliminating the need for user involvement as part of the failover process.
Fast-Start Failover Management REST API
Table 12-5 Fast-Start Failover
Feature | Description |
---|---|
URL | https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/websvcs/restful/db/dataguard/configure/fsfo |
Request header |
Authorization: Basic Content-Type: application/json |
Body |
{ "action" : "<edit | enable | disable| change_mode>", "primary" : { "dbTargetName" : "<primary database target name>", "dbTargetType" : "oracle_database | rac_database", "dbCredName" : "<primary database credential name>", "dbHostCredName" : "<primary database host credential name>", "dbGIHostCredName" : "<grid infrastructure credential name>" "dbObserverConnectIdentifier" : "<ObserverConnectIdentifier value of the primary database>", "dbFastRecoveryArea" : "<Fast recovery area location of the database - default V$RECOVERY_FILE_DEST>", "dbFastRecoveryAreaSize" : "<Fast recovery area size(MB) of the database - default 2x database size>", "dbFlashbackRetentionTime" : "<Flashback retention time hours - default 24h>" }, "candidateFSFOTargets" : { "dbTargetName" : "<standby database target name>", "dbTargetType" : "<oracle_database | rac_database>", "dbCredName" : "<standby database credential name>", "dbHostCredName" : "<standby database host credential name>", "dbGIHostCredName" : "<grid infrastructure credential name>" "dbObserverConnectIdentifier" : "<ObserverConnectIdentifier value of the primary database>", "dbFastRecoveryArea" : "<Fast recovery area location of the database - default V$RECOVERY_FILE_DEST>", "dbFastRecoveryAreaSize" : "<Fast recovery area size(MB) of the database - default 2x database size>", "dbFlashbackRetentionTime" : "<Flashback retention time hours - default 24h>" }, "observer" : { "name": "<observer name - default is the hostname>", "hostName" : "<observer host name>", "oracleHome" : "<observer oracle home>", "hostCredName" : "<observer host credential name>" }, "alternateObserver" : { "hostName" : "<alternate observer host name>", "oracleHome" : "<alternate observer oracle home>", "hostCredName" : "<alternate observer host credential name>" }, "failoverThreshold" : "<failover threshold>", "lagLimit" : "<lag limit>", "failoverConditions" : "<failover conditions>", "calloutScripts" : { "hostName" : "<host name>", "hostCredentials" : "<host credential>" "preCallout" : "<path of pre role change callout script>", "postCallout" : "<path of post role change callout script>", "sucFileName" : "<Name of the suc file that>", "errorFileName" : "<Name of the .err file>", "fsfoPreCalloutTimeout" : "<Value in seconds>", "fsfoActionOnPreCalloutFailure" : "<STOP | CONTINUE>" }, "enableFlashBackDatabase" : "<Yes | No>", "autoReinstatePrimary" : "<Yes | No>", "autoShutdownPrimary" : "<Yes | No>" "observeOnly" : "<Yes | No - Default Value: No>" "includeOraError240" : "<Yes | No -Default Value: Yes>", } |
Body for Disable | { "action" : "disable", ["stopAllObservers" : "<Yes | No - Default value: Yes, applicable only for 'disable' action>"] "primary" : { "dbTargetName" : "<Primary database Enterprise Manager target name>", "dbTargetType" : "oracle_database | rac_database", ["dbCredName" : "<Primary database named credential for a user with SYSDBA or SYSDG role. Default Value: Preferred credential will be used>",] ["dbHostCredName" : "<Primary database host named credential for an operating system user who can access the primary database Oracle home. Default Value: Preferred credential will be used>",] ["dbGIHostCredName" : "<Grid Infrastructure named credentials for an operating system user who can access the grid infrastructure Oracle home of the Primary Database. Default Value: Preferred credential will be used>"] } } |
Body for Change Mode | { "action" : "change_mode", "primary" : { "dbTargetName" : "<Primary database Enterprise Manager target name>", "dbTargetType" : "oracle_database | rac_database", ["dbCredName" : "<Primary database named credential for a user with SYSDBA or SYSDG role. Default Value: Preferred credential will be used>",] ["dbHostCredName" : "<Primary database host named credential for an operating system user who can access the primary database Oracle home. Default Value: Preferred credential will be used>",] ["dbGIHostCredName" : "<Grid Infrastructure named credentials for an operating system user who can access the grid infrastructure Oracle home of the Primary Database. Default Value: Preferred credential will be used>"] } } |
Notes | Observers and alternate observers are optional. |
Request method | POST |
Sample Response |
{ "status" : "Succeeded", "submissionName" : "DG_FAST_START_FAIL_OVER_*", "executionGUID" : "<execution guid>", "databaseName" : "<primary database name>", "message" : "Deployment Procedure for configuring fast-start failover of the Data Guard configuration determined from the primary database <primary database name> is successfully submitted." } |
Supported Since Release | EM DB 13.4 |
Table 12-6 Fast-Start Failover
Feature | Description |
---|---|
URL | https://<OMS_HOST>:<OMS_CONSOLE_PORT>/em/websvcs/restful/db/dataguard/configure/fsfo |
Request header |
Authorization: Basic Content-Type: application/json |
Body | { "action" : "<edit | enable | disable| change_mode>", "primary" : { "dbTargetName" : "<primary database target name>", "dbTargetType" : "oracle_database | rac_database", "dbCredName" : "<primary database credential name>", "dbHostCredName" : "<primary database host credential name>", "dbGIHostCredName" : "<grid infrastructure credential name>" "dbObserverConnectIdentifier" : "<ObserverConnectIdentifier value of the primary database>", "dbFastRecoveryArea" : "<Fast recovery area location of the database - default V$RECOVERY_FILE_DEST>", "dbFastRecoveryAreaSize" : "<Fast recovery area size(MB) of the database - default 2x database size>", "dbFlashbackRetentionTime" : "<Flashback retention time hours - default 24h>" }, "candidateFSFOTargets" : { "dbTargetName" : "<standby database target name>", "dbTargetType" : "<oracle_database | rac_database>", "dbCredName" : "<standby database credential name>", "dbHostCredName" : "<standby database host credential name>", "dbGIHostCredName" : "<grid infrastructure credential name>" "dbObserverConnectIdentifier" : "<ObserverConnectIdentifier value of the primary database>", "dbFastRecoveryArea" : "<Fast recovery area location of the database - default V$RECOVERY_FILE_DEST>", "dbFastRecoveryAreaSize" : "<Fast recovery area size(MB) of the database - default 2x database size>", "dbFlashbackRetentionTime" : "<Flashback retention time hours - default 24h>" }, "observer" : { "name": "<observer name - default is the hostname>", "hostName" : "<observer host name>", "oracleHome" : "<observer oracle home>", "hostCredName" : "<observer host credential name>" }, "alternateObserver" : { "hostName" : "<alternate observer host name>", "oracleHome" : "<alternate observer oracle home>", "hostCredName" : "<alternate observer host credential name>" }, "failoverThreshold" : "<failover threshold>", "lagLimit" : "<lag limit>", "failoverConditions" : "<failover conditions>", "calloutScripts" : { "hostName" : "<host name>", "hostCredentials" : "<host credential>" "preCallout" : "<path of pre role change callout script>", "postCallout" : "<path of post role change callout script>", "sucFileName" : "<Name of the suc file that>", "errorFileName" : "<Name of the .err file>", "fsfoPreCalloutTimeout" : "<Value in seconds>", "fsfoActionOnPreCalloutFailure" : "<STOP | CONTINUE>" }, "enableFlashBackDatabase" : "<Yes | No>", "autoReinstatePrimary" : "<Yes | No>", "autoShutdownPrimary" : "<Yes | No>" "observeOnly" : "<Yes | No - Default Value: No>" "includeOraError240" : "<Yes | No -Default Value: Yes>", } |
Notes | Observers and alternate observers are optional. |
Request method | POST |
Sample Response | { "status" : "Succeeded", "submissionName" : "DG_FAST_START_FAIL_OVER_*", "executionGUID" : "<execution guid>", "databaseName" : "<primary database name>", "message" : "Deployment Procedure for configuring fast-start failover of the Data Guard configuration determined from the primary database <primary database name> is successfully submitted." } |
Supported Since Release | EM DB 13.4 |
Fast-Start Failover Parameters
Parameter | Description | Required | Value | Default Value |
---|---|---|---|
action | Operation to be performed on the fast-start failover configuration.
|
Required | edit | enable | disable |
dbTargetName | Primary or standby database Enterprise Manager target names. | Required | N/A |
dbTargetType | Primary or standby database target types. | Required | oracle_database | rac_database |
dbCredName | Primary or standby database named credential for a user with SYSDBA or SYSDG role. | Optional | Preferred credential will be used. |
dbHostCredName | Primary or standby database host named credential for an operating system user who can access the database Oracle home. | Optional | Preferred credential will be used. |
dbGIHostCredName | Grid Infrastructure named credential for an operating system user who can access the grid infrastructure Oracle home of the database. | Optional | N/A |
hostName | Discovered host where Enterprise Manager will start the observer or alternate observer. | Required | N/A |
oracleHome | Oracle home on the observer or alternate host (as specified by "hostName") from which Enterprise Manager will start the observer or alternate observer.. | Required | N/A |
observer | A DGMGRL (Data Guard command line interface) client that continuously monitors the primary and target standby databases, evaluates whether failover is necessary, and initiates a fast-start failover when selected conditions occur. | Required | N/A |
alternateObserver | Enterprise Manager supports the automatic restart of an alternate observer on a different host if it detects that the observer process had failed in the earlier host. | Required | N/A |
hostCredName | Observer or alternate observer host named credential for an operating system user who can access the observer Oracle home. | Required | N/A |
failoverThreshold | Amount of time in seconds the primary database must be out of contact with the observer and the standby database before a fast-start failover is initiated. | Optional | 30 Seconds. |
lagLimit | Amount of time in seconds the standby database is allowed to fall behind the primary database, beyond which a fast-start failover will not be allowed. | Optional | 30 Seconds. |
failoverConditions | A comma separated list of failover conditions which should cause a fast-start failover if detected on the primary database.
|
Optional | 1, 2, 5 |
autoReinstatePrimary | Causes the former primary database to be automatically reinstated if a fast-start failover was initiated because the primary database was either isolated or had crashed. | Optional | Yes | No Default: Yes |
autoShutdownPrimary | Causes the primary database to automatically shut down if fast-start failover is enabled. | Optional | Yes | No |
dbObserverConnectIdentifier | Primary database ObserverConnectIdentifier configurable property value | Optional | N/A |
dbFastRecoveryArea | Fast recovery area location of the database | Optional | V$RECOVERY_FILE_DEST |
dbFastRecoveryAreaSize | Fast recovery area size of the database in MB | Optional | Twice the database size |
dbFlashbackRetentionTime | Flashback retention time in hours | Optional | 24 hours |
name | Name of the observer | Optional | hostname |
hostName | host name of host containing the pre and post role change callout scripts | Optional | N/A |
hostCredentials | host credential name of host containing pre and post role change callout scripts | Optional | N/A |
preCallout | Full path of pre role change callout script | Optional | N/A |
postCallout | Full path of post role change callout script | Optional | N/A |
sucFileName | Name of the success (.suc) file that the precallout script creates | Optional | precallout.suc |
errorFileName | Name of the error (.err) file that the precallout script creates | Optional | precallout.err |
fsfoPreCalloutTimeout | Callout timeout, numeric value expressed in seconds | Optional | 600 seconds |
fsfoActionOnPreCalloutFailure | Precallout action in case of failure. STOP or CONTINUE | Optional | STOP | CONTINUE Default: Top |
enableFlashBackDatabase | Enables flash back of database. | Optional | YES|NODefault: NO |
observeOnly | Observe only failover | Optional | YES|NODefault: NO |
Observer Management REST API
Note:
This REST API is applicable to Oracle Database version 12.2 and higher.Configure Multiple Observers for a Data Guard Configuration
Table 12-7 Start Observers
Feature | Description |
---|---|
URL |
|
Request header |
Authorization: basic Content-Type: application/json |
Body |
{ "action" : "<start | stop | setMaster | show | delete_alternate_observer | stopall | editCallout | removeCallout>", "primary" : { "dbTargetName" : "<Primary database Enterprise Manager target name>", "dbTargetType" : "oracle_database | rac_database", ["dbCredName" : "<Primary database named credential for a user with SYSDBA role. Default Value: Preferred credentials will be used>",] ["dbHostCredName" : "<Primary database host named credential for an operating system user who can access the primary database Oracle home. Default Value: Preferred credentials will be used.>"] }, "observers" : [ { "name" : "<Observer name>", "hostName" : "<Host name where observer will be started>", "oracleHome" : "<Oracle home location on the host where observer will be started>", "hostCredName" : "<Host named credential for user who can access the observer Oracle home>", "hostWalletCredName" : "<Named credential of the Oracle wallet configured in the observer Oracle home>", ["isMaster" : "<Y|N>",] ["runTimeDataFile" : "<Runtime data file path and name for the observer. If not specified, the file fsfo.dat will be created under the oracle base>",] ["logFile" : "<The full path of the observer log file>"] }, { ... }, { ... } ] ["calloutScripts" : { "hostName" : "<Name of the host containing the pre and post role change callout scripts>", "hostCredentials" : "<Credential name of the host containing pre and post role change callout scripts>" "preCallout" : "<Absolute path of pre role change callout script on the hostName>", "postCallout" : "<Absolute path of post role change callout script on the hostName>", "sucFileName" : "<Name of the suc file that the precallout script would create on the observer host | Default - precallout.suc>", "errorFileName" : "<Name of the err file that the precallout script would create on the observer host | Default - precallout.err>", "fsfoPreCalloutTimeout" : "<Numeric value in seconds of the time for whic the observer will wait for the suc/err file to be generated, default value - 600>", "fsfoActionOnPreCalloutFailure" : "<Action that indicates what the observer will do if the suc file does not exist even if after FastStartFailoverPreCalloutTimeout seconds, or the error file is detected before FastStartFailoverPreCalloutTimeout seconds passed. Initiate the failover - CONTINUE, or not do failover - STOP. Values - STOP | CONTINUE, default value - STOP>" }, ] } |
Body for Start | { "action" : "start", "primary" : { "dbTargetName" : "<Primary database Enterprise Manager target name>", "dbTargetType" : "oracle_database | rac_database", ["dbCredName" : "<Primary database named credential for a user with SYSDBA or SYSDG role. Default Value: Preferred credentials will be used>",] ["dbHostCredName" : "<Primary database host named credential for an operating system user who can access the primary database Oracle home. Default Value: Preferred credentials will be used.>"] }, "observers" : [ { "name" : "<Observer name>", "hostName" : "<Host name where observer will be started>", "oracleHome" : "<Oracle home location on the host where observer will be started>", "hostCredName" : "<Host named credential for user who can access the observer Oracle home>", "hostWalletCredName" : "<Named credential of the Oracle wallet configured in the observer Oracle home>", ["isMaster" : "<Y|N>",] ["runTimeDataFile" : "<Runtime data file path and name for the observer. If not specified, the file fsfo.dat will be created under the oracle base>",] ["logFile" : "<The full path of the observer log file>"] }, { ... }, { ... } ] ["calloutScripts" : { "hostName" : "<Name of the host containing the pre and post role change callout scripts>", "hostCredentials" : "<Credential name of the host containing pre and post role change callout scripts>" "preCallout" : "<Absolute path of pre role change callout script on the hostName>", "postCallout" : "<Absolute path of post role change callout script on the hostName>", "sucFileName" : "<Name of the suc file that the precallout script would create on the observer host | Default - precallout.suc>", "errorFileName" : "<Name of the err file that the precallout script would create on the observer host | Default - precallout.err>", "fsfoPreCalloutTimeout" : "<Numeric value in seconds of the time for whic the observer will wait for the suc/err file to be generated, default value - 600>", "fsfoActionOnPreCalloutFailure" : "<Action that indicates what the observer will do if the suc file does not exist even if after FastStartFailoverPreCalloutTimeout seconds, or the error file is detected before FastStartFailoverPreCalloutTimeout seconds passed. Initiate the failover - CONTINUE, or not do failover - STOP. Values - STOP | CONTINUE, default value - STOP>" }, ] } |
Body for Stop | { "action" : "stop", "primary" : { "dbTargetName" : "<Primary database Enterprise Manager target name>", "dbTargetType" : "oracle_database | rac_database", ["dbCredName" : "<Primary database named credential for a user with SYSDBA or SYSDG role. Default Value: Preferred credentials will be used>",] ["dbHostCredName" : "<Primary database host named credential for an operating system user who can access the primary database Oracle home. Default Value: Preferred credentials will be used.>"] } "observers" : [ {"name" : "<observer 1 name>"}, {"name" : "<observer 2 name>"}, {"name" : "<observer 3 name>"} ] } |
Body for Set Master | { "action" : "setMaster", "primary" : { "dbTargetName" : "<Primary database Enterprise Manager target name>", "dbTargetType" : "oracle_database | rac_database", ["dbCredName" : "<Primary database named credential for a user with SYSDBA or SYSDG role. Default Value: Preferred credentials will be used>",] ["dbHostCredName" : "<Primary database host named credential for an operating system user who can access the primary database Oracle home. Default Value: Preferred credentials will be used.>"] } "masterObserver" : "<master observer name>" } |
Body for Show and Stop All | { "action" : "show | stopall", "primary" : { "dbTargetName" : "<Primary database Enterprise Manager target name>", "dbTargetType" : "oracle_database | rac_database", ["dbCredName" : "<Primary database named credential for a user with SYSDBA or SYSDG role. Default Value: Preferred credentials will be used>",] ["dbHostCredName" : "<Primary database host named credential for an operating system user who can access the primary database Oracle home. Default Value: Preferred credentials will be used.>"] } } |
Body for Edit Callout | { "action" : "editCallout", "primary" : { "dbTargetName" : "<Primary database Enterprise Manager target name>", "dbTargetType" : "oracle_database | rac_database", ["dbCredName" : "<Primary database named credential for a user with SYSDBA or SYSDG role. Default Value: Preferred credentials will be used>",] ["dbHostCredName" : "<Primary database host named credential for an operating system user who can access the primary database Oracle home. Default Value: Preferred credentials will be used.>"] } ["calloutScripts" : { "hostName" : "<Name of the host containing the pre and post role change callout scripts>", "hostCredentials" : "<Credential name of the host containing pre and post role change callout scripts>" "preCallout" : "<Absolute path of pre role change callout script on the hostName>", "postCallout" : "<Absolute path of post role change callout script on the hostName>", "sucFileName" : "<Name of the suc file that the precallout script would create on the observer host | Default - precallout.suc>", "errorFileName" : "<Name of the err file that the precallout script would create on the observer host | Default - precallout.err>", "fsfoPreCalloutTimeout" : "<Numeric value in seconds of the time for whic the observer will wait for the suc/err file to be generated, default value - 600>", "fsfoActionOnPreCalloutFailure" : "<Action that indicates what the observer will do if the suc file does not exist even if after FastStartFailoverPreCalloutTimeout seconds, or the error file is detected before FastStartFailoverPreCalloutTimeout seconds passed. Initiate the failover - CONTINUE, or not do failover - STOP. Values - STOP | CONTINUE, default value - STOP>" }, ] } |
Body for Remove Callout | { "action" : "removeCallout", "primary" : { "dbTargetName" : "<Primary database Enterprise Manager target name>", "dbTargetType" : "oracle_database | rac_database", ["dbCredName" : "<Primary database named credential for a user with SYSDBA or SYSDG role. Default Value: Preferred credentials will be used>",] ["dbHostCredName" : "<Primary database host named credential for an operating system user who can access the primary database Oracle home. Default Value: Preferred credentials will be used.>"] }, "observers" : [ { "name" : "<Observer name>", "hostName" : "<Host name where observer will be started>", "oracleHome" : "<Oracle home location on the host where observer will be started>", "hostCredName" : "<Host named credential for user who can access the observer Oracle home>" }, { ... }, { ... } ] } |
Notes | A maximum of 3 observers can be assigned. |
Sample Response |
{ "status" : "Succeeded", "submissionName": "ConfigureObserver_*", "executionGUID" : "<execution guid>", "databaseName" : "<primary database name>", "message" : "Deployment procedure to start the observer(s) for the Data Guard Configuration associated with the primary database <primary database name> is successfully submitted." } |
Request method |
POST |
Supported Since Release |
EM DB 13.4 |
Table 12-8 Delete, Show, or Stop All Observers
Feature | Description |
---|---|
URL |
|
Request header |
Authorization: basic Content-Type: application/json |
Body |
{ "action" : "<delete_alternate_observer | show | stopall>", "primary" : { "dbTargetName" : "<primary database target name>", "dbTargetType" : "oracle_database | rac_database", "dbCredName" : "<primary database credential name>", "dbHostCredName" : "<primary database host credential name>" } } |
Sample Response |
Show { "status": "Succeeded", "submissionName" : "ShowObserver_*", "executionGUID" : "<execution guid>", "databaseName" : "<primary database name>", "message" : "Deployment procedure to list the observer(s) for the Data Guard Configuration associated with the primary database <primary database name> is successfully submitted." } Delete Alternate Observer { "status" : "Succeeded", "submissionName" : "DeleteAlternateObserver_*", "executionGUID" : "<execution guid>", "databaseName" : "<primary database name>", "message" : "Deployment procedure to delete the alternate observer for the Data Guard Configuration associated with the primary database <primary database name> is successfully submitted." } Stop All { "status" : "Succeeded", "submissionName" : "StopObserver_*", "executionGUID" : "<execution guid>", "databaseName" : "<primary database name>", "message" : "Deployment procedure to stop the observer(s) for the Data Guard Configuration associated with the primary database <primary database name> is successfully submitted." } |
Request method |
POST |
Supported Since Release |
EM DB 13.4 |
Table 12-9 Stop Observers
Feature | Description |
---|---|
URL |
|
Request header |
Authorization: basic Content-Type: application/json |
Body |
{ "action" : "stop", "primary" : { "dbTargetName" : "<primary database target name>", "dbTargetType" : "oracle_database | rac_database", "dbCredName" : "<primary database credential name>", "dbHostCredName" : "<primary database host credential name>" } "observers" : [ {"name" : "<observer 1 name>"}, {"name" : "<observer 2 name>"}, {"name" : "<observer 3 name>"} ] } |
Sample Response |
{ "status" : "Succeeded", "submissionName": "StopObserver_*", "executionGUID" : "<execution guid>", "databaseName" : "<primary database name>", "message" : "Deployment procedure to stop the observer(s) for the Data Guard Configuration associated with the primary database <primary database name> is successfully submitted." } |
Request method |
POST |
Supported Since Release |
EM DB 13.4 |
Table 12-10 Set Master Observer
Feature | Description |
---|---|
URL |
|
Request header |
Authorization: basic Content-Type: application/json |
Body |
{ "action" : "setMaster", "primary" : { "dbTargetName" : "<primary database target name>", "dbTargetType" : "oracle_database | rac_database", "dbCredName" : "<primary database credential name>", "dbHostCredName" : "<primary database host credential name>" } "masterObserver" : "<master observer name>" } |
Sample Response |
{ "status" : "Succeeded", "submissionName": "SetMasterObserver_*", "executionGUID" : "<execution guid>", "databaseName" : "<primary database name>", "message" : "Deployment procedure to set the master observer for the Data Guard Configuration associated with the primary database <primary database name> is successfully submitted." } |
Request method |
POST |
Supported Since Release |
EM DB 13.4 |
Table 12-11 Observer Parameters
Parameter | Description | Required | Value | Default Value |
---|---|---|---|
action |
The action the API will execute. All the operations are
mutually exclusive. They can't be combined and must be executed
separately.
|
Required | start | delete_alternate_observer | show | stop | stopall | setMaster |
dbTargetName | Primary database Enterprise Manager target name. | Required | N/A |
dbTargetType |
Primary database target type. |
Required | oracle_database | rac_database |
dbCredName |
Primary database named credential for a user with SYSDBA or SYSDG role. |
[OPTIONAL] | Preferred credentials will be used. |
dbHostCredName |
Primary database host named credential for an operating system user who can access the primary database Oracle home. |
[OPTIONAL] | Preferred credentials will be used. |
name | Observer name. | Required | N/A |
hostName | Host name where observer will be started. | Required | N/A |
oracleHome | Oracle home location on the host where the observer will be started. | Required | N/A |
hostCredName | Host named credential for user who can access the observer Oracle home. | Required | N/A |
hostWalletCredName | Named credential of the Oracle wallet configured in the observer Oracle home. | Required | N/A |
isMaster |
Defines if the observer is master. |
[OPTIONAL] | Y | N |
masterObserver |
Required for Set Master Observer Defines the master observer. |
[OPTIONAL] | N/A |
runTimeDataFile |
Runtime data file path and name for the observer. If not specified, the file fsfo.dat will be created under the Oracle base. |
[OPTIONAL] | N/A |
logFile |
The full path of the observer log file. |
[OPTIONAL] | N/A |
hostName | host name of host containing the pre and post role change callout scripts | Optional | N/A |
hostCredentials | host credential name of host containing pre and post role change callout scripts | Optional | N/A |
preCallout | Full path of pre role change callout script | Optional | N/A |
postCallout | Full path of post role change callout script | Optional | N/A |
sucFileName | Name of the success (.suc) file that the precallout script creates | Optional | precallout.suc |
errorFileName | Name of the error (.err) file that the precallout script creates | Optional | precallout.err |
fsfoPreCalloutTimeout | Callout timeout, numeric value expressed in seconds | Optional | 600 seconds |
fsfoActionOnPreCalloutFailure | Precallout action in case of failure. STOP or CONTINUE | Optional | STOP | CONTINUE Default: Top |