You are on page 1of 19

Handy Queries -

-------------
**For first time Dr setup in a particualr os user we need to change the group from oinstall to asmadmin for oracle binary.Please refer to below
for the process:-

oraicoe@orappa801pa:/u01/app/oraicoe/product/11.2.0.3/bin$ ls -ltr oracle


-rwsr-s--x 1 oraicoe oinstall 300821466 Oct 01 09:22 oracle
oraicoe@orappa801pa:/u01/app/oraicoe/product/11.2.0.3/bin$ gh
oraicoe@orappa801pa:/u01/app/11.2.0.3/grid$ cd bin
oraicoe@orappa801pa:/u01/app/11.2.0.3/grid/bin$ ls -ltr setasmgidwrap
-rwxr-xr-x 1 grid oinstall 2350 Sep 13 09:22 setasmgidwrap
oraicoe@orappa801pa:/u01/app/11.2.0.3/grid/bin$ ./setasmgidwrap -o=/u01/app/oraicoe/product/11.2.0.3/bin/oracle
oraicoe@orappa801pa:/u01/app/11.2.0.3/grid/bin$ ls -ltr /u01/app/oraicoe/product/11.2.0.3/bin/oracle
-rwsr-s--x 1 oraicoe asmadmin 300821466 Oct 01 09:22 /u01/app/oraicoe/product/11.2.0.3/bin/oracle
oraicoe@orappa801pa:/u01/app/11.2.0.3/grid/bin$

*************MODIFICATION IN LISTENER.ORA*******************************
Before starting please check whether any listener viz. DGOPS is running or not.We will be using DGOPS listener to configure DG broker along
with its operations.

grid@oramna801pa:/u01/app/11.2.0.3/grid/network/admin$ ps -ef|grep tns|grep DGOPS


grid 27852978 1 0 Mar 19 pts/3 0:05 /u01/app/11.2.0.3/grid/bin/tnslsnr DGOPS -inherit

Please verify whether the DGOPS listener service is running or not.If not running you need to start it and if the listener is not present you need to
add in listener.ora localted in GRID_HOME/network/admin folder

Sample entry for DGOPS listener:-

DGOPS =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pa-vip)(PORT = 1522))
)
)

Note: Please change the hostname accordingly

********************************************************************************

set line 200


col MEMBER for a100
select group#, MEMBER, type from v$logfile;

select GROUP#, THREAD#, MEMBERS from v$log;

select GROUP#, THREAD#, MEMBERS from v$standby_log;

1) On Primary

a) Enable Force logging

ALTER DATABASE FORCE LOGGING;

Validation
-------------
select NAME,inst_id,FORCE_LOGGING from gv$database;

b) ADD ONE MORE REDO LOG GROUP AND Create standby redo logs ( DO NOT MULTIPLEX)

EG

alter database add standby logfile thread 1 group 11 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 1 group 12 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 1 group 13 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 1 group 14 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 1 group 15 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 1 group 16 ('+FRA_ICOE') size 200M;

alter database add standby logfile thread 2 group 17 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 2 group 18 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 2 group 19 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 2 group 20 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 2 group 21 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 2 group 22 ('+FRA_ICOE') size 200M;

Validation
-------------
set line 200
col MEMBER for a100
select group#, MEMBER, type from v$logfile;
(it will show a total of 32 rows, 22 groups with group # 11 to group # 22 having one members each)

select GROUP#, THREAD#, MEMBERS from v$log;


(It will show a total of 10 rows and 10 groups with each group having 2 members each)

c) Modify initialization parameter on primary

Eg

alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(vobpre01pri,vobpre01dr)' 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=vobpre01pri' scope=both sid='*';

alter system set LOG_ARCHIVE_DEST_2='SERVICE=vobpre01dr_DGMGRL LGWR ASYNC NOAFFIRM


VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=vobpre01dr' scope=both sid='*';
(make an entry on the tnsnames.ora for *******_DGMGRL)
alter system set fal_server=vobpre01dr_DGMGRL scope=both sid='*';

alter system set fal_client=vobpre01pri_DGMGRL scope=both sid='*';

alter system set db_file_name_convert='+DATA_ICOE/vobpre01dr','+DATA_ICOE/vobpre01pri','+FRA_ICOE/vobpre01dr'


,'+FRA_ICOE/vobpre01pri' scope=spfile sid='*';

alter system set log_file_name_convert='+DATA_ICOE/vobpre01dr','+DATA_ICOE/vobpre01pri','+FRA_ICOE/vobpre01dr','+FRA_ICOE/


vobpre01pri' scope=spfile sid='*';

alter system set standby_file_management=AUTO scope=both sid='*';

alter system set log_archive_dest_state_2='defer' scope=both;

alter system set log_archive_dest_state_1='enable' scope=both;

alter system set DB_LOST_WRITE_PROTECT = 'TYPICAL' scope=both sid='*';

d) Create a pfile for standby


create pfile='?/dbs/pfile_vobpre01_dr.ora' from spfile;

2) Setup Connectivity

*) Shutdown 2nd instance only and copy password from first instance of primary to second instance of primary and to rest of DR
instances

a) As per following example add the following Listener entry for the following nodes
Note:We need to create a test listener.That will be used for Dataguard configuration and then DGMGRL operations.

You may add below entries in the listener.ora (Please take backup of listener.ora before staring this)

ON PRIMARY RAC NODE-1


SID_LIST_DGOPS=(SID_LIST=(SID_DESC=(GLOBAL_DBNAME =
vobpre01pri_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3)))

++++++++++++
ON DR RAC NODE-1
SID_LIST_DGOPS=(SID_LIST=(SID_DESC=(GLOBAL_DBNAME=vobpre01dr_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/
oraicoe/product/11.2.0.3)))

Restart DGOPS on all nodes of primary and dr server


lsnrctl stop DGOPS
lsnrctl start DGOPS
----------------------------------

b) Set the tnsname entry as follows on all the nodes of RAC(Add in both grid and database owner user here oraicoe)

VOBPRE01PRI_DGMGRL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pa)(PORT = 1522)) #change port
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pb)(PORT = 1522))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = vobpre01pri_DGMGRL)
)
)

VOBPRE01DR_DGMGRL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = orappa801pa)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = vobpre01dr_DGMGRL)
)
)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++

sqlplus sys/env1ronment@vobpre01dr_DGMGRL as sysdba


c) Verify the connetion from primary to dr and viceversa

3) Create stdby database

a) copy the password file from the primary $ORACLE_HOME/dbs and rename it to the standby database name
i) copy the password file from primary node-1 to all dr nodes

b) Create initialization parameter file

DB_NAME=vobpre01
DB_UNIQUE_NAME=vobpre01dr
DB_BLOCK_SIZE=8192
pga_aggregate_target=512M
sga_target=1536M

c) Create the necessary directories in the standby location to place the datafiles and the trace files in the $ADR_HOME
(dbump,udump, adump etc.)

Eg --in node-1
mkdir -p /u01/app/oraicoe/diag/rdbms/vobpre01dr/vobpre011/trace
mkdir -p /u01/app/oraicoe/diag/rdbms/vobpre01dr/vobpre011/cdump
mkdir -p /u01/app/oraicoe/admin/vobpre01dr/adump

d) Set the environment variable ORACLE_SID to the standby service and start the standby-instance
$export ORACLE_SID=vobpre011
$sqlplus "/ as sysdba"
SQL> startup nomount pfile=$ORACLE_HOME/dbs/initvobpre011.ora

============================================

4) On Primary NODE-1

a) alter system set log_archive_dest_state_2='enable' SCOPE=both sid='*';

5) On the primary system invoke the RMAN executable and connect to the primary and the auxiliary database (connect tru
sys/password@****_DGMGRL for both target and aux)…then run the following

EXAMPLE

rman target sys/env1ronment@vobpre01pri_DGMGRL auxiliary sys/env1ronment@vobpre01dr_DGMGRL


run {
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate auxiliary channel stby type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'vobpre01pri','vobpre01dr'
set db_file_name_convert='+DATA_ICOE/vobpre01pri','+DATA_ICOE/vobpre01dr','+FRA_ICOE/vobpre01pri','+FRA_ICOE/vobpre01dr'
set log_file_name_convert='+DATA_ICOE/vobpre01pri','+DATA_ICOE/vobpre01dr','+FRA_ICOE/vobpre01pri','+FRA_ICOE/vobpre01dr'
set db_unique_name='vobpre01dr'
set db_create_file_dest='+DATA_ICOE'
set db_recovery_file_dest='+FRA_ICOE'
set control_files='+DATA_ICOE','+FRA_ICOE'
set instance_number='1'
set log_archive_max_processes='5'
set fal_client='vobpre01dr_DGMGRL '
set fal_server='vobpre01pri_DGMGRL '
set standby_file_management='AUTO'
set remote_listener='orappa801p-scan:1541'
set log_archive_config='dg_config=(vobpre01pri,vobpre01dr)'
reset local_listener
set log_archive_dest_2='service=vobpre01pri_DGMGRL LGWR ASYNC NOAFFIRM valid_for=(online_logfiles,primary_role)
db_unique_name=vobpre01pri'
set log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=vobpre01dr';
}

6) On Standby NODE-1 execute the following

a) alter database recover managed standby database using current logfile disconnect;

b) for active DG ..stop the redo apply … open the db… start the redo apply

alter database recover managed standby database cancel;


shu immediate;
Startup mount;
alter database open read only;
alter database recover managed standby database using current logfile disconnect;

c) verify with select sequence#,thread#,applied from v$archived_log;


select PROCESS,STATUS,SEQUENCE# from V$managed_standby;

**** 7) On Standby NODE-1 : Edit the pfile and remove any references to primary db , except db_name this must be same as primary db. Set
instance specific instance_number, undo_tablespace, fal_client and thread.
8) On Standby NODE-1 : Shutdown the database and startup mount and create a spfile with +ASM diskgroup as the location

SQL> create pfile from spfile;

create spfile='+DATA_ICOE' from pfile='$ORACLE_HOME/dbs/initvobpre011.ora';


cp $ORACLE_HOME/dbs/initvobpre011.ora $ORACLE_HOME/dbs/initvobpre011.ora_bkp

now connect to grid -


asmcmd
cd +DATA_ICOE/VOBPRE01DR/PARAMETERFILE
ls

take the spfile name and create an alias for the spfile as recommended by oracle in the directory - '+DATA_ICOE/VOBPRE01DR'

mkalias +DATA_ICOE/VOBPRE01DR/PARAMETERFILE/spfile.471.838287367 +DATA_ICOE/VOBPRE01DR/spfilevobpre01dr.ora

9) On Standby NODE-1 : Create pfile file on each node's oracle home (ORACLE_HOME/dbs) that points to the spfile by adding one line that
referes to the spfile

edit the pfile and remove all the contents of the pfile and just put a link to the spfile in the ASM -

SPFILE='+DATA_ICOE/vobpre01dr/spfilevobpre01dr.ora'

10) Once above pfiles are created remove the spfile in $ORACLE_HOME/dbs that was created as part of the duplication.

11) Before bringing the standby instance start primary database.You need to do as below:-

srvctl stop database -d vobpre01pri

srvctl start database -d vobpre01pri

On DR
12) To add the database and instances to the cluster configuration run (run this from oracle user using grid srvctl)
EXAMPLE

/u01/app/11.2.0.3/grid/bin/srvctl add database -d vobpre01dr -o /u01/app/oraicoe/product/11.2.0.3 -p


"+DATA_ICOE/vobpre01dr/spfilevobpre01dr.ora" -n vobpre01 -r physical_standby -s open

/u01/app/11.2.0.3/grid/bin/srvctl add instance -d vobpre01dr -i vobpre011 -n orappa801pa

srvctl start database -d vobpre01dr -o 'READ ONLY'


========================================================

13) REMOVE ALL THE LISTENER ENTRY THAT WAS ADDEDD IN STEP 2 (a)
lsnrctl reload DGOPS

========================================================================================

SETUP listener_network

PRI01_LOCAL_NET1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pa )(PORT = 1521)))

PRI01_LOCAL_NET2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pa-vip )(PORT = 1522)))

PRI02_LOCAL_NET1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pb )(PORT = 1521)))

PRI02_LOCAL_NET2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pb-vip )(PORT = 1522)))
PRI_REMOTE_NET2 =
  (DESCRIPTION_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pa-vip )(PORT = 1522))
    (ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pb-vip )(PORT = 1522)))

DR01_LOCAL_NET1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = orappa801pa )(PORT = 1521)))

DR01_LOCAL_NET2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = orappa801pa-vip )(PORT = 1522)))

DR_REMOTE_NET2 =
  (DESCRIPTION_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = orappa801pa-vip )(PORT = 1522)))

ALTER SYSTEM SET listener_networks='((NAME=network1)(LOCAL_LISTENER=PRI01_LOCAL_NET1)(REMOTE_LISTENER=oramna801p-


scan:1541))','((NAME=network2)(LOCAL_LISTENER=PRI01_LOCAL_NET2)(REMOTE_LISTENER=PRI_REMOTE_NET2))' SCOPE=BOTH
SID='pinpre011';

ALTER SYSTEM SET listener_networks='((NAME=network1)(LOCAL_LISTENER=PRI02_LOCAL_NET1)(REMOTE_LISTENER=oramna801p-


scan:1541))','((NAME=network2)(LOCAL_LISTENER=PRI02_LOCAL_NET2)(REMOTE_LISTENER=PRI_REMOTE_NET2))' SCOPE=BOTH
SID='pinpre012';

ALTER SYSTEM SET listener_networks='((NAME=network1)(LOCAL_LISTENER=DR01_LOCAL_NET1)(REMOTE_LISTENER=orappa801p-


scan:1541))','((NAME=network2)(LOCAL_LISTENER=DR01_LOCAL_NET2)(REMOTE_LISTENER=DR_REMOTE_NET2))' SCOPE=BOTH
SID='pinpre011';

CONFIGURE DG BROKER -
1) Enter the following entry (in <<<<< >>>>>>> only)for listener.ora on each node of RAC. Change the entry as reqd. Plz. Note two entries are
reqd.
SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(GLOBAL_DBNAME =
vobpre01pri)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))
<<<<< (SID_DESC=(GLOBAL_DBNAME = vobpre01pri_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))
(SID_DESC=(GLOBAL_DBNAME = vobpre01dr_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3)) >>>>>> )

(SID_DESC=(GLOBAL_DBNAME = vobpre01pri_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))
(SID_DESC=(GLOBAL_DBNAME = vobpre01dr_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))

(SID_DESC=(GLOBAL_DBNAME = vobpre01pri_DGMGRL)(SID_NAME=vobpre012)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))
(SID_DESC=(GLOBAL_DBNAME = vobpre01dr_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))

Now we need to change the local listener of databases as below:-


Note: Please take note of current local_listener before proceeding
Check local_listener for all instances and it should be pointing to 1521
For primary node 1:-

alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.45.13.16)(PORT=1522))))' scope=both


sid='vobpre011';

For primary node 2:-

alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.45.13.17)(PORT=1522))))' scope=both


sid='vobpre012';

For dr node 1:-


alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.76.13.41)(PORT=1522))))' scope=both
sid='vobpre011';

Now bounce the DGOPS listener for all primary and dr nodes(e.g. lsnrctl stop DGOPS and then lsnrctl start DGOPS)

ON PRIMARY NODE-1 :
alter system set dg_broker_config_file1 = '+DATA_ICOE/vobpre01pri/dgb1_vobpre01pri.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+FRA_ICOE/vobpre01pri/dgb2_vobpre01pri.dat' scope=both sid='*';

ON DR NODE-1 :
alter system set dg_broker_config_file1 = '+DATA_ICOE/vobpre01dr/dgb1_vobpre01dr.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+FRA_ICOE/vobpre01dr/dgb2_vobpre01dr.dat' scope=both sid='*';

After Oracle confirmed these changes, start the broker on all databases:

alter system set dg_broker_start = true scope=both sid='*';

$ dgmgrl
DGMGRL for Linux: Version 11.2.0.2.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/env1ronment@vobpre01pri_dgmgrl

DGMGRL> create configuration vobpre01_dgconfig as primary database is vobpre01pri connect identifier is vobpre01pri_dgmgrl;

DGMGRL> add database vobpre01dr as connect identifier is vobpre01dr_dgmgrl maintained as physical;


=====================================================================
Please check the value of the parameter StaticConnectIdentifier if its as per the below setup or else execute the below commands –

edit instance pinpre011 on database pinpre01dr set PROPERTY StaticConnectIdentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)


(HOST=10.76.13.41)(PORT=1522))(CONNECT_DATA=(SERVICE_NAME=pinpre01dr_DGMGRL)(INSTANCE_NAME=pinpre011)
(SERVER=DEDICATED)))';

edit instance pinpre011 on database pinpre01pri set PROPERTY StaticConnectIdentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)


(HOST=10.45.13.16)(PORT=1522))(CONNECT_DATA=(SERVICE_NAME=pinpre01pri_DGMGRL)(INSTANCE_NAME=pinpre011)
(SERVER=DEDICATED)))';

edit instance pinpre012 on database pinpre01pri set PROPERTY StaticConnectIdentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)


(HOST=10.45.13.17)(PORT=1522))(CONNECT_DATA=(SERVICE_NAME=pinpre01pri_DGMGRL)(INSTANCE_NAME=pinpre012)
(SERVER=DEDICATED)))';

=====================================================================

DGMGRL> enable configuration;


**********************************************************************************************************************
*****************

NOW ...DELETE ALL THE TNS ENTRY THAT WAS ADDED EARLIER FOR RMAN DUPLICATE COMMAND.
======================================================================================================================
=

Changing protection mode steps

1. DGMGRL> EDIT DATABASE vobpre01dr SET PROPERTY 'LogXptMode'='ASYNC';


Property "LogXptMode" updated

2. DGMGRL> EDIT DATABASE vobpre01pri SET PROPERTY 'LogXptMode'='ASYNC';

Property "LogXptMode" updated

======================

SERVICE NAME ENTRIES

primary Site:-

Please run below commands in proper order as mentioned.

srvctl add service -d vobpre01pri -s vobpre01app -r vobpre011,vobpre012 -l primary -z 180 -w 5 -m BASIC -e SELECT -y automatic

srvctl add service -d vobpre01pri -s vobpre01stb -r vobpre011,vobpre012 -l physical_standby -z 180 -w 5 -m BASIC -e SELECT -y automatic

srvctl config service -d vobpre01pri -s vobpre01stb

srvctl config service -d vobpre01pri -s vobpre01app

srvctl start service -d vobpre01pri


srvctl status service -d vobpre01pri

<<Check all app and stb service is running or not>>

After that

srvctl stop service -d vobpre01pri

<<Check all app and stb service is not running>>

srvctl stop database -d vobpre01pri


srvctl start database -d vobpre01pri

<<Once database is started,please check by srvctl status service -d vobpre01pri whether app service running and stb service is not running.If all
fine then do a switchover to DR ,once it is successfull do show configuration in dgmgrl prompt and verify.If all fine then move to DR for service
addition>>
<<Before proceeding to DR (after successfull switchover )please verify whether app service is not running and stb service is running in primary
site>>

DR site:-

srvctl add service -d vobpre01dr -s vobpre01app -r vobpre011 -l primary -z 180 -w 5 -m BASIC -e SELECT -y automatic

srvctl add service -d vobpre01dr -s vobpre01stb -r vobpre011 -l physical_standby -z 180 -w 5 -m BASIC -e SELECT -y automatic

srvctl start service -d vobpre01dr


srvctl status service -d vobpre01dr
<<Check all app and stb service is running or not>>
After that
srvctl stop service -d vobpre01dr
<<Check all app and stb service is not running>>
srvctl stop database -d vobpre01dr
srvctl start database -d vobpre01dr
<<Once database is started,please check by srvctl status service -d vobpre01dr whether app service running and stb service is not running.If all
fine then move to DR service addition>>
<<Do a switchover and then please verify whether app service is not running and stb service is running in dr site>>
srvctl config service -d vobpre01dr -s vobpre01stb

srvctl config service -d vobpre01dr -s vobpre01app


============================
TNS ENTRY FOR CLIENT

VOBPRE01APP =
(DESCRIPTION = (CONNECT_TIMEOUT=10)(RETRY_COUNT=3)
(ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON)
(ADDRESS=(PROTOCOL=tcp)(HOST=oramna801p-scan)(PORT=1541))
(ADDRESS=(PROTOCOL=tcp)(HOST=orappa801p-scan)(PORT=1541))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = vobpre01app)
)
)

VOBPRE01STB =
(DESCRIPTION = (CONNECT_TIMEOUT=10)(RETRY_COUNT=3)
(ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON)
(ADDRESS=(PROTOCOL=tcp)(HOST=oramna801p-scan)(PORT=1541))
(ADDRESS=(PROTOCOL=tcp)(HOST=orappa801p-scan)(PORT=1541))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = vobpre01stb)
)
)
========================

Turn on flashback ON on primary

In DB mount mode execute the following

alter database flashback on;

=============================

sqlplus sys/env1ronment@AUDPRE01PRI as sysdba

sqlplus sys/env1ronment@AUDPRE01DR as sysdba

alter database recover managed standby database cancel;


shu immediate;
Startup mount;
alter database open read only;
alter database recover managed standby database using current logfile disconnect;

srvctl start database -d vobpre01dr -o 'READ ONLY'

srvctl start database -d vobpre01pri

select sequence#,thread#,applied from v$archived_log where thread#=2 order by sequence#;


select sequence#,thread#,applied from v$archived_log order by sequence#;

select sequence#,thread#,applied from v$archived_log where thread#=1 order by sequence#;


select sequence#,thread#,applied from gv$archived_log where inst_id=2 order by sequence#;

select PROCESS,STATUS,SEQUENCE# from V$managed_standby;

select sequence#,thread#,applied from v$archived_log where applied='NO' order by sequence#;


PING[ARC2]: Heartbeat failed to connect to standby 'vobpre01dr'. Error is 12154

select sequence#,thread#,applied from v$archived_log where thread#=1 order by sequence#;


select sequence#,thread#,applied from v$archived_log where thread#=2 order by sequence#;

sqlplus sys/env1ronment@vobpre01pri as sysdba

sqlplus sys/env1ronment@vobpre01dr as sysdba

You might also like