如何看一个SQL的真实的执行计划,下面是在ORACLE 10G里执行的命令:
SQL> select hash_value,child_number,sql_text from v$sql where sql_text like 'select value, consumer_group from resource_group_mapping$ where attribute %';
HASH_VALUE CHILD_NUMBER SQL_TEXT
---------- ------------ --------------------------------------------------------------------------------
2332139416 0 select value, consumer_group from resource_group_mapping$ where attribute = :1 a
SQL> select * from table(dbms_xplan.display_cursor(2332139416,0,'advanced'));
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
HASH_VALUE 2332139416, child number 0
select value, consumer_group from resource_group_mapping$ where
attribute = :1 and status = 'ACTIVE'
NOTE: cannot fetch plan for HASH_VALUE: 2332139416, CHILD_NUMBER: 0
Please verify value of HASH_VALUE and CHILD_NUMBER;
阅读(999) | 评论(0) | 转发(0) |