我運行已下列PL/SQL塊cron作業:ORA-30036:無法通過8撤銷表空間,延長段 'UNDOTBS'
declare
begin
--insert into DB_LOGS_TEMP table from DB_LOGS table
INSERT INTO DB_LOGS_TEMP SELECT * FROM DB_LOGS WHERE DB_LOG_ID NOT IN(SELECT DB_LOG_ID from DB_LOGS_TEMP);
--keep the lat 10 records and delete other records
DELETE DB_LOGS where rowid in (
select rid from (
select t.rowid rid,
row_number() over(partition by T.DB_LOG_ID order by T.TIMESTAMP desc) as rn
from DB_LOGS t)
where rn > 10);
end;
的DB_LOGS表中有10247302行。當cron作業運行時,它會拋出錯誤ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDOTBS'
。增加表格是否是這個問題的唯一解決方案,以及如何做到這一點? UNDOTBS有524288000字節。
您可能會在沒有提交的情況下刪除多條記錄。也許你應該更頻繁地循環表發送提交。你可以做到這一點,或者它必須在同一個交易? – vercelli