如何查看当前耗资源的SQL语句

 

1、查看当前用户资源

select sid,serial#,username,program,sql_hash_value,sql_id,
       to_char(logon_time,'yyyy/mm/dd hh24:mi:ss') as login_time
  from v$session
 where paddr in (select addr from v$process where spid in ('2057','27631'));

 

 

2、查看当前耗用资源的SQL

select * from  v$sqlarea t where t.SQL_ID in(
select sql_id
  from v$session where sql_id is not null
  )

你可能感兴趣的:(sql)