oracle11g的新特性,数据条数是0时不分配segment,所以就不能被导出。
解决方法:
1插入一条数据(或者再删除),浪费时间,有时几百张表会累死的。
2创建数据库之前
使用代码:
Sql代码
alter system set deferred_segment_creation=false;
调整再建表
这两种方都不好
下面是终极方法:
先查询一下哪些表是空的:
Sql代码
select table_name from user_tables where NUM_ROWS=0;
下面我们通过select 来生成修改语句:
Sql代码
select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0
然后就在结果窗口里面生成了下面那些东西:
Sql代码
alter table E2USER_STATE allocate extent;
alter table ENTERPRISE_E2USER allocate extent;
alter table ENTERPRISE_INFO_TYPE allocate extent;
数据泵导出数据库
expdp pt6/cape@10.216.60.69:1522/oms dumpfile=OMS_20131024.EXPDB schemas=(pt6,OMS)
解决方法:
1插入一条数据(或者再删除),浪费时间,有时几百张表会累死的。
2创建数据库之前
使用代码:
Sql代码
alter system set deferred_segment_creation=false;
调整再建表
这两种方都不好
下面是终极方法:
先查询一下哪些表是空的:
Sql代码
select table_name from user_tables where NUM_ROWS=0;
下面我们通过select 来生成修改语句:
Sql代码
select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0
然后就在结果窗口里面生成了下面那些东西:
Sql代码
alter table E2USER_STATE allocate extent;
alter table ENTERPRISE_E2USER allocate extent;
alter table ENTERPRISE_INFO_TYPE allocate extent;
数据泵导出数据库
expdp pt6/cape@10.216.60.69:1522/oms dumpfile=OMS_20131024.EXPDB schemas=(pt6,OMS)