Sunday, 11 February 2018

1) check the primary and standby databases are in sync


2) if observer is running
     1) disable fast_start failover (Disable FAST_START FAILOVER) and to ensure use "show configuration" command



     2) go to observer server then execute respective g2ap stop obeserver script and check the logfile to ensure observre is stopped

3)execute kill.sql script in primary server.
4)dgmgrl /
5)connect as sys user
7)show configuration
6)switchover to 'gleg2apr';
7)show configuration

scenario 1)

if gleg2apr becomes primary automatically after swithcover then log sync needs to be checked . if syncing is fine then database needs to be shutdown for unix patching

database shutdown process

1) connect to dgmgrl prompt
2) edit database 'glwg2apr' set property LogShipping='OFF'; show database verbose 'GLWG2APR';
3) go to glg2apprdb01 server.
4) down the listener
5) down the database

after unix patching is completed.

1) startup the database in mount mode ( alter database mount)
2)startup the listener
3)go to dgmgrl prompt
4)EDIT DATABASE 'GLWG2APR' SET PROPERTY LogShipping='ON'; show database verbose 'GLWG2APR';
5)check log sync


scenario 2)

if we get a message to startup the primary database manually after switchover command executed.

1) go to gleg2apprdb01
2) alter database open
4) go to glg2apprdb01
5) shutdown the database
6) open the database in mount state(alter database mount)
7) check the status of logshipping;
8) check all databases are in sync
9) if all are in sync , off the logshipping ie edit database 'glwg2apr' set property LogShipping='OFF'; show database verbose 'GLWG2APR';
10) down the listener
5) down the database

after unix patching is completed.

1) startup the database in mount mode ( alter database mount)-glg2apprdb01
2)startup the listener
3)go to dgmgrl prompt
4)EDIT DATABASE 'GLWG2APR' SET PROPERTY LogShipping='ON'; show database verbose 'GLWG2APR';
5)check log sync



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

Verify Data Guard ships logs all right
Primary: SQL>select thread#, max(sequence#) "Last Primary Seq Generated"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;


PhyStdby:SQL> select thread#, max(sequence#) "Last Standby Seq Received"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;

PhyStdby:SQL>select thread#, max(sequence#) "Last Standby Seq Applied"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
and val.applied in ('YES','IN-MEMORY')
group by thread# order by 1;



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

SQL> select process,sequence#,status from v$managed_standby;

PROCESS SEQUENCE# STATUS
--------- ---------- ------------
ARCH 3440 CLOSING
ARCH 3358 CLOSING
RFS 3441 IDLE
RFS 0 IDLE
MRP0 3441 APPLYING_LOG

set lines 132
col group# format a9
col status format a25
Select process, status,group#,thread#, sequence# from v$managed_standby
order by group#,thread#, sequence#;




How to start the MRP Process:-

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

REAL TIME apply

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE using current logfile disconnect from session;

How to Stop MRP process

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL DISCONNECT FROM SESSION;


===============================================================================
DGMGRL> switchover to 'tdusdpr';
Performing switchover NOW, please wait...
Operation requires shutdown of instance "TDUSGPR" on database "tdusgpr"
Shutting down instance "TDUSGPR"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires shutdown of instance "TDUSDPR" on database "tdusdpr"
Shutting down instance "TDUSDPR"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "TDUSGPR" on database "tdusgpr"
Starting instance "TDUSGPR"...
ORACLE instance started.
Database mounted.
Operation requires startup of instance "TDUSDPR" on database "tdusdpr"
Starting instance "TDUSDPR"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "tdusdpr"
-------------------------------------

SQL> select process,sequence#,status from v$managed_standby;

PROCESS SEQUENCE# STATUS
--------- ---------- ------------
ARCH 3440 CLOSING
ARCH 3358 CLOSING
RFS 3441 IDLE
RFS 0 IDLE
MRP0 3441 APPLYING_LOG

set lines 132
col group# format a9
col status format a25
Select process, status,group#,thread#, sequence# from v$managed_standby
order by group#,thread#, sequence#;


No comments:

Post a Comment