专家意见:几个办法:
1. 如果删除的数据是大部分,建议使用楼上的方法把要保留的数据放在一个临时表里,truncate table后再放回来
2. 也可以分段提交,楼上也提到了
3. 专门使用一个大回滚段
4. 如果确认将来不需要做恢复,改为非归档模式,删除完改回来再做个备份.
专家给出的解决方案:
有条件的分步删除数据表中的记录
--创建测试表
create table test as select * from dba_objects;
Table created.
--创建删除表的存储过程
create or replace procedure deleteTab
--插入语句
SQL> insert into test select * from dba_objects;
6374 rows created.
SQL> /
6374 rows created.
SQL> /
6374 rows created.
SQL> commit;
--创建删除的存储过程
create or replace procedure deleteTab
/**
** Usage: run the script to create the proc deleteTab
** in SQL*PLUS, type "exec deleteTab(’Foo’,’ID>=1000000’,’3000’);"
** to delete the records in the table "Foo", commit per 3000 records.
** Condition with default value ’1=1’ and default Commit batch is 10000.
**/