Oracle 11g 导库导不出空表有关问题

Oracle 11g 导库导不出空表问题

Oracle11g 会遇到这样的问题,用exp整库导出的时候,会遇到这样的问题,库里的空表没办法导出

select * from all_all_tables aa where aa.owner='User名大写' ---查看用户下所有表

select * from all_tables t where t.owner = 'User名大写' and t.num_rows = 0;--查看用户下所有空表

好了,下面是处理方法脚本:

在命令窗口运行:

set heading off;
set echo off;
set feedback off;
set termout on;
spool D:\allocate.sql;
Select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0;
spool off;

 

运行完成后,把allocate.sql再在命令窗口执行一次,然后就可以用exp语句了,这样空表就能被导出来了