Prior to Oracle 11g, the database needed to be in the Mount state when the physical repository (physical Standby) applied Redo. Starting from 11g, when applying redo, physical repositories can be in read-only mode, which is called Active Data Guard, which can realize real-time query function.
1. operation on standby Library
1) View the current status of the standby mount
Sql> select Open_mode,database_role,db_unique_name from V$database;
Open_mode Database_role Db_unique_name
-------------------- ---------------- ------------------------------
Mounted physical STANDBY Slave
2) Cancel the automatic recovery of the standby library
sql> ALTER DATABASE recover managed standby database cancel;
The database has changed.
3 The Open library is read-only (Dataguard can only boot to readonly mode)
sql> ALTER DATABASE open;
The database has changed.
Sql> select Open_mode,database_role,db_unique_name from V$database;
Open_mode Database_role Db_unique_name
-------------------- ---------------- ------------------------------
READ only physical STANDBY slave
4) Open Real-time application state mode
sql> ALTER DATABASE recover managed standby database using current logfile disconnect;
The database has changed.
Sql> select Open_mode,database_role,db_unique_name from V$database;
Open_mode Database_role Db_unique_name
-------------------- ---------------- ------------------------------
READ only with APPLY physical STANDBY slave
To view the real-time application of the database on the standby
Sql> select name from V$tablespace;
NAME
------------------------------
SYSTEM
Sysaux
UNDOTBS1
USERS
TEMP
5 rows have been selected.
2. Operations on the main library perform DDL,DML operation validation
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/
sql> Create tablespace abcd datafile '/u01/app/oracle/oradata/orcl/abcd.dbf ' size 10m autoextend on next
10m;
The table space has been created.
Sql> Conn ABC/ABC
is connected.
Sql> SELECT * FROM ABC;
ID NAME
---------- ----------
0 AAA
Sql>
Sql> INSERT INTO ABC values (1, ' BBB ');
1 lines have been created.
Sql> commit;
Submit completed.
Sql> SELECT * FROM ABC;
ID NAME
---------- ----------
0 AAA
1 BBB
Sql>
3. Verification operation on standby library
Sql> select name from V$tablespace;
NAME
------------------------------
SYSTEM
Sysaux
UNDOTBS1
USERS
TEMP
Abcd
6 rows have been selected.
The table space is already in the standby library.
Sql> Conn ABC/ABC
is connected.
Sql> SELECT * FROM ABC;
ID NAME
---------- ----------
0 AAA
1 BBB
Sql>
The table record has been applied.
Active Dataguard experiment ended.
This article is from "Koumm Linux Technology blog" blog, please be sure to keep this source http://koumm.blog.51cto.com/703525/1275246