11g 新特性 real time apply +real time query

paulyibinyi發表於2008-07-30

主庫

由不同步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 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-413643/,如需轉載,請註明出處,否則將追究法律責任。

相關文章