Wednesday, May 23, 2012

Failover to standby database:Manual method


SCENARIO : We had simulated a crash on the priamry db by shut down database and deleted a control file from ASM location. So as a result next time when i tried to start the DB it refused to come up. So we have decided to failover to standby site.

Failover test
<log in to standby DB as sysdba>
$ export ORACLE_SID=TRAINSBY
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon May 21 19:59:03 2012
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
TRAIN     READ ONLY WITH APPLY PHYSICAL STANDBY
<cancel managed recovery>
SQL> alter database recover managed standby database cancel;

Database altered.
<activate standby database>
SQL> alter database activate standby database;

Database altered.

SQL>  select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
TRAIN     MOUNTED              PRIMARY


<shutdown database>
SQL> shu immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
<startup>
SQL> startup
ORACLE instance started.

Total System Global Area 1.0689E+10 bytes
Fixed Size                  2216200 bytes
Variable Size            3959426808 bytes
Database Buffers         6710886400 bytes
Redo Buffers               16945152 bytes
Database mounted.
Database opened.
SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
TRAIN     READ WRITE           PRIMARY

SQL>

1 comment:

  1. Hi Subhendu,
    We have a customer DR coming up. setup is Primary 2 Node RAC instance and 1 node physical standby server. Customer is going to completely cut-off the primary site, test DR site, make changes to DR site and recover Primary back.
    During this exercise, they expect to see changes/modifications done on DR site replicated back in Primary RAC db's.
    I have gone through your blog and didn't find such scenario so could you please guide me this kind of failover testing?
    Thanks and regards,
    Vishwanath

    ReplyDelete