If you don’t want to deal with missteps, I recommend that you test your standby database to facilitate the failover or switchover process.
This procedure is very useful when you have physical standby databases for testing and other purposes that require read-write access to the standby database. Also, it improves your checklist in the event of an error or disaster.
By using Snapshot standby databases, redo data is not applied until you convert the snapshot standby database back into a physical standby database, and after all local updates to the snapshot standby database are discarded.
The following requirements need to be met in order to create a snapshot standby.
TRUE (to avoid no-logging operations).SQL> alter system set dg_broker_start=FALSE;
SQL> select current_scn from v$database;
SQL> alter database recover managed standby database cancel;
SQL> create restore point TEST_NEW_FEATURE guarantee flashback database;
SQL> col name form a40; SQL> select scn, time, name from v$restore_point where name = 'TEST_NEW_FEATURE';
SQL> alter system archive log current; SQL> alter system switch logfile; SQL> alter system switch logfile;
SQL> alter system set log_archive_dest_state_2=DEFER
SQL> alter database activate standby database; SQL> startup mount force; SQL> alter database set standby database to maximize performance; (This is used in case you have not set it before) SQL> alter database open;
log_archive_dest_2 (this will prevent archive logs being sent to primary):
SQL> alter system set log_archive_dest_state_2=DISABLE;
Once the standby database has been activated, it is a full-blown production system. You may run reports, test new code, or create objects. Remember that any results stored in the activated database will be lost when the database is flashed back to before activation time.. If you need to save the results, they must be copied or exported out of the activated database before flashing it back.
After testing is completed, you need to resynchronize the activated database with the primary database.
SQL> STARTUP MOUNT FORCE; SQL> FLASHBACK DATABASE TO RESTORE POINT TEST_NEW_FEATURE; SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY; SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE; SQL> STARTUP MOUNT FORCE;
SQL> alter system set log_archive_dest_state_2=ENABLE
SQL> alter system set log_archive_dest_state_2=ENABLE
A status of data guard configuration successful indicates the success of the procedures.
On Oracle Database 11g, you can use the Data Guard command-line interface (DGMGRL), Oracle Active Data Guard, and the OEM interface. In my next blog I’ll describe the equivalent procedures on 11g.
Ready to optimize your Oracle Database for the future?