Script: resource_waits.sql
-- Purpose: to show the total waiting time for resource types
--
-- Copyright: (c) 1998 Ixora Pty Ltd
-- Author: Steve Adams[@more@]
-------------------------------------------------------------------------------
--
-- 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
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9925929/viewspace-978076/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Script
- 請說說`<script>`、`<script async>`和`<script defer>`的區別
- Script Browser & Script Analyzer 1.3更新發布
- Shell Script
- shell script
- oracle scriptOracle
- script win
- bat scriptBAT
- script標籤
- [Oracle Script] LockOracle
- Tablespace Space Script
- Cold backup script
- Oracle Database ScriptOracleDatabase
- tom's script
- Shell Script(轉)
- QlikView Script – 進階篇1 Script呼叫Macro之變化ViewMac
- MySQL Server Startup ScriptMySqlServer
- npm script中&&和&NPM
- Elasticsearch script sort 排序Elasticsearch排序
- JavaScript <script>標籤JavaScript
- [Oracle Script] Top sqlOracleSQL
- script error總結Error
- script元素屬性
- [Oracle Script] check userOracle
- [Oracle Script] check latchOracle
- how to use coffee script
- Script form where usedORM
- "Continuum for phones" script
- Oracle kill session scriptOracleSession
- One very useful script
- sql server schedule scriptSQLServer
- check ftp success scriptFTP
- rman backup script(引用)
- Cold Database backup scriptDatabase
- IPTables配置Script(轉)
- ORACLE常用Script(轉)Oracle
- ORACLE常用Script (轉)Oracle
- shell script to rename directory