Professional Documents
Culture Documents
Setting Up Active Dataguard - Oracle 11g
Setting Up Active Dataguard - Oracle 11g
Prerequsite:
Configuring Oracle 11gR2 Data Guard - Physical Standby (without DG Broker)
Once a standby database is configured, it can be opened in read-only mode to allow query access. This is
often used to offload reporting to the standby server, thereby freeing up resources on the primary server.
When open in read-only mode, archive log shipping continues, but managed recovery is stopped, so the
standby database becomes increasingly out of date until managed recovery is resumed.
While the standby is open read only, the following operations are disallowed
Any Data Manipulation Language (DML) except for select statements
Steps:
1) Check the status of the Primary database and the latest sequence generated in the primary database.
MAX(SEQUENCE#)
119
2) Check the status of the physical standby database and the latest sequence applied on the physcial
standby database.
MAX(SEQUENCE#)
119
3) Check if the Managed Recovery Process (MRP) is active on the physcial standby database.
Here, MRP is active. The PROCESS Column above shows that MRP is active and is waiting for the log
sequence 17.
4) Cancel the MRP on the physical standby database and open the standby database.
The standby database would be opened in the READ-ONLY Mode.
SQL> alter database recover managed standby database cancel;Database altered.
SQL> alter database open;
Database altered.
select name,open_mode,database_role,db_unique_name from v$database;
SQL> alter database recover managed standby database disconnect from session;
Database altered.
You can see that the MRP is active and is waiting for the log sequence 19 and also the physical standby
database is opened in READ-ONLY mode which would allow users to use the physical standby database
for fetching reports.
You can run the below query on standby also to verify
select name,open_mode,database_role,db_unique_name from v$database;
You can check on the primary also which logs have been applied to standby using below query.
select SEQUENCE#, FIRST_TIME, NEXT_TIME, APPLIED, ARCHIVED from
V$ARCHIVED_LOG where name = 'riyadh' order by FIRST_TIME desc;
Note:
The SET TRANSACTION READ ONLY SQL statement must be executed before performing a distributed
query on a physical standby database.