记一次insert因为db file sequential read影响性能导致性能原因的分析
Posted ClarkYu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了记一次insert因为db file sequential read影响性能导致性能原因的分析相关的知识,希望对你有一定的参考价值。
通过详细的10046 trace发现,大量的io等待分布在以下数据文件上:
Misses in library cache during parse: 0
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net more data from client 47 0.00 0.00
db file sequential read 1396 1.40 69.48
Misses in library cache during parse: 0
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net more data from client 47 0.00 0.00
db file sequential read 1396 1.40 69.48
通过查看发现其中file#=后面的文件号对应的数据文件分别为:
WAIT #3: nam=‘SQL*Net more data from client‘ ela= 97 driver id=675562835 #bytes=5 p3=0 obj#=-1 tim=2087739809552
WAIT #3: nam=‘db file sequential read‘ ela= 9787 file#=203 block#=65516 blocks=1 obj#=139501 tim=2087739819840
WAIT #3: nam=‘db file sequential read‘ ela= 29250 file#=88 block#=903826 blocks=1 obj#=139503 tim=2087739849887
WAIT #3: nam=‘db file sequential read‘ ela= 14184 file#=86 block#=262556 blocks=1 obj#=139503 tim=2087739864826
WAIT #3: nam=‘db file sequential read‘ ela= 62924 file#=89 block#=914843 blocks=1 obj#=139503 tim=2087739927918
WAIT #3: nam=‘db file sequential read‘ ela= 30286 file#=86 block#=788126 blocks=1 obj#=139505 tim=2087739959072
WAIT #3: nam=‘db file sequential read‘ ela= 12197 file#=85 block#=346836 blocks=1 obj#=139505 tim=2087739971677
WAIT #3: nam=‘db file sequential read‘ ela= 19443 file#=89 block#=825411 blocks=1 obj#=139505 tim=2087739991255
WAIT #3: nam=‘db file sequential read‘ ela= 73414 file#=89 block#=378855 blocks=1 obj#=139505 tim=2087740064903
WAIT #3: nam=‘db file sequential read‘ ela= 25007 file#=87 block#=279733 blocks=1 obj#=139505 tim=2087740090218
WAIT #3: nam=‘db file sequential read‘ ela= 34222 file#=86 block#=349231 blocks=1 obj#=139505 tim=2087740124718
WAIT #3: nam=‘db file sequential read‘ ela= 12976 file#=87 block#=639786 blocks=1 obj#=139505 tim=2087740137987
WAIT #3: nam=‘db file sequential read‘ ela= 42800 file#=87 block#=277869 blocks=1 obj#=139505 tim=2087740180951
WAIT #3: nam=‘db file sequential read‘ ela= 26248 file#=203 block#=39292 blocks=1 obj#=139505 tim=2087740207500
WAIT #3: nam=‘db file sequential read‘ ela= 16534 file#=88 block#=75324 blocks=1 obj#=139505 tim=2087740224369
WAIT #3: nam=‘db file sequential read‘ ela= 14318 file#=87 block#=276944 blocks=1 obj#=139505 tim=2087740238924
WAIT #3: nam=‘db file sequential read‘ ela= 10609 file#=15 block#=50567 blocks=1 obj#=139505 tim=2087740249666
WAIT #3: nam=‘db file sequential read‘ ela= 15451 file#=86 block#=349898 blocks=1 obj#=139505 tim=2087740265319
WAIT #3: nam=‘db file sequential read‘ ela= 41652 file#=89 block#=766147 blocks=1 obj#=139505 tim=2087740307199
WAIT #3: nam=‘db file sequential read‘ ela= 24658 file#=86 block#=352515 blocks=1 obj#=139505 tim=2087740332184
WAIT #3: nam=‘db file sequential read‘ ela= 18741 file#=87 block#=408687 blocks=1 obj#=139505 tim=2087740351201
WAIT #3: nam=‘db file sequential read‘ ela= 13814 file#=87 block#=213143 blocks=1 obj#=139505 tim=2087740365202
WAIT #3: nam=‘db file sequential read‘ ela= 19805 file#=85 block#=809539 blocks=1 obj#=139505 tim=2087740385174
WAIT #3: nam=‘db file sequential read‘ ela= 84448 file#=88 block#=648443 blocks=1 obj#=139505 tim=2087740469831
WAIT #3: nam=‘db file sequential read‘ ela= 19118 file#=14 block#=49758 blocks=1 obj#=139505 tim=2087740489121
WAIT #3: nam=‘db file sequential read‘ ela= 18210 file#=85 block#=260618 blocks=1 obj#=139505 tim=2087740507502
WAIT #3: nam=‘SQL*Net more data from client‘ ela= 50 driver id=675562835 #bytes=1 p3=0 obj#=139505 tim=2087740508284
WAIT #3: nam=‘db file sequential read‘ ela= 16073 file#=203 block#=65574 blocks=1 obj#=139501 tim=2087740524783
WAIT #3: nam=‘SQL*Net more data from client‘ ela= 97 driver id=675562835 #bytes=5 p3=0 obj#=-1 tim=2087739809552
WAIT #3: nam=‘db file sequential read‘ ela= 9787 file#=203 block#=65516 blocks=1 obj#=139501 tim=2087739819840
WAIT #3: nam=‘db file sequential read‘ ela= 29250 file#=88 block#=903826 blocks=1 obj#=139503 tim=2087739849887
WAIT #3: nam=‘db file sequential read‘ ela= 14184 file#=86 block#=262556 blocks=1 obj#=139503 tim=2087739864826
WAIT #3: nam=‘db file sequential read‘ ela= 62924 file#=89 block#=914843 blocks=1 obj#=139503 tim=2087739927918
WAIT #3: nam=‘db file sequential read‘ ela= 30286 file#=86 block#=788126 blocks=1 obj#=139505 tim=2087739959072
WAIT #3: nam=‘db file sequential read‘ ela= 12197 file#=85 block#=346836 blocks=1 obj#=139505 tim=2087739971677
WAIT #3: nam=‘db file sequential read‘ ela= 19443 file#=89 block#=825411 blocks=1 obj#=139505 tim=2087739991255
WAIT #3: nam=‘db file sequential read‘ ela= 73414 file#=89 block#=378855 blocks=1 obj#=139505 tim=2087740064903
WAIT #3: nam=‘db file sequential read‘ ela= 25007 file#=87 block#=279733 blocks=1 obj#=139505 tim=2087740090218
WAIT #3: nam=‘db file sequential read‘ ela= 34222 file#=86 block#=349231 blocks=1 obj#=139505 tim=2087740124718
WAIT #3: nam=‘db file sequential read‘ ela= 12976 file#=87 block#=639786 blocks=1 obj#=139505 tim=2087740137987
WAIT #3: nam=‘db file sequential read‘ ela= 42800 file#=87 block#=277869 blocks=1 obj#=139505 tim=2087740180951
WAIT #3: nam=‘db file sequential read‘ ela= 26248 file#=203 block#=39292 blocks=1 obj#=139505 tim=2087740207500
WAIT #3: nam=‘db file sequential read‘ ela= 16534 file#=88 block#=75324 blocks=1 obj#=139505 tim=2087740224369
WAIT #3: nam=‘db file sequential read‘ ela= 14318 file#=87 block#=276944 blocks=1 obj#=139505 tim=2087740238924
WAIT #3: nam=‘db file sequential read‘ ela= 10609 file#=15 block#=50567 blocks=1 obj#=139505 tim=2087740249666
WAIT #3: nam=‘db file sequential read‘ ela= 15451 file#=86 block#=349898 blocks=1 obj#=139505 tim=2087740265319
WAIT #3: nam=‘db file sequential read‘ ela= 41652 file#=89 block#=766147 blocks=1 obj#=139505 tim=2087740307199
WAIT #3: nam=‘db file sequential read‘ ela= 24658 file#=86 block#=352515 blocks=1 obj#=139505 tim=2087740332184
WAIT #3: nam=‘db file sequential read‘ ela= 18741 file#=87 block#=408687 blocks=1 obj#=139505 tim=2087740351201
WAIT #3: nam=‘db file sequential read‘ ela= 13814 file#=87 block#=213143 blocks=1 obj#=139505 tim=2087740365202
WAIT #3: nam=‘db file sequential read‘ ela= 19805 file#=85 block#=809539 blocks=1 obj#=139505 tim=2087740385174
WAIT #3: nam=‘db file sequential read‘ ela= 84448 file#=88 block#=648443 blocks=1 obj#=139505 tim=2087740469831
WAIT #3: nam=‘db file sequential read‘ ela= 19118 file#=14 block#=49758 blocks=1 obj#=139505 tim=2087740489121
WAIT #3: nam=‘db file sequential read‘ ela= 18210 file#=85 block#=260618 blocks=1 obj#=139505 tim=2087740507502
WAIT #3: nam=‘SQL*Net more data from client‘ ela= 50 driver id=675562835 #bytes=1 p3=0 obj#=139505 tim=2087740508284
WAIT #3: nam=‘db file sequential read‘ ela= 16073 file#=203 block#=65574 blocks=1 obj#=139501 tim=2087740524783
综上所属,通过详细的10046 trace中可以看到,在一条数据插入时会写入5到8个不同的数据文件,原因为oracle会在此表空间中寻找可用块,这些块不一定连续,因此硬盘寻道会话费大量的时间因此造成大量的db file sequential read等待事件。因此本月余下的几天会持续出现导入数据慢的问题,预计在下个月份使用新的表空间时问题会得到缓解。
以上是关于记一次insert因为db file sequential read影响性能导致性能原因的分析的主要内容,如果未能解决你的问题,请参考以下文章
记一次Ubuntu宕机 Failure:File system check of the root filesystem failed