Home > Database > Mysql Tutorial > Oracle 11g用exp无法导出空表的处理发布方法

Oracle 11g用exp无法导出空表的处理发布方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:59:35
Original
1108 people have browsed it

Oracle 11G在用EXPORT导出时,空表不能导出。 11G中有个新特性,当表无数据时,不分配segment,以节省空间 解决方法:

  Oracle 11G在用EXPORT导出时,空表不能导出。

  11G中有个新特性,当表无数据时,不分配segment,以节省空间

  解决方法:

  1、insert一行,再rollback就产生segment了。

  该方法是在在空表中插入数据,再删除,则产生segment。导出时则可导出空表。

  2、设置deferred_segment_creation 参数

  该参数值默认是TRUE,当改为FALSE时,无论是空表还是非空表,都分配segment。

  需注意的是:该值设置后对以前导入的空表不产生作用,仍不能导出,只能对后面新增的表产生作用。如需导出之前的空表,只能用第一种方法。

  搞了我好久,最后查到这个方法。

  用以下这句查找空表

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

  把查询结果导出,,执行导出的语句

  然后再执行

  exp 用户名/密码@数据库名 file=D:\dmp\exp_sms20110224.dmp log=D:\dmp\exp_smsrun.log

  成功!

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template