switchover from primary db to standby [message #282865] |
Sat, 24 November 2007 05:47 |
M.Shakeel Azeem
Messages: 226 Registered: September 2006
|
Senior Member |
|
|
Dear All,
i want to test switchover from primary DB to standby DB
AT Primary DB
SQL> conn sys/gateway@prim1 as sysdba
Connected.
SQL> select database_role,switchover_status
2 from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
---------------- ------------------
PRIMARY SESSIONS ACTIVE
At standby DB
SQL> select database_role,switchover_status
2 from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
---------------- ------------------
PHYSICAL STANDBY NOT ALLOWED
SWITCHOVER_STATUS is showing not allowed?
please suggest!
|
|
|
|
Re: switchover from primary db to standby [message #283282 is a reply to message #282871] |
Mon, 26 November 2007 10:35 |
DreamzZ
Messages: 1666 Registered: May 2007 Location: Dreamzland
|
Senior Member |
|
|
Quote: | Manual Switchover:
On the PRIMARY Database: (Open stage)
Query V$DATABASE to check the role of Primary Database.
• SQL> Select Database_role
from v$Database;
It will return “PRIMARY”,
Now check the Switchover Status of the Primary Database.
• SQL> Select switchover_status
from v$Database;
It will return “SESSIONS ACTIVE”.
Now you are ready to perform a manual switchover. Execute the following command using “WITH SESSION SHUTDOWN” option.
• SQL> Alter Database Commit to Switchover to Physical Standby with session Shutdown;
Database Altered.
Now your PRIMARY Database has become Physical Standby. To verify this change, again query the Database_role column of V$DATABASE. Now it will return “PHYSICAL STANDBY”.
Shutdown the database and again Start it to mount stage.
On the PHYSICAL STANDBY Database: (Mount stage)
Query V$DATABASE to check the role of Standby Database.
• SQL> Select Database_role
from v$Database;
It will return “PHYSICAL STANDBY”,
Now check the Switchover Status of the Standby Database.
• SQL> Select switchover_status
from v$Database;
It will return “SESSIONS ACTIVE”.
Now cancel the MRP which is running in the background of the Standby Database. Execute the following command:
• SQL> Alter database Recover Managed Standby Database Cancel;
Database Altered.
Now you are ready to perform a manual switchover from Physical Standby to Primary. Execute the following command using “WITH SESSION SHUTDOWN” option.
• SQL> Alter Database Commit to Switchover to PRIMARY with session Shutdown;
Database Altered.
Now your PHYSICAL STANDBY Database has become PRIMARY. To verify this change, again query the Database_role column of V$DATABASE. Now it will return “PRIMARY”.
Shutdown the database and again Start it to Open stage.
|
|
|
|
|
|
|