oracle 11g新特性dataguard real time apply +real time query
oracle 11g新特性dataguard real time apply +real time query
主库
由不同步ASYNC改为SYNC
SQL> alter system set log_archive_dest_2='service=standby SYNC VALID_FOR=(ONLINE_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby' scope=spfile;
System altered.
备库由日志恢复模式变成 real time query
A physical standby database can be open for read-only access while Redo Apply is
active if a license for the Oracle Active Data Guard option has been purchased. This
capability is known as Real-time Query.
A physical standby database instance cannot be opened if Redo Apply is active on that
instance or on any other mounted instance. Use the following SQL statements to stop
Redo Apply, open a standby instance read-only, and restart Redo Apply:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE OPEN;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE
2> DISCONNECT;
SQL> recover managed standby database cancel;
Media recovery complete.
SQL> recover managed standby database using current logfile disconnect from session;
Media recovery complete.
主库进行插入:
SQL> insert into paul select * from paul;
1024 rows created.
SQL> commit;
Commit complete.
SQL> select count(*) from paul;
COUNT(*)
----------
2048
备库进行查询
检查recovery_managed
SQL> select recovery_mode from v$archive_dest_status where dest_id=2
2 ;
RECOVERY_MODE
-----------------------
MANAGED REAL TIME APPLY
SQL> select count(*) from paul;
COUNT(*)
----------
2048
由MANAGED REAL TIME APPLY 变为managed 模式
SQL> recover managed standby database cancel;
Media recovery complete.
SQL> recover managed standby database disconnect from session;
Media recovery complete.
SQL> select recovery_mode from v$archive_dest_status where dest_id=2
2 ;
RECOVERY_MODE
-----------------------
MANAGED