Thursday, December 3, 2009

Active Data Guard - Step by Step Configuration

With Oracle Database 11g, we can open the physical standby database in read-only mode and restart the recovery process. This means we can continue to be in sync with primary but can use the standby for reporting. Let's see how it is done. Make sure Logical Physical Standby database is working properly.

First, cancel the managed standby recovery and open database as read only:

SQL> alter database recover managed standby database cancel;
SQL> alter database open read only;

While the standby database is open in read-only mode, we can resume the managed recovery process.

SQL> alter database recover managed standby database disconnect;

Now the standby database has been placed in managed recovery mode applying the log files while it is open. Confirm, changes applying on standby database

On the primary create any table, do a log switch and check the maximum log sequence number:

SQL> create table test (cd number);
SQL> alter system switch logfile;

SQL> select max(Sequence#) from v$log;

Connect sys/password@standbydb as sysdba

SQL> select max(Sequence#) from v$log;
SQL> describe test;

The table Description appears in standby, and is ready to be queried.

0 comments: