Search This Blog

Thursday, 20 July 2017

DG Switchover:(Switchover from _G1 (GREAT_SER) Primary Database to _C1(COOL_SER)
====================================================================
Through DGMGRL:

The SWITCHOVER is technically a database role transition, where replication is reversed and primary/standby databases are changing their
current database roles:

=> Initial Primary Database: <Database_Name>_G1 will become the current Standby database after Switchover
=> Initial Physical Standby: <Database_Name>_C1 will become the current Primary database after Switchover

Primary:
dgmgrl> show configuration;
dgmgrl> show database ‘<INSTANCE_NAME>_G1';
dgmgrl> show database ‘<INSTANCE_NAME>_C1';

 Connect on standby site (C1) with DG-Broker to the database:


Standby(it will become new primary after switchover)

server>. goto $ DBNAME
server> dgmgrl
dgmgrl> connect sys/<password>@<INSTANCE_NAME>_C1

dgmgrl> show configuration;
--- No errors are reported, then


=> Pre-Check for any replication delay and DG Broker errors.

Resolve any delay and error(s) before:

dgmgrl> switchover to ‘<INSTANCE_NAME>_C1';

=> Make <INSTANCE_NAME>_C1 the primary database. Invoke the actual switchover.
Connect on standby site (C1) with DG-Broker to the database:


server>. goto $ DBNAME
server> dgmgrl
dgmgrl> connect sys/<password>@<INSTANCE_NAME>_C1

After first swithover you have to add tempfile with reuse command on new primary(old standby).

=====================================================================
alter tablespace TEMP add tempfile '/oracle/XXXX/oratemp01/o_XXX_TEMP_1.dbf' size 1g reuse;
=====================================================================

Post Check if Standby database is only mounted:

You must have a license to use Active Data Guard, where the standby database is opened

dgmgrl> show configuration;
dgmgrl> show database ‘<INSTANCE_NAME>_G1';
dgmgrl> show database ‘<INSTANCE_NAME>_C1';

server> sqlplus /nolog
sqlplus> connect sys/<password>@<INSTANCE_NAME>_G1
sqlplus>

col line format a200
select to_char(sysdate,'DD.MM.YYYY-HH24:MI:SS')||': ' ||i.host_name||', '
||nvl(d.DB_UNIQUE_NAME,d.NAME)||'('||d.NAME||','||i.INSTANCE_NAME||'), ' ||translate(d.DATABASE_ROLE,' ','_')||',
'||translate(d.OPEN_MODE,' ','_')||', ' ||i.VERSION||', startuptime='||to_char(i.STARTUP_TIME,'DD.MM.YYYY-HH24:MI:SS') as line from
V$DATABASE d, V$INSTANCE i ;
If Standby database is opened and you do not have a license for Active Data Guard, restart and mount only the database.


No comments:

Post a Comment