Oracle 11g Dataguard Snapshot standby database functionality, which places the standby in open read/write state and simulates the test in the main library of the production environment. When the standby snapshot standby task completes, you can switch back to the physical repository role. In the state of snapshot standby database, the repository can accept the log from the main library, but it cannot apply the change to the repository.
This article uses Oracle 11g Dataguard broker Snapshot Standby configuration
1. Use DG Broker configuration Snapshot Standby configuration
1) View configuration information
$ DGMGRL sys/oracle
DGMGRL for Linux:version 11.2.0.3.0-64bit Production
Copyright (c), 2009, Oracle. All rights reserved.
Welcome to the DGMGRL, for information, type Help.
is connected.
Dgmgrl> show configuration;
Configuration-Dgorcldb
Protection mode: Maxperformance
Database:
ORCL-Primary Database
Slave-Physical Standby database
Quick Start Failover: DISABLED
Configuration Status:
SUCCESS
2. Conversion repository to mirror library (snapshot standby)
Dgmgrl> Convert database slave to snapshot standby;
Please wait while the database "slave" is being converted to a snapshot standby database ...
Database "Slave" has been successfully converted
Dgmgrl>
Dgmgrl> Show Configuration
Configuration-Dgorcldb
Protection mode: Maxperformance
Database:
ORCL-Primary Database
Slave-Snapshot Standby database
Quick Start Failover: DISABLED
Configuration Status:
SUCCESS
Dgmgrl>
3. Test Mirror Library
1) operation on the standby library
[Oracle@slave ~]$ Sqlplus/nolog
Sql*plus:release 11.2.0.3.0 Production on Saturday August 17 21:35:29 2013
Copyright (c) 1982, Oracle. All rights reserved.
Sql> Conn/as sysdba;
is connected.
Sql> select Open_mode,database_role,db_unique_name from V$database;
Open_mode Database_role Db_unique_name
-------------------- ---------------- ------------------------------
READ WRITE SNAPSHOT STANDBY Slave
#此次镜像库已经是打开状态, database roles are also snapshot STANDBY.
Sql> Conn ABC/ABC
is connected.
Sql> SELECT * FROM ABC;
ID NAME
---------- ----------
0 AAA
1 BBB
Sql> INSERT INTO ABC values (one, ' fffff ');
1 lines have been created.
Sql> commit;
Submit completed.
Sql> SELECT * FROM ABC;
ID NAME
---------- ----------
One FFFFF
0 AAA
1 BBB
Sql>
2) View on the main library
Sql> select Open_mode,database_role,db_unique_name from V$database;
Open_mode Database_role Db_unique_name
-------------------- ---------------- ------------------------------
READ WRITE PRIMARY ORCL
Insert a record on the main library and switch the log.
Sql> Conn ABC/ABC
Sql> SELECT * FROM ABC;
ID NAME
---------- ----------
0 AAA
1 BBB
Sql> INSERT INTO ABC values (2, ' CCC ');
1 lines have been created.
Sql> commit;
Submit completed.
Sql> SELECT * FROM ABC;
ID NAME
---------- ----------
2 CCC
0 AAA
1 BBB
Sql>
Sql> Conn/as sysdba;
sql> alter system switch logfile;
sql> archive log list;
Database log Mode archive mode
AutoArchive enabled
Archive Endpoint/u01/archivelog/
The oldest online log sequence 16
Next Archive log sequence 18
Current log Sequence 18
A new record is added to the main library and the log is switched, stating that the 17th log is the log of the file just now.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/