本文的編寫得到枯榮長老的大力幫助,在此表示感謝。
本文適用的oracle db版本為oracle 10g或者更高版本.
之所以說這個視圖很重要,是因為該視圖中有一列是在awrsqrpt報告中沒有的。這一列就是 filter_predicates列。
SELECT plan_hash_value,
TO_CHAR(RAWTOHEX(child_address)), TO_NUMBER(child_number), id, LPAD(' ', DEPTH) || operation operation, options, object_owner, object_name, optimizer, cost, access_predicates, filter_predicates FROM V$SQL_PLAN WHERE sql_id = 'bkcyk7bf380t6' ORDER BY 1, 3, 2, 4; 重點關注optimizer列,filter_predicates列。 若是該sql不在shared pool中時,改為執行如下的sql: set linesize 500 set pagesize 500 col plan_hash_value format 9999999999 col id format 999999 col operation format a30 col options format a15 col object_owner format a15 col object_name format a20 col optimizer format a15 col cost format 9999999999 col access_predicates format a15 col filter_predicates format a15