Sunday, November 17, 2013

Prerequisite of active dataguard setup

Step 1:  ON PRIMARY DATABASE (SURIYA)
Check the status  latest sequence generated in the primary database.
SQL> select status,instance_name,database_role from v$instance,v$database;
STATUS       INSTANCE_NAME    DATABASE_ROLE
------------ ---------------- ----------------
OPEN         suriya         PRIMARY

SQL> select max(sequence#) from v$archived_log;

MAX(SEQUENCE#)
--------------
 246

Step 2:  ON PHYSICAL STANDBY (SURIYADR)
Check the status of the  latest sequence applied on the physcial standby database.

SQL> select status,instance_name,database_role from v$instance,v$database;
STATUS       INSTANCE_NAME    DATABASE_ROLE
------------ ---------------- ----------------
MOUNTED      suriyadr           PHYSICAL STANDBY


SQL> select max(sequence#) from v$archived_log;

MAX(SEQUENCE#)
--------------
           246

Step 3: ON PRIMARY DATABASE (SURIYA)
Check if the Managed Recovery Process (MRP) is active on the physical standby database.

 SQL> select process,status,sequence# from v$managed_standby;

PROCESS   STATUS        SEQUENCE#
--------- ------------ ----------
ARCH      CONNECTED             0
ARCH      CLOSING             245
ARCH      CLOSING             244
ARCH      CONNECTED             0
LNS       WRITING             247

Step 4: ON PHYSICAL STANDBY (SURIYADR)
Cancel the MRP on the physical standby database and open the standby database so standby database  opened in the READ-ONLY Mode.

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database open;

Database altered.

SQL> select status,instance_name,database_role,open_mode from v$database,v$instance;

STATUS       INSTANCE_NAME    DATABASE_ROLE    OPEN_MODE
------------ ---------------- ---------------- --------------------
OPEN                   suriyadr                 PHYSICAL STANDBY      READ ONLY

Step 6: ON PHYSICAL STANDBY (SURIYADR)
Now start the Media Recovery Preocessor (MRP) on the physical standby database.

SQL> alter database recover managed standby database disconnect from session;

Database altered.

SQL> select process,status,sequence# from v$managed_standby;

PROCESS   STATUS        SEQUENCE#
--------- ------------ ----------
ARCH      CLOSING             244
ARCH      CONNECTED             0
ARCH      CONNECTED             0
ARCH      CLOSING             246
RFS       IDLE                  0
RFS       IDLE                  0
RFS       IDLE                247
MRP0      WAIT_FOR_LOG        247


Finally MRP is active and is waiting for the log sequence 247 on physical standby location and
also the physical standby database is opened in READ-ONLY mode. Now report from physical standby database can be fetched by the users. 

No comments:

Post a Comment