我有一个像这样的PL / SQL脚本......
DECLARE
CURSOR curs_delete
IS
SELECT cus_num
FROM dob.cust_table GROUP BY cust_num HAVING COUNT(*)>1;
TYPE row_cust_num IS TABLE OF dob.cust_table.cust_num%TYPE;
col_cust_num row_cust_num;
BEGIN
OPEN curs_delete;
LOOP
FETCH curs_delete
BULK COLLECT INTO col_cust_num LIMIT 10000;
EXIT WHEN col_cust_num.EXISTS (1) = FALSE;
FORALL i IN 1 .. col_cust_num.LAST
DELETE FROM cust_table
WHERE cust_num = col_cust_num (i);
COMMIT;
END LOOP;
CLOSE curs_delete;
END;
此查询返回ORA-12805:parallel query server died unexpectedly
错误。我不确定为什么会这样。当我收到此错误时,游标中的select查询返回415条记录。
任何人都明白为什么会出现此错误?
答案 0 :(得分:4)
这是您的DBA要解决的问题,因为有很多可能的原因。有人需要查看警报日志并检查bdump
目录中的跟踪文件以获取诊断信息。
与此同时,如果您只删除415条记录,则应该直接使用SQL:
DELETE FROM cust_table
WHERE cust_num in (SELECT cus_num
FROM dob.cust_table
GROUP BY cust_num HAVING COUNT(*)>1);