Oracle Study之--Oracle等待事件(5)
創(chuàng)新互聯(lián)建站-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設、高性價比怒江州網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式怒江州網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設找我們,業(yè)務覆蓋怒江州地區(qū)。費用合理售后完善,十載實體公司更值得信賴。
Db file single write
這個等待事件通常只發(fā)生在一種情況下,就是Oracle 更新數(shù)據(jù)文件頭信息時(比如發(fā)生Checkpoint)。
當這個等待事件很明顯時,需要考慮是不是數(shù)據(jù)庫中的數(shù)據(jù)文件數(shù)量太大,導致Oracle 需要花較長的時間來做所有文件頭的更新操作(checkpoint)。
這個等待事件有三個參數(shù):
File#: 需要更新的數(shù)據(jù)塊所在的數(shù)據(jù)文件的文件號。
Block#: 需要更新的數(shù)據(jù)塊號。
Blocks: 需要更新的數(shù)據(jù)塊數(shù)目(通常來說應該等于1)。
案例分析:
15:03:26 SYS@ prod>select event,TOTAL_WAITS,AVERAGE_WAIT from v$system_event 15:03:31 2 where upper(event) like 'DB FILE%'; EVENT TOTAL_WAITS AVERAGE_WAIT ---------------------------------------------------------------- ----------- ------------ db file sequential read 2093 .01 db file scattered read 833 .02 db file single write 27 .28 db file parallel write 5 17.48 15:03:51 SYS@ prod>alter system checkpoint; System altered. 15:03:35 SYS@ prod>select event,TOTAL_WAITS,AVERAGE_WAIT from v$system_event 2* where upper(event) like 'DB FILE%' EVENT TOTAL_WAITS AVERAGE_WAIT ---------------------------------------------------------------- ----------- ------------ db file sequential read 2673 .01 db file scattered read 833 .02 db file single write 36 .55 db file parallel write 7 14.73 Elapsed: 00:00:00.01
Direct path read
這個等待事件發(fā)生在會話將數(shù)據(jù)塊直接讀取到PGA當中而不是SGA中的情況,這些被讀取的數(shù)據(jù)通常是這個會話私有的數(shù)據(jù),所以不需要放到SGA作為共享數(shù)據(jù),因為這樣做沒有意義。這些數(shù)據(jù)通常是來自于臨時段上的數(shù)據(jù),比如一個會話中SQL的排序數(shù)據(jù),并行執(zhí)行過程中間產(chǎn)生的數(shù)據(jù),以及Hash Join,merge join產(chǎn)生的排序數(shù)據(jù),因為這些數(shù)據(jù)只對當前的會話的SQL操作有意義,所以不需要放到SGA當中。
當發(fā)生direct path read等待事件時,意味著磁盤上有大量的臨時數(shù)據(jù)產(chǎn)生,比如排序,并行執(zhí)行等操作。或者意味著PGA中空閑空間不足。
這個等待事件有三個參數(shù):
Descriptor address: 一個指針,指向當前會話正在等待的一個direct read I/O。
First dba: descriptor address 中最舊的一個I/O數(shù)據(jù)塊地址。
Block cnt: descriptor address上下文中涉及的有效的buffer 數(shù)量。

Direct path write
這個等待事件和direct path read 正好相反,是會話將一些數(shù)據(jù)從PGA中直接寫入到磁盤文件上,而不經(jīng)過SGA。
這種情況通常發(fā)生在:
使用臨時表空間排序(內(nèi)存不足)
數(shù)據(jù)的直接加載(使用append方式加載數(shù)據(jù))
并行DML操作。
這個等待事件有三個參數(shù):
Descriptor address: 一個指針,指向當前會話正在等待的一個direct I/O.
First dba: descriptor address 中最舊的一個I/O數(shù)據(jù)塊地址。
Block cnt: descriptor address 上下文中涉及的有效地 buffer 數(shù)量。
案例分析:
15:37:17 SCOTT@ prod> 1* select * from t1 order by 1 600000 rows selected. Elapsed: 00:00:04.35 Execution Plan ---------------------------------------------------------- Plan hash value: 2148421099 ----------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | ----------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 838K| 10M| | 4260 (1)| 00:00:52 | | 1 | SORT ORDER BY | | 838K| 10M| 16M| 4260 (1)| 00:00:52 | | 2 | TABLE ACCESS FULL| T1 | 838K| 10M| | 276 (2)| 00:00:04 | ----------------------------------------------------------------------------------- Note ----- - dynamic sampling used for this statement (level=2) Statistics ---------------------------------------------------------- 7 recursive calls 3 db block gets 1355 consistent gets 1823 physical reads 0 redo size 10809270 bytes sent via SQL*Net to client 440512 bytes received via SQL*Net from client 40001 SQL*Net roundtrips to/from client 0 sorts (memory) 1 sorts (disk) 600000 rows processed 15:36:39 SYS@ prod>select event,TOTAL_WAITS,AVERAGE_WAIT from v$system_event 2* where upper(event) like 'DIRECT%' EVENT TOTAL_WAITS AVERAGE_WAIT ---------------------------------------------------------------- ----------- ------------ direct path read 154 .03 direct path read temp 1746 0 direct path write temp 63 .98 Elapsed: 00:00:00.04 15:37:31 SYS@ prod>
分享題目:OracleStudy之--Oracle等待事件(5)
地址分享:http://www.chinadenli.net/article14/iphede.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站維護、搜索引擎優(yōu)化、軟件開發(fā)、微信小程序、、面包屑導航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)