轻松解决oracle11g 空表不能 exp 导出 的问题。
2021-09-16 22:11:40
by 山阴客

打印???
天盟网(http://www.aksky.com)
技术文章(http://www.aksky.comhref=category.php?cid=1)

轻松解决oracle11g 空表不能 exp 导出 的问题。

oracle11g的新特性,数据条数是0时不分配segment,所以就不能被导出。

会出现 EXP-00003: 未找到段 (0,0) 的存储定义 报错的处理

 

解决方法:

1插入一条数据(或者再删除),浪费时间,有时几百张表会累死的。

2创建数据库之前

使用代码:

 

Sql代码 

 

  1. alter system set  deferred_segment_creation=false;  

调整再建表

这两种方都不好

下面是终极方法:

先查询一下哪些表是空的:

Sql代码 

  1. select table_name from user_tables where NUM_ROWS=0;  

下面我们通过select 来生成修改语句:

 

Sql代码 

 

  1. select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0  

或者
Select 'alter table '||table_name||' allocate extent;' from user_tables where segment_created= 'NO' ;  

然后就在结果窗口里面生成了下面那些东西:

 

 

Sql代码 

 

  1. alter table E2USER_STATE allocate extent;  
  2. alter table ENTERPRISE_E2USER allocate extent;  
  3. alter table ENTERPRISE_INFO_TYPE allocate extent;  
  4. alter table ENTERPRISE_MAPMARK allocate extent;  
  5. alter table ENTERPRISE_NEEDTASK allocate extent;  
  6. alter table ENTERPRISE_PICTURE allocate extent;  
  7. alter table ENTERPRISE_REPORT allocate extent;  
  8. alter table ENTERPRISE_REPORT_TYPE allocate extent;  
  9. alter table ENTERPRISE_TEAM allocate extent;  
  10. alter table FROMUSER_ADJUNCT_TARGET allocate extent;  
  11. alter table FROMUSER_OFFER allocate extent;  
  12. alter table NEEDTASK_TYPE allocate extent;  
  13. alter table SYS_PRIVILEGE allocate extent;  
  14. alter table SYS_RELEVANCE_RESOURCE allocate extent;  
  15. alter table SYS_RELEVANCE_TARGET allocate extent;  
  16. alter table SYS_RESOURCE_TYPE allocate extent;  
  17. alter table TASK_FEEDBACK allocate extent;  
  18. alter table TASK_MYTASKTYPE allocate extent;  
  19. alter table TOUSER_MESSAGE allocate extent;  
  20. alter table ABOUTUSER_POINT allocate extent;  
  21. alter table ABOUTUSER_POINT_MARK allocate extent;  
  22. alter table ABOUTUSER_QUERYKEY allocate extent;  
  23. alter table ABOUTUSER_REPORT_HISTORY allocate extent;  
  24. alter table DICT_COMMENT_TYPE allocate extent;  
  25. alter table DICT_INDUSTRY_TYPE allocate extent;  
  26. alter table DICT_POST allocate extent;  
  27. alter table DICT_REGION allocate extent;  
  28. alter table ENTERPRISE_COMMENT allocate extent;  
  29. alter table ENTERPRISE_COMMENT_C allocate extent;  
  30. alter table ENTERPRISE_INFO allocate extent;  
  31. alter table ENTERPRISE_INFO_C allocate extent;  
  32. alter table ENTERPRISE_INFO_STATE allocate extent;  
  33. alter table CALENDAR_CREATETYPE allocate extent;  
  34. alter table CALENDAR_MY allocate extent;  
  35. alter table CALENDAR_TYPE allocate extent;  

 

 

 

ok 执行上面那些sql,之后再exp吧,那就是见证奇迹的时刻。

"

"



Copyright © 2002-2022 http://www.aksky.com
All rights reserved.

备案号:浙ICP备17002154号-2 Powered by: myarticle.com.cn Version 1.0dev
Processed Time: 0.0015 s Querys: 4 [ Gzip Level 0 ]