This content has been marked as final. Show 17 replies
Try to remember if you databases are in sync its kind of like having one database in two different roles, Primary role and Standby role.
Also if you want to do maintenance then don't issue this command after switchover, wait until the maintenance is complete and then issue it and Data Guard will catch up :
Once you have done a switchover its a good idea to do a log switch and make sure the new primary and standby are working correctly. Once you have done that the step to switch back are as follows : ( Do not use if you have Data Guard Broker setup )
alter system set log_archive_dest_state_2=enable;
h3. Verify that it is possible to perform a switchover operation.
h3. Convert the primary database to the new standby
SQL> select switchover_status from v$database; Note:All v$database switchover_status values are shown at the bottom of this page. If SWITCHOVER_STATUS returns SESSIONS ACTIVE then you should either disconnect all sessions manually or when performing step 2 you should append the with session shutdown clause. For example: SQL> alter database commit to switchover to standby with session shutdown;
h3. Shutdown the former primary and mount as a standby database
SQL> alter database commit to switchover to standby with session shutdown; Note: This might take a few minutes.
h3. Defer the remote archive destination on the old primary
SQL> shutdown immediate Note: An ORA-01507: database not mounted is normal SQL> startup nomount SQL> alter database mount standby database;
h3. Verify that the physical standby can be converted to the new primary
SQL> alter system set log_archive_dest_state_2=defer;
h3. Convert the physical standby to the new primary ( step 6 )
QL> select switchover_status from v$database; SWITCHOVER_STATUS -------------------- TO PRIMARY Note that if the status returns SESSIONS ACTIVE then you should append the with session shutdown clause to the command in step 6.
h3. Shutdown and startup the new primary
SQL> alter database commit to switchover to primary;
h3. Enable remote archiving on the new primary to the new standby
SQL> shutdown immediate ORA-01109: database not open SQL> startup
h3. Start managed recover on the new standby database
SQL> alter system set log_archive_dest_state_2=enable;
SQL> recover managed standby database disconnect; Media recovery complete. SQL> Note: It’s a good idea to perform a log switch on the new primary. SQL>alter system switch logfile;
Once you do the switchover, you can place your standby database is open mode for reporting purpose.
Open the standby database, and start the recovery.
If mounted and recovery is in progress, then cancel it using below query.
sql>alter database recover managed standby database cancel;Now open the standby database which would get opened in read-only mode.
sql>alter database open;Start the Recovery:
sql>alter database recover managed standby database disconnect from session;or
sql>alter database recover managed standby database disconnect from session using current logfile;You can refer this http://shivanandarao.wordpress.com/2012/03/19/how-to-setup-active-dataguard-in-oracle-11g/
But here is another situation
I want to make my physical standby as primary database
lets suppose my primary is crashed & I am unable to run the following command
alter database commit to switchover to physical standby with session shutdown;
than how can I make my standby as primary
i have also issued
alter database recover managed standby database cancel; at standby
alter database open;
it open db but show physical standby
When your primary database is crashed and you want to convert your standby database to primary database, then that would be called in as FAILOVER.
You can refer this for the detailed steps on how to perform failover http://shivanandarao.wordpress.com/2012/08/28/dataguard-failover/
Make sure that you would be testing out a switchover operation or a failover as they both are different. Switchover is a two way process where primary would behave as standby and standby as primary.
Failover is a one way process where say your primary is crashed, you can convert your standby to primary database and you'll have to build a new standby for it if flashback is not enabled. You can refer the link mentioned above.
11gR1 database is running. Active dataguard is configured in my environment.
Can I shutdown my primary database & convert my standby database as snapshot database & then revert back snapshot to physical standby ?
will it work instead of switchover ?
& Also provide steps for active dg in 11gr1 as i want to do it for my practice.
Edited by: Fayn_dba on Oct 10, 2012 2:47 AM