我正在运行具有以下 PL/SQL block 的 cron 作业:
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'
。增加 tablespce 是这个问题的唯一解决方案吗?如何做到这一点? UNDOTBS有524288000字节。
最佳答案
它在增加表空间和启用自动扩展时对我有用。
ALTER DATABASE DATAFILE '/vg01lv11/oracle//data/undotbs_d1_O2P00R11.dbf' AUTOEXTEND ON MAXSIZE 10g;
ALTER DATABASE DATAFILE '/vg01lv11/oracle//data/undotbs_d1_O2P00R11.dbf'
RESIZE 1000M;
关于oracle - ORA-30036 : unable to extend segment by 8 in undo tablespace 'UNDOTBS' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38615071/