oracle11g导出空表少表的解决办法

       ORACLE 11G中有个新特性,当表无数据时,不分配segment,以节省空间。

       解决方法:

       1)设置deferred_segment_creation参数

       alter system set deferred_segment_creation=false;

  需注意的是:该值设置后对以前导入的空表不产生作用,仍不能导出,只能对后面新增的表产生作用。如需导出之前的空表,只能用第一种方法。

       2)批量处理空表

       用SQL语句执行查询

   select 'alter table '||table_name||' allocate extent;' from user_tables where segment_created='NO'

  假设我们这里有空表TBL_1,TBL_2,TBL_3,TBL_4,则查询结果如下:

alter table TBL_1 allocate extent;
alter table TBL_2 allocate extent;
alter table TBL_3 allocate extent;
alter table TBL_4 allocate extent;

  最后我们把上面的SQL语句执行就可以了。

猜你喜欢

转载自blog.csdn.net/fuhanghang/article/details/82732904
今日推荐