- Deploy a hybrid DR topology for an on-premises Oracle Exadata
- Complete the Configuration
Complete the Configuration
Configure Oracle Data Guard, register the standby database, and synchronize the on-premises and standby database passwords.
Configure Oracle Data Guard Broker
Configure Oracle Data Guard by enabling the dg_broker_config_file
parameter on the primary
and standby databases. For Oracle Automatic Storage Management (Oracle
ASM), place the broker configuration files on separate disk groups. For Oracle Real Application Clusters (Oracle
RAC), the broker configuration files must be on shared storage.
- Check the
dg_broker_start
value for the on-premises database host. It should be set tofalse
.SQL> show parameter dg_broker_start;
The output will look similar to the following:NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_start boolean FALSE
- On the standby Oracle Database Exadata Cloud
Service, check the Oracle Data Guard configuration files.
The following is example output:SQL> show parameter dg_broker_config_file1;
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_config_file1 string /u02/app/oracle/product/19.0.0.0/dbhome_5/dbs/dr1DB1_phx3g7.dat
The following is example output:SQL> show parameter dg_broker_config_file2;
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_config_file2 string /u02/app/oracle/product/19.0.0.0/dbhome_5/dbs/dr2DB1_phx3g7.dat
- Display the datafiles, then change the location to where you
want to store the files. For example, Oracle ASM, Oracle RAC , or devices.
SQL> select name from v$datafile;
NAME -------------------------------------------------------------------------------- +DATAC1/DB1_PHX3G7/DATAFILE/system.348.1063638053 +DATAC1/DB1_PHX3G7/DATAFILE/sysaux.349.1063638055 +DATAC1/DB1_PHX3G7/DATAFILE/undotbs1.350.1063638057 +DATAC1/DB1_PHX3G7/DATAFILE/undotbs2.351.1063638057 +DATAC1/DB1_PHX3G7/DATAFILE/users.352.1063638059
SQL> alter system set dg_broker_config_file1='+DATAC1/DB1_PHX3G7/dr1DB1_phx3g7.dat';
SQL> alter system set dg_broker_config_file2='+RECOC1/DB1_PHX3G7/dr2DB1_phx3g7.dat';
- On the primary on-premises Oracle Exadata Database Machine, check the Oracle Data Guard configuration files.
The following is example output:SQL> show parameter dg_broker_config_file1;
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_config_file1 string /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/dr1db1.dat.dat
The following is example output:SQL> show parameter dg_broker_config_file2;
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_config_file2 string /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/dr2db1.dat
- Display the datafiles, then change the location to where you
want to store the files.
The following is example output:SQL> select name from v$datafile;
Run the following commands to change the configuration file location:NAME -------------------------------------------------------------------------------- +DATAC1/DB1/DATAFILE/system.277.1063487795 +DATAC1/DB1/DATAFILE/sysaux.270.1063487827 +DATAC1/DB1/DATAFILE/undotbs1.259.1063487843 +DATAC1/DB1/DATAFILE/undotbs2.275.1063487867 +DATAC1/DB1/DATAFILE/users.269.1063487879
SQL> alter system set dg_broker_config_file1='+DATAC1/DB1/dr1db1.dat';
SQL> alter system set dg_broker_config_file2='+RECOC1/DB1/dr2db1.dat';
SQL> alter system set dg_broker_start=false; SQL> alter system set dg_broker_config_file1='+DATAC1/DB1/dr1db1.dat'; SQL> alter system set dg_broker_config_file2='+RECOC1/DB1/dr2db1.dat';
- On the primary on-premises Oracle Exadata Database Machine, start the Oracle Data Guard Broker process.
SQL> alter system set dg_broker_start=true; SQL> show parameter dg_broker_start
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_start boolean TRUE
SQL> select pname from v$process where pname like 'DMON%';
PNAME ----- DMON
- Start the Oracle Data Guard Broker process on the standby database.
SQL> alter system set dg_broker_start=true; SQL> show parameter dg_broker_start
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_start boolean TRUE
SQL> select pname from v$process where pname like 'DMON%';
PNAME ----- DMON
Register the Standby Database
Use the Oracle Data Guard command-line interface (DGMGRL) to register, or add, the standby database profile to the broker configuration on the primary, on-premises host.
- Log into the primary host as
sys
.$ dgmgrl sys/sys password@net service name for primary database
- Create a configuration that uses the primary database name.
For example:DGMGRL> CREATE CONFIGURATION configuration_name AS PRIMARY DATABASE IS primary database name CONNECT IDENTIFIER IS primary database name;
CREATE CONFIGURATION OnPremExaDR AS PRIMARY DATABASE IS DB1 CONNECT IDENTIFIER IS DB1;
- Add the standby database.Ensure that your identifier is the same as the service name, including upper case and lower case.
For example:DGMGRL> ADD DATABASE standby unique database name AS CONNECT IDENTIFIER IS standby unique database name MAINTAINED AS PHYSICAL;
ADD DATABASE DB1_PHX3G7 AS CONNECT IDENTIFIER IS DB1_phx3g7 MAINTAINED AS PHYSICAL;
If you receive an ORA-16698 error message, then verify that your identifier is the same as the service name.Error: ORA-16698: member has a LOG_ARCHIVE_DEST_n parameter with SERVICE attribute set
- Change the log archive destination state.
SQL> alter system set log_archive_dest_state_10='DEFER';
SQL> alter system set log_archive_dest_10='';
- Verify the log archive destination.
SQL> show parameter log_archive_dest;
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ log_archive_dest string log_archive_dest_1 string LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DB1_PHX3G7 log_archive_dest_10 string log_archive_dest_11 string log_archive_dest_12 string log_archive_dest_13 string log_archive_dest_14 string log_archive_dest_15 string NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ log_archive_dest_16 string log_archive_dest_17 string log_archive_dest_18 string log_archive_dest_19 string log_archive_dest_2 string SERVICE=DB1 VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DB1 log_archive_dest_20 string log_archive_dest_21 string log_archive_dest_22 string log_archive_dest_23 string
- Enable the configuration.
DGMGRL> enable configuration;
- Display the configuration.
DGMGRL> show configuration;
The output will look similar to the following:Configuration - onpremexadr Protection Mode: MaxPerformance Members: db1 - Primary database Warning: ORA-16809: multiple warnings detected for the member db1_phx3g7 - Physical standby database Error: ORA-16532: Oracle Data Guard broker configuration does not exist Fast-Start Failover: Disabled Configuration Status: ERROR (status updated 21 seconds ago)
- On the standby Oracle Database Exadata Cloud
Service, log in to verify the configuration.
[oracle@exacs82-vm3sv1 ~]$ dgmgrl DGMGRL> connect
Username: sys Password: Connected to "DB1_phx3g7" Connected as SYSDBA.
The output will be similar to the following:DGMGRL> show configuration;
Configuration - onpremexadr Protection Mode: MaxPerformance Members: db1 - Primary database Warning: ORA-16809: multiple warnings detected for the member db1_phx3g7 - Physical standby database Warning: ORA-16809: multiple warnings detected for the member Fast-Start Failover: Disabled Configuration Status: WARNING (status updated 43 seconds ago
Copy the Redo Log Files from On-Premises to OCI
Copy the redo
log files and other database files from the
on-premises database onto the Oracle Cloud
Infrastructure (OCI) instance.
- View the on-premises database files.
select name from v$datafile;
The output will look similar to the following:NAME -------------------------------------------------------------------------------- +DATAC1/DB1/DATAFILE/system.277.1063487795 +DATAC1/DB1/DATAFILE/sysaux.270.1063487827 +DATAC1/DB1/DATAFILE/undotbs1.259.1063487843 +DATAC1/DB1/DATAFILE/undotbs2.275.1063487867 +DATAC1/DB1/DATAFILE/users.269.1063487879
- View the size of each group for the on-premises data
files.
select bytes, group# from v$log;
The output will look similar to the following:BYTES GROUP# ---------- ---------- 209715200 1 209715200 2 209715200 3 209715200 4
- View the
redo
logs for the on-premises data files.select member from v$logfile;
The output will look similar to the following:MEMBER -------------------------------------------------------------------------------- +DATAC1/DB1/ONLINELOG/group_2.272.1063449917 +RECOC1/DB1/ONLINELOG/group_2.281.1063449917 +DATAC1/DB1/ONLINELOG/group_1.273.1063449917 +RECOC1/DB1/ONLINELOG/group_1.282.1063449919 +DATAC1/DB1/ONLINELOG/group_3.268.1063450555 +RECOC1/DB1/ONLINELOG/group_3.283.1063450557 +DATAC1/DB1/ONLINELOG/group_4.261.1063450557 +RECOC1/DB1/ONLINELOG/group_4.284.1063450557
- Add a standby log file group for each
redo
log.For example, if you have threeredo
log files, add three standby log file groups.SQL> alter database add standby logfile group 5 ('+DATAC1','+RECOC1'); alter database add standby logfile group 6 ('+DATAC1','+RECOC1'); alter database add standby logfile group 7 ('+DATAC1','+RECOC1');
- View the members of the log file.
SQL> select member from v$logfile;
The output will look similar to the following:MEMBER -------------------------------------------------------------------------------- +DATAC1/DB1/ONLINELOG/group_2.272.1063449917 +RECOC1/DB1/ONLINELOG/group_2.281.1063449917 +DATAC1/DB1/ONLINELOG/group_1.273.1063449917 +RECOC1/DB1/ONLINELOG/group_1.282.1063449919 +DATAC1/DB1/ONLINELOG/group_5.264.1063812687 +DATAC1/DB1/ONLINELOG/group_3.268.1063450555 +RECOC1/DB1/ONLINELOG/group_3.283.1063450557 +DATAC1/DB1/ONLINELOG/group_4.261.1063450557 +RECOC1/DB1/ONLINELOG/group_4.284.1063450557 +RECOC1/DB1/ONLINELOG/group_5.422.1063812687 +DATAC1/DB1/ONLINELOG/group_6.262.1063812785 +RECOC1/DB1/ONLINELOG/group_6.445.1063812785 +DATAC1/DB1/ONLINELOG/group_7.263.1063812807 +RECOC1/DB1/ONLINELOG/group_7.446.1063812807
- View the group number and members of the log file.
SQL> select group#,member from v$logfile;
The output will look similar to the following:GROUP# MEMBER ------------ -------------------------------------------------- 2 +DATAC1/DB1/ONLINELOG/group_2.272.1063449917 2 +RECOC1/DB1/ONLINELOG/group_2.281.1063449917 1 +DATAC1/DB1/ONLINELOG/group_1.273.1063449917 1 +RECOC1/DB1/ONLINELOG/group_1.282.1063449919 5 +DATAC1/DB1/ONLINELOG/group_5.264.1063812687 3 +DATAC1/DB1/ONLINELOG/group_3.268.1063450555 3 +RECOC1/DB1/ONLINELOG/group_3.283.1063450557 4 +DATAC1/DB1/ONLINELOG/group_4.261.1063450557 4 +RECOC1/DB1/ONLINELOG/group_4.284.1063450557 5 +RECOC1/DB1/ONLINELOG/group_5.422.1063812687 6 +DATAC1/DB1/ONLINELOG/group_6.262.1063812785 6 +RECOC1/DB1/ONLINELOG/group_6.445.1063812785 7 +DATAC1/DB1/ONLINELOG/group_7.263.1063812807 7 +RECOC1/DB1/ONLINELOG/group_7.446.1063812807
- View the configuration in Oracle Data Guard.
DGMGRL> show configuration
The output will look similar to the following:Configuration - onpremexadr Protection Mode: MaxPerformance Members: db1 - Primary database db1_phx3g7 - Physical standby database Warning: ORA-16809: multiple warnings detected for the member Fast-Start Failover: Disabled Configuration Status: WARNING (status updated 8 seconds ago)
- On the standby Oracle Database Exadata Cloud
Service, view the redo logs.
select member from v$logfile;
The output will look similar to the following:MEMBER --------------------------------------------------- /opt/oracle/oradata/ORCLCDB/redo03.log /opt/oracle/oradata/ORCLCDB/redo02.log /opt/oracle/oradata/ORCLCDB/redo01.log
- Log into an Oracle Data Guard command-line interface (DGMGRL)
session on the standby Oracle Database Exadata Cloud
Service database instance with the
sys
user name and password.[oracle@droci admin]$ dgmgrl DGMGRL> connect
- View the configuration on the standby database in OCI.
DGMGRL> show configuration;
The output will look similar to the following:Configuration - OnPremDr Protection Mode: MaxPerformance Members: db1 - Primary database db1_phx3g7 - Physical standby database Warning: ORA-16809: multiple warnings detected for the member Fast-Start Failover: Disabled Configuration Status: WARNING (status updated 38 seconds ago)
- Edit the standby database instance in OCI and set the state to
apply-off
. When the command succeeds, exit the command-line interface.DGMGRL> edit database DB1_phx3g7 set state=apply-off;
DGMGRL> exit
- Log into the standby database instance in OCI as
sysdba
.[oracle@exacs82-vm3sv1 ~]$ sqlplus / as sysdba
- View the group number and members of the log file.
SQL> select group#,member from v$logfile;
The output will look similar to the following:GROUP# ---------- MEMBER -------------------------------------------------------------------------------- 2 +DATAC1/DB1_PHX3G7/ONLINELOG/group_2.354.1063638089 3 +DATAC1/DB1_PHX3G7/ONLINELOG/group_3.355.1063638089 1 +DATAC1/DB1_PHX3G7/ONLINELOG/group_1.353.1063638089 4 +DATAC1/DB1_PHX3G7/ONLINELOG/group_4.356.1063638089
- View the size of each group.
select bytes, group# from v$log;
The output will look similar to the following:BYTES GROUP# ---------- ---------- 209715200 1 209715200 2 209715200 3 209715200 4
- Add the standby log file groups to the database in OCI.
[oracle@exacs82-vm3sv1 ~]$ sqlplus / as sysdba
alter database add standby logfile group 5 ('+DATAC1','+RECOC1'); alter database add standby logfile group 6 ('+DATAC1','+RECOC1'); alter database add standby logfile group 7 ('+DATAC1','+RECOC1');
- View the group number and members of the log file.
SQL> select group#,member from v$logfile;
The output will look similar to the following:GROUP# ---------- MEMBER -------------------------------------------------------------------------------- 2 +DATAC1/DB1_PHX3G7/ONLINELOG/group_2.354.1063638089 3 +DATAC1/DB1_PHX3G7/ONLINELOG/group_3.355.1063638089 1 +DATAC1/DB1_PHX3G7/ONLINELOG/group_1.353.1063638089 4 +DATAC1/DB1_PHX3G7/ONLINELOG/group_4.356.1063638089 5 +DATAC1/DB1_PHX3G7/ONLINELOG/group_5.358.1063813749 5 +RECOC1/DB1_PHX3G7/ONLINELOG/group_5.256.1063813749 6 +DATAC1/DB1_PHX3G7/ONLINELOG/group_6.359.1063813761 6 +RECOC1/DB1_PHX3G7/ONLINELOG/group_6.262.1063813761 7 +DATAC1/DB1_PHX3G7/ONLINELOG/group_7.360.1063813773 7 +RECOC1/DB1_PHX3G7/ONLINELOG/group_7.300.1063813773
- On the standby OCI database instance, log into an Oracle Data
Guard command-line interface (DGMGRL) session with the
sys
user name and password.[oracle@exacs82-vm3sv1 ~]$ dgmgrl DGMGRL> connect Username: sys Password:
Connected to "DB1_phx3g7" Connected as SYSDBA.
- Edit the standby database instance in OCI and set the state to
apply-on
.DGMGRL> edit database db1_phx3g7 set state=apply-on;
- Edit the standby database instance in OCI and set the transport
state to
transport-on
, then exit the command-line interface. When the command succeeds, exit DGMGRL.DGMGRL> edit database DB1 set state=transport-on;
DGMGRL> exit
- View the standby log files in the standby database on OCI to
verify standby.
SQL> select * from v$logfile where type='STANDBY';
- View the redo log files in the standby database on OCI.
SQL> select member from v$logfile where type != 'STANDBY';
The output will look similar to the following:MEMBER -------------------------------------------------------------------------------- +DATAC1/DB1_PHX3G7/ONLINELOG/group_2.354.1063638089 +DATAC1/DB1_PHX3G7/ONLINELOG/group_3.355.1063638089 +DATAC1/DB1_PHX3G7/ONLINELOG/group_1.353.1063638089 +DATAC1/DB1_PHX3G7/ONLINELOG/group_4.356.1063638089
- Recover the managed standby database.
SQL> recover managed standby database cancel;
The output will look similar to the following:Media recovery complete
- View the files with the
convert
parameter.SQL> show parameter convert;
The output will look similar to the following:NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_file_name_convert string DB1, DB1_phx3g7 log_file_name_convert string DB1, DB1_phx3g7 pdb_file_name_convert string
- View the database files.
select name from v$datafile;
The output will look similar to the following:NAME -------------------------------------------------------------------------------- +DATAC1/DB1_PHX3G7/DATAFILE/system.348.1063638053 +DATAC1/DB1_PHX3G7/DATAFILE/sysaux.349.1063638055 +DATAC1/DB1_PHX3G7/DATAFILE/undotbs1.350.1063638057 +DATAC1/DB1_PHX3G7/DATAFILE/undotbs2.351.1063638057 +DATAC1/DB1_PHX3G7/DATAFILE/users.352.1063638059
- View the Oracle Data Guard archive details.
SQL> SELECT ROLE, THREAD#, SEQUENCE#, ACTION FROM V$DATAGUARD_PROCESS;
The output will look similar to the following:ROLE THREAD# SEQUENCE# ACTION ------------------------ ---------- ---------- ------------ RFS ping 1 0 IDLE RFS ping 2 62 IDLE RFS async 2 62 RECEIVING broker instance worker 0 0 IDLE broker worker 0 0 IDLE archive redo 0 0 IDLE archive redo 0 0 IDLE archive redo 0 0 IDLE archive local 0 0 IDLE redo transport timer 0 0 IDLE gap manager 0 0 IDLE ROLE THREAD# SEQUENCE# ACTION ------------------------ ---------- ---------- ------------ broker monitor 0 0 IDLE broker net worker 0 0 IDLE redo transport monitor 0 0 IDLE log writer 0 0 IDLE RFS async 0 187 RECEIVING 16 rows selected.
- Disable the recovery of the managed standby database using the
log file.
SQL> recover managed standby database using current logfile disconnect;
Media recovery complete.
- Display the files with the destination parameter and verify.
SQL>show parameter dest;