13 Using Oracle Data Guard for Disaster Management and Recovery on Oracle Database Appliance
Understand how you can use Oracle Data Guard for disaster management and recovery on Oracle Database Appliance.
- About Oracle Data Guard on Oracle Database Appliance
Oracle Database Appliance provides client interface through ODACLI commands for easy configuration and management of Oracle Data Guard for high availability, data protection, and disaster recovery. - Configuring Oracle Data Guard on Oracle Database Appliance
Oracle Database Appliance enables you to set up Oracle Data Guard using ODACLI commands. - Viewing Oracle Data Guard Status on Oracle Database Appliance
View Oracle Data Guard status using ODACLI commands. - Performing Oracle Data Guard Operations
Perform failover, switchover, and reinstate operations on Oracle Data Guard using ODACLI commands. - Creating an Oracle Data Guard Network
Create an Oracle Data Guard network and associate it with a database using ODACLI commands. - Migrating an Oracle Data Guard Database from One System to Another
You can migrate Oracle Data Guard databases using ODACLI commands. - Patching Oracle Data Guard Databases on Oracle Database Appliance
Understand how you can patch primary and standby databases on Oracle Data Guard using ODACLI commands. - Upgrading Oracle Data Guard Databases on Oracle Database Appliance
Understand how you can upgrade primary and standby databases on Oracle Data Guard using ODACLI commands. - Enabling Oracle Active Data Guard on Existing Configurations
Understand how you can enable Oracle Active Data Guard on existing configurations. - Deconfiguring Oracle Data Guard on Oracle Database Appliance
Deconfigure Oracle Data Guard status using ODACLI commands.
About Oracle Data Guard on Oracle Database Appliance
Oracle Database Appliance provides client interface through ODACLI commands for easy configuration and management of Oracle Data Guard for high availability, data protection, and disaster recovery.
Oracle Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions. Oracle Data Guard maintains these standby databases as copies of the production database. Then, if the production database becomes unavailable because of a planned or an unplanned outage, Oracle Data Guard can switch any standby database to the production role, minimizing the downtime associated with the outage. Oracle Data Guard can be used with traditional backup, restoration, and cluster techniques to provide a high level of data protection and data availability. Oracle Data Guard transport services are also used by other Oracle features such as Oracle Streams and Oracle GoldenGate for efficient and reliable transmission of redo from a source database to one or more remote destinations.
Note:
Oracle Database Enterprise Edition includes Oracle Data Guard.Configuring Oracle Data Guard on Oracle Database Appliance
Oracle Database Appliance enables you to set up Oracle Data Guard using ODACLI commands.
Prerequisites for Oracle Database Guard Configuration
- Oracle recommends running the primary and the standby databases on separate Oracle Database Appliance hardware, so ensure that you have at least two separate Oracle Database Appliance machines.
- Oracle recommends running the primary and the standby databases on two homogeneous Oracle Database Appliance systems. For example, if the primary database is a High-Availability system, then the standby database must be on a similar High-Availability system.
- Oracle recommends that the primary and standby systems have the same Oracle Database Appliance configuration. The database must have similar configuration for database shape, version, memory, networking, and storage (both must have either Oracle ASM or Oracle ACFS storage) to avoid any unpredictability with the database switch roles.
- The primary and standby systems must be the same Oracle Database Appliance release, and must be on Oracle Database Appliance release 19.8 or later.
- If you have customized the operating system, then ensure that environments on both machines are identical.
- Ensure that your deployment follows Oracle Maximum Availability Architecture (MAA) best practices. See the Oracle Maximum Availability Architecture (MAA) page on Oracle Technology Network.
- If you decide to use Oracle ObjectStore for backup and recovery, then you must configure access for both the primary and standby systems.
- You need the TrustStore password to configure Oracle Data Guard. The
TrustStore password is available in the location
/opt/oracle/dcs/dcscli/cacerts
.
Setting up Backup and Recovery for Oracle Database Guard Configuration
You can use either Object Store or External FRA (NFS) to set up the backup for primary and standby databases when configuring Oracle Data Guard on Oracle Database Appliance. A backup is necessary to instantiate a standby database.
- Configure the agent proxy
settings:
# odacli update-agentConfigParameters -n HttpProxyHost -v www-proxy.test.com -n HttpProxyPort -v 80 -u
For more information, see the topic Configuring Agent Proxy Settings for Object Store Access in this guide.
- Create the Object Store credentials on both primary and standby
systems:
# odacli create-objectstoreswift -e swift_end_point_URL -n Object Store_Swift_name -t Object_Store_tenant_name -u Object_Store_user_name
For example:
# odacli create-objectstoreswift -e https://swiftobjectstorage.us-ashburn-1.oraclecloud.com/v1 -n aaa -t test_user -u testuser
- View the Object Store Swift
name:
# odacli list-objectstoreswifts
- Create the backup
configuration:
# odacli create-backupconfig -d objectstore -c testuser -on aaa -w 7 -cr -n backupConfig7days
- Associate the backup configuration with the
database:
# odacli modify-database -in test_db -bin backupConfig7days -bp
- Create the backup configuration. For High-Availability deployments, run the
command on one node
only.
# odacli create-backupconfig -n nfsbkup -w 10 -d NFS -c /u01/nfs_backup
- Associate the backup configuration with the
database:
# odacli modify-database -in test_db -bin nfsbkup
Configuring Oracle Data Guard using ODACLI commands
Follow these steps:
- Take a backup of your primary database to Object Store or External
FRA (NFS) with the
-ka
option to keep archivelogs enabled.# odacli create-backup primary_DB -ka
For example:# odacli create-backup --backupType Regular-L0 -in test_db -ka
- Save the backup
report:
# odacli describe-backupreport -i eba406c7-ae46-4d1d-a1e5-3e985397b171 > backup_report_test_db_0620.json
The backup report ID is the ID of the backup created in step 1 and can be obtained by running the
odacli list-backupreports
command. - Copy the backup report to the standby system and restore the backup
to a standby
database.
# odacli irestore-database -ro STANDBY
If you want to use Object Store, then specify the Object Store location:
# odacli irestore-database -r backup_report.json -u dbUniqueName -on objectStoreName -bp -ro STANDBY Rman Backup Encryption Password(s). Multiple passwords needs to be comma separated.: Password for SYS user:
In the above command, specify the
dbUniqueName
of the standby system.If your backup option is NFS, then specify the NFS location:
odacli irestore-database -r backup_report.json -u dbUniqueName -bl backup_location -ro STANDBY Password for SYS user:
- Copy the trust store file of the standby machine to the primary
machine, and set the file permissions to
400.
# scp root@standby_host:/opt/oracle/dcs/dcscli/cacerts /opt/oracle/dcs/dcscli/cacerts.standby_host_name # chmod 400 /opt/oracle/dcs/dcscli/cacerts.standby_host_name
- Configure Oracle Data Guard, by running the
odacli configure-dataguard
command on the primary system. Provide the values for your configuration through the interactive command line interface.In the interactive CLI configuration steps, the parameters are as follows:- Standby site address is IP address of the standby host. Provide the fully qualified domain name and hostname if the primary and the standby systems are in the same domain and DNS is configured.
- The TrustStore_password is the value in the
TrustStorePassword
field in the/opt/oracle/dcs/dcscli/dcscli.conf
file on the standby system. - Select Oracle Data Guard protection modes to meet
availability, performance and data protection requirements. Oracle
Data Guard Protection Modes are Maximum Availability, Maximum
Performance, and Maximum Protection. The log transport modes are
ASYNC, SYNC, and FASTSYNC.
You can select the following combinations of protection modes and transport types:
Table 13-1 Oracle Data Guard protection modes and transport modes
Protection Mode \ Transport Type ASYNC FASTSYNC** SYNC MAXPERFORMANCE Y* Y Y MAXAVAILABILITY N Y Y* MAXPROTECTION N N Y* * in the table indicates the default supported pair and ** FASTSYNC mode is available only in Oracle Database 12.1 or later.
# odacli configure-dataguard Standby site address: test_domain BUI username for Standby site (default: oda-admin): BUI password for Standby site: TrustStore path for Standby DCS server (copy from /opt/oracle/dcs/dcscli/cacerts on Standby site to this machine and set file permissions to 400): /cacerts.a TrustStore password for Standby DCS server: TrustStore_Password Database name for Data Guard configuration: test_db Primary site network for Data Guard configuration [vlan162, Public-network] (default: vlan162): Standby site network for Data Guard configuration [Public-network] (default: Public-network): Transport type [ASYNC, FASTSYNC, SYNC] (default: ASYNC): Primary database syspassword: Primary machine listener port (default: 1521): Standby machine listener port (default: 1521): Data Guard configuration name (default: test_db1_test_db2): Data Guard protection mode [MAX_PROTECTION, MAX_PERFORMANCE, MAX_AVAILABILITY] (default: MAX_PERFORMANCE): Enable Active Data Guard? (Y/N, default:N): Y Enable Flashback? (Y/N, default:Y): Y The TrustStore of the Standby site should be removed unless it is necessary for some other purpose. Do you want to delete it? (Y/N, default:Y): n As a requirement, Standby database’s SYS password will be set to Primary database’s after Data Guard configuration. Are you sure you want to proceed? (Y/N): y Data Guard configuration for database 'test_db' started ******************************************************************************************* Step 1: Validate Data Guard configuration request (Primary site) Description: Validate DG Config Creation Job ID: a7053469-1bbe-4fb9-b559-5a3a0d976d7c Started Validate create Data Guard configuration request Finished ******************************************************************************************* Step 2: Validate Data Guard configuration request (Standby site) Description: Validate DG Config Creation Job ID: e240ec9a-c9bb-472a-9b26-2549c0b1d0b9 Started Validate create Data Guard configuration request Finished ******************************************************************************************* Step 3: Download password file from Primary database (Primary site) Description: Download orapwd file from Primary database Started Prepare orapwd file for Primary database test_db Finished ******************************************************************************************* Step 4: Upload password file to Standby database (Standby site) Description: Upload orapwd file to Standby database Started Write orapwd file to Standby database test_db Finished ******************************************************************************************* Step 5: Configure Primary database (Primary site) Description: DG Config service creation - ConfigurePrimary Job ID: 8e3ccee3-4ee0-4c78-be9f-7c5a991ca680 Started Configure host DNS on primary env Configure Data Guard Tns on primary env Enable Data Guard related Db parameters for primary env Enable force logging and archivelog mode in primary env Enable FlashBack Configure network parameters for local listener on primary env Restart listener on primary env Create services for primary db Finished ******************************************************************************************* Step 6: Configure Standby database (Standby site) Description: DG Config service creation - ConfigureStandby Job ID: 55520496-24d8-4c6f-8b67-3ff59a86a79a Started Configure Data Guard Tns on standby env Configure host DNS on standby env Clear Data Guard related Db parameters for standby env Enable Data Guard related Db parameters for standby env Enable force logging and archivelog mode in standby env Populate standby database metadata Configure network parameters for local listener on standby env Reset Db sizing and hidden parameters for ODA best practice Restart listener on standby env Create services for standby db Finished ******************************************************************************************* Step 7: Configure and enable Data Guard (Primary site) Description: DG Config service creation - ConfigureDg Job ID: c79dea2d-3d2f-4179-bbe2-aee254d5ec32 Started Config and enable Data Guard Post check Data Guard configuration Finished ******************************************************************************************* Step 8: Enable Flashback (Standby machine) Description: DG Config service creation - EnableFlashback Job ID: 8220286f-e6d6-4a37-a886-ae9af7c29a6e Started Enable FlashBack Finished ******************************************************************************************* Step 9: Enable Active Data Guard (Standby machine) Description: DG Config service creation - EnableActivedg Job ID: 3117c046-2d71-453d-9950-c85bed19f5f2 Started Open standby db Restart standby db Finished ******************************************************************************************* Step 10: Create Data Guard status (Primary site) Description: DG Status service creation - NewDgconfig Job ID: 6fb707c5-5f9f-41ab-bc89-7da5e3f3996c Started Create Data Guard status Finished ****************************************************************************************** Step 11: Create Data Guard status (Standby site) Description: DG Status service creation - NewDgconfig Job ID: d47aad99-0e64-40aa-bffd-6f76ec00555d Started Create Data Guard status Finished ******************************************************************************************* Configure Data Guard test_db1_test_db2 completed *******************************************************************************************
You can also specify a JSON file to configure Oracle Data Guard. An example JSON file is described in this topic.# odacli configure-dataguard -r configdg_ODA_HA.json Standby machine address: 192.214.108.19 BUI username for Standby machine (default: oda-admin): BUI password for Standby machine: TrustStore path for Standby DCS server (copy from /opt/oracle/dcs/dcscli/cacerts on Standby machine to this machine and set file permissions to 400): /cacerts.a TrustStore password for Standby DCS server: TrustStore_password Primary database syspassword: The TrustStore of the Standby machine should be removed unless it is necessary for some other purpose. Do you want to delete it? (Y/N, default:Y): n As a requirement, Standby database’s SYS password will be set to Primary database’s after Data Guard configuration. Are you sure you want to proceed? (Y/N): y Data Guard configuration for database 'test' started ******************************************************************************************* Step 1: Validate Data Guard configuration request (Primary machine) .....
For more information about these command options, see the Oracle Database Appliance Command Line Reference chapter in this guide.
Example JSON for configuring Oracle Data Guard on Oracle Database Appliance
{
"name": "test1_test7",
"protectionMode": "MAX_PERFORMANCE",
"enableFlashback": true,
"enableActiveDg": false,
"replicationGroups": [
{
"sourceEndPoints": [
{
"endpointType": "PRIMARY",
"hostName": "test_domain1",
"listenerPort": 1521,
"databaseUniqueName": "test1",
"ipAddress": "192.214.96.214"
},
{
"endpointType": "PRIMARY",
"hostName": "test_domain2",
"listenerPort": 1521,
"databaseUniqueName": "test1",
"ipAddress": "192.214.96.215"
}
],
"targetEndPoints": [
{
"endpointType": "STANDBY",
"hostName": "test_domain1",
"listenerPort": 1521,
"databaseUniqueName": "test7",
"ipAddress": "192.214.108.19"
},
{
"endpointType": "STANDBY",
"hostName": "test_domain2",
"listenerPort": 1521,
"databaseUniqueName": "test7",
"ipAddress": "192.214.108.20"
}
],
"transportType": "ASYNC"
}
]
}
Viewing Oracle Data Guard Status on Oracle Database Appliance
View Oracle Data Guard status using ODACLI commands.
Viewing Oracle Data Guard Status using ODACLI commands
- To view the status of primary and standby databases in your Oracle Data
Guard configuration, use the following
command:
# odacli list-dataguardstatus
- To view the status of your specific Oracle Data Guard
configuration, use the following command:
# odacli describe-dataguardstatus -i 5f0ed48a-366d-454c-a389-fe367772dbb7
For more information about these command options, see the Oracle Database Appliance Command Line Reference chapter in this guide.
Performing Oracle Data Guard Operations
Perform failover, switchover, and reinstate operations on Oracle Data Guard using ODACLI commands.
Performing Oracle Data Guard operations using ODACLI commands
- To switch roles between the primary database and standby
database in your Oracle Data Guard configuration, run the following command
on the primary
system:
# odacli switchover-dataguard -i dg_ID -u standby_db_unique_name_to_switchover
For example:
# odacli switchover-dataguard -i 75f23ce0-006a-4aeb-ba6d-b4b60275c19 -u test_db2
Confirm that the switchover of roles completed successfully:
# odacli describe-dataguardstatus -i 75f23ce0-006a-4aeb-ba6d-b4b60275c19
- A failover provides for transitioning a standby database in your
configuration to take over the primary database role, if all instances of an
Oracle RAC primary database fail, or are unreachable.
To failover a standby database to the primary database in your Oracle Data Guard configuration, run the following command on your current standby system:
# odacli failover-dataguard -i dg_ID -u standby_db_unique_name_to_failover_to
For example:
# odacli failover-dataguard -i 75f23ce0-006a-4aeb-ba6d-b4b60275c19 -u test_db2
Confirm that the requested database failover to the new primary database has completed successfully:
# odacli describe-dataguardstatus -i 75f23ce0-006a-4aeb-ba6d-b4b60275c19
-
To reinstate a failed primary database after a failover and convert it to a new standby database in your Oracle Data Guard configuration, run the following command on your new primary system:
# odacli reinstate-dataguard -i dg_ID -u db_unique_name_to_reinstate
For example:
# odacli reinstate-dataguard -i 75f23ce0-006a-4aeb-ba6d-b4b60275c19 -u test_db2
Confirm that the requested database is reinstated as a new standby database:
# odacli describe-dataguardstatus -i 75f23ce0-006a-4aeb-ba6d-b4b60275c19
For more information about these command options, see the Oracle Database Appliance Command Line Reference chapter in this guide.
Creating an Oracle Data Guard Network
Create an Oracle Data Guard network and associate it with a database using ODACLI commands.
Configuring an Oracle Data Guard Network using ODACLI commands
You can configure Oracle Data Guard using a network of type Public, Database, or Dataguard.
- Create the
network:
# odacli create-network -n btbond1 -t VLAN -p 192.209.10.227 -w Dataguard -no-d -s 255.255.255.240 -v 369 -g 192.209.10.225
- View the new
network:
# odacli list-networks ID Name NIC Interface Type Subnet Mask Gateway VLAN ID Node Networks -------------------------------------- -------------------- ------------ --------------- ------------------ ------------------ -------- ----------------------- 836cfa4b-5d2c-45e3-a62d-099fc7c57984 Private-network priv0 INTERNAL 255.255.255.240 [ IP Address on node0: 192.168.16.24 ] 1a312239-761d-4321-84d2-8da406f21e5c Public-network btbond1.359 VLAN 255.255.255.240 10.209.10.65 359 [ IP Address on node0: 192.209.10.69 ] f279ac96-5a4a-4b73-86af-1afbdb6ae5d4 vlan369 btbond1.369 VLAN 255.255.255.240 10.209.10.225 369 [ IP Address on node0: 192.209.10.227]
- To attach a network of type Dataguard to a
database:
# odacli modify-database -in test_db -an vlan369
For more information about these command options, see the Oracle Database Appliance Command Line Reference chapter in this guide.
Migrating an Oracle Data Guard Database from One System to Another
You can migrate Oracle Data Guard databases using ODACLI commands.
Migrating Oracle Data Guard Database using ODACLI commands
If your database is on an old Oracle Database Appliance hardware model, and you want to move your deployment to a new Oracle Database Appliance hardware, then you can use your Oracle Data Guard configuration on Oracle Database Appliance to migrate from one system to another.
- Oracle recommends running the primary and the standby databases on separate Oracle Database Appliance hardware, so ensure that you have at least two separate Oracle Database Appliance machines.
- The primary and standby systems must be the same Oracle Database Appliance release, and must be on Oracle Database Appliance release 19.8 or later. The instances on the primary and standby databases must have similar configuration for database parameter settings including database version, memory, CPU, networking, and storage (Oracle ASM or Oracle ACFS), thus avoiding any unpredictability when the databases switch roles.
- If you have customized the operating system, then ensure that environments on both machines are identical.
- Ensure that your deployment follows Oracle Maximum Availability Architecture (MAA) best practices.
Follow these steps:
- Take a backup of your primary database to Object Store or External
FRA (NFS) with the option to keep archivelogs enabled.
# odacli create-backup primary_DB -ka
For example:# odacli create-backup --backupType Regular-L0 -in test_db -ka
- Save the backup
report:
# odacli describe-backupreport -i eba406c7-ae46-4d1d-a1e5-3e985397b171 > backup_report_test_db_0620.json
The backup report ID is the ID of the backup created in step 1 and can be obtained by running the
odacli list-backupreports
command. - Copy the backup report to the standby system and restore the backup
to a standby
database.
# odacli irestore-database -ro STANDBY
If your backup option is Object Store, then specify the Object Store location:
# odacli irestore-database -r backup_report.json -u dbUniqueName -on objectStoreName -bp -ro STANDBY -dh Password for SYS user: Rman Backup Encryption Password(s). Multiple passwords needs to be comma separated.:
If your backup option is NFS, then specify the NFS location:
odacli irestore-database -r backup_report.json -u dbUniqueName -ro STANDBY Password for SYS user:
- Copy the trust store file of the standby machine to the primary
machine, and set the file permissions to
400.
# scp root@standby_host:/opt/oracle/dcs/dcscli/cacerts/opt/oracle/dcs/dcscli/cacerts.standby_host_name # chmod 400 /opt/oracle/dcs/dcscli/cacerts.standby_host_name
- Configure Oracle Data Guard, by running the following command on the
primary
system:
# odacli configure-dataguard Standby site address: test_domain BUI username for Standby site (default: oda-admin): BUI password for Standby site: TrustStore path for Standby DCS server (copy from /opt/oracle/dcs/dcscli/cacerts on Standby site to this machine and set file permissions to 400): /cacerts.a TrustStore password for Standby DCS server: TrustStore_Password Database name for Data Guard configuration: test_db Primary site network for Data Guard configuration [vlan162, Public-network] (default: vlan162): Standby site network for Data Guard configuration [Public-network] (default: Public-network): Transport type [ASYNC, FASTSYNC, SYNC] (default: ASYNC): Primary database syspassword: Primary machine listener port (default: 1521): Standby machine listener port (default: 1521): Data Guard configuration name (default: test_db1_test_db2): Data Guard protection mode [MAX_PROTECTION, MAX_PERFORMANCE, MAX_AVAILABILITY] (default: MAX_PERFORMANCE): Enable Active Data Guard? (Y/N, default:N): Y The TrustStore of the Standby site should be removed unless it is necessary for some other purpose. Do you want to delete it? (Y/N, default:Y): n As a requirement, Standby database’s SYS password will be set to Primary database’s after Data Guard configuration. Are you sure you want to proceed? (Y/N): y Data Guard configuration for database 'test_db' started ******************************************************************************************* Step 1: Validate Data Guard configuration request (Primary site) Description: Validate DG Config Creation Job ID: a7053469-1bbe-4fb9-b559-5a3a0d976d7c Started Validate create Data Guard configuration request Finished ******************************************************************************************* Step 2: Validate Data Guard configuration request (Standby site) Description: Validate DG Config Creation Job ID: e240ec9a-c9bb-472a-9b26-2549c0b1d0b9 Started Validate create Data Guard configuration request Finished ******************************************************************************************* Step 3: Download password file from Primary database (Primary site) Description: Download orapwd file from Primary database Started Prepare orapwd file for Primary database test_db Finished ******************************************************************************************* Step 4: Upload password file to Standby database (Standby site) Description: Upload orapwd file to Standby database Started Write orapwd file to Standby database test_db Finished ******************************************************************************************* Step 5: Configure Primary database (Primary site) Description: DG Config service creation - ConfigurePrimary Job ID: 8e3ccee3-4ee0-4c78-be9f-7c5a991ca680 Started Configure host DNS on primary env Configure Data Guard Tns on primary env Enable Data Guard related Db parameters for primary env Enable force logging and archivelog mode in primary env Enable FlashBack Configure network parameters for local listener on primary env Restart listener on primary env Create services for primary db Finished ******************************************************************************************* Step 6: Configure Standby database (Standby site) Description: DG Config service creation - ConfigureStandby Job ID: 55520496-24d8-4c6f-8b67-3ff59a86a79a Started Configure Data Guard Tns on standby env Configure host DNS on standby env Clear Data Guard related Db parameters for standby env Enable Data Guard related Db parameters for standby env Enable force logging and archivelog mode in standby env Populate standby database metadata Configure network parameters for local listener on standby env Reset Db sizing and hidden parameters for ODA best practice Restart listener on standby env Create services for standby db Finished ******************************************************************************************* Step 7: Configure and enable Data Guard (Primary site) Description: DG Config service creation - ConfigureDg Job ID: c79dea2d-3d2f-4179-bbe2-aee254d5ec32 Started Config and enable Data Guard Post check Data Guard configuration Finished ******************************************************************************************* Step 8: Enable Flashback (Standby machine) Description: DG Config service creation - EnableFlashback Job ID: 8220286f-e6d6-4a37-a886-ae9af7c29a6e Started Enable FlashBack Finished ******************************************************************************************* Step 9: Enable Active Data Guard (Standby machine) Description: DG Config service creation - EnableActivedg Job ID: 3117c046-2d71-453d-9950-c85bed19f5f2 Started Open standby db Restart standby db Finished ******************************************************************************************* Step 10: Create Data Guard status (Primary site) Description: DG Status service creation - NewDgconfig Job ID: 6fb707c5-5f9f-41ab-bc89-7da5e3f3996c Started Create Data Guard status Finished ****************************************************************************************** Step 11: Create Data Guard status (Standby site) Description: DG Status service creation - NewDgconfig Job ID: d47aad99-0e64-40aa-bffd-6f76ec00555d Started Create Data Guard status Finished ******************************************************************************************* Configure Data Guard test_db1_test_db2 completed *******************************************************************************************
Note: The TrustStore_password is the value in the
TrustStorePassword
field in the/opt/oracle/dcs/dcscli/dcscli.conf
file on the standby system. - Check the status of Oracle Data Guard and ensure it is
working:
# odacli describe-dataguardstatus
- Switch over to the standby
database:
# odacli switchover-dataguard -i 75f23ce0-006a-4aeb-ba6d-b4b60275c19 -u houdg02
- Deconfigure Oracle Data Guard. The process also deletes the standby
database on the old Oracle Database Appliance hardware
machine.
# odacli deconfigure-dataguard -i 8396aac4-f7e7-42e4-a2e8-0cbbc89ce31b Standby site address: test_domain BUI username for Standby site (default: oda-admin): BUI password for Standby site: TrustStore path for Standby DCS server (copy from /opt/oracle/dcs/dcscli/cacerts on Standby site to this site and set file permissions to 400): /cacerts.a TrustStore password for Standby DCS server: The TrustStore of the Standby site should be removed unless it is necessary for some other purpose. Do you want to delete it? (Y/N, default:Y): n Standby database will be deleted after Data Guard configuration is removed. Are you sure you want to proceed? (Y/N): y Deconfigure Dataguard Started ******************************************************************************************* Step 1: Deconfigure Data Guard (Primary site) Description: Deconfigure DG service Job ID: 8deb3e4c-09cd-4593-8184-f7706dd2ec8a Started Deconfigure Data Guard service Cleanup broker resources Finished ******************************************************************************************* Step 2: Delete Data Guard status (Primary site) Description: DG Status service creation - UpdateDgconfig Job ID: 59c61629-6c7d-474c-8c29-c0a9565d91a3 Started Update Data Guard status Finished ******************************************************************************************* Step 3: Delete Data Guard status (Standby site) Description: DG Status service creation - UpdateDgconfig Job ID: 93dcf4cd-1019-4bcd-984a-d3efeb3fae6e Started Update Data Guard status Finished ******************************************************************************************* Step 4: Delete Standby database (Standby site) Description: Database service deletion with db name: test_db with id : 30dd49da-a54f-4a9a-abbf-d3a4e39abee5 Job ID: 0b1cb921-fd41-4e01-86df-beff3adb6de0 Started Validate db 30dd49da-a54f-4a9a-abbf-d3a4e39abee5 for deletion Database Deletion Unregister Db From Cluster Kill Pmon Process Database Files Deletion Deleting Volume Delete File Groups of Database test_db Finished ******************************************************************************************* Data Guard configuration is removed
For more information about these command options, see the Oracle Database Appliance Command Line Reference chapter in this guide.
Patching Oracle Data Guard Databases on Oracle Database Appliance
Understand how you can patch primary and standby databases on Oracle Data Guard using ODACLI commands.
Patching Oracle Data Guard primary and standby databases using ODACLI commands
Before patching the database homes, upload the RDBMS Clone Files for the database version, to the repository. See Updating Oracle Database Appliance Repository with Database Clone Files Using the CLI for the procedure to update the repository with the latest RDBMS Clone Files. Also ensure that the primary Oracle Database Appliance system and the standby Oracle Database Appliance system are on the same Oracle Database Appliance release. It is recommended that the two systems be on the latest Oracle Database Appliance release. See Patching Oracle Database Appliance Bare Metal Systems Using the Command-Line for the procedure to patch your Oracle Database Appliance deployment.
- Run the following command on the standby
database:
# odacli update-dbhome
- After patching job on the standby database is successful, run
the following command on the primary
database:
# odacli update-dbhome
- Confirm that the patching jobs are
successful:
# /opt/oracle/dcs/bin/odacli list-jobs
- Confirm the existing Data Guard configuration is working properly
by running the following command on both primary and standby
systems:
odacli describe-dataguardstatus -i dgid
For more information about these command options, see the Oracle Database Appliance Command Line Reference chapter in this guide.
Upgrading Oracle Data Guard Databases on Oracle Database Appliance
Understand how you can upgrade primary and standby databases on Oracle Data Guard using ODACLI commands.
Upgrading Oracle Data Guard primary and standby databases using ODACLI commands
Before upgrading the database homes, upload the RDBMS Clone Files for the database version, to the repository. See Updating Oracle Database Appliance Repository with Database Clone Files Using the CLI for the procedure to update the repository with the latest RDBMS Clone Files. Ensure that the primary Oracle Database Appliance system and the standby Oracle Database Appliance system are on the same Oracle Database Appliance release, and on Oracle Database Appliance release 19.8 or later. It is recommended that the two systems be on the latest Oracle Database Appliance release. See Patching Oracle Database Appliance Bare Metal Systems Using the Command-Line for the procedure to patch your Oracle Database Appliance deployment.
- Run the following command to disable log transport and
apply:
EDIT DATABASE primary_database SET STATE=‘TRANSPORT-OFF’; EDIT DATABASE standby_database SET STATE=‘APPLY-OFF’;
- Upgrade the standby
database:
# odacli upgrade-database -i standby_databaseId -to destination_DbHomeId
- Upgrade the primary
database:
# odacli upgrade-database -i primary_databaseId -to destination_DbHomeId
- Run the following command to enable log transport and
apply:
EDIT DATABASE primary_database SET STATE=‘TRANSPORT-ON’; EDIT DATABASE standby_database SET STATE=‘APPLY-ON’;
- Confirm the existing Data Guard configuration is working
properly by running the following command on both primary and standby
systems several
times:
odacli describe-dataguardstatus -i dgid
For more information about these command options, see the Oracle Database Appliance Command Line Reference chapter in this guide.
Enabling Oracle Active Data Guard on Existing Configurations
Understand how you can enable Oracle Active Data Guard on existing configurations.
Oracle Active Data Guard is licensed option to the Oracle Database Enterprise Edition and enables advanced capabilities that extend the basic Oracle Data Guard functionality.
- Modify database to have read-only start
option:
srvctl modify database -d standby_db_unique_name -startoption "read only" srvctl stop database -d standby_db_unique_name srvctl start database -d standby_db_unique_name
To check if Oracle Data Guard has read-only start option set, run the following command:
srvctl config database -d standby_db_unique_name | grep "Start options"
- Enable redo log apply by running the following PL/SQL
commands:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Deconfiguring Oracle Data Guard on Oracle Database Appliance
Deconfigure Oracle Data Guard status using ODACLI commands.
Deconfiguring Oracle Data Guard Status using ODACLI commands
- To deconfigure Oracle Data Guard and delete the standby
database, run the following command on the primary
system:
# odacli deconfigure-dataguard -i 8396aac4-f7e7-42e4-a2e8-0cbbc89ce31b Standby site address: test_domain BUI username for Standby site (default: oda-admin): BUI password for Standby site: TrustStore path for Standby DCS server (copy from /opt/oracle/dcs/dcscli/cacerts on Standby site to this site and set file permissions to 400): /cacerts.a TrustStore password for Standby DCS server: The TrustStore of the Standby site should be removed unless it is necessary for some other purpose. Do you want to delete it? (Y/N, default:Y): n Standby database will be deleted after Data Guard configuration is removed. Are you sure you want to proceed? (Y/N): y Deconfigure Dataguard Started ******************************************************************************************* Step 1: Deconfigure Data Guard (Primary site) Description: Deconfigure DG service Job ID: 8deb3e4c-09cd-4593-8184-f7706dd2ec8a Started Deconfigure Data Guard service Cleanup broker resources Finished ******************************************************************************************* Step 2: Delete Data Guard status (Primary site) Description: DG Status service creation - UpdateDgconfig Job ID: 59c61629-6c7d-474c-8c29-c0a9565d91a3 Started Update Data Guard status Finished ******************************************************************************************* Step 3: Delete Data Guard status (Standby site) Description: DG Status service creation - UpdateDgconfig Job ID: 93dcf4cd-1019-4bcd-984a-d3efeb3fae6e Started Update Data Guard status Finished ******************************************************************************************* Step 4: Delete Standby database (Standby site) Description: Database service deletion with db name: test_db with id : 30dd49da-a54f-4a9a-abbf-d3a4e39abee5 Job ID: 0b1cb921-fd41-4e01-86df-beff3adb6de0 Started Validate db 30dd49da-a54f-4a9a-abbf-d3a4e39abee5 for deletion Database Deletion Unregister Db From Cluster Kill Pmon Process Database Files Deletion Deleting Volume Delete File Groups of Database test_db Finished ******************************************************************************************* Data Guard configuration is removed
For deconfiguring Oracle Data Guard, you must specify the Oracle Data Guard Configuration ID. Run the
odacli list-dataguardstatus
command to find the Oracle Data Guard Configuration ID.
For more information about these command options, see the Oracle Database Appliance Command Line Reference chapter in this guide.