DB2 SQL文執(zhí)行計劃監(jiān)控簡介
DB2 SQL文執(zhí)行計劃監(jiān)控是DB2數(shù)據(jù)庫監(jiān)控的重要組成部分,下面就讓我們來了解一下什么是DB2 SQL文執(zhí)行計劃監(jiān)控。
靜態(tài)的sql文執(zhí)行計劃存放在系統(tǒng)的catalog表中,動態(tài)sql文的執(zhí)行計劃存放在global package cache。
如果要使用explain工具,首先要創(chuàng)建相關(guān)的表,建表腳本在/misc/EXPLAIN.DDL,只要運(yùn)行過一次explain GUI工具,將自動創(chuàng)建這些表。
explain特定注冊器類型:
CURRENT EXPLAIN MODE - Used to populate only the explain data. No snapshot will be taken.
CURRENT EXPLAIN SNAPSHOT - Used to capture only the explain snapshot data.
設(shè)置explain特定注冊器類型:
SET CURRENT EXPLAIN MODE option
SET CURRENT EXPLAIN SNAPSHOT option
The explain registers options are:
NO - No explain information is captured for dynamic SQL statements.
YES - Explain tables or snapshot information will be populated for dynamic SQL statements while executing the SQL statement, and the result is returned.
EXPLAIN - Explain tables or snapshot information will be populated for dynamic SQL statements without executing the SQL statement. Use this state to obtain explain information without executing the SQL statement.
【編輯推薦】