lcb0 2015-09-17
前不久使用数据泵工具impdp进行数据导入时,遇到报错,提示无效的dunp文件,通过查询文档才知道是由于因为从高版本到低版本不兼容导致的,下面分享一下解决方法。
导入报错
C:\Documents and Settings\hoegh>impdp hoeghto/ilovehoegh directory=data_pump_directory
dumpfile=20150826dynamic.dmp remap_schema= hoeghfrom:hoeghto remap_tablespace= hoeghfrom:hoeghto
Import: Release 10.1.0.2.0 - Production on 星期二, 01 9月, 2015 9:31
Copyright (c) 2003, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31619: invalid dump file "d:\data_pump_directory\20150826dynamic.dmp"
C:\Documents and Settings\hoegh>
源端数据库版本
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL>
目标端数据库版本
SQL>
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod
PL/SQL Release 10.1.0.2.0 - Production
CORE 10.1.0.2.0 Production
TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
NLSRTL Version 10.1.0.2.0 - Production
SQL>
添加version参数
源端数据库版本10.2.0.4.0,目标端数据库版本10.1.0.2.0,源端数据库版本高于目标端数据库版本;解决的办法很简单,从源端数据库导出数据时加上目标端version即可,参看一下sql语句:
expdp hoeghfrom/ilovehoegh directory=data_pump_directory dumpfile=20150826dynamic.dmp tables=(HOEGH) version=10.1.0.2.0
接下来,我们再次执行impdp语句就ok了。