DB2 SQL文执行计划监控是DB2数据库监控的重要组成部分,下面就让我们来了解一下什么是DB2 SQL文执行计划监控。
静态的sql文执行计划存放在系统的catalog表中,动态sql文的执行计划存放在global package cache。
如果要使用explain工具,首先要创建相关的表,建表脚本在/misc/EXPLAIN.DDL,只要运行过一次explain GUI工具,将自动创建这些表。
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.
设置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.