10-
Open the database at recovery mode.
SQL>
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT
FROM SESSION;
11-
Now, you should be able to check and
confirm that all the transaction on the primary database will be copy to the
physical standby database.
On
the primary database, check the archived sequence number and make a note of the
last sequence number. Then create a table and insert records into your created
table. At the end archive the current log file (ALTER SYSTEM ARCHIVE LOG
CURRENT).
SQL>
SELECT SEQUENCE# FROM V$ARCHIVED_LOG ORDER BY 1;
On
the standby database, check the applied archive log files. If the “APPLIED”
value is “NO,” then run the query again until you get the “YES” value.
It may take a while.
SQL>
SELECT SEQUENCE#, APPLIED FROM V$ARCHIVED_LOG ORDER BY 1;
Now,
you should be able to see your created table with all the data.
How
to stop and start the standby database:
At
the standby database:
SQL>
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; --to
stop applying the redo log
SQL>
ALTER DATABASE OPEN;
To
start applying redo log file again, do the following:
SQL>
STARTUP;
SQL>
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFLILE
DISCONNECT;
How
to change the physical standby database to the read-write mod:
--On
the standby database
First
stop redo apply and also make sure that you are on the MOUNT status.
SQL>
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; --to
stop applying the redo log
SQL>
SELECT status FROM v$instance;
Now,
change the read-only state to the read-write state. In order to do this first
you need to convert the standby database to snapshot and then shutdown
immediately to alter database with flashback on and open the database.
SQL>
ALTER DATABASE CONVERT TO SNAPSHOT STANDBY; -- it will dismount the database and
must be restarted
SQL>
SHUTDOWN IMMEDIATE;
SQL>
STARTUP MOUNT;
SQL>
ALTER DATABASE FLASHBACK ON;
SQL>
ALTER DATABASE OPEN;
Now,
you should be able to create tables and insert data. Notice that all the changes
will not be applied to the primary database, unless you convert it back to
physical standby at recovery mode;
How
to change the standby database back to physical standby:
SQL> SHUTDOWN IMMEDIATE;
SQL>
STARTUP MOUNT;
SQL>
ALTER DATABASE CONVERT TO PHYSICAL STANDBY; -- it will dismount the database and
must be restarted
SQL>
SHUTDOWN IMMEDIATE;
SQL>
STARTUP;
SQL>
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFLILE
DISCONNECT;
Good Luck!