同时访问Oracle软件包时,我正在“等待缓冲区忙”,此错误是由于某些更新语句引起的。
这些更新语句正在循环执行,当我尝试使用ForAll和BULK COLLECT INTO更改/改进这些Update语句时,执行时间没有太大差异,并且仍然会出现此错误。
对于给定的表,我已经将PCTFREE从10更改为30,但是仍然可以看到“ buffer busy waits”,由于这个原因,进程继续运行更长的时间,然后失败。
表配置:
CREATE TABLE TEST
(--columns)
SEGMENT CREATION IMMEDIATE
PCTFREE 30 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
还有其他方法可以避免此错误吗?
编辑:
Update statement:
FOR rec IN
(SELECT a.mid,
SUM(hpct * NVL(mcap,0))/v_mc p_lead
FROM wip a
WHERE a.rid = n_rid
AND a.rtype =n_rtype
AND a.sid = c_sid
AND a.pid = n_pid
AND ( ( n_spct = 0
AND vorder != 1 )
OR (n_spct = 1) )
GROUP BY a.mid
)
LOOP
UPDATE final
SET PlEAD =ROUND(rec.p_lead,2)
WHERE rid = n_rid
AND rtype = n_rtype
AND pid = n_pid
AND sid = c_sid
AND mid =rec.mid;
END LOOP;