【故障处理】IMP-00010错误 12C的dmp文件导入11G
2016-11-09 20:14
513 查看
【故障处理】IMP-00010错误 12C的dmp文件导入11G
① 12C的dmp文件导入11g数据库
② IMP-00010: not a valid export file, header failed verification错误解决一例
③ 软件PilotEdit Lite的使用
④ 从dmp文件头获取导出的版本、时间、用户
⑤ 查看dmp文件的字符集
Tips:
① 本文在itpub(http://blog.itpub.net/26736162)、博客园(http://www.cnblogs.com/lhrbest)和微信公众号(xiaomaimiaolhr)上有同步更新。
② 文章中用到的所有代码、相关软件、相关资料及本文的pdf版本都请前往小麦苗的云盘下载,小麦苗的云盘地址见:http://blog.itpub.net/26736162/viewspace-1624453/。
③ 若网页文章代码格式有错乱,请下载pdf格式的文档来阅读。
④ 在本篇BLOG中,代码输出部分一般放在一行一列的表格中。其中,需要特别关注的地方我都用灰色背景和粉红色字体来表示,比如在下边的例子中,thread 1的最大归档日志号为33,thread 2的最大归档日志号为43是需要特别关注的地方;而命令一般使用黄色背景和红色字体标注;对代码或代码输出部分的注释一般采用蓝色字体表示。
本文如有错误或不完善的地方请大家多多指正,ITPUB留言或QQ皆可,您的批评指正是我写作的最大动力。
使用软件PilotEdit Lite打开(此软件可以打开上G的文件):
修改为如下的形式:
重新导入数据库:
其实这个可以使用UE或editplus文本编辑器的列模式实现也很快。
将刚导出的文件/tmp/exp_ddl_lhr_02.dmp下载到Windows环境下,用UE或editplus打开。
可以看到第2第3个字节的内容是0354,用如下的SQL语句可以查出它对应的字符集:
如果dmp文件很大,比如有2G以上(这也是最常见的情况),用文本编辑器打开很慢或者完全打不开,可以用以下命令(在unix主机上):
然后用上述SQL也可以得到它对应的字符集。
About Me
1 [b]BLOG文档结构图[/b]
2 前言部分
2.1 [b]导读和注意事项[/b]
各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~:① 12C的dmp文件导入11g数据库
② IMP-00010: not a valid export file, header failed verification错误解决一例
③ 软件PilotEdit Lite的使用
④ 从dmp文件头获取导出的版本、时间、用户
⑤ 查看dmp文件的字符集
Tips:
① 本文在itpub(http://blog.itpub.net/26736162)、博客园(http://www.cnblogs.com/lhrbest)和微信公众号(xiaomaimiaolhr)上有同步更新。
② 文章中用到的所有代码、相关软件、相关资料及本文的pdf版本都请前往小麦苗的云盘下载,小麦苗的云盘地址见:http://blog.itpub.net/26736162/viewspace-1624453/。
③ 若网页文章代码格式有错乱,请下载pdf格式的文档来阅读。
④ 在本篇BLOG中,代码输出部分一般放在一行一列的表格中。其中,需要特别关注的地方我都用灰色背景和粉红色字体来表示,比如在下边的例子中,thread 1的最大归档日志号为33,thread 2的最大归档日志号为43是需要特别关注的地方;而命令一般使用黄色背景和红色字体标注;对代码或代码输出部分的注释一般采用蓝色字体表示。
List of Archived Logs in backup set 11 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- ------------------- ---------- --------- 1 32 1621589 2015-05-29 11:09:52 1625242 2015-05-29 11:15:48 1 33 1625242 2015-05-29 11:15:48 1625293 2015-05-29 11:15:58 2 42 1613951 2015-05-29 10:41:18 1625245 2015-05-29 11:15:49 2 43 1625245 2015-05-29 11:15:49 1625253 2015-05-29 11:15:53 [ZHLHRDB1:root]:/>lsvg -o T_XLHRD_APP1_vg rootvg [ZHLHRDB1:root]:/> 00:27:22 SQL> alter tablespace idxtbs read write; ====》2097152*512/1024/1024/1024=1G |
2.2 [b]本文简介[/b]
今天客户给了一个ash的dmp文件,需要分析一下,结果导入数据库的时候发生了IMP-00010: not a valid export file, header failed verification的错误,我用软件PilotEdit Lite打开的时候发现原来导出文件使用的是12C的客户端,而我手头没有12c的客户端,于是将文件头修改为TEXPORT:V11.02.00,然后即可顺利导入了数据库,下面给出详细过程。3 [b]错误解决[/b]
3.1 [b]IMP-00010: not a valid export file, header failed verification[/b]
D:\Users\xiaomaimiao>imp 'sys/lhr@192.168.59.129/oratest as sysdba' full=y file="E:\ash_20161108.dmp\ash_20161108.dmp" Import: Release 11.2.0.1.0 - Production on Wed Nov 9 11:26:05 2016 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.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 |
使用软件PilotEdit Lite打开(此软件可以打开上G的文件):
修改为如下的形式:
重新导入数据库:
D:\Users\xiaomaimiao>imp 'sys/lhr@192.168.59.129/oratest as sysdba' full=y file="E:\ash_20161108.dmp\ash_20161108_01.dmp" Import: Release 11.2.0.1.0 - Production on Wed Nov 9 11:28:24 2016 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Export file created by EXPORT:V11.02.00 via conventional path import done in ZHS16GBK character set and AL16UTF16 NCHAR character set export client uses US7ASCII character set (possible charset conversion) . importing SYS's objects into SYS . importing SYS's objects into SYS . . importing table "ASH_20161108" 29394 rows imported Import terminated successfully without warnings. |
4 [b]从dmp文件头可以获取到的信息[/b]
其实之前在文章http://blog.itpub.net/26736162/viewspace-2122942/中已经介绍过这部分的内容,今天把这部分内容重新拷贝过来,因为实在太有用了。4.1 [b]获取基本信息:导出的版本、时间、导出的用户[/b]
[ZFZHLHRDB1:oracle]:/tmp>strings exp_ddl_lhr_02.dmp | head -10 TEXPORT:V11.02.00 ====》版本号 DSYS ====》使用SYS用户导出 RTABLES ====》基于表模式导出,RUSERS表示基于用户模式,RENTIRE表示基于全库模式 4096 Tue Aug 2 16:8:8 2016/tmp/exp_ddl_lhr_02.dmp====》生成的时间和文件地址 #C#G #C#G +00:00 BYTE UNUSED |
4.2 [b]获取dmp文件中的表信息[/b]
[ZFZHLHRDB1:oracle]:/tmp>strings exp_ddl_lhr_02.dmp | grep "CREATE TABLE"|awk '{print $3}'|sed 's/"//g' EMP ====》说明exp_ddl_lhr_02.dmp中只有一个emp表 |
4.3 [b]解析dmp文件生成parfile文件[/b]
[ZFZHLHRDB1:oracle]:/tmp>strings exp_ddl_lhr_03.dmp | grep "CREATE TABLE"|awk '{print $3}'|sed 's/"//g'|awk '{ if (FNR==1) print "tables="$1 ; else print ","$1 }' tables=DEF$_AQCALL ,DEF$_AQERROR ,DEF$_CALLDEST ,DEF$_DEFAULTDEST ,DEF$_DESTINATION ,DEF$_ERROR ,DEF$_LOB ,DEF$_ORIGIN ,DEF$_PROPAGATOR ,DEF$_PUSHED_TRANSACTIONS ,MVIEW$_ADV_INDEX [ZFZHLHRDB1:oracle]:/tmp> |
4.4 [b]查看[/b][b]dmp文件的字符集[/b]
4.4.1 通过imp导入命令查看
[ZFZHLHRDB1:oracle]:/oracle>ORACLE_SID=lhrdb [ZFZHLHRDB1:oracle]:/oracle>exp \'/ AS SYSDBA\' tables=scott.emp file=/tmp/exp_ddl_lhr_03.dmp log=/tmp/exp_table.log buffer=41943040 rows=n compress=n Export: Release 11.2.0.4.0 - Production on Tue Oct 25 17:14:49 2016 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, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Tes Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set<<<<--当前环境下NLS_LANG的设置 server uses ZHS16GBK character set (possible charset conversion)<<<<--当前数据库的字符集 Note: table data (rows) will not be exported About to export specified tables via Conventional Path ... Current user changed to SCOTT . . exporting table EMP EXP-00091: Exporting questionable statistics. EXP-00091: Exporting questionable statistics. Export terminated successfully with warnings. [ZFZHLHRDB1:oracle]:/oracle>ORACLE_SID=mydb [ZFZHLHRDB1:oracle]:/oracle>export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK [ZFZHLHRDB1:oracle]:/oracle>imp \'/ AS SYSDBA\' tables=xxx.xx file=/tmp/exp_ddl_lhr_03.dmp Import: Release 11.2.0.4.0 - Production on Tue Oct 25 17:21:02 2016 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, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Tes Export file created by EXPORT:V11.02.00 via conventional path import done in ZHS16GBK character set and AL16UTF16 NCHAR character set<<<<--当前环境的NLS_LANG import server uses WE8ISO8859P1 character set (possible charset conversion)<<<<--当前数据库的字符集 export client uses AL32UTF8 character set (possible charset conversion)<<<<--当前dmp文件的字符集 IMP-00029: cannot qualify table name by owner (xxx.xx), use FROMUSER parameter IMP-00000: Import terminated unsuccessfully |
4.4.2 通过dmp文件的第2和3个字节查看
用Oracle的exp工具导出的dmp文件包含了字符集的信息,dmp文件的第2和第3个字节记录了dmp文件的字符集的信息。若dmp文件比较小,比如只有几M或几十M,可以用UltraEdit或Editplus以16进制的方式打开,查看第2和第3个字节的内容。将刚导出的文件/tmp/exp_ddl_lhr_02.dmp下载到Windows环境下,用UE或editplus打开。
可以看到第2第3个字节的内容是0354,用如下的SQL语句可以查出它对应的字符集:
SYS@lhrdb> SELECT NLS_CHARSET_NAME(TO_NUMBER('0354','XXXX')) FROM DUAL; NLS_CHARSET_NAME(TO_NUMBER('0354','XXXX' ---------------------------------------- ZHS16GBK |
cat /tmp/exp_ddl_lhr_02.dmp |od -x|head -1|awk '{print $2 $3}'|cut -c 3-6 |
[ZFZHLHRDB1:oracle]:/oracle>cat /tmp/exp_ddl_lhr_02.dmp |od -x|head -1|awk '{print $2 $3}'|cut -c 3-6 0354 |
相关文章推荐
- Oracle 11g导出来的dmp导入到 10g的数据库(IMP-00010:不是有效的导出文件,头部验证失败)
- Oracle 11g导出来的dmp导入到 10g的数据库(IMP-00010:不是有效的导出文件,头部验证失败)
- Oracle 11g导出来的dmp导入到 10g的数据库(IMP-00010:不是有效的导出文件,头部验证失败)
- Oracle 11g导出来的dmp导入到 10g的数据库(IMP-00010:不是有效的导出文件,头部验证失败)
- Oracle 11g导出来的dmp导入到 10g的数据库(IMP-00010:不是有效的导出文件,头部验证失败)
- Oracle 11g导出来的dmp导入到 10g的数据库(IMP-00010:不是有效的导出文件,头部验证失败)
- Oracle 11g导出来的dmp导入到 10g的数据库(IMP-00010:不是有效的导出文件,头文件验证失败)
- Oracle导入dmp文件报错IMP-00010: 不是有效的导出文件, 头部验证失败
- oracle 12c DMP文件导出,oracle 11gDMP文件导入
- oracle imp导入dmp文件报12506错误解决办法
- imp-oracle10g数据库dmp导入到11g数据库提示IMP-00058,表或试图不存在
- oracleDMP文件导入错误
- oracle导入时IMP-00010: 不是有效的导出文件, 头部验证失败
- oracle导入时IMP-00010: 不是有效的导出文件, 头部验证失败
- 解决Oracel导入dmp文件错误问题
- 用imp命令导入数据表时出现了"只有DBA 才能导入由其它DBA 导出的文件"错误
- 【编程语言】Android--错误处理--工程文件导入时候出现乱码
- oracle 11g dmp文件导入10g
- oracle 11g 导入 导出 dmp文件
- oracle中导入.dmp文件时出现IMP-00009 和IMP-00028异常提示