Using a Physical Standby Database for Read/Write Testing and Reporting
1. Prepare the physical standby database to be activated.
a. Set up a flash recovery area
ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=20G;
ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='/arch/oradata';
b. Cancel Redo Apply and create a guaranteed restore point.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
CREATE RESTORE POINT before_application_patch GUARANTEE FLASHBACK DATABASE;
2. Prepare the primary database to have the physical standby be diverged
a. On Primary Archive the current log file
ALTER SYSTEM ARCHIVE LOG CURRENT;
b. Defer log archive destinations pointing to the standby that will be activated
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=DEFER;
3. Activate the physical standby database
a. Activate the physical standby database
ALTER DATABASE ACTIVATE STANDBY DATABASE;
b. If the physical standby database has been opened read-only since the instance was
started, perform this step. Otherwise, skip to step 3
STARTUP MOUNT FORCE;
c. Set the protection mode to maximum performance and open the database for read/write
access
ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE;
ALTER DATABASE OPEN;
4. Revert the activated database back to a physical standby database.
STARTUP MOUNT FORCE;
FLASHBACK DATABASE TO RESTORE POINT
ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
STARTUP MOUNT FORCE;
5. Catch up the standby database to the primary database
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;
6. On Primary Reenable archiving to the physical standby database destination
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE;