ORACLE 11G中有个新特性,当表无数据时,不分配segment,以节省空间
解决方法如下:

1、所在的用户下创建查询生产分析表的语句如下:
select ‘analyze table ‘||table_name||’ compute statistics;’ from user_tables;

2、将查出的数据进行执行
Oracle 导出少表以及不能导出空表
3、处理空表 生成处理语句
select ‘alter table ‘||table_name||’ allocate extent;’ from user_tables where num_rows=0;

4、将查出的数据进行执行
Oracle 导出少表以及不能导出空表
5、查询所有空表

select table_name from user_tables where NUM_ROWS=0;

6、执行导出语句,导出表空间内所有表 (exp导出 owner 表示导出用户下的全部数据 file 导出文件存放的路径 text.dmp 导出dmp数据文件)

exp 用户名/密码@orcl file=D:\test.dmp owner=用户名

7、导入语句(imp 导入 file 文件路径 text.dmp 要导入dmp文件 full=y 导入该文件的全部数据)
imp 用户名/密码@orcl file=D:\text.dmp full=y

相关文章:

  • 2022-03-03
  • 2021-06-23
  • 2021-12-30
猜你喜欢
  • 2021-12-21
  • 2022-12-23
  • 2021-11-29
  • 2021-11-07
相关资源
相似解决方案