SQL监控视图plan_cache_plan_stat汇总记录每一台Server 上的每一个SQL PLAN 的执行统计信息,以下关于plan_cache_plan_stat的说法正确的是 A 对gv$plan_cache_plan_stat的查询必须同时提供svr_ip、svr_port、tenant_id和plan_id,否则查询结果为空。 B 字段elapsed_time、cpu_time记录的是所有执行的总时间,不是平均执行时间。 C 字段slowest_exe_usec记录了所有执行中最慢的那次执行的执行耗时。 D plan_cache_plan_stat 统计了SQL PLAN作为慢查询、大查询的执行次数。
时间: 2024-04-15 09:26:09 浏览: 50
关于plan_cache_plan_stat的说法,以下是正确的:
B. 字段elapsed_time、cpu_time记录的是所有执行的总时间,不是平均执行时间。
字段elapsed_time和cpu_time记录的是SQL PLAN的所有执行时间的累计值,而不是平均执行时间。
其他选项的描述如下:
A. 对gv$plan_cache_plan_stat的查询并不需要同时提供svr_ip、svr_port、tenant_id和plan_id。可以根据需要选择相应的条件进行查询,不提供某些条件会返回更多的结果,而不是空结果。这个说法是不正确的。
C. 字段slowest_exe_usec并不记录所有执行中最慢的那次执行的执行耗时。它实际上记录的是SQL PLAN中最慢的那个操作(Step)的执行耗时。这个说法是不正确的。
D. plan_cache_plan_stat并不统计SQL PLAN作为慢查询、大查询的执行次数。它主要用于记录SQL PLAN的执行统计信息,如执行时间、CPU时间等,并不涉及慢查询或大查询的分类。这个说法是不正确的。
综上所述,只有选项B关于plan_cache_plan_stat的说法是正确的。
阅读全文
相关推荐


















