Oracle10g New Feature -- 11. Wait Interface
本章內容同上一章一樣,都是針對資料庫效能。本章更注重對等待事件的分析。
檢視v$session_wait, v$session, v$session_wait_class, v$system_wait_class, v$session_wait_history幫助使用者取得關於等待事件的各種詳細資訊
[@more@]Wait Interface1. Enhancement in V$SESSION_WAIT Added 3 columns:
WAIT_CLASS_ID
WAIT_CLASS#
WAIT_CLASS: the type of the wait that must be either addressed as a valid wait event or dismissed as an idle one
WAIT_TIME : -2 In Oracle10g,-2 means the platform does not support a fast timing mechanism and TIMED_STATISTICS is not set
2. Enhancement in V$SESSION Event wait information is also included in view v$session, like BLOCKING_SESSION_STATUS, BLOCKING_SESSION, SEQ#, EVENT#, EVENT, P1TEXT, P1, P1RAW, P2TEXT, P2, P2RAW, P3TEXT, P3, P3RAW, WAIT_CLASS_ID, WAIT_CLASS#, WAIT_CLASS, WAIT_TIME, SECONDS_IN_WAIT, STATE, SERVICE_NAME.
So, if a session is waiting for a lock holding by another session, you can issue the following query:
SQL> select BLOCKING_SESSION_STATUS, BLOCKING_SESSION from v$session where sid=216;
BLOCKING_SE BLOCKING_SESSION
----------- ----------------
VALID 265
3. How Many Waits? We can get more precise wait information by issue the following query:
SQL>select * from v$session_wait_class where sid = 269;
SID SERIAL# WAIT_CLASS_ID WAIT_CLASS# WAIT_CLASS TOTAL_WAITS TIME_WAITED
---- ------- ------------- ----------- ------------- ----------- -----------
269 1106 4217450380 1 Application 873 261537
269 1106 3290255840 2 Configuration 4 4
269 1106 3386400367 5 Commit 1 0
269 1106 2723168908 6 Idle 15 148408
269 1106 2000153315 7 Network 15 0
269 1106 1740759767 8 User I/O 26 1
the session has waited 873 times for a total of 261,537 centi-seconds for application-related waits, 15 times in network-related events, and so on.
System wide statistics for wait classes(we also can use this query to get wait_class_id and wait_class list):
SQL>select * from v$system_wait_class;
WAIT_CLASS_ID WAIT_CLASS# WAIT_CLASS TOTAL_WAITS TIME_WAITED
------------- ----------- ------------- ----------- -----------
1893977003 0 Other 2483 18108
4217450380 1 Application 1352 386101
3290255840 2 Configuration 82 230
3875070507 4 Concurrency 80 395
3386400367 5 Commit 2625 1925
2723168908 6 Idle 645527 219397953
2000153315 7 Network 2125 2
1740759767 8 User I/O 5085 3006
4108307767 9 System I/O 127979 18623
To show the metric values of wait classes for the most recent 60-second interval
SQL>select * from V$WAITCLASSMETRIC
To show the metric value of wait classes for all intervals in the last one hour:
SQL>select * from V$WAITCLASSMETRIC_HISTORY
4. Session Wait History:V$SESSION_WAIT_HISTORY automatically maintains the last 10 wait event for active sessions.
SQL>select event, wait_time, wait_count
from v$session_wait_history
where sid = 265
/
EVENT WAIT_TIME WAIT_COUNT
------------------------------ ---------- ----------
log file switch completion 2 1
log file switch completion 1 1
log file switch completion 0 1
SQL*Net message from client 49852 1
SQL*Net message to client 0 1
enq: TX - row lock contention 28 1
SQL*Net message from client 131 1
SQL*Net message to client 0 1
log file sync 2 1
log buffer space 1 1
Added 3 columns:
WAIT_CLASS_ID
WAIT_CLASS#
WAIT_CLASS: the type of the wait that must be either addressed as a valid wait event or dismissed as an idle one
WAIT_TIME : -2 In Oracle10g,-2 means the platform does not support a fast timing mechanism and TIMED_STATISTICS is not set
2. Enhancement in V$SESSION Event wait information is also included in view v$session, like BLOCKING_SESSION_STATUS, BLOCKING_SESSION, SEQ#, EVENT#, EVENT, P1TEXT, P1, P1RAW, P2TEXT, P2, P2RAW, P3TEXT, P3, P3RAW, WAIT_CLASS_ID, WAIT_CLASS#, WAIT_CLASS, WAIT_TIME, SECONDS_IN_WAIT, STATE, SERVICE_NAME.
So, if a session is waiting for a lock holding by another session, you can issue the following query:
SQL> select BLOCKING_SESSION_STATUS, BLOCKING_SESSION from v$session where sid=216;
BLOCKING_SE BLOCKING_SESSION
----------- ----------------
VALID 265
3. How Many Waits? We can get more precise wait information by issue the following query:
SQL>select * from v$session_wait_class where sid = 269;
SID SERIAL# WAIT_CLASS_ID WAIT_CLASS# WAIT_CLASS TOTAL_WAITS TIME_WAITED
---- ------- ------------- ----------- ------------- ----------- -----------
269 1106 4217450380 1 Application 873 261537
269 1106 3290255840 2 Configuration 4 4
269 1106 3386400367 5 Commit 1 0
269 1106 2723168908 6 Idle 15 148408
269 1106 2000153315 7 Network 15 0
269 1106 1740759767 8 User I/O 26 1
the session has waited 873 times for a total of 261,537 centi-seconds for application-related waits, 15 times in network-related events, and so on.
System wide statistics for wait classes(we also can use this query to get wait_class_id and wait_class list):
SQL>select * from v$system_wait_class;
WAIT_CLASS_ID WAIT_CLASS# WAIT_CLASS TOTAL_WAITS TIME_WAITED
------------- ----------- ------------- ----------- -----------
1893977003 0 Other 2483 18108
4217450380 1 Application 1352 386101
3290255840 2 Configuration 82 230
3875070507 4 Concurrency 80 395
3386400367 5 Commit 2625 1925
2723168908 6 Idle 645527 219397953
2000153315 7 Network 2125 2
1740759767 8 User I/O 5085 3006
4108307767 9 System I/O 127979 18623
To show the metric values of wait classes for the most recent 60-second interval
SQL>select * from V$WAITCLASSMETRIC
To show the metric value of wait classes for all intervals in the last one hour:
SQL>select * from V$WAITCLASSMETRIC_HISTORY
4. Session Wait History:V$SESSION_WAIT_HISTORY automatically maintains the last 10 wait event for active sessions.
SQL>select event, wait_time, wait_count
from v$session_wait_history
where sid = 265
/
EVENT WAIT_TIME WAIT_COUNT
------------------------------ ---------- ----------
log file switch completion 2 1
log file switch completion 1 1
log file switch completion 0 1
SQL*Net message from client 49852 1
SQL*Net message to client 0 1
enq: TX - row lock contention 28 1
SQL*Net message from client 131 1
SQL*Net message to client 0 1
log file sync 2 1
log buffer space 1 1
We can get more precise wait information by issue the following query:
SQL>select * from v$session_wait_class where sid = 269;
SID SERIAL# WAIT_CLASS_ID WAIT_CLASS# WAIT_CLASS TOTAL_WAITS TIME_WAITED
---- ------- ------------- ----------- ------------- ----------- -----------
269 1106 4217450380 1 Application 873 261537
269 1106 3290255840 2 Configuration 4 4
269 1106 3386400367 5 Commit 1 0
269 1106 2723168908 6 Idle 15 148408
269 1106 2000153315 7 Network 15 0
269 1106 1740759767 8 User I/O 26 1
the session has waited 873 times for a total of 261,537 centi-seconds for application-related waits, 15 times in network-related events, and so on.
System wide statistics for wait classes(we also can use this query to get wait_class_id and wait_class list):
SQL>select * from v$system_wait_class;
WAIT_CLASS_ID WAIT_CLASS# WAIT_CLASS TOTAL_WAITS TIME_WAITED
------------- ----------- ------------- ----------- -----------
1893977003 0 Other 2483 18108
4217450380 1 Application 1352 386101
3290255840 2 Configuration 82 230
3875070507 4 Concurrency 80 395
3386400367 5 Commit 2625 1925
2723168908 6 Idle 645527 219397953
2000153315 7 Network 2125 2
1740759767 8 User I/O 5085 3006
4108307767 9 System I/O 127979 18623
To show the metric values of wait classes for the most recent 60-second interval
SQL>select * from V$WAITCLASSMETRIC
To show the metric value of wait classes for all intervals in the last one hour:
SQL>select * from V$WAITCLASSMETRIC_HISTORY
4. Session Wait History:V$SESSION_WAIT_HISTORY automatically maintains the last 10 wait event for active sessions.
SQL>select event, wait_time, wait_count
from v$session_wait_history
where sid = 265
/
EVENT WAIT_TIME WAIT_COUNT
------------------------------ ---------- ----------
log file switch completion 2 1
log file switch completion 1 1
log file switch completion 0 1
SQL*Net message from client 49852 1
SQL*Net message to client 0 1
enq: TX - row lock contention 28 1
SQL*Net message from client 131 1
SQL*Net message to client 0 1
log file sync 2 1
log buffer space 1 1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/207/viewspace-778841/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle10g New Feature -- 8. Tablespace ManagementOracle
- Oracle10g New Feature -- 4. Flashback DatabaseOracleDatabase
- Oracle10g New Feature -- 3.Flashback TableOracle
- Oracle10g New Feature -- 2.Flashback RecordsOracle
- Oracle10g New Feature -- 7. Rollback MonitoringOracle
- Oracle10g New Feature -- 6. Oracle Data PumpOracle
- Oracle10g New Feature -- 5.Temporary Tablespace GroupOracle
- oracle10g new feature -- 1. SqlplusOracleSQL
- Oracle10g New Feature:CRS(Cluster Ready Services) (zt)Oracle
- Oracle10g New Feature -- 9. ASM (Automatic Storage Management)OracleASM
- java new featureJava
- Oracle10g New Feature -- 14. OEM ( Oracle Enterprise Manager)Oracle
- Oracle10g New Feature -- 13. Automatic Shared Memory ManagementOracle
- Oracle10g New Feature --12. ASSM ( Automatic Segment Space Management )OracleSSM
- Oracle wait interface -- sessionOracleAISession
- Oracle, History and the Wait InterfaceOracleAI
- Oracle10g New Feature -- 10. AWR (Automatic Workload Repository)Oracle
- Oracle Wait Interface解釋OracleAI
- oracle10g new feature:對expdp並行方式的幾個測試Oracle並行
- 12c new feature
- 版本新特性(new feature)
- new feature ——>mysql to oracle MigrationMySqlOracle
- Oracle Database 12C New FeatureOracleDatabase
- 11g New Feature: Health monitor
- Oracle wait interface - ORA-00054: resource busyOracleAI
- Oracle 12c Recover Table New FeatureOracle
- oracle 12c new feature 列不可見Oracle
- j2ee1.4 new feature請教banq
- Oracle10g New Features(1)Oracle
- [摘錄]Oracle Wait Interface之Buffer busy waits事件OracleAI事件
- 11g New Feature: Health monitor (Doc ID 466920.1)
- Oracle10g Wait Event Data Collection ProcedureOracleAI
- Oracle Wait Interface效能診斷與調整實踐指南OracleAI
- oracle 11g ocp new feature 1z0-050Oracle
- Test Negtive Role Set in a stream environmnet- 10g_new_feature
- oracle 12cR2 new feature dbca 命令可以建立standby 庫Oracle
- Does Goldengate Support The New Oracle 10g Flashback Feature? [ID 966212.1]GoOracle 10g
- New redo log sizing advisor in Oracle10gOracle