查詢real-time apply、real-time query的檢視
real-time apply:就是備庫USING CURRENT LOGFILE,對應檢視V$ARCHIVE_DEST_STATUS.RECOVERY_MODE=MANAGED REAL TIME APPLY
real-time query:就是備庫啟到open read only模式,對應檢視v$database.open_mode=READ ONLY WITH APPLY
real-time query
V$DATABASE.OPEN_MODE
READ ONLY WITH APPLY - A physical standby database is open in real-time query mode
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select V$DATABASE.OPEN_MODE from V$DATABASE;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
real-time apply
Use the ALTER DATABASE statement to enable the real-time apply feature, as follows:
For physical standby databases, issue the ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE statement.
SQL> alter database recover managed standby database using current logfile disconnect from session;
V$ARCHIVE_DEST_STATUS.RECOVERY_MODE
■ MANAGED - Managed recovery is active
■ MANAGED REAL TIME APPLY - Log apply services recover redo data from standby redo logs at the same time the logs are being written to,as opposed to recovering redo from archived redo logs when a log switch occurs
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select DEST_ID,DEST_NAME,RECOVERY_MODE from V$ARCHIVE_DEST_STATUS where dest_id<4;
DEST_ID DEST_NAME RECOVERY_MODE
1 LOG_ARCHIVE_DEST_1 MANAGED
2 LOG_ARCHIVE_DEST_2 IDLE
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.
SQL> select DEST_ID,DEST_NAME,RECOVERY_MODE from V$ARCHIVE_DEST_STATUS where dest_id<4;
DEST_ID DEST_NAME RECOVERY_MODE
1 LOG_ARCHIVE_DEST_1 MANAGED REAL TIME APPLY
2 LOG_ARCHIVE_DEST_2 IDLE
以下兩個檢視都不是查詢是否real-time apply的檢視
V$LOGSTDBY_STATE.REALTIME_APPLY
Y indicates that SQL Apply is running in real-time apply mode. If a standby redo log is configured, SQL Apply applies changes as they are written to the standby redo log files. N indicates that SQL Apply applies changes as each archived redo log file is received.
V$MANAGED_STANDBY.STATUS
APPLYING_LOG - Process is actively applying the archived redo log to the standby database
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select V$MANAGED_STANDBY.STATUS from V$MANAGED_STANDBY;
STATUS
------------
CLOSING
CLOSING
CONNECTED
CLOSING
WAIT_FOR_LOG
IDLE
IDLE
IDLE
8 rows selected.
SQL> select status, sequence#, block# from v$managed_standby where client_process='LGWR';
STATUS SEQUENCE# BLOCK#
------------ ---------- ----------
IDLE 60 1059
SQL> /
STATUS SEQUENCE# BLOCK#
------------ ---------- ----------
IDLE 60 1061
SQL> select V$LOGSTDBY_STATE.REALTIME_APPLY from V$LOGSTDBY_STATE;
no rows selected
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.
SQL> select V$MANAGED_STANDBY.STATUS from V$MANAGED_STANDBY;
STATUS
------------
CLOSING
CLOSING
CONNECTED
CLOSING
APPLYING_LOG
IDLE
IDLE
IDLE
8 rows selected.
SQL> select V$LOGSTDBY_STATE.REALTIME_APPLY from V$LOGSTDBY_STATE;
no rows selected
real-time query:就是備庫啟到open read only模式,對應檢視v$database.open_mode=READ ONLY WITH APPLY
real-time query
V$DATABASE.OPEN_MODE
READ ONLY WITH APPLY - A physical standby database is open in real-time query mode
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select V$DATABASE.OPEN_MODE from V$DATABASE;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
real-time apply
Use the ALTER DATABASE statement to enable the real-time apply feature, as follows:
For physical standby databases, issue the ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE statement.
SQL> alter database recover managed standby database using current logfile disconnect from session;
V$ARCHIVE_DEST_STATUS.RECOVERY_MODE
■ MANAGED - Managed recovery is active
■ MANAGED REAL TIME APPLY - Log apply services recover redo data from standby redo logs at the same time the logs are being written to,as opposed to recovering redo from archived redo logs when a log switch occurs
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select DEST_ID,DEST_NAME,RECOVERY_MODE from V$ARCHIVE_DEST_STATUS where dest_id<4;
DEST_ID DEST_NAME RECOVERY_MODE
1 LOG_ARCHIVE_DEST_1 MANAGED
2 LOG_ARCHIVE_DEST_2 IDLE
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.
SQL> select DEST_ID,DEST_NAME,RECOVERY_MODE from V$ARCHIVE_DEST_STATUS where dest_id<4;
DEST_ID DEST_NAME RECOVERY_MODE
1 LOG_ARCHIVE_DEST_1 MANAGED REAL TIME APPLY
2 LOG_ARCHIVE_DEST_2 IDLE
以下兩個檢視都不是查詢是否real-time apply的檢視
V$LOGSTDBY_STATE.REALTIME_APPLY
Y indicates that SQL Apply is running in real-time apply mode. If a standby redo log is configured, SQL Apply applies changes as they are written to the standby redo log files. N indicates that SQL Apply applies changes as each archived redo log file is received.
V$MANAGED_STANDBY.STATUS
APPLYING_LOG - Process is actively applying the archived redo log to the standby database
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select V$MANAGED_STANDBY.STATUS from V$MANAGED_STANDBY;
STATUS
------------
CLOSING
CLOSING
CONNECTED
CLOSING
WAIT_FOR_LOG
IDLE
IDLE
IDLE
8 rows selected.
SQL> select status, sequence#, block# from v$managed_standby where client_process='LGWR';
STATUS SEQUENCE# BLOCK#
------------ ---------- ----------
IDLE 60 1059
SQL> /
STATUS SEQUENCE# BLOCK#
------------ ---------- ----------
IDLE 60 1061
SQL> select V$LOGSTDBY_STATE.REALTIME_APPLY from V$LOGSTDBY_STATE;
no rows selected
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.
SQL> select V$MANAGED_STANDBY.STATUS from V$MANAGED_STANDBY;
STATUS
------------
CLOSING
CLOSING
CONNECTED
CLOSING
APPLYING_LOG
IDLE
IDLE
IDLE
8 rows selected.
SQL> select V$LOGSTDBY_STATE.REALTIME_APPLY from V$LOGSTDBY_STATE;
no rows selected
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2146013/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【DG】Real-time query實時查詢操作
- 【DataGuard】Oracle 11g物理Active Data Guard實時查詢(Real-time query)特性Oracle
- oracle active data guard real-time apply特性OracleAPP
- 【DataGuard】Oracle 11g DataGuard 新特性之 Active Standby:Real-Time Apply+QueryOracleAPP
- 淺析物化檢視與查詢重寫(Enable query rewrite)
- Creating a 10gr2 Data Guard Physical Standby database with Real-Time applyDatabaseAPP
- 建立Oracle 10gR2的local stream和downstream real-time apply 流複製Oracle 10gAPP
- Lecture 12 Real-time Ray Tracing
- Oracle最佳化技術---物化檢視查詢重寫query rewriteOracle
- 【Flashback】使用檢視快速獲得Flashback Query閃回查詢資料
- Laravel 5.4 real-time facade 探究Laravel
- Lecture 05 Real-time Environment MappingAPP
- Laravel query when 的查詢Laravel
- MySQL 查詢的成本的檢視MySql
- Oracle 10g R2 實現dataguard實時日誌應用(real-time apply)Oracle 10gAPP
- 物化檢視和query_rewrite_enabled引數配合提高select查詢效能
- 檢視查詢報錯
- 【MySQL】檢視&子查詢MySql
- oracle 常用查詢檢視Oracle
- Linux核心支援實時(Real-Time)(轉)Linux
- Hibernate——Query查詢
- [20230225]12c Real-time materialized view 實時物化檢視的應用.txtZedView
- 檢視慢查詢進度
- 使用物化檢視查詢重寫 優化對於 UNION ALL檢視的CONNECT BY查詢優化
- Real-Time C++電子書pdf下載C++
- 查詢基表的相關檢視
- 資料庫的查詢與檢視資料庫
- 應用zabbix的實時匯出(real-time export)功能Export
- Flashback Query閃回查詢
- Oracle Flashback query查詢的侷限Oracle
- 【PDB】Oracle跨PDB檢視查詢Oracle
- OushuDB 檢視查詢執行情況
- 【MV】物化檢視查詢重寫
- sql查詢檢視列備註SQL
- Elasticsearch Query DSL查詢入門Elasticsearch
- 關於查詢塊query blockBloC
- 【SQL】Oracle查詢轉換之物化檢視查詢重寫SQLOracle
- 檢視 Laravel 查詢資料語句Laravel