Home > Database > Mysql Tutorial > 用exp命令不能导出Oracle 11g空表的解决方法

用exp命令不能导出Oracle 11g空表的解决方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:07:55
Original
1337 people have browsed it

最近用oracle 11g的exp命令备份数据库,然后恢复,发现导出前表中还从没插入过数据的表并没有导出。以前用9i、10g的时候都没发现

最近用Oracle 11g的exp命令备份数据库,然后恢复,发现导出前表中还从没插入过数据的表并没有导出。以前用9i、10g的时候都没发现过类似问题,,着实被坑了一把,google一查发现11g中有个新特性,当表无数据时,不分配segment以节省空间。为了使空表也能导出需要如下处理:

1) 用以下这句查找空表

select 'alter table '||table_name||' allocate extent;' from user_tables where segment_created='NO';

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

2) 然后再使用exp命令导出数据库即可

linux

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