LoveUnix » ORACLE等数据库 » delete带来的表空间的问题
让LU留住您的每

一天 让LU博客留住您的每一天
2005-7-1 22:54 linlinlv
我的一张数据表大约有1千万条记录,用delete删除了其中的400万,但数据文件所在的表空间的剩余空间并没有增加,我应该怎样回收他们呢?<br /><br />请高手指点,谢谢 <!--emo&:P--><img src='style_emoticons/default/tongue.gif' border='0' style='vertical-align:middle' alt='tongue.gif' /><!--endemo-->

2005-7-2 14:48 长天污水
<!--emo&:grin:--><img src='style_emoticons/default/grin.gif' border='0' style='vertical-align:middle' alt='grin.gif' /><!--endemo--> <br />1. exp<br />2. truncate <br />3. imp<br /> <!--emo&:grin:--><img src='style_emoticons/default/grin.gif' border='0' style='vertical-align:middle' alt='grin.gif' /><!--endemo-->

2005-7-2 15:25 linlinlv
我只是打个比方说我的数据有1千万,其实要比它多很多,<br />exp<br />truncate<br />这都可以,是没有问题的,但是imp是就要有些麻烦了,如果不给我的表建索引,由于数据<br />量太大,temp表空间就会不够;如果先建索引再imp就会很慢很慢,甚至出不来。所以我<br />想找一个方法,能回收delete之后的表空间。楼上的还有什么好办法吗?小弟谢谢了

2005-7-4 15:00 长天污水
<!--QuoteBegin-linlinlv+2005-07-02 15:25:48--><div class='quotetop'>QUOTE(linlinlv @ 2005-07-02 15:25:48)</div><div class='quotemain'><!--QuoteEBegin-->我只是打个比方说我的数据有1千万,其实要比它多很多,<br />exp<br />truncate<br />这都可以,是没有问题的,但是imp是就要有些麻烦了,如果不给我的表建索引,由于数据<br />量太大,temp表空间就会不够;如果先建索引再imp就会很慢很慢,甚至出不来。所以我<br />想找一个方法,能回收delete之后的表空间。楼上的还有什么好办法吗?小弟谢谢了<br />[right][snapback]476187[/snapback][/right]<br /><!--QuoteEnd--></div><!--QuoteEEnd--><br />不对吧, 记得imp操作实际上是被oracle变成insert into操作了, 应该是回滚段空间不够才对啊, 不知道对否, 望高人指路 ...   <!--emo&:blush:--><img src='style_emoticons/default/blush.gif' border='0' style='vertical-align:middle' alt='blush.gif' /><!--endemo-->

2005-7-5 16:12 chao_ping
If table does not have long /long raw, just alter table move and rebuild index using nologging mode, this will be the fastest way.<br /><br />10g has the so-called segment shrink, maybe you can try.<br /><br />9i has the online redefinition, also works.

页: [1]


Powered by Discuz! Archiver 5.5.0  © 2001-2006 Comsenz Inc.