官术网_书友最值得收藏!

Time for action – checking the SQL Apply service status

The following steps can be performed to check the SQL Apply service status:

  1. Use the following query on the logical standby database, to check the general SQL Apply status:
    SQL> SELECT * FROM V$LOGSTDBY_STATE;
    
       PRIMARY_DBID SESSION_ID REALTIME_APPLY  STATE
    --------------- ---------- --------------- ---------------
         1319333016          1 Y               APPLYING

    At the STATE column, we can see INITIALIZING, WAITING FOR DICTIONARY LOGS, LOADING DICTIONARY, WAITING ON GAP, APPLYING, and IDLE values, which describe the status of the SQL Apply clearly with their names.

  2. The DBA_LOGSTDBY_LOG view, that we have queried in the Checking the Redo Transport Service Status action, will be very helpful to find the last applied archived log sequence and to check if there are archived log sequences that were received but not applied. Another view V$LOGSTDBY_PROCESS is helpful to control the status of the processes responsible for SQL Apply.
    SQL> SELECT TYPE, STATUS_CODE, STATUS FROM V$LOGSTDBY_PROCESS;
    
    TYPE         STATUS_CODE STATUS
    ------------ ----------- ----------------------------------------
    COORDINATOR        16116 ORA-16116: no work available
    ANALYZER           16116 ORA-16116: no work available
    APPLIER            16123 ORA-16123: transaction 11 22 786 is waiting for commit approval
    APPLIER            16117 ORA-16117: processing
    APPLIER            16117 ORA-16117: processing
    APPLIER            16117 ORA-16117: processing
    APPLIER            16123 ORA-16123: transaction 11 25 786 is waiting for commit approval
    READER             16127 ORA-16127: stalled waiting for additional transactions to be applied
    BUILDER            16116 ORA-16116: no work available
    PREPARER           16117 ORA-16117: processing

Output shows all the processes in the SQL Apply and their status. The READER, PREPARER, and BUILDER processes are responsible for the mining of the redo. On the other side, COORDINATOR, ANALYZER, and APPLIER processes work together to apply the changes to the database. We can see that the READER process is waiting for the transactions to be applied, so that memory will become available and it will read more redo. On the other side, some APPLIER processes apply redo and some wait for commit approval to continue applying redo as shown in the following diagram:

What just happened?

We have seen several queries to gather information about the logical standby configuration. We have verified that the newly created logical standby is synchronized with the primary and everything works fine.

Redo transport and SQL Apply, which are the two main services of logical standby, can be monitored at any time using the mentioned methods.

Have a go hero – check the services in a broken configuration

Now stop the listener on the logical standby site and run some operation on the primary database. New archived logs will be created but primary would not send these logs to standby. This will cause a gap between primary and standby. In the case of a gap, query redo transport and SQL Apply services with the same queries. Start the listener and continue checking the status.

主站蜘蛛池模板: 沿河| 黄龙县| 阿拉善左旗| 启东市| 仪征市| 磐石市| 正蓝旗| 军事| 堆龙德庆县| 阳西县| 横峰县| 延庆县| 新昌县| 晋中市| 成都市| 望都县| 太康县| 望都县| 子洲县| 杨浦区| 佛坪县| 化隆| 武陟县| 敦煌市| 新疆| 上犹县| 许昌县| 五家渠市| 开化县| 大竹县| 新竹县| 浦江县| 明星| 通州市| 钟山县| 云安县| 讷河市| 米林县| 西丰县| 武强县| 化德县|