数据泵版本问题

 

http://space.itpub.net/4227/viewspace-722483

数据泵在10g刚推出的时候,跨版本的问题并不明显,而等到11.2推出之后,数据泵同样存在处理跨版本的问题。

Oracle原始的EXP/IMP导出、导入工具的扩版本特性对于从8/9版本就接触数据库的人来说,应该是基本常识了——低版本导出,目标版本导入。

而对于数据泵来说,很多人并没有意识到这一点,事实上数据泵如果从低版本导出,高版本导入是不需要额外处理的,而大多数的需求不是版本相同,就是版本升级,因此很多人没有注意到数据泵的版本问题。

不过如果数据泵从高版本导入大低版本,如果不加处理,就会出现下面的错误:

[orat1@hpserver2 ~]$ expdp test/test dumpfile=d_tmp:tab1.dp tables=tab1

Export: Release 11.2.0.3.0 - Production on Mon Apr 27 09:50:10 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
N*fz,a3t1[1@2B};_12131609With the Partitioning, OLAP, Data Mining and Real Application Testing optionsITPUB个人空间j;J0oRF4c3}2A
Starting "TEST"."SYS_EXPORT_TABLE_01": test/******** dumpfile=d_tmp:tab1.dp tables=tab1ITPUB个人空间etRCK/f
Estimate in progress using BLOCKS method...ITPUB个人空间]1d'{?3e
Processing object type TABLE_EXPORT/TABLE/TABLE_DATAITPUB个人空间9\ce n_A Dj
Total estimation using BLOCKS method: 64 KB
d\0Nn@ w12131609Processing object type TABLE_EXPORT/TABLE/TABLE
B;C1H7b7u7ye/bU;U1u12131609Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICSITPUB个人空间'@k\F K!N;J1G
. . exported "TEST"."TAB1" 6.593 KB 63 rowsITPUB个人空间_r5NPUPsp
Master table "TEST"."SYS_EXPORT_TABLE_01" successfully loaded/unloadedITPUB个人空间~\\1mVQ
******************************************************************************ITPUB个人空间0d$BF l"q;r:G!e
Dump file set for TEST.SYS_EXPORT_TABLE_01 is:ITPUB个人空间5Nv F2u^G%b#M5Gj?
/tmp/tab1.dpITPUB个人空间6|#~9^9W_3R&S
Job "TEST"."SYS_EXPORT_TABLE_01" successfully completed at 09:50:17

11.2导入的文件,10.2直接导入报错:

[orat3@hpserver2 ~]$ impdp test/test directory=d_tmp dumpfile=tab1.dp

Import: Release 10.2.0.4.0 - 64bit Production on Monday,27 April, 2012 9:50:25

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit ProductionITPUB个人空间 {Q-?5r-gA
With the Partitioning, OLAP, Data Mining and Real Application Testing options
C'D WC.rt5H12131609ORA-39001: invalid argument value
+j\ C C:\Y'L#I]f12131609ORA-39000: bad dump file specification
2M3m n p s\12131609ORA-39142: incompatible version number 3.1 in dump file "/tmp/tab1.dp"

正确的方式是在高版本导出的时候指定导出的版本,比如导入版本为10204,那么在11.2上导出时通过VERSION=10.2.0.4,确保导出的数据和结构和低版本兼容。

[orat1@hpserver2 ~]$ expdp test/test dumpfile=d_tmp:tab110204.dp tables=tab1 version=10.2.0.4

Export: Release 11.2.0.3.0 - Production on Mon Apr 27 09:52:03 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
9mQS5_tR12131609With the Partitioning, OLAP, Data Mining and Real Application Testing options
$ZkK(G!U{U2\O-U G6B12131609Starting "TEST"."SYS_EXPORT_TABLE_01": test/******** dumpfile=d_tmp:tab110204.dp tables=tab1 version=10.2.0.4
H0P'@^Zf12131609Estimate in progress using BLOCKS method...
"o;fq5uU&l12131609Processing object type TABLE_EXPORT/TABLE/TABLE_DATAITPUB个人空间` Lmw3N.gVx
Total estimation using BLOCKS method: 64 KB
sy)^3Q;Q/k8f12131609Processing object type TABLE_EXPORT/TABLE/TABLEITPUB个人空间8E X._R^'G{
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
L2yV(U_-b12131609. . exported "TEST"."TAB1" 6.406 KB 63 rowsITPUB个人空间1F_ o6H[eZ l
Master table "TEST"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
k'^-YKz}3[12131609******************************************************************************ITPUB个人空间0z.U*l pjak2soK
Dump file set for TEST.SYS_EXPORT_TABLE_01 is:ITPUB个人空间8G9r2Z5l @!J"E
/tmp/tab110204.dp
J jc#Gpga12131609Job "TEST"."SYS_EXPORT_TABLE_01" successfully completed at 09:52:09

这样在10.2.0.4数据库上就可以直接导入了。

[orat3@hpserver2 ~]$ impdp test/test directory=d_tmp dumpfile=tab110204.dp

Import: Release 10.2.0.4.0 - 64bit Production on Monday, 27 April, 2012 9:54:35

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit ProductionITPUB个人空间mb7BF)V}8w1P d
With the Partitioning, OLAP, Data Mining and Real Application Testing options
6A0nH0V3l@h12131609Master table "TEST"."SYS_IMPORT_FULL_01" successfully loaded/unloadedITPUB个人空间 CMJ8z!lN
Starting "TEST"."SYS_IMPORT_FULL_01": test/******** directory=d_tmp dumpfile=tab110204.dp
2g:},x[1m3_#|12131609Processing object type TABLE_EXPORT/TABLE/TABLE
l-E$B3^DYI#b*G(o$L12131609Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
x9Xx ^9O*~ m12131609. . imported "TEST"."TAB1" 6.406 KB 63 rowsITPUB个人空间3qdtn%yc
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICSITPUB个人空间e,C!aV rw dvN
Job "TEST"."SYS_IMPORT_FULL_01" successfully completed at 09:54:36

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12131609/viewspace-722557/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/12131609/viewspace-722557/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值