Tuesday, September 29, 2020

 Reinstate standby database after activation using flashback.

Physical standby database PRI_DB has been activated using steps listed in the "Disaster recovery procedure." 

If a decision is made to convert the database back to physical standby the following steps apply.

Stop the database and mount one instance.

srvctl stop database -d PRI_DB

SQL> startup mount;


If a guaranteed restore point has been created prior to standby activation.

SQL>FLASHBACK DATABASE TO restore point grp_before_activate;

If no guaranteed restore point has been created but SCN prior to activation had been recorded


SQL>FLASHBACK DATABASE TO scn  <<scn prior to activate>>;

If none of the above applies, time of activation has to be determined from the alert log.


SQL> FLASHBACK DATABASE TO time  <<timestamp before standby activation>>;

After a successful flashback, convert to physical standby.


SQL>ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

SQL>shutdown immediate


Change cluster configuration and start the database.

srvctl modify database -d PRI_DB -r physical_standby -s "read only"

srvctl start database -d PRI_DB

srvctl start service -d dbname

Start MRP.


SQL>alter database recover managed standby database using current logfile disconnect;

On the primary enable the corresponding destination.


SQL>alter system set log_archive_dest_state_2='enable' scope=both sid='*';

Check the alert logs on both primary and standby to verify media recovery.


PRI_DB: Check log_archive_dest_state_2 and 3 for DEFER or ENABLE. Keep this parameter ENABLE for RMAN script.

show parameter log_archive_dest_state_2  (if DEFER then make it enable)

show parameter log_archive_dest_state_3  (if DEFER then make it enable)

alter system set log_archive_dest_state_2='enable' scope=both sid='*';

alter system set log_archive_dest_state_3='enable' scope=both sid='*';


PRI_DB - How to drop RESTORE POINT ?

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

srvctl stop database -d dbname_PRI_DB

Startup mount;


Drop restore point GRP_BEFORE_ACTIVATE;

shutdown immediate

srvctl start database -d dbname_PRI_DB

srvctl start service -d dbname_PRI_DB

alter database recover managed standby database using current logfile disconnect;

No comments:

Post a Comment