当需要对一个非常大的表update的时候,会消耗非常多的资源,
因为update表的时候,oracle需要生成 redo log和undo log;
此时最好的解决办法是用insert, 并且将表设置为nologging;
当把表设为nologging后, 并且使用/*+ append*/的insert时,
速度是最快的,这个时候oracle只会生成最低限度的必须的redo log,
而没有一点undo信息。如果有可能将index也删除,重建
1.alter table table_name nologging;
2. insert /*+ append */ into table_name
select * from xxxx;
对此落落给了更好的解决方法:
首先 disable所有index 然后 insert /*+ append nologging parallel n */ n表示 cpu core数 , 当然了 也可以 不写n, 让Oracle自己决定。最后 rebuild index online nolgging parallel
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/ONLYONE_HTLIU/archive/2010/07/27/5768458.aspx
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25088941/viewspace-681856/ ,如需转载,请注明出处,否则将追究法律责任。