3 Scenario: Configuring Oracle Data Guard using ODACLI Commands
This scenario describes setting up Oracle Data Guard on Oracle Database Appliance using ODACLI commands.
- Environment
Understand the primary and standby database environment topologies used in the subsequent Data Guard setup example using Oracle Database Appliance. - Configuring Oracle Data Guard
Understand the steps to configure Oracle Data Guard. - Performing Switchover on Oracle Data Guard
Understand the steps to switchover Oracle Data Guard. - Failover Oracle Data Guard
Understand the steps to failover Oracle Data Guard. - Deconfiguring Oracle Data Guard
Understand the steps to deconfigure Oracle Data Guard. - Configuring Additional Network on Oracle Data Guard
Understand how to set up additional network for Oracle Data Guard.
Environment
Understand the primary and standby database environment topologies used in the subsequent Data Guard setup example using Oracle Database Appliance.

Description of the illustration oda_with_data_guard.png
Component | Primary Oracle Database Appliance | Standby Oracle Database Appliance |
---|---|---|
Host Names | proddb1, proddb2 | stbydb1, stbydb2 |
Database Name | hun | hun |
Database Unique Name | buda | pest |
Instance Name | budapest1, budapest2 | budapest1, budapest2 |
SCAN Name and IPs | proddb-scan (10.1.27.2, 10.1.27.3) | stbydb-scan (10.1.27.4, 10.1.27.5) |
Grid Infrastructure Software Installation | /u01/app/19.21.0.0/grid | /u01/app/19.21.0.0/grid |
Oracle Database Software Installation | /u01/app/odaorahome/oracle/product/19.0.0.0/db_home1 | /u01/app/odaorahome/oracle/product/19.0.0.0/db_home1 |
Database storage | ASM | ASM |
ARCHIVELOG mode | Yes | Yes |
FORCE LOGGING mode | Yes | Yes |
Configuring Oracle Data Guard
Understand the steps to configure Oracle Data Guard.
Configure remote database backup for the source database either on NFS or on the cloud-based Oracle Object Store
Note:
If the NAS or external NFS server is not already configured, then follow the steps described in the Configuring NFS Server on Oracle Database Appliance topic in this document.- The NFS file system must be mounted on all source and target nodes.
- For a TDE-enabled database, the database and TDE backup
folders must be readable and writeable by the
oracle
operating system user. - For a database without TDE encryption, the database must
be readable and writeable by the
oracle
operating system user. - The NFS file system must be shared with the
no_root_squash
option. - When configuring the backup location on Oracle Object Storage, for a TDE-enabled database, create dedicated buckets for database and TDE backups. For database without TDE encryption, create a bucket for the database backups.
Follow these steps:
- Create a backup configuration.
If you use NFS file system as the backup location, then run the following command:If you use Oracle Object Storage as your backup location, then perform the following steps:
-
For a TDE-enabled database:
# odacli create-backupconfig -d NFS -n nfs -cr -c /odabackup/db -f /odabackup/tde -w 7
- For a non-TDE database with or
without an RMAN backup
password:
# odacli create-backupconfig -d NFS -n nfs -cr -c /odabackup/db -w 7
- Update the DCS agent configuration with the
internet proxy, if
required.
[root@proddb1] # odacli update-agentconfig-parameters -n HttpProxyHost -v proxy.oracle.com -n HttpProxyPort -v 80 -u
- Create Object Storage credential
details.
[root@proddb1] # odacli create-objectstoreswift -e https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1 -n oosswift -t mytenant -u firstname.lastname@oracle.com
- Create a backup
configuration.
[root@proddb1] # odacli create-backupconfig -d ObjectStore -c dbbackups -on oosswift -w 7 -f tdebackups -cr -n backupConfig2ObjectStorage
-
- Verify that the backup configuration is available.
For
example:
[root@proddb1] # odacli list-backupconfigs ID Name RecoveryWindow CrosscheckEnabled BackupDestination ------------------------------------------------------------------------------------------------------------------------------------- ------------------- -------------------- c0bc22a2-b9c0-4b3e-a4fb-1e69c661cfbf backupConfig2ObjectStorage 7 true ObjectStore 251aadf9-34ea-4579-aab7-d0e0c8f27dc7 nfs 7 true NFS
- Assign the backup configuration to the source
database.
For a TDE-enabled database:
[root@proddb1] # odacli modify-database -n hun -bin nfs
For a non-TDE database with an RMAN backup password:[root@proddb1] # odacli modify-database -n hun -bin nfs -bp
For a non-TDE database without an RMAN backup password:[root@proddb1] # odacli modify-database -n hun -bin nfs
Create a Level 0 database backup and keep archive logs
- Create a backup
configuration:
[root@proddb1] # odacli create-backup -n hun -bt Regular-L0 -ka { "jobId" : "2ff6931c-aa69-4529-92fa-379dda6e6a36", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "March 18, 2022 16:15:57 PM CET", "resourceList" : [ ], "description" : "Create Regular-L0 Backup[TAG:auto][Db:hun][NFS:/odabackup/db/orabackups/primaryODA-c/database/2894792645/buda]", "updatedTime" : "March 18, 2022 16:15:57 PM CET" }
- Verify that the job completed
successfully:
[root@proddb1] # odacli describe-job -i 2ff6931c-aa69-4529-92fa-379dda6e6a36 Job details ---------------------------------------------------------------- ID: 2ff6931c-aa69-4529-92fa-379dda6e6a36 Description: Create Regular-L0 Backup[TAG:auto][Db:hun][NFS:/odabackup/db/orabackups/primaryODA-c/database/2894792645/buda] Status: Success Created: March 18, 2022 4:15:57 PM CET Task Name Start Time End Time Status -------------------------------------------------------------------------------------------------------------- ---------- Validate TDE Wallet Existence March 18, 2022 4:16:00 PM CET March 18, 2022 4:16:01 PM CET Success Validate backup config March 18, 2022 4:16:01 PM CET March 18, 2022 4:16:01 PM CET Success NFS location existence validation March 18, 2022 4:16:01 PM CET March 18, 2022 4:16:02 PM CET Success Backup Validations March 18, 2022 4:16:02 PM CET March 18, 2022 4:16:07 PM CET Success Recovery Window validation March 18, 2022 4:16:07 PM CET March 18, 2022 4:16:10 PM CET Success Archivelog deletion policy configuration March 18, 2022 4:16:10 PM CET March 18, 2022 4:16:14 PM CET Success Database backup March 18, 2022 4:16:14 PM CET March 18, 2022 4:17:41 PM CET Success Password Protected TDE Wallet Backup March 18, 2022 4:17:41 PM CET March 18, 2022 4:17:42 PM CET Success
- Identify the ID of the backupreport that belongs to the L0
backup.
[root@proddb1]# odacli list-backupreports Backup Report Id Database Resource Id Database DbId DB Name DB Unique Name Backup Type Backup Tag Create Time Updated Time Status ---------------------------------------- ---------------------------------------- ------------- ---------- -------------- ------------ ------------ ----------------------------- 13faba84-d83f-499d-ae4a-4bb451f4702c c0409b01-03da-4326-b268-29a48d8d617f 2894792645 hun buda Regular-L0 auto March 18, 2022 4:16:14 PM CET March 18, 2022 4:17:42 PM CET Configured
- Take a backup of the backup report in JSON format
and copy it to the standby system backup on
NFS.
[root@proddb1]# odacli describe-backupreport -i 13faba84-d83f-499d-ae4a-4bb451f4702c > /odabackup/backupreport_hun_20220318.json
Backup on Oracle Object Storage:[root@proddb1]# odacli describe-backupreport -i 13faba84-d83f-499d-ae4a-4bb451f4702c > /tmp/backupreport_hun_20220318.json
Copy the JSON file to the standby system:[root@proddb1]# scp /tmp/backupreport_hun_20220318.json root@stbydb1:/tmp
- Verify that the Object Storage Swift or NFS was configured on
the standby side. For NFS, verify with the command
df -h
that the file system is mounted on both target nodes. For Oracle Object Storage, verify with the commandodacli list-objectstoreswifts
that Swift credentials are configured. - Restore the database as a standby on the target.
The target could be a bare metal or DB system. If the target
is a DB system, then ensure that no database is configured
on the DB system.
Identify the ID of the home for an existing home:
[root@stdbydb1 ~]# odacli list-dbhomes ID Name DB Version Home Location Status ---------------------------------------- -------------------- ---------------------------------------- ------------------------------- e8a36f29-7fcf-49fc-8575-c599dc28949d OraDB19000_home1 19.14.0.0.220118 /u01/app/odaorahome/oracle/product/19.0.0.0/dbhome_1 CONFIGURED
Restore the database with the
odacli irestore-database
command.Backup on NFS using an existing database home:[root@stdbydb1 ~]# odacli irestore-database -r /odabackup/backupreport_hun_20220318.json -u pest -ro STANDBY -t -dh e8a36f29-7fcf-49fc-8575-c599dc28949d --backupLocation /odabackup/db
Backup on Oracle Object Storage creating a new database home:[root@stdbydb1 ~]# odacli irestore-database -r backupreport_hun_20220318.json -u pest -on odabackups -ro STANDBY -t
Replace-t
with-bp
in the above commands for a non-TDE database if the backup was protected with an RMAN password. For example:[root@stdbydb1 ~]# odacli irestore-database -r /odabackup/backupreport_hun_20220318.json -u pest -ro STANDBY -t -dh e8a36f29-7fcf-49fc-8575-c599dc28949d --backupLocation /odabackup/db Enter SYS user password: Retype SYS user password: Enter TDE wallet password: { "jobId" : "6d36ebdf-2b31-4d19-a75f-5d997286ed9f", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "March 18, 2022 16:32:16", "resourceList" : [ ], "description" : "Database service recovery with db name: hun", "updatedTime" : "March 18, 2022 16:32:16" }
- Verify that the job completed
successfully.
[root@stbydb1]# odacli describe-job -i "0a35a4af-13bc-4a03-bfe6-ec4ae4e43dc6" Job details ---------------------------------------------------------------- ID: 6d36ebdf-2b31-4d19-a75f-5d997286ed9f Description: Database service recovery with db name: hun Status: Success Created: March 18, 2022 4:32:16 PM CET Task Name Start Time End Time Status ---------------------------------------- ----------------------------------- Check if cluster ware is running March 18, 2022 4:32:17 PM CET March 18, 2022 4:32:17 PM CET Success … Enable New Tablespace Encryption March 18, 2022 4:49:22 PM CET March 18, 2022 4:49:23 PM CET Success
- Verify that the database is in
CONFIGURED
status.[root@stbydb1]# odacli list-databases ID DB Name DB Type DB Version CDB Class Shape Storage Status DbHomeID ---------------------------------------- ---------- -------- ------------ 9cec6f9a-5256-48c0-8386-4bda7ee6b393 hun RAC 19.14.0.0.220118 true OLTP odb2 ASM CONFIGURED e8a36f29-7fcf-49fc-8575-c599dc28949d
Configure Oracle Data Guard from the first node of the primary Oracle Database Appliance system
- Listener port and port 7070 must be open to configure Oracle Data Guard between two appliances.
- Configuring Oracle Data Guard requires Oracle Database Appliance release 19.15 when either the primary or standby database, or both, are configured on a DB system.
Note:
On Oracle Database Appliances releases earlier than 19.21, theodacli configure-dataguard
command requires
an RMAN password even if the backup does not use it. In such cases,
provide a password such as welcome1
which allows
you to proceed with Oracle Data Guard configuration.
- Configure Oracle Data
Guard:
[root@ proddb1]# odacli configure-dataguard Standby site address: stbydb1 BUI username for Standby site. If Multi-user Access is disabled on Standby site, enter 'oda-admin'; otherwise, enter the name of the user who has irestored the Standby database (default: oda-admin): BUI password for Standby site: root@stbydb1's password: Database name for Data Guard configuration: hun Primary database SYS password: ******************************************************************************************* Data Guard default settings Primary site network for Data Guard configuration: Public-network Standby site network for Data Guard configuration: Public-network Primary database listener port: 1521 Standby database listener port: 1521 Transport type: ASYNC Protection mode: MAX_PERFORMANCE Data Guard configuration name: buda_pest Active Data Guard: disabled Do you want to edit this Data Guard configuration? (Y/N, default:N): y ******************************************************************************************* Primary site network for Data Guard configuration [Public-network] (default: Public-network): Standby site network for Data Guard configuration [Public-network] (default: Public-network): Primary database listener port (default: 1521): Standby database listener port (default: 1521): Transport type [ASYNC, FASTSYNC, SYNC] (default: ASYNC): Protection mode [MAX_PROTECTION, MAX_PERFORMANCE, MAX_AVAILABILITY] (default: MAX_PERFORMANCE): Data Guard configuration name (default: buda_pest): Enable Active Data Guard? (Y/N, default:N): n Standby database's SYS password will be set to Primary database's after Data Guard configuration. Ignore warning and proceed with Data Guard configuration? (Y/N, default:N): y ******************************************************************************************* Configure Data Guard buda_pest started ******************************************************************************************* Step 1: Validate Data Guard configuration request (Primary site) Description: Validate DG Config Creation for db hun Job ID: 1cdcc4d9-f869-49ed-90a7-651a0a76db03 Started March 18, 2022 17:02:17 PM CET Validate create Data Guard configuration request Finished March 18, 2022 17:02:21 PM CET ******************************************************************************************* Step 2: Validate Data Guard configuration request (Standby site) Description: Validate DG Config Creation for db hun Job ID: c9dcb3fc-90d7-495e-860d-d3fdd421aad0 Started March 18, 2022 17:02:22 PM CET Validate create Data Guard configuration request Finished March 18, 2022 17:02:27 PM CET ******************************************************************************************* Step 3: Download password file from Primary database (Primary site) Description: Download orapwd file from Primary database Started March 18, 2022 17:02:27 PM CET Prepare orapwd file for Primary database hun Finished March 18, 2022 17:02:32 PM CET ******************************************************************************************* Step 4: Upload password file to Standby database (Standby site) Description: Upload orapwd file to Standby database Started March 18, 2022 17:02:32 PM CET Write orapwd file to Standby database hun Finished March 18, 2022 17:02:43 PM CET ******************************************************************************************* Step 5: Configure Primary database (Primary site) Description: DG Config service for db hun – ConfigurePrimary Job ID: ed2e490d-f3e4-40b5-adee-ec5a31c6cdc6 Started March 18, 2022 17:02:44 PM CET 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 March 18, 2022 17:05:46 PM CET ******************************************************************************************* Step 6: Configure Standby database (Standby site) Description: DG Config service for db hun – ConfigureStandby Job ID: 989931fb-c7ec-4f36-9e8e-7cbe932af96c Started March 18, 2022 17:05:47 PM CET 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 March 18, 2022 17:07:27 PM CET ******************************************************************************************* Step 7: Configure and enable Data Guard (Primary site) Description: DG Config service for db hun – ConfigureDg Job ID: 0616ad61-a6fe-4e33-b9a9-f0ea1698022f Started March 18, 2022 17:07:28 PM CET Config and enable Data Guard Post check Data Guard configuration Finished March 18, 2022 17:08:03 PM CET ******************************************************************************************* Step 8: Enable Flashback (Standby site) Description: DG Config service for db hun – EnableFlashback Job ID: 1104e7ab-de51-4477-9a03-0cc37fc0431f Started March 18, 2022 17:08:04 PM CET Enable FlashBack Finished March 18, 2022 17:11:55 PM CET ******************************************************************************************* Step 9: Re-enable Data Guard (Primary site) Description: DG Config service for db hun – ReenableDg Job ID: 6aea76eb-e51a-4517-ae85-ba6b108804a4 Started March 18, 2022 17:11:56 PM CET Re-enable Data Guard if inconsistent properties found Post check Data Guard configuration Finished March 18, 2022 17:12:53 PM CET ******************************************************************************************* Step 10: Create Data Guard status (Primary site) Description: DG Status operation for db hun – NewDgconfig Job ID: df82b9d3-9a7e-4545-888f-29d678879870 Started March 18, 2022 17:12:53 PM CET Create Data Guard status Finished March 18, 2022 17:13:00 PM CET ******************************************************************************************* Step 11: Create Data Guard status (Standby site) Description: DG Status operation for db hun – NewDgconfig Job ID: 9a70c3b8-5edb-406e-99e8-e03c44000d03 Started March 18, 2022 17:13:01 PM CET Create Data Guard status Finished March 18, 2022 17:13:08 PM CET ******************************************************************************************* Configure Data Guard buda_pest completed *******************************************************************************************
In the interactive CLI configuration steps, the parameters are as follows:
- Standby site address is IP address or host name 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.
- 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.
The following table indicates the default supported pair and the FASTSYNC mode is available only in Oracle Database 12.1 or later:
Protection Mode/Transport Type | ASYNC | FASTSYNC | SYNC |
---|---|---|---|
MAXPERFORMANCE | Y | Y | Y |
MAXAVAILABILITY | N | Y | Y |
MAXPROTECTION | N | N | Y |
Performing Switchover on Oracle Data Guard
Understand the steps to switchover Oracle Data Guard.
Follow these steps on the primary:
- Use the
odacli list-dataguardstatus
command to verify on which system the database is running as the primary. The command also provides the ID of the Data Guard configuration which is needed in switchover and failover commands. In the following example, the systemproddb
hosts the primary database.[root@proddb1]# odacli list-dataguardstatus Updated about 2 second(s) ago ID Name Database Name Role Protection Mode Apply Lag Transport Lag Apply Rate Status ---------------------------------------- -------------------------------------------- be217130-633b-4eef-a4b7-3192028b853c buda_pest hun PRIMARY MAX_PERFORMANCE 0 seconds 0 seconds 14.00 KByte/s CONFIGURED
- Initiate switchover. Provide the Oracle Data Guard
configuration ID and the database unique name of the standby
database. Run the command on the current primary
system.
[root@proddb1 ~]# odacli switchover-dataguard -i be217130-633b-4eef-a4b7-3192028b853c -u pest Password for target database: { "jobId" : "02ddfc45-da95-4f70-8823-bcd30ce3b738", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "March 18, 2022 17:24:11 PM CET", "resourceList" : [ ], "description" : "Dataguard operation for buda_pest - SwitchoverDg", "updatedTime" : "March 18, 2022 17:24:11 PM CET" }
- Monitor the status of the switchover
operation.
[root@proddb1 ~]# odacli describe-job -i "02ddfc45-da95-4f70-8823-bcd30ce3b738" Job details ---------------------------------------------------------------- ID: 02ddfc45-da95-4f70-8823-bcd30ce3b738 Description: Dataguard operation for buda_pest – SwitchoverDg Status: Success Created: March 18, 2022 5:24:11 PM CET Message: Task Name Start Time End Time Status ---------------------------------------- ----------------------------------- ---------- Precheck switchover DataGuard March 18, 2022 5:24:12 PM CET March 18, 2022 5:24:15 PM CET Success Switchover DataGuard March 18, 2022 5:24:15 PM CET March 18, 2022 5:25:24 PM CET Success Postcheck switchover DataGuard March 18, 2022 5:25:24 PM CET March 18, 2022 5:26:19 PM CET Success Check if DataGuard config is updated March 18, 2022 5:26:29 PM CET March 18, 2022 5:26:39 PM CET Success
- Verify the status of Oracle Data Guard on both
nodes after the operation completes successfully. You may
need to run the command a few times to verify the
changes.
[root@proddb1 ~]# odacli describe-dataguardstatus -i be217130-633b-4eef-a4b7-3192028b853c Updated about 2 minute(s) ago Dataguard Status details ---------------------------------------------------------------- ID: be217130-633b-4eef-a4b7-3192028b853c Name: buda_pest Database Name: c0409b01-03da-4326-b268-29a48d8d617f Role: STANDBY Protection Mode: MAX_PERFORMANCE Apply Lag: 0 seconds Transport Lag: 0 seconds Apply Rate: 1.35 MByte/s Status: CONFIGURED Updated Time: March 18, 2022 5:26:26 PM CET [root@stbydb1 ~]# odacli describe-dataguardstatus -i be217130-633b-4eef-a4b7-3192028b853c Updated about 5 minute(s) ago Dataguard Status details ---------------------------------------------------------------- ID: be217130-633b-4eef-a4b7-3192028b853c Name: buda_pest Database Name: 9cec6f9a-5256-48c0-8386-4bda7ee6b393 Role: STANDBY <–------------------------// not updated yet Protection Mode: MAX_PERFORMANCE Apply Lag: 0 seconds Transport Lag: 0 seconds Apply Rate: 2.00 KByte/s Status: CONFIGURED Updated Time: March 18, 2022 5:23:15 PM CET
Running the same command the second time:[root@stbydb1 ~]# odacli describe-dataguardstatus -i be217130-633b-4eef-a4b7-3192028b853c Updated about 34 second(s) ago Dataguard Status details ---------------------------------------------------------------- ID: be217130-633b-4eef-a4b7-3192028b853c Name: buda_pest Database Name: 9cec6f9a-5256-48c0-8386-4bda7ee6b393 Role: PRIMARY <---------------------//role is updated and reflects the right status Protection Mode: MAX_PERFORMANCE Apply Lag: 0 seconds Transport Lag: 0 seconds Apply Rate: 274.00 KByte/s Status: CONFIGURED Updated Time: March 18, 2022 5:29:16 PM CET
Failover Oracle Data Guard
Understand the steps to failover Oracle Data Guard.
Follow these steps on the standby:
- Use the
odacli list-dataguardstatus
command to verify on which system the database is running as the standby. The command also provides the ID of the Data Guard configuration which is needed in switchover and failover commands. In the following example, the systemproddb
hosts the standby database.[root@proddb1]# odacli list-dataguardstatus Updated about 2 second(s) ago ID Name Database Name Role Protection Mode Apply Lag Transport Lag Apply Rate Status ---------------------------------------- -------------------------------------------- 633b-4eef-a4b7-3192028b853c buda_pest hun STANDBY MAX_PERFORMANCE 0 seconds 0 seconds 14.00 KByte/s CONFIGURED
- Initiate failover. Provide the Oracle Data Guard
configuration ID and the database unique name of the current
standby database. Run the command on the current standby
system.
[root@proddb1 ~]# odacli failover-dataguard -i be217130-633b-4eef-a4b7-3192028b853c -u buda Password for target database: { "jobId" : "3dd42271-2919-4cae-a801-1a4d635c3120", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "March 18, 2022 17:31:12 PM CET", "resourceList" : [ ], "description" : "Dataguard operation for buda_pest - FailoverDg", "updatedTime" : "March 18, 2022 17:31:12 PM CET" }
- Monitor the status of the failover
operation.
[root@proddb1 ~]# odacli describe-job -i "3dd42271-2919-4cae-a801-1a4d635c3120" Job details ---------------------------------------------------------------- ID: 3dd42271-2919-4cae-a801-1a4d635c3120 Description: Dataguard operation for buda_pest – FailoverDg Status: Success Created: March 18, 2022 5:31:12 PM CET Message: Task Name Start Time End Time Status ---------------------------------------- ----------------------------------- -------------------------- Precheck failover DataGuard March 18, 2022 5:31:12 PM CET March 18, 2022 5:31:13 PM CET Success Failover DataGuard March 18, 2022 5:31:13 PM CET March 18, 2022 5:31:45 PM CET Success Postcheck DataGuard status March 18, 2022 5:31:45 PM CET March 18, 2022 5:31:46 PM CET Success Check if DataGuard config is updated March 18, 2022 5:31:56 PM CET March 18, 2022 5:32:06 PM CET Success
- Reinstate the former primary as standby. Provide
the Oracle Data Guard configuration ID and the database
unique name of the former primary system. Run the command on
the current primary Oracle Database
Appliance.
[root@proddb1 ~]# odacli reinstate-dataguard -i be217130-633b-4eef-a4b7-3192028b853c -u pest Password for target database: { "jobId" : "c53d2d6f-a128-4b16-a894-25fc6e73493e", "status" : "Created", "message" : null, "reports" : [ ], "createTimestamp" : "March 18, 2022 17:33:24 PM CET", "resourceList" : [ ], "description" : "Dataguard operation for buda_pest - ReinstateDg", "updatedTime" : "March 18, 2022 17:33:24 PM CET" }
- Monitor the reinstate job
status.
[root@proddb1 ~]# odacli describe-job -i "c53d2d6f-a128-4b16-a894-25fc6e73493e" Job details ---------------------------------------------------------------- ID: c53d2d6f-a128-4b16-a894-25fc6e73493e Description: Dataguard operation for buda_pest – ReinstateDg Status: Success Created: March 18, 2022 5:33:24 PM CET Message: Task Name Start Time End Time Status ---------------------------------------- ----------------------------------- --------------------------- Precheck reinstate DataGuard March 18, 2022 5:33:24 PM CET March 18, 2022 5:33:25 PM CET Success Reinstate DataGuard March 18, 2022 5:33:25 PM CET March 18, 2022 5:35:07 PM CET Success Postcheck DataGuard status March 18, 2022 5:35:07 PM CET March 18, 2022 5:36:30 PM CET Success Check if DataGuard config is updated March 18, 2022 5:36:40 PM CET March 18, 2022 5:36:50 PM CET Success
- Verify the status of Oracle Data Guard on both
nodes after the operation completes successfully. You may
need to run the command a few times to verify the
changes.
[root@stdbydb1 ~]# odacli describe-dataguardstatus -i be217130-633b-4eef-a4b7-3192028b853c Updated about 34 second(s) ago Dataguard Status details ---------------------------------------------------------------- ID: be217130-633b-4eef-a4b7-3192028b853c Name: buda_pest Database Name: 9cec6f9a-5256-48c0-8386-4bda7ee6b393 Role: PRIMARY ←--------------------------//the status is not updated yet Protection Mode: MAX_PERFORMANCE Apply Lag: 0 seconds Transport Lag: 0 seconds Apply Rate: 274.00 KByte/s Status: CONFIGURED Updated Time: March 18, 2022 5:29:16 PM CET
Running the same command the second time:[root@stdbydb1 ~]# odacli describe-dataguardstatus -i be217130-633b-4eef-a4b7-3192028b853c Updated about 3 second(s) ago Dataguard Status details ---------------------------------------------------------------- ID: be217130-633b-4eef-a4b7-3192028b853c Name: buda_pest Database Name: 9cec6f9a-5256-48c0-8386-4bda7ee6b393 Role: STANDBY <------------------------//updated and correct status Protection Mode: MAX_PERFORMANCE Apply Lag: 0 seconds Transport Lag: 0 seconds Apply Rate: 386.00 KByte/s Status: CONFIGURED Updated Time: March 18, 2022 5:37:35 PM CET
Deconfiguring Oracle Data Guard
Understand the steps to deconfigure Oracle Data Guard.
Follow these steps on the primary:
- Use the
odacli list-dataguardstatus
command to verify on which system the database is running as the standby. The command also provides the ID of the Data Guard configuration which is needed in switchover and failover commands.[root@stybydb1]# odacli list-dataguardstatus Updated about 2 second(s) ago ID Name Database Name Role Protection Mode Apply Lag Transport Lag Apply Rate Status ---------------------------------------- -------------------------------------------- 633b-4eef-a4b7-3192028b853c buda_pest hun STANDBY MAX_PERFORMANCE 0 seconds 0 seconds 14.00 KByte/s CONFIGURED
- Running Data Guard deconfiguration is an interactive
process. You must run the deconfiguration operation from the
primary
system.
[root@proddb1 ~]# odacli deconfigure-dataguard -i be217130-633b-4eef-a4b7-3192028b853c Standby site address: stbydb1 BUI username for Standby site. If Multi-user Access is disabled on Standby site, enter 'oda-admin'; otherwise, enter the name of the user who has irestored the Standby database (default: oda-admin): BUI password for Standby site: root@stbydb1's password: Standby database will be deleted after Data Guard configuration is removed. Ignore warning and proceed with Data Guard deconfiguration? (Y/N): y Deconfigure Dataguard Started ******************************************************************************************* Step 1: Deconfigure Data Guard (Primary site) Description: Deconfigure DG service Job ID: ce9e0871-6630-452f-bf3a-44262b0d461d Started March 18, 2022 17:39:04 PM CET Deconfigure Data Guard service Cleanup broker resources Finished March 18, 2022 17:40:49 PM CET ******************************************************************************************* Step 2: Delete Data Guard status (Primary site) Description: DG Status operation for db - UpdateDgconfig Job ID: 0aa8cebf-4cb5-4444-8426-991bab48eb6e Started March 18, 2022 17:40:49 PM CET Finished March 18, 2022 17:40:49 PM CET ******************************************************************************************* Step 3: Delete Data Guard status (Standby site) Description: DG Status operation for db - UpdateDgconfig Job ID: adcd8b6d-e514-45ee-8eb9-998e4968ef97 Started March 18, 2022 17:40:50 PM CET Update Data Guard status Finished March 18, 2022 17:40:51 PM CET ******************************************************************************************* Step 4: Delete Standby database (Standby site) Description: Database service deletion with db name: hun with id : 9cec6f9a-5256-48c0-8386-4bda7ee6b393 Job ID: 9fd067c3-9a51-4db9-88d2-105e673143c7 Started March 18, 2022 17:40:54 PM CET Validate db 9cec6f9a-5256-48c0-8386-4bda7ee6b393 for deletion Database Deletion By RHP Unregister Db From Cluster Close Pmon Process Database Files Deletion TDE Wallet deletion Finished March 18, 2022 17:43:16 PM CET ******************************************************************************************* Data Guard configuration is removed
Configuring Additional Network on Oracle Data Guard
Understand how to set up additional network for Oracle Data Guard.
According to MAA best practices, it is recommended to use a
dedicated network interface for Oracle Data Guard related traffic.
The odacli configure-dataguard
command supports
configuration of an additional network. By default, Oracle Database
Appliance uses public network configuration, but a different network
can be assigned to it easily. If the database runs on bare metal
system, then a new interface must be configured with
Dataguard
type and attached to the
database.
- Create a new network on the desired
interface.
# odacli create-network -m network_name -n interface_name -p ip0, ip1 -w Dataguard -no-d -s subnet_mask -g gate_ip -vs vipname0:nodenumber0:vip0,vipname1:nodenumber1:vip1 -sn scan_name -sip scanip0,scanip1 (optional: -t VLAN -v vlan_id)
For example:# odacli create-network -m DataGuard -n bond1 -p "0:2.2.2.2,1:2.2.2.3" -w Dataguard -no-d -s 255.255.255.0 -g 2.2.2.1 -vs "dg-vip1:0:2.2.2.4,dg-vip2:1:2.2.2.5" -sn dg-scan -sip 2.2.2.6
- Attach the network to the
database.
# odacli modify-database -in dbname -an network name
For example:# odacli modify-database -in testdb -an DataGuard
Verify the network name with the
odacli list-networks
command.
Dataguard
type and attached
to the database:
- Create a new vnetwork on the interface you want to
configure on the bare metal
system:
# odacli create-vnetwork -n vnetwork_name -t bridged|bridgedVLAN -br bridge_name -gw gateway -if interface_name -ip
For example:# odacli create-vnetwork -n DataGuard -t bridged -br DataGuard -gw 2.2.2.1 -if btbond5 -ip "2.2.2.7,2.2.2.8" -nm "255.255.255.0" -u
- Assign the new vnetwork to the DB system as a
Dataguard
type network on the bare metal system.# odacli modify-dbsystem -n dbsystem_name -avn vnetwork_name -gw gateway -ip ip0,ip1 -nm netmask -sn scan_name -sip scanip0,scanip1 -vips vipname0:nodenumber0:vip0,vipname1:nodenumber1:vip1 -vt network_type
For example:# odacli modify-dbsystem -n dbsystem1 -avn DataGuard -gw "2.2.2.1" -ip "2.2.2.11,2.2.2.12" -nm "255.255.255.0" -sn dg-scan -sip "2.2.2.15,2.2.2.16" -vips "dg-vip1:0:2.2.2.13,dg-vip2:1:2.2.2.14" -vt dataguard
- Attach the network to the database on the DB system
host:
# odacli modify-database -in dbname -an network_name
For example:# odacli modify-database -in testdb -an DataGuard
Run the steps on both the primary and the standby systems, regardless of whether the database is on the bare metal system or in a DB system.
- Finally, provide the network name for the Oracle Data
Guard configuration in the
odacli configure-dataguard
command. At the step “Do you want to edit this Data Guard configuration?” choose ‘y’ to change the Data Guard network.For example:Do you want to edit this Data Guard configuration? (Y/N, default:N): y … Primary site network for Data Guard configuration [Public-network] (default: Public-network): DataGuard Standby site network for Data Guard configuration [Public-network] (default: Public-network): DataGuard