原因可能是还没有任何任何段的表在一些系统视图中缺少相关信息,导致exp程序没有将他们作为导出对象,以至于没有导出这些表。于是实验了一下,果然如此,问题顺利解决,实验过程如下:
0.数据库版本
test@LEISORE> select banner from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 -
Production
PL/SQL Release 11.2.0.1.0 - Production
CORE
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
1. 创建用户:
sys@LEISORE>create user test identified by
test;
sys@LEISORE>GRANT CONNECT TO test;
sys@LEISORE>GRANT RESOURCE TO test;
sys@LEISORE>GRANT SELECT_CATALOG_ROLE TO test;
sys@LEISORE>GRANT EXECUTE_CATALOG_ROLE TO
test;
sys@LEISORE>GRANT RECOVERY_CATALOG_OWNER TO
test;
sys@LEISORE>GRANT SELECT ANY DICTIONARY TO
test;
2. 创建测试表
test@LEISORE> create table test(col
number(10));
test@LEISORE> select table_name,segment_created from
user_tables;
TABLE_NAME
------------------------------ ---
TEST
注意:没有创建segment
3. 导出
C:/>exp test/test@DB_106 file=test.dmp
log=log.log
Export: Release 11.2.0.1.0 - Production on 星期六 2月 12 16:09:26
2011
Copyright (c) 1982, 2009, Oracle and/or its
affiliates.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
. 正在导出 pre-schema 过程对象和操作
. 正在导出用户 TEST 的外部函数库名
. 导出 PUBLIC 类型同义词
. 正在导出专用类型同义词
. 正在导出用户 TEST 的对象类型定义
即将导出 TEST 的对象...
. 正在导出数据库链接
. 正在导出序号
. 正在导出簇定义
. 即将导出 TEST
的表通过常规路径...
注意:没有导出任何表
. 正在导出同义词
. 正在导出视图
. 正在导出存储过程
. 正在导出运算符
. 正在导出引用完整性约束条件
. 正在导出触发器
. 正在导出索引类型
. 正在导出位图, 功能性索引和可扩展索引
. 正在导出后期表活动
. 正在导出实体化视图
. 正在导出快照日志
. 正在导出作业队列
. 正在导出刷新组和子组
. 正在导出维
. 正在导出 post-schema 过程对象和操作
. 正在导出统计信息
成功终止导出, 没有出现警告。
4. 导入
test@LEISORE> drop table test;
test@LEISORE> select count(*) from user_objects
where object_type='TABLE';
----------
C:/>imp test/test@DB_106 file=test.dmp fromuser=test
touser=test
Import: Release 11.2.0.1.0 - Production on 星期六 2月 12 16:14:12
2011
Copyright (c) 1982, 2009, Oracle and/or its
affiliates.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
经由常规路径由 EXPORT:V11.02.00 创建的导出文件
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入
成功终止导入, 没有出现警告。
5. 查看导入结果
test@LEISORE> select table_name,segment_created from
user_tables;
未选定行
问题:没有导入表test
6. 解决
6.1插入一行然后删除然后导出导入
6.1.1 插入
test@LEISORE> insert into test values(1);
已创建 1 行。
test@LEISORE> commit;
提交完成。
test@LEISORE> delete from test;
已删除 1 行。
test@LEISORE> commit;
提交完成。
6.1.2 导出
C:/>exp test/test@DB_106 file=test.dmp
log=log.log
Export: Release 11.2.0.1.0 - Production on 星期六 2月 12 16:35:40
2011
Copyright (c) 1982, 2009, Oracle and/or its
affiliates.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
. 正在导出 pre-schema 过程对象和操作
. 正在导出用户 TEST 的外部函数库名
. 导出 PUBLIC 类型同义词
. 正在导出专用类型同义词
. 正在导出用户 TEST 的对象类型定义
即将导出 TEST 的对象...
. 正在导出数据库链接
. 正在导出序号
. 正在导出簇定义
. 即将导出 TEST 的表通过常规路径...
. .
正在导出表
. 正在导出同义词
. 正在导出视图
. 正在导出存储过程
. 正在导出运算符
. 正在导出引用完整性约束条件
. 正在导出触发器
. 正在导出索引类型
. 正在导出位图, 功能性索引和可扩展索引
. 正在导出后期表活动
. 正在导出实体化视图
. 正在导出快照日志
. 正在导出作业队列
. 正在导出刷新组和子组
. 正在导出维
. 正在导出 post-schema 过程对象和操作
. 正在导出统计信息
成功终止导出, 没有出现警告。
6.1.3 删除表
test@LEISORE> drop table test;
表已删除。
test@LEISORE> select table_name,segment_created from
user_tables;
未选定行
6.1.4 导入
C:/>imp test/test@DB_106 file=test.dmp fromuser=test
touser=test
Import: Release 11.2.0.1.0 - Production on 星期六 2月 12 16:37:44
2011
Copyright (c) 1982, 2009, Oracle and/or its
affiliates.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
经由常规路径由 EXPORT:V11.02.00 创建的导出文件
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入
. .
正在导入表
成功终止导入, 没有出现警告。
6.1.5 导入结果
test@LEISORE> select table_name,segment_created from
user_tables;
TABLE_NAME
------------------------------ ---
TEST
6.2 使用SEGMENT CREATION IMMEDIATE建表
6.2.1 建表
test@LEISORE> create table test(col
number(10))
表已创建。
test@LEISORE> select table_name,segment_created from
user_tables;
TABLE_NAME
------------------------------ ---
TEST
6.2.2 导出
C:/>exp test/test@DB_106 file=test.dmp
log=log.log
Export: Release 11.2.0.1.0 - Production on 星期六 2月 12 16:44:52
2011
Copyright (c) 1982, 2009, Oracle and/or its
affiliates.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
. 正在导出 pre-schema 过程对象和操作
. 正在导出用户 TEST 的外部函数库名
. 导出 PUBLIC 类型同义词
. 正在导出专用类型同义词
. 正在导出用户 TEST 的对象类型定义
即将导出 TEST 的对象...
. 正在导出数据库链接
. 正在导出序号
. 正在导出簇定义
. 即将导出 TEST 的表通过常规路径...
. .
正在导出表
. 正在导出同义词
. 正在导出视图
. 正在导出存储过程
. 正在导出运算符
. 正在导出引用完整性约束条件
. 正在导出触发器
. 正在导出索引类型
. 正在导出位图, 功能性索引和可扩展索引
. 正在导出后期表活动
. 正在导出实体化视图
. 正在导出快照日志
. 正在导出作业队列
. 正在导出刷新组和子组
. 正在导出维
. 正在导出 post-schema 过程对象和操作
. 正在导出统计信息
成功终止导出, 没有出现警告。
6.2.3 删除表
test@LEISORE> drop table test;
表已删除。
test@LEISORE> select table_name,segment_created from
user_tables;
未选定行
6.2.4 导入
CC:/>imp test/test@DB_106 file=test.dmp
fromuser=test touser=test
Import: Release 11.2.0.1.0 - Production on 星期六 2月 12 16:45:45
2011
Copyright (c) 1982, 2009, Oracle and/or its
affiliates.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
经由常规路径由 EXPORT:V11.02.00 创建的导出文件
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入
. .
正在导入表