OraPub System Monitor (OSM) Toolkit
Get Complete OSM Toolkit (free)

ashclp.sql
ashclpct.sql
ashp.sql
ashpctcpu.sql
ashpcte.sql
ashpctecl.sql
ashpctes.sql
ashpcts.sql
ashrt.sql
ashrt_old.sql
ashsp.sql
ashspct.sql
ashsqlcl.sql
ashsqle.sql
ashsqlpctcl.sql
ashsqlpctcpu.sql
ashsqlpcte.sql
ashsqlpcts.sql
ashsqlpctt.sql
ashsqls.sql
avgexplore.sql
bc.sql
bc7.sql
bcmap.sql
bcmap7.sql
bcobjfb.sql
chr.sql
clone.sql
cr_rtsp.sql
cu.sql
cycledb6
cycledb9
dboc.sql
delete.me
dev_list.txt
dfio.sql
dfl.sql
diag.sql
ds.sql
ds7.sql
dsn.sql
eval1.sql
event_type.sql
event_type_nc.sql
fgidx.sql
fgtbl.sql
hashchk.sql
idx.sql
iosum.sql
iosum9.sql
iosum9x.sql
iosumx.sql
ip.sql
ipcbc.sql
ipx.sql
irtviews.sql
istat.sql
latch.sql
latch8.sql
latch_old.sql
latchchild.sql
latchclass.sql
latchx.sql
lc.sql
lock.sql
loghist8.sql
lruno.sql
mkodo.sql
mkodo_ouch.sql
mts.sql
mysess.sql
objfb.sql
objloc.sql
ogbigld.sql
ogcrobj.sql
ogdoit.sql
ogobjlst.sql
ogobjset.sql
oracpu.sql
oracputext.sql
oracpux.sql
oracpux1.sql
oracpux2.sql
oscpux.sql
oscpux1.sql
oscpux10.sql
oscpux2.sql
oscpux210.sql
osmclear.sql
osmi.sql
osmprep.sql
osmtitle.sql
osmtitlel.sql
osmtitlell.sql
osmtitlem.sql
osmtitles.sql
rbs.sql
rdohist.sql
readme.txt
rlog.sql
rtc.sql
rtcx.sql
rtio.sql
rtow.sql
rtpctx.sql
rtsess.sql
rtsess9.sql
rtsessx.sql
rtsum.sql
rtsys.sql
rtsysx.sql
rtsysx8.sql
sessinfo.sql
sessinfo9.sql
sesstat.sql
sga.sql
simsql1.sql
simsql2.sql
snap_stats.sql
spspinfo.sql
sqls1.sql
sqls18.sql
sqls19.sql
sqls2.sql
sqls3.sql
sqls4.sql
stu.sql
supers.sql
swenq.sql
swenqc.sql
swenqnew.sql
swenqx.sql
swhist.sql
swhist.sql.sav
swhistx.sql
swhistx.sql.sav
swpct.sql
swpctidle.sql
swpctx.sql
swpctxidle.sql
swsessid.sql
swsid.sql
swsw.sql
swswc.sql
swswp.sql
swsys.sql
sysstat.sql
tbfsum.sql
tcsizing.sql
tcstats.sql
test.sql
timechk.sql
topcpu
topdml.sql
tp.sql
tp9.sql
tsmap.sql
tss.sql
undo.sql
users.sql
-- ********************************************************************
-- * Copyright Notice   : (c)1998-2007,2008 OraPub, Inc.
-- * Filename			: sqls1.sql 
-- * Author				: Craig A. Shallahamer
-- * Original			: 17-AUG-98
-- * Last Update		: 04-Jan-2008
-- * Description		: Identify top SQL statements.
-- * Usage		: start sqls1.sql ‹min disk rds› ‹min buff rds›
-- * Thanks		  1) Thanks to Geert van Lierop for tip to use
-- *			     "address" instead of "hash_value".
-- *			  2) Thanks to Ghassan Salem for taking the time
-- *			     to create the core wait based loading code.
-- ********************************************************************

def min_pio=&&1
def min_lio=&&2

prompt For proper sort and output, swpctx.sql must have been run.
prompt

def osm_prog    = 'sqls1.sql'
def osm_title   = 'Intelligent Top SQL Statement Activity Summary'

col mod         heading 'Stmt Addr'             format          a16
col dr          heading 'Phys Rds|(k)'              format  999,999
col bg          heading 'Log Rds|(k)'               format  999,999
col cpu         heading 'CPU Time|(min)'        format      999,990.0
col sr          heading 'Sorts'                 format        9,999
col exe         heading 'Runs'                  format      999,999
col rows_p      heading 'Rows|(k)'              format       99,990
col load        heading 'Load Factor'           format      999,999 noprint
col pio_time    heading 'Sec/PIO'               format           90.000
col lio_time    heading 'Sec/LIO'               format           90.000
col exe_time    heading 'Sec/EXE'               format        9,990.00
col etime       heading 'Tot Time|(min)'        format       99,990.0
col stype       heading 'Stmt|Type'             format           a5
col appwt		heading 'APPL WT'				format		999,990
col curwt		heading 'Concur WT'				format		999,990
col clswt		heading 'Cluster WT'			format	    999,990
col uiowt		heading 'User IO WT'			format      999,990
col plswt		heading 'PL/SQL WT'				format	    999,990
col javwt		heading 'Java WT'			    format      999,990
col sql_id		heading 'SQL ID'	

start osmtitlell

select
  a.sql_id,
  a.address                       mod,
  (a.elapsed_time/1000000)/(a.executions+0.0000001)	  exe_time,
  a.disk_reads/1000                    dr,
  a.buffer_gets/1000                   bg,
  a.elapsed_time/1000000/60	  etime,
  a.cpu_time/1000000/60           cpu,
  (a.elapsed_time/1000000)/(a.disk_reads+0.00000001)	  pio_time,
  (a.elapsed_time/1000000)/(a.buffer_gets+0.00000001)	  lio_time,
  a.executions                    exe,
  a.rows_processed/1000		  ROWS_p,
  a.sorts		  sr,
  APPLICATION_WAIT_TIME/1000 appwt,
  CONCURRENCY_WAIT_TIME/1000 curwt,
  CLUSTER_WAIT_TIME/10000 clswt,
  USER_IO_WAIT_TIME/10000 uiowt,
  PLSQL_EXEC_TIME/10000 plswt,
  JAVA_EXEC_TIME/10000 javwt,  
  substr(a.sql_text,1,5) 		  stype,
  a.disk_reads*1000+a.buffer_gets load
from
  v$sql a
 where	disk_reads › &min_pio
   and	buffer_gets › &min_lio
 order by
  load desc
/

undef min_blocks

start osmclear


Know what's important before it's too late!



OraPub's
Performance Training

is like no other...




More Class Pics...
Get student testimonials!



Craig Shallahamer's Blog