19c通过exp命令到处的dmp文件,导到11gR2会报错,
Import: Release 11.2.0.4.0 - Production on Tue Jan 11 17:36:14 2022
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
IMP-00010: not a valid export file, header failed verification
IMP-00000: Import terminated unsuccessfully
有人说用expdp指定版本号,这个自然没问题,但一来麻烦,二来有可能没有服务器权限,没法expdp,其实简单修改导出的dmp文件即可
linux下直接vimdmp文件修改文件头由V19.00.00改为V11.02.00即可,下面那行还可以改下用户名,
当然表空间就没法了,对于大数据类型CLOB,BLOB 表 表空间不存在的情况,exp就只能给它新建表空间了,数据泵expdp可以重定向,exp不行;新建表空间后,导入,然后重新把表迁移到对应表空间
IMP-00003: ORACLE error 959 encountered
ORA-00959: tablespace 'YYQ_SYS_BJ' does not exist
用以下语句整体迁移下,在删除额外新建的表空间,问题解决
select 'alter table ' || table_name || ' move tablespace test1;'
from user_all_tables
where tablespace_name = 'TEST';
2022年5月7日补充
昨天某地测试问题,19c到12c,改成12.01.00一直不行,最后发现版本号不一定是数据库的版本号,还要看本地oracle客户端的版本号,应该是哪个版本低用哪个就可以