如果你在64bit的oracle 和32bit的oracle之间做过数据迁移,那么你会发现,从64bit的客户端直接exp的dmp文件,拿到32bit的oracle上是不能imp的,那么我们如何来解决这个问题呢:
1.在tnsname中配连接,然后用32bit的oracle连64bit的oracle:
C:Documents and Settingsduanl>sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on 星期三 6月 30 11:56:21 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> connect / as sysdba
已连接。
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production'
服务器的oracle 64bit 9204 :
SQL> connect dlinger/dlinger@ora64.ufsoft.com.cn
已连接。
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
TNS for Solaris: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production
SQL> create table test(id int);
表已创建。
SQL> insert into test values(1);
已创建 1 行。
SQL> commit;
提交完成。'
2.
在32bit的oracle(本机)上做exp,导出64bit oracle的数据:
C:Documents and Settingsduanl>exp userid=dlinger/dlinger@ora64.ufsoft.com.cn o
wner=dlinger file='d:/exp.dmp'
Export: Release 9.2.0.1.0 - Production on 星期三 6月 30 11:53:59 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
连接到: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即将导出指定的用户...
. 正在导出 pre-schema 过程对象和操作
. 正在导出用户 DLINGER 的外部函数库名称
. 导出 PUBLIC 类型同义词
. 导出私有类型同义词
. 正在导出用户 DLINGER 的对象类型定义
即将导出 DLINGER 的对象 ...
. 正在导出数据库链接
. 正在导出序号
. 正在导出群集定义
. 即将导出 DLINGER 的表通过常规路径 ...
. . 正在导出表 TEST 1 行被导出
. 正在导出同义词
. 正在导出视图
. 正在导出存储的过程
. 正在导出运算符
. 正在导出引用完整性约束条件
. 正在导出触发器
. 正在导出索引类型
. 正在导出位图, 功能性索引和可扩展索引
. 正在导出后期表活动
. 正在导出实体化视图
. 正在导出快照日志
. 正在导出作业队列
. 正在导出刷新组和子组
. 正在导出维
. 正在导出 post-schema 过程对象和操作
. 正在导出统计
在没有警告的情况
3.将dmp导入到32bit的oracle :
C:Documents and Settingsduanl>imp userid=dlinger/dlinger full=y file='d:/exp.d
mp'
Import: Release 9.2.0.1.0 - Production on 星期三 6月 30 11:59:23 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
连接到: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
经由常规路径导出由EXPORT:V09.02.00创建的文件
已经完成ZHS16GBK字符集和AL16UTF16 NCHAR 字符集中的导入
. 正在将DLINGER的对象导入到 DLINGER
. . 正在导入表 "TEST" 1行被导入
成功终止导
4.查询数据:
C:Documents and Settingsduanl>sqlplus dlinger/dlinger
SQL*Plus: Release 9.2.0.1.0 - Production on 星期三 6月 30 11:59:57 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
连接到:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL> select * from test;
ID
----------
1
那么,如果我们用64bit的客户端来exp,然后用32bit的客户端imp,会怎样呢?
我们同样exp上面的table,exp.dmp是我用64bit的客户端exp的dmp文件:
D:/>imp dlinger/dlinger file='d:/exp64.dmp'
Import: Release 9.2.0.1.0 - Production on 星期四 7月 8 16:44:52 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
连接到: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
IMP-00010: 不是有效的导出文件,标题验证失败
IMP-00000: 未成功终止导入
我们再来比较一下64和32bit exp的dmp文件有什么区别:
从大小上来看,64bit的dmp文件在同样的数据量下,要比32bit的dmp文件小一些。
再来看看文件头的信息:
64bit:
TEXPORT:V09.02.00
DDLINGER
RTABLES
1024
0
32
0
TT
32bit:
TEXPORT:V09.02.00
DDLINGER
RTABLES
2048
0
20
0
TT
红字部分的区别,应该就是“标题验证失败”的原因了。