Filename : fphv.sql
REM *** Find Plan Hash value
column plan_hash_value format 999999999999
accept v_sqlid prompt ‘Enter SQL_ID : ‘
select distinct sql_id, plan_hash_value, to_char(timestamp, ‘DD-MON-RRRR:HH24:MI:SS’) from dba_hist_sql_plan
where sql_id=’&v_sqlid’;