ZT:instance Wait Tuning
The v$active_session_history XE "v$active_session_history" table can be used to view specific events with the highest resource waits.
select
ash.event,
sum(ash.wait_time +
ash.time_waited) ttl_wait_time
from
v$active_session_history ash
where
ash.sample_time between sysdate - 60/2880 and sysdate
group by
ash.event
order by 2;
For a given session, an Oracle user may issue multiple SQL statements and it is the interaction between the SQL and the database that determines the wait conditions. The v$active_session_history XE "v$active_session_history" table can be joined into the v$sqlarea XE "v$sqlarea" and dba_users XE "dba_users" to quickly see the top SQL waits as well as the impacted user and session with which they are associated:
select
ash.user_id,
u.username,
sqla.sql_text,
sum(ash.wait_time + ash.time_waited) wait_time
from
v$active_session_history ash,
v$sqlarea sqla,
dba_users u
where
ash.sample_time > sysdate-1
and
ash.sql_id = sqla.sql_id
and
ash.user_id = u.user_id
group by
ash.user_id,
sqla.sql_text,
u.username
order by 4;
Once the SQL details have been identified, the DBA can drill down deeper by joining v$active_session_history XE "v$active_session_history" with dba_objects XE "dba_objects" and find important information about the interaction between the SQL and specific tables and indexes. What follows is an ASH script that can be used to show the specific events that are causing the highest resource waits. Also, remember that some contention is NOT caused by SQL but by faulty network, slow disk or some other external causes. Also, frequent deadlocks may be caused by improperly indexed foreign keys.
· ash_obj_waits.sql
select
obj.object_name,
obj.object_type,
ash.event,
sum(ash.wait_time + ash.time_waited) wait_time
from
v$active_session_history ash,
dba_objects obj
where
ash.sample_time > sysdate -1
and
ash.current_obj# = obj.object_id
group by
obj.object_name,
obj.object_type,
ash.event
order by 4 desc;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-82897/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle Wait Event - TuningOracleAI
- zt_weblogic tuningWeb
- zt_buffer busy waitAI
- zt_ibm websphere tuning要點IBMWeb
- Common Oracle Wait Event Descriptions(zt)OracleAI
- zt_關於wait events asynch descriptor resize_wait eventAI
- Wait Event Enhancements in Oracle 10g(zt)AIOracle 10g
- Introduction to SQL Tuning Advisor zt自ITPUBSQL
- Oracle 10g Automatic Undo Retention Tuning (zt)Oracle 10g
- True Session Wait Activity in Oracle 10g[zt]SessionAIOracle 10g
- 常見的wait等待事件及處理(zt)AI事件
- zt_小荷_記得cursor pin s wait on xAI
- [zt]Oracle Tuning (Oracle 效能調整)的一些總結Oracle
- 9i Performance Tuning Guide 讀書筆記二(zt)ORMGUIIDE筆記
- zt_日誌檔案相關等待_log file waitAI
- zt_direct path read temp等待如何解決_wait eventAI
- zt_real application cluster恢復為單例項single instanceAPP單例
- zt_eygle大師_如何與io相關的wait event等待事件AI事件
- zt_例項恢復instance recovery相關原理精簡總結(原創)
- 【WAIT】wait eventAI
- oracle tuningOracle
- Tuning Scripts
- sql tuningSQL
- zt_如何用一個表的兩個以上索引訪問表_sql tuning_sql優化索引SQL優化
- sql tuning set/sql tuning advisor(待完善)SQL
- 【go語言】wait,wait for meGoAI
- what is Goals for Tuning?Go
- sql tuning setSQL
- 熟悉SQL tuningSQL
- instance和clientclient
- Oracle database instanceOracleDatabase
- The Instance and the Database (285)Database
- STATUS OF ORACLE INSTANCEOracle
- 解密Prompt系列3. 凍結LM微調Prompt: Prefix-Tuning & Prompt-Tuning & P-Tuning解密
- 【筆記】SQL tuning筆記SQL
- Oracle Tuning總結Oracle
- Oracle SQL Perfomance TuningOracleSQL
- fork waitAI