原文:http://www.db110.com/?p=1714
my_sess_event.sql:求当前会话的v$session_event视图的结果
view sourceprint?1 select event,total_waits,time_waited from v$session_event
2 where sid=(select sid from v$mystat where rownum=1)
3 order by 3 desc;
show_param.sql:显示包括隐含参数在内的参数值
view sourceprint?1 select ksppinm,ksppstvl
2 from x$ksppi x,x$ksppcv y
3 where(x.indx=y.indx)
4 and (translate(ksppinm,'_','#') like '%&1%');
system_event.sql:v$system_event视图上,求整个系统当前等待状况.
view sourceprint?1 select *
2 from (
3 select event,total_waits,time_waited from v$system_event where wait_class <> 'Idle' order by 3 desc
4 ) where rownum <= 100;
sesstat.sql: 求当前会话的v$sesstat视图结果
view sourceprint?1 select n.name,sum(s.value)
2 from v$sesstat s,v$statname n
3 where n.name like '%&stat_name%'
4 and s.statistic#=n.statistic#
5 and s.sid=(select sid from v$mystat where rownum=1)
6 group by n.name;
undosize.sql: 获得当前事务的undo数据信息
view sourceprint?1 select used_ublk,used_urec from v$transaction t,v$session s
2 where s.sid=(select sid from v$mystat where rownum=1)
3 and s.taddr=t.addr;