Dataguard Creation with 2 Standby Database + DGMGRL Configuration + Switchover and Failover Step on EXADATA Servers.
1. Apply the below command in Primary database for enabling the force logging mode.
alter database force logging;
2.1 change the below parameter in Primary database.
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(AMBU,AMBUDR1,AMBUDR2)' scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=AMBU' scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_2='SERVICE=AMBUDR1 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=AMBUDR1' scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_3='SERVICE=AMBUDR2 ASYNC LGWR VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=AMBUDR2' scope=both sid='*';
alter system set log_archive_format='%t_%s_%r.arc' scope=spfile sid='*';
alter system set log_archive_max_processes=8 scope=both sid='*';
alter system set fal_server=AMBUDR1,AMBUDR2 scope=both sid='*';
alter system set standby_file_management=AUTO scope=both sid='*';
2.2. verify the parameter changes using the below query.
set linesize 500 pages 0
col value for a90
col name for a50
select name, value
from v$parameter
where name in ('db_name','db_unique_name','log_archive_config', 'log_archive_dest_1','log_archive_dest_2','log_archive_dest_3',
'log_archive_dest_state_1','log_archive_dest_state_2','log_archive_dest_state_3', 'remote_login_passwordfile',
'log_archive_format','log_archive_max_processes','fal_server','db_file_name_convert',
'log_file_name_convert', 'standby_file_management');
Output:
=======
select name, value
from v$parameter
where name in ('db_name','db_unique_name','log_archive_config', 'log_archive_dest_1','log_archive_dest_2','log_archive_dest_3',
'log_archive_dest_state_1','log_archive_dest_state_2','log_archive_dest_state_3', 'remote_login_passwordfile',
'log_archive_format','log_archive_max_processes','fal_server','db_file_name_convert',
'log_file_name_convert', 'standby_file_management');SQL> SQL> 2 3 4 5 6
db_file_name_convert
log_file_name_convert
log_archive_dest_1 LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=AMBU
log_archive_dest_2 service="ambudr1", LGWR ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 ma
x_connections=1 reopen=300 db_unique_name="ambudr1" net_timeout=30, valid_for=(all_logfiles,
primary_role)
log_archive_dest_3 service="ambudr2", LGWR ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 ma
x_connections=1 reopen=300 db_unique_name="ambudr2" net_timeout=30, valid_for=(all_logfiles,
primary_role)
log_archive_dest_state_1 enable
log_archive_dest_state_2 ENABLE
log_archive_dest_state_3 ENABLE
fal_server ambudr2, ambudr1
log_archive_config DG_CONFIG=(AMBU,AMBUDR1,AMBUDR2)
log_archive_format %t_%s_%r.arc
log_archive_max_processes 8
standby_file_management AUTO
remote_login_passwordfile EXCLUSIVE
db_name ambu
db_unique_name ambu
3.1. verify the logfile using the below query's.
select group#,THREAD#,bytes/1024/1024,status,members from v$log;
select member from v$logfile;
3.2. Add the below logfile and standby logfile in primary database
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 1 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 2 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 3 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 4 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 5 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 6 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 7 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 8 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 9 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 10 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 11 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 12 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 13 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 GROUP 14 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 GROUP 15 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 GROUP 16 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 GROUP 17 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 GROUP 18 ('+DATAC1','+RECOC1') SIZE 100m;
4. Take the rman backup using below command.
rman target / nocatalog
run
{
sql 'alter system switch logfile';
backup database plus archivelog format '/u03/rmanbkp/ambu/Primary_bkp_for_stndby_%U';
backup current controlfile for standby format '/u03/rmanbkp/ambu/stby.ctl';
sql 'alter system archive log current';
}
5.1. create the init file using the below command in primary database.
create pfile='/u03/rmanbkp/ambu/pfile_for_standby.txt' from spfile;
5.2. edit the init parameters as below 1st DR.
ambudr12.__db_cache_size=7348420608
ambudr11.__db_cache_size=7482638336
ambudr12.__java_pool_size=234881024
ambudr11.__java_pool_size=234881024
ambudr12.__large_pool_size=637534208
ambudr11.__large_pool_size=637534208
ambudr12.__oracle_base='/u01/app/grid'#ORACLE_BASE set from environment
ambudr11.__oracle_base='/u02/app/oracle'#ORACLE_BASE set from environment
ambudr12.__pga_aggregate_target=6878658560
ambudr11.__pga_aggregate_target=6878658560
ambudr12.__sga_target=10301210624
ambudr11.__sga_target=10301210624
ambudr12.__shared_io_pool_size=0
ambudr11.__shared_io_pool_size=0
ambudr12.__shared_pool_size=1979711488
ambudr11.__shared_pool_size=1845493760
ambudr12.__streams_pool_size=0
ambudr11.__streams_pool_size=0
*.archive_lag_target=0
*.audit_file_dest='/u02/app/oracle/admin/ambudr1/adump' ##### Changed for dataguard
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+DATAC1/ambudr1/controlfile/current.256.853762891','+RECOC1/ambudr1/controlfile/current.264.853762891'
*.db_block_size=8192
*.db_create_file_dest='+DATAC1'
*.db_create_online_log_dest_1='+RECOC1'
*.db_domain=''
*.db_file_name_convert='+DATAC1','+DATAC1'
*.db_name='ambu'
*.db_recovery_file_dest='+RECOC1'
*.db_recovery_file_dest_size=536870912000
*.db_unique_name='ambudr1' ##### Changed for dataguard
*.dg_broker_config_file1='+DATAC1/AMBUDR1/dr1ambudr1.dat'
*.dg_broker_config_file2='+DATAC1/AMBUDR1/dr2ambudr1.dat'
*.dg_broker_start=TRUE
*.diagnostic_dest='/u02/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ambudr1XDB)'
*.fal_client='AMBUDR1'
*.fal_server='ambu','ambudr2' ##### Changed for dataguard
ambudr12.instance_number=2
ambudr11.instance_number=1
*.log_archive_config='dg_config=(ambudr1,AMBU,ambudr2)' ##### Changed for dataguard
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=AMBUDR1' ##### Changed for dataguard
*.log_archive_dest_2='SERVICE=AMBU LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=AMBU'
*.log_archive_dest_3='SERVICE=AMBUDR2 ASYNC LGWR VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=AMBUDR2'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_dest_state_3='ENABLE'
*.log_archive_format='%t_%s_%r.arc'
ambudr12.log_archive_format='%t_%s_%r.arc'
ambudr11.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=8
*.log_archive_min_succeed_dest=1
ambudr12.log_archive_trace=0
ambudr11.log_archive_trace=0
*.log_file_name_convert='+DATAC1','+DATAC1','+RECOC1','+RECOC1'
*.memory_max_target=17179869184
*.memory_target=17179869184
*.open_cursors=300
*.processes=1500
*.remote_listener='exadr-scan:1521' ##### Changed for dataguard
*.remote_login_passwordfile='exclusive'
*.sessions=1655
*.standby_file_management='AUTO'
ambudr12.thread=2
ambudr11.thread=1
ambudr11.undo_tablespace='UNDOTBS1'
ambudr12.undo_tablespace='UNDOTBS2'
5.3. edit the init parameters as below 2st DR.
ambudr21.__db_cache_size=7985954816
ambudr22.__db_cache_size=7985954816
ambudr21.__java_pool_size=201326592
ambudr22.__java_pool_size=201326592
ambudr21.__large_pool_size=234881024
ambudr22.__large_pool_size=234881024
ambudr21.__oracle_base='/u02/app/oracle'#ORACLE_BASE set from environment
ambudr22.__oracle_base='/u01/app/grid'#ORACLE_BASE set from environment
ambudr21.__pga_aggregate_target=6878658560
ambudr22.__pga_aggregate_target=6878658560
ambudr21.__sga_target=10301210624
ambudr22.__sga_target=10301210624
ambudr21.__shared_io_pool_size=0
ambudr22.__shared_io_pool_size=0
ambudr21.__shared_pool_size=1778384896
ambudr22.__shared_pool_size=1778384896
ambudr21.__streams_pool_size=0
ambudr22.__streams_pool_size=0
*.archive_lag_target=0
*.audit_file_dest='/u02/app/oracle/admin/ambudr2/adump' ##### Changed for dataguard
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+datac1/ambudr2/controlfile/current.441.856524137','+RECOC1/ambudr2/controlfile/current.341.856524137'
*.db_block_size=8192
*.db_create_file_dest='+DATAC1'
*.db_create_online_log_dest_1='+RECOC1'
*.db_domain=''
*.db_file_name_convert='+DATAC1','+DATAC1'
*.db_name='ambu'
*.db_recovery_file_dest='+RECOC1'
*.db_recovery_file_dest_size=536870912000
*.db_unique_name='ambudr2' ##### Changed for dataguard
*.dg_broker_config_file1='+DATAC1/AMBUDR2/dr1ambudr2.dat'
*.dg_broker_config_file2='+DATAC1/AMBUDR2/dr2ambudr2.dat'
*.dg_broker_start=TRUE
*.diagnostic_dest='/u02/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ambudr2XDB)'
*.fal_client='AMBUDR2'
*.fal_server='ambu','ambudr1' ##### Changed for dataguard
ambudr22.instance_number=2
ambudr21.instance_number=1
*.log_archive_config='DG_CONFIG=(AMBU,AMBUDR1,AMBUDR2)' ##### Changed for dataguard
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=AMBUDR2' ##### Changed for dataguard
*.log_archive_dest_2='service="ambu"','LGWR ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=300 db_unique_name="ambu" net_timeout=30','valid_for=(all_logfiles,primary_role)' ##### Changed for dataguard
*.log_archive_dest_3='SERVICE=AMBUDR1 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=AMBUDR1' ##### Changed for dataguard
*.log_archive_dest_state_2='ENABLE'
*.log_archive_dest_state_3='ENABLE'
*.log_archive_format='%t_%s_%r.arc'
ambudr21.log_archive_format='%t_%s_%r.arc'
ambudr22.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=8
*.log_archive_min_succeed_dest=1
ambudr21.log_archive_trace=0
ambudr22.log_archive_trace=0
*.log_file_name_convert='+DATAC1','+DATAC1','+RECOC1','+RECOC1'
*.memory_max_target=17179869184
*.memory_target=17179869184
*.open_cursors=300
*.processes=1500
*.remote_listener='exatest-scan:1521' ##### Changed for dataguard
*.remote_login_passwordfile='exclusive'
*.sessions=1655
*.standby_file_management='AUTO'
ambudr22.thread=2
ambudr21.thread=1
ambudr21.undo_tablespace='UNDOTBS1'
ambudr22.undo_tablespace='UNDOTBS2'
6. copy the backup pices and init file from Production to DR server.
7. start the standby database as below command.
startup nomount pfile='/u03/rmanbkp/ambu/pfile_for_standby.txt';
8. Using the below command for creating a standby database.
rman target sys/password@AMBU auxiliary /
DUPLICATE TARGET DATABASE FOR STANDBY NOFILENAMECHECK;
9. start the MRP process using the below command in SQL prompt.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
10. change the controlfile name in the init file as per the restoration output.
output file name=+DATAC1/ambudr1/controlfile/current.256.853762891
output file name=+RECOC1/ambudr1/controlfile/current.264.853762891
11. Create the spfile using the below command.
create spfile='+DATAC1/ambudr1/spfileambu.ora' from pfile='/u03/rmanbkp/ambu/pfile_for_standby.txt';
11.1. Create the 2nd standby database as followed the step from 7 to 11.
12. Create cluster server using the below command.
1st DR server.
--------------
srvctl add database -d ambudr1 -o /u02/app/oracle/product/11.2.0/dbhome_1 -p +DATAC1/ambudr1/spfileambu.ora -r physical_standby -a DATAC1,RECOC1 -s MOUNT
srvctl add instance -d ambudr1 -i ambudr11 -n drexa01
srvctl add instance -d ambudr1 -i ambudr12 -n drexa02
2nd DR server.
--------------
srvctl add database -d ambudr2 -o /u02/app/oracle/product/11.2.0/dbhome_1 -p +DATAC1/ambudr2/spfileambu.ora -r physical_standby -a DATAC1,RECOC1 -s MOUNT
srvctl add instance -d ambudr2 -i ambudr21 -n drtest01
srvctl add instance -d ambudr2 -i ambudr22 -n drtest02
13.1. Add the below entries in both production nodes tnsnames.ora file as a oracle user.
ambu_DGMGRL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.1.12)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.1.14)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ambu_DGMGRL)
)
)
13.2. Add the below entries in 1st DR both nodes tnsnames.ora file as a oracle user.
ambudr1_DGMGRL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.1.12)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.1.14)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ambudr1_DGMGRL)
)
)
13.3. Add the below entries in 2nd DR both nodes tnsnames.ora file as a oracle user.
ambudr2_DGMGRL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.7.12)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.7.14)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ambudr2_DGMGRL)
)
)
13.4. Add the below entries in production node1 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambu_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambu1)
)
)
13.5. Add the below entries in production node2 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambu_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambu2)
)
)
13.6. Add the below entries in 1st DR node1 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambudr1_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambudr11)
)
)
13.7. Add the below entries in 1st DR node2 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambudr1_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambudr12)
)
)
13.8. Add the below entries in 2nd DR node1 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambudr2_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambudr21)
)
)
13.9. Add the below entries in 2nd DR node2 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambudr2_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambudr22)
)
)
13.10. Using the below command to restart the listener.
$ srvctl stop listener
$ srvctl start listener
14.1. Set the below parameter in primary database.
alter system set fal_server='AMBUDR1,AMBUDR2' sid='*';
alter system set fal_client='AMBU' sid='*';
alter system set dg_broker_config_file1 = '+DATAC1/AMBU/dr1ambu.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+DATAC1/AMBU/dr2ambu.dat' scope=both sid='*';
alter system set dg_broker_start = true scope=both sid='*';
14.2. Set the below parameter in 1st standby database.
alter system set fal_server='AMBU,AMBUDR2' sid='*';
alter system set fal_client='AMBUDR1' sid='*';
alter system set dg_broker_config_file1 = '+DATAC1/AMBUDR1/dr1ambudr1.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+DATAC1/AMBUDR1/dr2ambudr1.dat' scope=both sid='*';
alter system set dg_broker_start = true scope=both sid='*';
14.2. Set the below parameter in 2nd standby database.
alter system set fal_server='AMBU,AMBUDR1' sid='*';
alter system set fal_client='AMBUDR2' sid='*';
alter system set dg_broker_config_file1 = '+DATAC1/AMBUDR2/dr1ambudr2.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+DATAC1/AMBUDR2/dr2ambudr2.dat' scope=both sid='*';
alter system set dg_broker_start = true scope=both sid='*';
15.1. Configure the dataguard brocker using the below command.
/home/oracle::11g-->dgmgrl
DGMGRL> connect sys/password
DGMGRL> create configuration dg_ambu as primary database is ambu connect identifier is ambu;
DGMGRL> add database ambudr1 as connect identifier is ambudr1 maintained as physical;
DGMGRL> add database ambudr2 as connect identifier is ambudr2 maintained as physical;
DGMGRL> enable configuration;
15.2. Configuration output.
/home/oracle::11g-->dgmgrl
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/password
Connected.
DGMGRL> create configuration dg_ambu as primary database is ambu connect identifier is ambu;
Configuration "dg_ambu" created with primary database "ambu"
DGMGRL> add database ambudr1 as connect identifier is ambudr1 maintained as physical;
Database "ambudr1" added
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambu - Primary database
ambudr1 - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
DGMGRL> enable configuration
Enabled.
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambu - Primary database
ambudr1 - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
16. switchover steps.
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambu - Primary database
ambudr1 - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> switchover to ambudr1
Performing switchover NOW, please wait...
Operation requires a connection to instance "ambudr1" on database "ambudr1"
Connecting to instance "ambudr1"...
Connected.
New primary database "ambudr1" is opening...
Operation requires startup of instance "ambu" on database "ambu"
Starting instance "ambu"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "ambudr1"
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambudr1 - Primary database
ambu - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
17. Failover steps.
$ dgmgrl sys/password@ambu ### Connection should be with standby database.
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambudr1 - Primary database
ambu - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> failover to ambu;
Performing failover NOW, please wait...
Failover succeeded, new primary is "ambu"
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambu - Primary database
ambudr1 - Physical standby database (disabled)
ORA-16661: the standby database needs to be reinstated
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> reinstate database ambudr1;
Reinstating database "ambudr1", please wait...
Operation requires shutdown of instance "ambudr1" on database "ambudr1"
Shutting down instance "ambudr1"...
Database closed.
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "ambudr1" on database "ambudr1"
Starting instance "ambudr1"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "ambudr1" ...
Operation requires shutdown of instance "ambudr1" on database "ambudr1"
Shutting down instance "ambudr1"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "ambudr1" on database "ambudr1"
Starting instance "ambudr1"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "ambudr1" ...
Reinstatement of database "ambudr1" succeeded
DGMGRL> show configuration;
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambu - Primary database
ambudr1 - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
alter database force logging;
2.1 change the below parameter in Primary database.
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(AMBU,AMBUDR1,AMBUDR2)' scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=AMBU' scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_2='SERVICE=AMBUDR1 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=AMBUDR1' scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_3='SERVICE=AMBUDR2 ASYNC LGWR VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=AMBUDR2' scope=both sid='*';
alter system set log_archive_format='%t_%s_%r.arc' scope=spfile sid='*';
alter system set log_archive_max_processes=8 scope=both sid='*';
alter system set fal_server=AMBUDR1,AMBUDR2 scope=both sid='*';
alter system set standby_file_management=AUTO scope=both sid='*';
2.2. verify the parameter changes using the below query.
set linesize 500 pages 0
col value for a90
col name for a50
select name, value
from v$parameter
where name in ('db_name','db_unique_name','log_archive_config', 'log_archive_dest_1','log_archive_dest_2','log_archive_dest_3',
'log_archive_dest_state_1','log_archive_dest_state_2','log_archive_dest_state_3', 'remote_login_passwordfile',
'log_archive_format','log_archive_max_processes','fal_server','db_file_name_convert',
'log_file_name_convert', 'standby_file_management');
Output:
=======
select name, value
from v$parameter
where name in ('db_name','db_unique_name','log_archive_config', 'log_archive_dest_1','log_archive_dest_2','log_archive_dest_3',
'log_archive_dest_state_1','log_archive_dest_state_2','log_archive_dest_state_3', 'remote_login_passwordfile',
'log_archive_format','log_archive_max_processes','fal_server','db_file_name_convert',
'log_file_name_convert', 'standby_file_management');SQL> SQL> 2 3 4 5 6
db_file_name_convert
log_file_name_convert
log_archive_dest_1 LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=AMBU
log_archive_dest_2 service="ambudr1", LGWR ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 ma
x_connections=1 reopen=300 db_unique_name="ambudr1" net_timeout=30, valid_for=(all_logfiles,
primary_role)
log_archive_dest_3 service="ambudr2", LGWR ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 ma
x_connections=1 reopen=300 db_unique_name="ambudr2" net_timeout=30, valid_for=(all_logfiles,
primary_role)
log_archive_dest_state_1 enable
log_archive_dest_state_2 ENABLE
log_archive_dest_state_3 ENABLE
fal_server ambudr2, ambudr1
log_archive_config DG_CONFIG=(AMBU,AMBUDR1,AMBUDR2)
log_archive_format %t_%s_%r.arc
log_archive_max_processes 8
standby_file_management AUTO
remote_login_passwordfile EXCLUSIVE
db_name ambu
db_unique_name ambu
3.1. verify the logfile using the below query's.
select group#,THREAD#,bytes/1024/1024,status,members from v$log;
select member from v$logfile;
3.2. Add the below logfile and standby logfile in primary database
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 1 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 2 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 3 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 4 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 5 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 6 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 7 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 8 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 9 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 10 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 11 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 12 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 13 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 GROUP 14 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 GROUP 15 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 GROUP 16 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 GROUP 17 ('+DATAC1','+RECOC1') SIZE 100m;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 GROUP 18 ('+DATAC1','+RECOC1') SIZE 100m;
4. Take the rman backup using below command.
rman target / nocatalog
run
{
sql 'alter system switch logfile';
backup database plus archivelog format '/u03/rmanbkp/ambu/Primary_bkp_for_stndby_%U';
backup current controlfile for standby format '/u03/rmanbkp/ambu/stby.ctl';
sql 'alter system archive log current';
}
5.1. create the init file using the below command in primary database.
create pfile='/u03/rmanbkp/ambu/pfile_for_standby.txt' from spfile;
5.2. edit the init parameters as below 1st DR.
ambudr12.__db_cache_size=7348420608
ambudr11.__db_cache_size=7482638336
ambudr12.__java_pool_size=234881024
ambudr11.__java_pool_size=234881024
ambudr12.__large_pool_size=637534208
ambudr11.__large_pool_size=637534208
ambudr12.__oracle_base='/u01/app/grid'#ORACLE_BASE set from environment
ambudr11.__oracle_base='/u02/app/oracle'#ORACLE_BASE set from environment
ambudr12.__pga_aggregate_target=6878658560
ambudr11.__pga_aggregate_target=6878658560
ambudr12.__sga_target=10301210624
ambudr11.__sga_target=10301210624
ambudr12.__shared_io_pool_size=0
ambudr11.__shared_io_pool_size=0
ambudr12.__shared_pool_size=1979711488
ambudr11.__shared_pool_size=1845493760
ambudr12.__streams_pool_size=0
ambudr11.__streams_pool_size=0
*.archive_lag_target=0
*.audit_file_dest='/u02/app/oracle/admin/ambudr1/adump' ##### Changed for dataguard
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+DATAC1/ambudr1/controlfile/current.256.853762891','+RECOC1/ambudr1/controlfile/current.264.853762891'
*.db_block_size=8192
*.db_create_file_dest='+DATAC1'
*.db_create_online_log_dest_1='+RECOC1'
*.db_domain=''
*.db_file_name_convert='+DATAC1','+DATAC1'
*.db_name='ambu'
*.db_recovery_file_dest='+RECOC1'
*.db_recovery_file_dest_size=536870912000
*.db_unique_name='ambudr1' ##### Changed for dataguard
*.dg_broker_config_file1='+DATAC1/AMBUDR1/dr1ambudr1.dat'
*.dg_broker_config_file2='+DATAC1/AMBUDR1/dr2ambudr1.dat'
*.dg_broker_start=TRUE
*.diagnostic_dest='/u02/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ambudr1XDB)'
*.fal_client='AMBUDR1'
*.fal_server='ambu','ambudr2' ##### Changed for dataguard
ambudr12.instance_number=2
ambudr11.instance_number=1
*.log_archive_config='dg_config=(ambudr1,AMBU,ambudr2)' ##### Changed for dataguard
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=AMBUDR1' ##### Changed for dataguard
*.log_archive_dest_2='SERVICE=AMBU LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=AMBU'
*.log_archive_dest_3='SERVICE=AMBUDR2 ASYNC LGWR VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=AMBUDR2'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_dest_state_3='ENABLE'
*.log_archive_format='%t_%s_%r.arc'
ambudr12.log_archive_format='%t_%s_%r.arc'
ambudr11.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=8
*.log_archive_min_succeed_dest=1
ambudr12.log_archive_trace=0
ambudr11.log_archive_trace=0
*.log_file_name_convert='+DATAC1','+DATAC1','+RECOC1','+RECOC1'
*.memory_max_target=17179869184
*.memory_target=17179869184
*.open_cursors=300
*.processes=1500
*.remote_listener='exadr-scan:1521' ##### Changed for dataguard
*.remote_login_passwordfile='exclusive'
*.sessions=1655
*.standby_file_management='AUTO'
ambudr12.thread=2
ambudr11.thread=1
ambudr11.undo_tablespace='UNDOTBS1'
ambudr12.undo_tablespace='UNDOTBS2'
5.3. edit the init parameters as below 2st DR.
ambudr21.__db_cache_size=7985954816
ambudr22.__db_cache_size=7985954816
ambudr21.__java_pool_size=201326592
ambudr22.__java_pool_size=201326592
ambudr21.__large_pool_size=234881024
ambudr22.__large_pool_size=234881024
ambudr21.__oracle_base='/u02/app/oracle'#ORACLE_BASE set from environment
ambudr22.__oracle_base='/u01/app/grid'#ORACLE_BASE set from environment
ambudr21.__pga_aggregate_target=6878658560
ambudr22.__pga_aggregate_target=6878658560
ambudr21.__sga_target=10301210624
ambudr22.__sga_target=10301210624
ambudr21.__shared_io_pool_size=0
ambudr22.__shared_io_pool_size=0
ambudr21.__shared_pool_size=1778384896
ambudr22.__shared_pool_size=1778384896
ambudr21.__streams_pool_size=0
ambudr22.__streams_pool_size=0
*.archive_lag_target=0
*.audit_file_dest='/u02/app/oracle/admin/ambudr2/adump' ##### Changed for dataguard
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+datac1/ambudr2/controlfile/current.441.856524137','+RECOC1/ambudr2/controlfile/current.341.856524137'
*.db_block_size=8192
*.db_create_file_dest='+DATAC1'
*.db_create_online_log_dest_1='+RECOC1'
*.db_domain=''
*.db_file_name_convert='+DATAC1','+DATAC1'
*.db_name='ambu'
*.db_recovery_file_dest='+RECOC1'
*.db_recovery_file_dest_size=536870912000
*.db_unique_name='ambudr2' ##### Changed for dataguard
*.dg_broker_config_file1='+DATAC1/AMBUDR2/dr1ambudr2.dat'
*.dg_broker_config_file2='+DATAC1/AMBUDR2/dr2ambudr2.dat'
*.dg_broker_start=TRUE
*.diagnostic_dest='/u02/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ambudr2XDB)'
*.fal_client='AMBUDR2'
*.fal_server='ambu','ambudr1' ##### Changed for dataguard
ambudr22.instance_number=2
ambudr21.instance_number=1
*.log_archive_config='DG_CONFIG=(AMBU,AMBUDR1,AMBUDR2)' ##### Changed for dataguard
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=AMBUDR2' ##### Changed for dataguard
*.log_archive_dest_2='service="ambu"','LGWR ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=300 db_unique_name="ambu" net_timeout=30','valid_for=(all_logfiles,primary_role)' ##### Changed for dataguard
*.log_archive_dest_3='SERVICE=AMBUDR1 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=AMBUDR1' ##### Changed for dataguard
*.log_archive_dest_state_2='ENABLE'
*.log_archive_dest_state_3='ENABLE'
*.log_archive_format='%t_%s_%r.arc'
ambudr21.log_archive_format='%t_%s_%r.arc'
ambudr22.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=8
*.log_archive_min_succeed_dest=1
ambudr21.log_archive_trace=0
ambudr22.log_archive_trace=0
*.log_file_name_convert='+DATAC1','+DATAC1','+RECOC1','+RECOC1'
*.memory_max_target=17179869184
*.memory_target=17179869184
*.open_cursors=300
*.processes=1500
*.remote_listener='exatest-scan:1521' ##### Changed for dataguard
*.remote_login_passwordfile='exclusive'
*.sessions=1655
*.standby_file_management='AUTO'
ambudr22.thread=2
ambudr21.thread=1
ambudr21.undo_tablespace='UNDOTBS1'
ambudr22.undo_tablespace='UNDOTBS2'
6. copy the backup pices and init file from Production to DR server.
7. start the standby database as below command.
startup nomount pfile='/u03/rmanbkp/ambu/pfile_for_standby.txt';
8. Using the below command for creating a standby database.
rman target sys/password@AMBU auxiliary /
DUPLICATE TARGET DATABASE FOR STANDBY NOFILENAMECHECK;
9. start the MRP process using the below command in SQL prompt.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
10. change the controlfile name in the init file as per the restoration output.
output file name=+DATAC1/ambudr1/controlfile/current.256.853762891
output file name=+RECOC1/ambudr1/controlfile/current.264.853762891
11. Create the spfile using the below command.
create spfile='+DATAC1/ambudr1/spfileambu.ora' from pfile='/u03/rmanbkp/ambu/pfile_for_standby.txt';
11.1. Create the 2nd standby database as followed the step from 7 to 11.
12. Create cluster server using the below command.
1st DR server.
--------------
srvctl add database -d ambudr1 -o /u02/app/oracle/product/11.2.0/dbhome_1 -p +DATAC1/ambudr1/spfileambu.ora -r physical_standby -a DATAC1,RECOC1 -s MOUNT
srvctl add instance -d ambudr1 -i ambudr11 -n drexa01
srvctl add instance -d ambudr1 -i ambudr12 -n drexa02
2nd DR server.
--------------
srvctl add database -d ambudr2 -o /u02/app/oracle/product/11.2.0/dbhome_1 -p +DATAC1/ambudr2/spfileambu.ora -r physical_standby -a DATAC1,RECOC1 -s MOUNT
srvctl add instance -d ambudr2 -i ambudr21 -n drtest01
srvctl add instance -d ambudr2 -i ambudr22 -n drtest02
13.1. Add the below entries in both production nodes tnsnames.ora file as a oracle user.
ambu_DGMGRL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.1.12)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.1.14)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ambu_DGMGRL)
)
)
13.2. Add the below entries in 1st DR both nodes tnsnames.ora file as a oracle user.
ambudr1_DGMGRL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.1.12)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.1.14)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ambudr1_DGMGRL)
)
)
13.3. Add the below entries in 2nd DR both nodes tnsnames.ora file as a oracle user.
ambudr2_DGMGRL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.7.12)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.7.14)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ambudr2_DGMGRL)
)
)
13.4. Add the below entries in production node1 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambu_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambu1)
)
)
13.5. Add the below entries in production node2 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambu_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambu2)
)
)
13.6. Add the below entries in 1st DR node1 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambudr1_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambudr11)
)
)
13.7. Add the below entries in 1st DR node2 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambudr1_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambudr12)
)
)
13.8. Add the below entries in 2nd DR node1 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambudr2_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambudr21)
)
)
13.9. Add the below entries in 2nd DR node2 listener.ora file as a grid user.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ambudr2_DGMGRL)
(ORACLE_HOME = /u02/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ambudr22)
)
)
13.10. Using the below command to restart the listener.
$ srvctl stop listener
$ srvctl start listener
14.1. Set the below parameter in primary database.
alter system set fal_server='AMBUDR1,AMBUDR2' sid='*';
alter system set fal_client='AMBU' sid='*';
alter system set dg_broker_config_file1 = '+DATAC1/AMBU/dr1ambu.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+DATAC1/AMBU/dr2ambu.dat' scope=both sid='*';
alter system set dg_broker_start = true scope=both sid='*';
14.2. Set the below parameter in 1st standby database.
alter system set fal_server='AMBU,AMBUDR2' sid='*';
alter system set fal_client='AMBUDR1' sid='*';
alter system set dg_broker_config_file1 = '+DATAC1/AMBUDR1/dr1ambudr1.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+DATAC1/AMBUDR1/dr2ambudr1.dat' scope=both sid='*';
alter system set dg_broker_start = true scope=both sid='*';
14.2. Set the below parameter in 2nd standby database.
alter system set fal_server='AMBU,AMBUDR1' sid='*';
alter system set fal_client='AMBUDR2' sid='*';
alter system set dg_broker_config_file1 = '+DATAC1/AMBUDR2/dr1ambudr2.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+DATAC1/AMBUDR2/dr2ambudr2.dat' scope=both sid='*';
alter system set dg_broker_start = true scope=both sid='*';
15.1. Configure the dataguard brocker using the below command.
/home/oracle::11g-->dgmgrl
DGMGRL> connect sys/password
DGMGRL> create configuration dg_ambu as primary database is ambu connect identifier is ambu;
DGMGRL> add database ambudr1 as connect identifier is ambudr1 maintained as physical;
DGMGRL> add database ambudr2 as connect identifier is ambudr2 maintained as physical;
DGMGRL> enable configuration;
15.2. Configuration output.
/home/oracle::11g-->dgmgrl
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/password
Connected.
DGMGRL> create configuration dg_ambu as primary database is ambu connect identifier is ambu;
Configuration "dg_ambu" created with primary database "ambu"
DGMGRL> add database ambudr1 as connect identifier is ambudr1 maintained as physical;
Database "ambudr1" added
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambu - Primary database
ambudr1 - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
DGMGRL> enable configuration
Enabled.
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambu - Primary database
ambudr1 - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
16. switchover steps.
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambu - Primary database
ambudr1 - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> switchover to ambudr1
Performing switchover NOW, please wait...
Operation requires a connection to instance "ambudr1" on database "ambudr1"
Connecting to instance "ambudr1"...
Connected.
New primary database "ambudr1" is opening...
Operation requires startup of instance "ambu" on database "ambu"
Starting instance "ambu"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "ambudr1"
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambudr1 - Primary database
ambu - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
17. Failover steps.
$ dgmgrl sys/password@ambu ### Connection should be with standby database.
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambudr1 - Primary database
ambu - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> failover to ambu;
Performing failover NOW, please wait...
Failover succeeded, new primary is "ambu"
DGMGRL> show configuration
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambu - Primary database
ambudr1 - Physical standby database (disabled)
ORA-16661: the standby database needs to be reinstated
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> reinstate database ambudr1;
Reinstating database "ambudr1", please wait...
Operation requires shutdown of instance "ambudr1" on database "ambudr1"
Shutting down instance "ambudr1"...
Database closed.
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "ambudr1" on database "ambudr1"
Starting instance "ambudr1"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "ambudr1" ...
Operation requires shutdown of instance "ambudr1" on database "ambudr1"
Shutting down instance "ambudr1"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "ambudr1" on database "ambudr1"
Starting instance "ambudr1"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "ambudr1" ...
Reinstatement of database "ambudr1" succeeded
DGMGRL> show configuration;
Configuration - dg_ambu
Protection Mode: MaxPerformance
Databases:
ambu - Primary database
ambudr1 - Physical standby database
ambudr2 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>
Comments
Post a Comment