exp/imp 空表少表问题
来源:互联网 发布:知思索的意思 编辑:程序博客网 时间:2024/05/21 10:48
ORACLE 11G中有个新特性,当表无数据时,不分配segment,以节省空间。
解决方法:
1)insert一行,再rollback就产生segment了
该方法是在在空表中插入数据,再删除,则产生segment。导出时则可导出空表。
2)设置deferred_segment_creation参数
SQL> show parameter deferred_segment_creation NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ deferred_segment_creation boolean TRUE SQL> alter system set deferred_segment_creation=false; 系统已更改。 SQL> show parameter deferred_segment_creation NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ deferred_segment_creation boolean FALSE
需注意的是:该值设置后对以前导入的空表不产生作用,仍不能导出,只能对后面新增的表产生作用。如需导出之前的空表,只能用第一种方法。
3)批量处理空表
首先使用下面的sql语句查询一下当前用户下的所有空表
select table_name from user_tables where NUM_ROWS=0;
然后用一下SQL语句执行查询
select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0
假设我们这里有空表TBL_1,TBL_2,TBL_3,TBL_4,则查询结果如下:
alter table TBL_1 allocate extent;alter table TBL_2 allocate extent;alter table TBL_3 allocate extent;alter table TBL_4 allocate extent;
最后我们把上面的SQL语句执行就可以了。
参看资料:
http://ligaosong.iteye.com/blog/1317886
0 0
- exp/imp 空表少表问题
- exp,imp问题
- exp,imp问题
- exp,imp问题
- 【EXP/IMP】问题总结
- exp/imp遇到的问题
- oracle imp/exp 字符集问题
- 【EXP/IMP】EXP/IMP过程中的字符集问题
- [转]【EXP/IMP】EXP/IMP过程中的字符集问题
- EXP/IMP】EXP/IMP过程中的字符集问题
- imp&exp
- exp imp
- exp/imp
- exp /imp
- exp/imp
- imp/exp
- exp/imp
- imp / exp
- iOS 在textView中添加图片
- [投稿]Speex回声消除代码分析
- linux dmesg命令参数及用法详解(linux显示开机信息命令)
- MyBatis 都是分号惹的祸(ORA-00911: invalid character)
- gcc编译器安装
- exp/imp 空表少表问题
- gulp 插件
- Enable HTTPS in Spring Boot
- Android 表格控件-动态实现表格效果(内容、样式可扩展)
- ajax异步刷新得到json数据
- 指针类型学习总结(函数指针、数组指针和指针数组)
- SQL优化大全
- 循环语句-JTable与 removeRow
- 开源项目源码解析