Oracle11G中有个新特性,当表无数据时,不分配segment,以节省空间
(以下操作对oracle 11g中之前的空表起作用)
1:先查询下那些表是空的
sql :select table_name from user_tables where NUM_ROWS=0;
2:通过select来生成修改语句
sql:select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0
3:将第二步 查询的结果导出 运行导出的结果
比喻:(运行下面的语句)
alter table E2USER_STATE allocate extent;
alter table ENTERPRISE_E2USER allocate extent;
alter table ENTERPRISE_INFO_TYPE allocate extent;
alter table ENTERPRISE_MAPMARK allocate extent;
alter table ENTERPRISE_NEEDTASK allocate extent;
alter table ENTERPRISE_PICTURE allocate extent;
alter table ENTERPRISE_REPORT allocate extent;
alter table ENTERPRISE_REPORT_TYPE allocate extent;
alter table ENTERPRISE_TEAM allocate extent;
4:执行导出语句
exp 用户名/密码/@orcl file=d:aa.dmp owner=用户名
alter table ENTERPRISE_E2USER allocate extent;
alter table ENTERPRISE_INFO_TYPE allocate extent;
alter table ENTERPRISE_MAPMARK allocate extent;
alter table ENTERPRISE_NEEDTASK allocate extent;
alter table ENTERPRISE_PICTURE allocate extent;
alter table ENTERPRISE_REPORT allocate extent;
alter table ENTERPRISE_REPORT_TYPE allocate extent;
alter table ENTERPRISE_TEAM allocate extent;
4:执行导出语句
exp 用户名/密码/@orcl file=d:aa.dmp owner=用户名