//
Scripts

To check the SQL Plan and its Monitoring functionality, based on SQLID

col id format 999
col operation format a25
col object format a6
set colsep ‘|’
set lines 100

select p.id,
rpad(‘ ‘,p.depth*2, ‘ ‘)||p.operation operation,
p.object_name object,
p.cardinality card
p.cost cost,
substr(m.status,1,4) status,
m.output_rows
from V$SQL_PLAN P, V$SQL_PLAN_MONITOR M
where p.sql_id=m.sql_id
and p.child_address=m.sql_child_address
and p.plan_hash_value=m.sql_plan_hash_value
and p.id=m.plan_line_id
and m.sql_id=’&&v_sql_id’
and m.sql_exec_id=&&v_sql_exec_id
and m.sql_exec_start=to_date(‘&&v_sql_exec_start’,’DD/MM/YYYY HH24:MI:SS’)
order by p.id;

Comments are closed.