接到一个小任务,需要将一个表从测试数据库迁移到线上库,并且两个库上的表结构还有所不同,该表数据不大,只有58行,但是包含有clob字段,大概几百K。
整个任务使用数据泵来实现,先在测试库将其导出
[oracle@testdb ~]$ expdp justin/*** directory=pump dumpfile=justin_tab.dmp tables=justin_tab
使用sftp将其传输到生产库,尝试导入
[oracle@rac1 ~]$ impdp justin/*** directory=pump dumpfile= justin_tab.dmp
但是却报一下错误
Import: Release 10.2.0.5.0 - 64bit Production on Tuesday, 23 November, 2010 14:22:00
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39142: incompatible version number 2.1 in dump file "/data/oracle/pump/alliance_user_info.dmp"
根据提示,是dump文件的version不对,查看一下,测试库
SQL> show parameter compatible
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
compatible string 11.1.0.6
而生产库为
SQL> show parameter compatible;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
compatible string 10.2.0.1.0
解决方案:
使用参数version重新导出该表
[oracle@testdb ~]$ expdp justin/*** directory=pump dumpfile=justin_tab.dmp tables=justin_tab version=10.2.0.1.0
继续尝试导入生成库
[oracle@rac1 ~]$ impdp justin/*** directory=pump dumpfile= justin_tab.dmp version=10.2.0.1.0
导入成功
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15480802/viewspace-679494/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/15480802/viewspace-679494/