问题描述
应用批量插数据到表,总插4万条,每1000条提交,但是会出现卡的情况,对应的的等待事件是sql net more data from client?表子段比较多。这个能判断为是网络原因吗?
专家解答
从10046trace文件来看,你的问题在于写日志太慢了:
EXEC #2:c=0,e=663,p=0,cr=1,cu=7,mis=0,r=1,dep=0,og=1,plh=0,tim=199411454697382
WAIT #2: nam='SQL*Net message to client' ela= 0 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=199411454697415
WAIT #2: nam='SQL*Net message from client' ela= 601 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=199411454698035
CLOSE #2:c=0,e=4,dep=0,type=3,tim=199411454698057
XCTEND rlbk=0, rd_only=0, tim=199411454698079
WAIT #0: nam='log file sync' ela= 4302 buffer#=10993 sync scn=1469605365 p3=0 obj#=-1 tim=199411454702426
WAIT #0: nam='SQL*Net message to client' ela= 1 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=199411454702453
WAIT #0: nam='SQL*Net message from client' ela= 568 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=199411454703034
XCTEND rlbk=1, rd_only=1, tim=199411454703053
WAIT #0: nam='SQL*Net message to client' ela= 0 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=199411454703082
WAIT #0: nam='SQL*Net message from client' ela= 816 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=199411454703912
log file sync 的时间最长,可能是存储太慢,有性能瓶颈。