ORACLE SOS

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 4628|回复: 0

记录一次报IMP-00098导入异常求助

[复制链接]

95

主题

266

帖子

1719

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1719
发表于 2014-3-16 04:05:18 | 显示全部楼层 |阅读模式
晚上十点多,准备睡觉了,以前的一个老客户找到我,说他们的库在imp的时候报错,需要技术支持
大概情况如下:
使用exp/imp升级并迁移数据库从win 10.2.0.1 升级到linux 11.2.0.3 由于硬盘空间不够,使用exp把win上面数据导出来,格式化掉win的数据文件所在硬盘格式化并加入到linux系统中(也就是说,故障之时,只有dmp文件,没有了数据文件)
imp报错如下:
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Tes

Export file created by EXPORT:V10.02.01 via conventional path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
export client uses US7ASCII character set (possible charset conversion)
. . importing table                "ART_T_ARCTYPE"          0 rows imported
. . importing table                "ART_T_ARTICLE"          0 rows imported
……
. . importing table            "EVT_T_ACCEPT_CODE"          1 rows imported
. . importing table            "EVT_T_ACCEPT_FLOW"
illegal lob length marker 51166
bytesread = 00000000000
TABLE =EVT_T_ACCEPT_FLOW   EVT_T_ACCEPT_FLOW
IMP-00098: INTERNAL ERROR: impgst2
IMP-00028: partial import of previous table rolled back: 680071 rows rolled back
IMP-00008: unrecognized statement in the export file:
  ???????????????????????????????????
IMP-00008: unrecognized statement in the export file:
  .:
IMP-00008: unrecognized statement in the export file:
  -$
IMP-00008: unrecognized statement in the export file:
  6
IMP-00008: unrecognized statement in the export file:
  
IMP-00008: unrecognized statement in the export file:
  .
IMP-00008: unrecognized statement in the export file:
  /5
IMP-00008: unrecognized statement in the export file:
  /5$
IMP-00008: unrecognized statement in the export file:
  7%$
IMP-00008: unrecognized statement in the export file:
  $;
IMP-00008: unrecognized statement in the export file:
  $

…………
进一步分析exp导出日志
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)


EXP-00091: Exporting questionable statistics.
. . exporting table              EVT_T_ACCEPT_FLOW    3470071 rows exported
. . exporting table             EVT_T_ACCEPT_FLOW1    2707606 rows exported

……
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully with warnings.


到这里基本上清楚了exp和imp的相关编码情况:
1. 原库编码是ZHS16GBK ,使用exp导出客户端编码为US7ASCII
2. 辛苦编码为ZHS16GBK ,使用imp导入客户端编码为ZHS16GBK
在导出过程中,因为ZHS16GBK 到US7ASCII  发生编码转换,甚至导致部分数据在dmp中可能无法完成编码转换(数据可能本身就有可能丢失),然后导入的时候客户端编码又是为ZHS16GBK(和数据库端编码一致,不再发生转换)
针对这样的情况,需要事先做一个是否有数据无法转换,而导致dmp文件本身就乱码的评估,使用dul文件扫描dmp,幸运的是数据都是正常(汉字为明显乱码),至此问题简单化:
处理方法:
就是在数据库的imp过程中也让其发生一个从US7ASCII  到ZHS16GBK 的编码转换,所以设置NLS_LANG=AMERICAN_AMERICA.US7ASCII,再执行imp即可解决问题.

Q Q:107644445
Tel:13429648788
Email:dba@xifenfei.com
个人Blog(惜分飞)
提供专业ORACLE技术支持(数据恢复,安装实施,升级迁移,备份容灾,故障诊断,系统优化等)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|ORACLE SOS 技术论坛

GMT+8, 2024-5-2 12:43 , Processed in 0.021342 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表