select sql_id, child_number, plan_hash_value plan_hash, executions execs,
       (elapsed_time/1000000)/decode(nvl(executions,0),0,1,executions) avg_etime,
       buffer_gets/decode(nvl(executions,0),0,1,executions) avg_lio,
       sql_text
  from gv$sql s
 where upper(sql_text) like '%'||upper(nvl('&sql_text',sql_text))||'%'
   and sql_text not like '%v$sql%'
   and sql_id like '%'||nvl('&sql_id',sql_id)||'%'
 order by 1, 2, 3
/