Let check the different scenarios to open a data guard:
========================================================================
1. STARTUP will open with READ ONLY WITH APPLY
========================================================================
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP
ORACLE instance started.
Total System Global Area 1043886080 bytes
Fixed Size 2234960 bytes
Variable Size 729810352 bytes
Database Buffers 306184192 bytes
Redo Buffers 5656576 bytes
Database mounted.
Database opened.
SQL> SELECT OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, DATABASE_ROLE ROLE FROM V$DATABASE;
OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY WITH APPLY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PHYSICAL STANDBY
Note: It will take few seconds to change status from READ ONLY to READ ONLY WITH STANDBY
SQL>select * from jtable;
1000
Using DGMGRL:
DGMGRL> show database verbose 'ATEST_STBY';
Database - ATEST_STBY
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: ON
Instance(s): ATEST
========================================================================
2. STARTUP MOUNT will open with MOUNTED and REDO APPLY ON
========================================================================
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1043886080 bytes
Fixed Size 2234960 bytes
Variable Size 729810352 bytes
Database Buffers 306184192 bytes
Redo Buffers 5656576 bytes
Database mounted.
SQL> SELECT OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, DATABASE_ROLE ROLE FROM V$DATABASE;
OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL ROLE
-------------------- -------------------- -------------------- ----------------
MOUNTED MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PHYSICAL STANDBY
SQL> select * from jtable2;
select * from jtable
*
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only
Using DGMGRL:
DGMGRL> show database verbose 'ATEST_STBY';
Database - ATEST_STBY
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: OFF
Instance(s): ATEST
========================================================================
3. Oracle 11gR2 : alter database open read only will make DG READONLY with REDO APPLY
========================================================================
SQL> alter database open read only;
Database altered.
SQL> SELECT OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, DATABASE_ROLE ROLE FROM V$DATABASE;
OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PHYSICAL STANDBY
SQL> SELECT OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, DATABASE_ROLE ROLE FROM V$DATABASE;
OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY WITH APPLY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PHYSICAL STANDBY
Using DGMGRL:
show database verbose 'ATEST_STBY';
Database - ATEST_STBY
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: ON
Instance(s): ATEST
========================================================================
========================================================================
1. STARTUP will open with READ ONLY WITH APPLY
========================================================================
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP
ORACLE instance started.
Total System Global Area 1043886080 bytes
Fixed Size 2234960 bytes
Variable Size 729810352 bytes
Database Buffers 306184192 bytes
Redo Buffers 5656576 bytes
Database mounted.
Database opened.
SQL> SELECT OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, DATABASE_ROLE ROLE FROM V$DATABASE;
OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY WITH APPLY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PHYSICAL STANDBY
Note: It will take few seconds to change status from READ ONLY to READ ONLY WITH STANDBY
SQL>select * from jtable;
1000
Using DGMGRL:
DGMGRL> show database verbose 'ATEST_STBY';
Database - ATEST_STBY
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: ON
Instance(s): ATEST
========================================================================
2. STARTUP MOUNT will open with MOUNTED and REDO APPLY ON
========================================================================
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1043886080 bytes
Fixed Size 2234960 bytes
Variable Size 729810352 bytes
Database Buffers 306184192 bytes
Redo Buffers 5656576 bytes
Database mounted.
SQL> SELECT OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, DATABASE_ROLE ROLE FROM V$DATABASE;
OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL ROLE
-------------------- -------------------- -------------------- ----------------
MOUNTED MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PHYSICAL STANDBY
SQL> select * from jtable2;
select * from jtable
*
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only
Using DGMGRL:
DGMGRL> show database verbose 'ATEST_STBY';
Database - ATEST_STBY
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: OFF
Instance(s): ATEST
========================================================================
3. Oracle 11gR2 : alter database open read only will make DG READONLY with REDO APPLY
========================================================================
SQL> alter database open read only;
Database altered.
SQL> SELECT OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, DATABASE_ROLE ROLE FROM V$DATABASE;
OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PHYSICAL STANDBY
SQL> SELECT OPEN_MODE, PROTECTION_MODE, PROTECTION_LEVEL, DATABASE_ROLE ROLE FROM V$DATABASE;
OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL ROLE
-------------------- -------------------- -------------------- ----------------
READ ONLY WITH APPLY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PHYSICAL STANDBY
Using DGMGRL:
show database verbose 'ATEST_STBY';
Database - ATEST_STBY
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: ON
Instance(s): ATEST
========================================================================
No comments:
Post a Comment