standby
Create temporary listener
LISTENER_TEMP=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS= (PROTOCOL=TCP)(HOST=exadb01)(PORT=1525))
)
)
SID_LIST_LISTENER_TEMP =
(SID_LIST=
(SID_DESC=
(SID_NAME=apple1)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1)
)
)
******************************************************************************
Primary
Add tns entries of source and target on all the 3 nodes.
apple =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = exadb10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = apple)
)
)
appleDR =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = exadb01)(PORT = 1525))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = apple1)
)
)
******************************************************************************
Standby
Add tns entries of source and target on all the 3 nodes.
apple =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = exadb10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = apple)
)
)
appleDR =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = exadb01)(PORT = 1525))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = apple1)
)
)
******************************************************************************
Primary
ALTER DATABASE FORCE LOGGING;
alter system set log_archive_max_processes=4 scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_1='LOCATION=/oracle/archive/apple VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=apple' scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_2='SERVICE=appledr VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=apple' scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_STATE_1='ENABLE' scope=both sid='*';
alter system set LOG_ARCHIVE_DEST_STATE_2='ENABLE' scope=both sid='*';
alter system set STANDBY_FILE_MANAGEMENT='AUTO'scope=both sid='*';
alter system set FAL_SERVER='appleDR'scope=both sid='*';
alter system set FAL_CLIENT='apple'scope=both sid='*';
alter system set log_archive_config='dg_config=(apple,apple)' scope=both sid='*';
create pfile from spfile;
alter user sys identified by "xxxx" account unlock;
orapwd file=orapwapple1 password=xxxx entries=5 force=y
scp initapple1.ora oracle@exadb01:/opt/app/oracle/product/11.2.0.4/dbs/initapple1.ora
scp orapwapple1 oracle@exadb01:/opt/app/oracle/product/11.2.0.4/dbs/orapwapple1
scp orapwapple1 oracle@exadb02:/opt/app/oracle/product/11.2.0.4/dbs/orapwapple2
scp orapwapple1 oracle@exadb03:/opt/app/oracle/product/11.2.0.4/dbs/orapwapple3
******************************************************************************
Standby
At this point Parameter file on standby server will have all parameters including RAC
Rename the init file as below to differentiate
cp initapple1.ora initapple1.ora.rac
Now edit the initapple1.ora and remove all the RAC related parameters which includes below
instance related, cluster_database, threads, undo etc.. Keep the apple1_xxx parameters as is.
Modify the below parameters
*.LOG_ARCHIVE_DEST_1='LOCATION=+RECO VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=apple'
*.LOG_ARCHIVE_DEST_2='SERVICE=apple VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=apple'
*.LOG_ARCHIVE_DEST_STATE_1='ENABLE'
*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'
*.FAL_SERVER='apple'
*.FAL_CLIENT='appledr'
*.control_files='+DATA/apple/controlfile/control01.ctl','+REDO/apple/controlfile/control02.ctl','+RECO/apple/controlfile/control03.ctl'
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+REDO'
Create respective directories here as per pfile
. oraenv=apple1
startup nomount
******************************************************************************
Primary
rman target sys/xxxx@apple auxiliary sys/xxxx@appleDR
duplicate target database for standby from active database dorecover;
After finish exit rman console
******************************************************************************
Standby
create spfile from the rac pfile as below
create spfile='+CRS/apple/parameterfile/spfileapple.ora' from pfile='/opt/app/oracle/product/11.2.0.4/dbs/initapple1.ora.rac';
shut immediate;
vi initapple1.ora
spfile='+crs/apple/parameterfile/spfileapple.ora'
scp initapple1.ora oracle@exadb02:/opt/app/oracle/product/11.2.0.4/dbs/initapple2.ora
scp initapple1.ora oracle@exadb03:/opt/app/oracle/product/11.2.0.4/dbs/initapple3.ora
******************************************************************************
Standby
Adding the 3 instances to cluster
srvctl add database -d apple -o /opt/app/oracle/product/11.2.0.4 -p +CRS/apple/parameterfile/spfileapple.ora -r physical_standby -a DATA,REDO,RECO,CRS
srvctl add instance -d apple -i apple1 -n exadb01
srvctl add instance -d apple -i apple2 -n exadb02
srvctl add instance -d apple -i apple3 -n exadb03
srvctl start database -d apple
srvctl status database -d apple
srvctl config database -d apple
******************************************************************************
Standby
After verifying the config stop the database on all the 3 instances and start on a single instance.
srvctl start instance -d apple -i apple1
sqlplus / as sysdba
start MRP process
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
******************************************************************************
Note
To stop MRP process use
alter database recover managed standby database cancel;
******************************************************************************
To very dataguard sync use below commands
Standby
select thread#,max(sequence#) from v$archived_log where applied='YES' group by thread#;
PRIMARY
select thread#,max(sequence#) from v$archived_log group by thread#;
or
select max(sequence#) from v$archived_log where resetlogs_change#=(SELECT resetlogs_change# FROM v$database)
******************************************************************************