Opening Standby For Read - Write
Opening Standby For Read - Write
On 11g we can open a Physical Standby database on read-only mode, while the Standby
continues to be updated. This is a major break through on the High Availability field.
PRIMARY
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> archive log list;
PHYSICAL STANDBY
SQL> archive log list;
To enable flashback database the database needs to be shutdown cleanly, after that
start up mount and enable flashback.
We need to archive the current redo log on the primary database; it will be shipped
to the standby server but not applied. This way we will assure that when flashing
back and reactivating the standby we will have the archived logs up to the SCN of
the restore point.
SQL> alter system archive log current;
System altered.
SQL> archive log list;
First we check the actual values for the standby archive log destination
SQL> show parameters log_archive_dest_state_2
Once we are sure which is the destination to defer we can execute the defer
command
When later we will flash back to the restore point, the physical standby automatically
will get the protection mode defined on the primary.
Database altered.
Now we have the standby database activated. It is a block by block 100% copy of our
production environment we can use it to run reports, to do applications testing, i.e.
implementing a new version of our applications and testing it, perform critical changes to the
structure, if required on production and test the impact, etc.
NOTE: While the standby is open read write do not provide protection to the Primary.
You may have a second standby for this purpose.
In this test I’m executing some read / write operations to mimic some reporting
activity
SQL> connect avargas/oracle
Connected.
DATABASE_ROLE OPEN_MODE
---------------- ----------
PRIMARY READ WRITE
On step 19, after enabling redo shipping to the standby we did a switch logfile, now we can
check if the standby is in sync with the primary, the current log sequence needs to be 37.
DATABASE_ROLE OPEN_MODE
---------------- ----------
PHYSICAL STANDBY MOUNTED
n the standby alert.log we can see the Remote File Server (RFS) process executing the
apply process up to the last sequence.
http://blogs.oracle.com/AlejandroVargas/gems/PhysicalStandbyActivatedRead.pdf