Configuration of DataGuard Broker
In the Primary database – on every node.
On Node 1
1 2 3 |
alter system set dg_broker_config_file1='+DATA/MX/mx1.dat' scope=both sid='*'; alter system set dg_broker_config_file2='+DATA/MX/mx2.dat' scope=both sid='*'; alter system set dg_broker_start=true scope=both sid='*'; |
In the Standby database – on every node.
1 2 3 |
alter system set dg_broker_config_file1='+DATA/STDMX/stdmx1.dat' scope=both; alter system set dg_broker_config_file2='+DATA/STDMX/stdmx2.dat' scope=both; alter system set dg_broker_start=true scope=both sid='*'; |
1 2 3 4 5 6 7 8 |
dgmgrl connect / CREATE CONFIGURATION 'dg_broker' AS PRIMARY DATABASE IS 'mx' CONNECT IDENTIFIER IS mx;ADD DATABASE 'stdmx' AS CONNECT IDENTIFIER IS stdmx; EDIT DATABASE 'mx' SET PROPERTY FastStartFailoverTarget='stdmx'; EDIT DATABASE 'stdmx' SET PROPERTY FastStartFailoverTarget='mx'; EDIT DATABASE "mx" SET PROPERTY 'LogXptMode'='SYNC'; EDIT DATABASE "stdmx" SET PROPERTY 'LogXptMode'='SYNC'; EDIT DATABASE 'mx' SET PROPERTY NetTimeout=180 ; EDIT DATABASE 'stdmx' SET PROPERTY NetTimeout=180 ; |
Note: Due to a bug in version 11.2.0.2.0, NetTimeout has been set to 180.
Both of these should be used carefully as they can close the database depending on the protection mode.
1 2 3 |
enable database 'stdmx' ; enable configuration ; enable fast_start failover; |
Information
1 2 3 4 5 6 7 8 9 |
select FS_FAILOVER_OBSERVER_HOST from v$database; show configuration ; show configuration verbose; SHOW DATABASE VERBOSE 'mx' ; SHOW DATABASE VERBOSE 'stdmx' ; show instance verbose stdmx; show instance verbose mx1; show instance verbose mx2; |
1 2 |
DISABLE FAST_START FAILOVER force ; REMOVE CONFIGURATION; |
Log
1 |
/u01/app/oracle/diag/rdbms/mx/mx1/trace/drcmx1.log |
Switchover
1 |
switchover to 'stdmx'; (the name of the standBY should be written at that moment.) |
Note: After the switchover a few errors can be viewed using dgmgrl (Data Guard command-line interface) but after a while the Data Guard Broker fixes these and the errors disappear.
Both sides have thus successfully carried out a switch over.
Resolving Archive Log Gaps
1 |
SELECT * FROM V$ARCHIVE_GAP; |
1 |
SELECT STATUS, GAP_STATUS FROM V$ARCHIVE_DEST_STATUS WHERE DEST_ID = 2; |
1 |
SELECT NAME FROM V$ARCHIVED_LOG WHERE THREAD#=1 AND -DEST_ID=1 AND SEQUENCE# BETWEEN 7 AND 10; |
1 |
ALTER DATABASE REGISTER LOGFILE '/physical_standby1/thread1_dest/arcr_1_7.arc'; |
1 |
SELECT * FROM V$ARCHIVE_GAP; |
Copying the archivelogs to the ASM and saving them:
1 |
catalog archivelog '/cluster/home/oracle/o1_mf_1_245440_8dp02lsr_.arc'; |
1 |
copy archivelog '/tmp/thread_1_seq_105.345.813673069' to '+fra'; |
1 |
ALTER DATABASE REGISTER LOGFILE '+FRA/stdmx/archivelog/2013_04_26/thread_1_seq_105.317.813752707' ; |
Automatic Storage Management...
12 March 2019