Oracle空表无法导出的解决方法

由于Oracle 11g的新特性,表数据如果为空,则延迟分配表空间,所以导出的数据不全

1、-设置立刻分配表空间(设置后,后续新增的表即使没有数据会自动创建表空间,不再延迟创建)
     alter system set deferred_segment_creation=false;


2、--查询当前用户下的所有空表
select table_name from user_tables where NUM_ROWS=0; 


3、-- 根据上述查询,可以构建针对空表分配空间的命令语句,再把下列查询结果语句执行即可
Select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0 or num_rows is null;

通过以上3步操作后便能正常导出所有空表


4、--后续直接exp导出数据即可
exp 用户名/密码@数据库IP:1521/数据库名  file=c:\sheyin.dump log=c:\sheyin.log

发布了33 篇原创文章 · 获赞 26 · 访问量 102万+

猜你喜欢

转载自blog.csdn.net/lmdsoft/article/details/99625022
今日推荐