October 28, 2012

DGMGRL SWITCHOVER SWITCHBACK

SELECT PROCESS, CLIENT_PROCESS, SEQUENCE#, STATUS,THREAD#, DELAY_MINS FROM V$MANAGED_STANDBY;

PROCESS CLIENT_P  SEQUENCE# STATUS
------- -------- ---------- ------
MRP0      N/A            1000 APPLIED_LOG

select THREAD#,SEQUENCE#,STATUS,ARCHIVED from v$log;  ------ the status of redo log files
LGWR RFS 1000 CURRENT

Both the above current values must be same.


$ps -ef|grep dmon|grep -v grep

show parameter broker;

$dgmgrl

DGMGRL> connect /

Broker config pre switchover:
============================

DGMGRL> show configuration;

Databases:
    TESTPRI - Primary database
    TESTDG  - Physical standby database

Switchover Now:
--------------
DGMGRL> switchover to 'TESTDG';


Broker config post switchover:
=============================

DGMGRL> show configuration;

Databases:

    TESTPRI - Physical standby database

    TESTDG  - Primary database

Switchback Now:
---------------

DGMGRL> connect sys/sys@TESTDG

Connected.

DGMGRL> switchover to 'TESTPRI';

DGMGRL> exit


Troubleshooting Tips:
---------------------
1. Remember to create TEMP files on DG(new primary) after switchover

2. Give sys passsword explicitly as time of connecting using DGMGRL for switchover else it fails. Let us take an example where sys password was not given.

DGMGRL> connect /

Connected.

DGMGRL> switchover to 'TESTDG';

Performing switchover NOW. Please wait...

Operation requires shutdown of instance "TESTPRIR1" on database "TESTPRI".

Shutting down instance "TESTPRIR1"...

ORA-01017: invalid username/password; logon denied

You are no longer connected to ORACLE

Please connect again.

Unable to shut down instance "TESTPRIR1".

You must shut down instance "TESTPRIR1" manually.

Operation requires shutdown of instance "TESTPRI" on database "TESTDG".

You must shut down instance "TESTPRI" manually.

Operation requires startup of instance "TESTPRIR1" on database "TESTPRI".

You must start instance "TESTPRIR1" manually.

Operation requires startup of instance "TESTPRI" on database "TESTDG".

You must start instance "TESTPRI" manually.

Switchover succeeded. New primary is "TESTDG"


Fix:
----

Just manually stop and start the instances. Switchover of role reversal is already done.

3. Before executing the switchover you may reduce the number of ARCH processes to the minimum needed for both remote and local archiving. Additional ARCH processes can take additional time to shutdown thereby increasing overall switchover timings. Once the switchover has been completed you can reenable the additional ARCH processes.'log_archive_max_processes' is the parameter in question here.

This is it. So we saw how easy it was to switchover/switchback using Oracle Dataguard broker. If the configuration is set correctly, it's very easy to manage.

No comments:

Post a Comment