-------------------------------------------------------------------------------
--
-- Script: resource_waits.sql
-- Purpose: to show the total waiting time for resource types
--
-- Copyright: (c) 1998 Ixora Pty Ltd
-- Author: Steve Adams
--
-------------------------------------------------------------------------------
@reset_sqlplus
column average_wait format 9999990.00
select
substr(e.event, 1, 40) event,
e.time_waited,
e.time_waited / (
e.total_waits - decode(e.event, 'latch free', 0, e.total_timeouts)
) average_wait
from
sys.v_$system_event e,
sys.v_$instance i
where
e.event = 'buffer busy waits' or
e.event = 'enqueue' or
e.event = 'free buffer waits' or
e.event = 'global cache freelist wait' or
e.event = 'latch free' or
e.event = 'log buffer space' or
e.event = 'parallel query qref latch' or
e.event = 'pipe put' or
e.event = 'write complete waits' or
e.event like 'library cache%' or
e.event like 'log file switch%' or
( e.event = 'row cache lock' and
i.parallel = 'NO'
)
union all
select
'non-routine log file syncs',
round(e.average_wait * greatest(e.total_waits - s.value, 0)),
e.average_wait
from
sys.v_$system_event e,
sys.v_$sysstat s
where
e.event = 'log file sync' and
s.name = 'user commits'
order by
2 desc
/
@reset_sqlplus
其中和reset_sqlplus是:
-------------------------------------------------------------------------------
--
-- Script: reset_sqlplus.sql
-- Purpose: to reset sqlplus settings
--
-- Copyright: (c) 1998 Ixora Pty Ltd
-- Author: Steve Adams
--
-------------------------------------------------------------------------------
clear breaks
clear columns
clear computes
set feedback off
set verify off
资料来源:Oracle8i Internal Services
本文地址:http://com.8s8s.com/it/it20283.htm