`
izuoyan
  • 浏览: 8935737 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

troubleshooting IMP-00032&IMP-00008

 
阅读更多
在一次imp操作中遇到了如下错误:
IMP-00032: SQL statement exceeded buffer length
IMP-00008: unrecognized statement in the export file
这2个错误的官方解释如下:
IMP-00032: SQL statement exceeded buffer length
Cause: The buffer was too small for the SQL statement being read.
Action: Rerun with a larger buffer. This can also be an indication of a corruption in the import datafile.

IMP-00008: unrecognized statement in the export file: string
Cause: Import did not recognize a statement in the export file. Either the export file was corrupted, or an Import internal error has occurred.
Action: If the export file was corrupted, retry with a new export file. Otherwise, report this as an Import internal error and submit the export file to customer support.

真是的错误原因是第1个IMP-00032,解决办法是增加buffer的大小,默认情况下的buffer大小依赖于操作系统。
BUFFER

Default: operating system-dependent. See your Oracle operating system-specific documentation to determine the default value for this parameter.

win2003下默认值是exp是4096,imp是8192,见如下测试:
C:\Users\Administrator>exp

Export: Release 10.2.0.1.0 - Production on 星期五 1月 13 10:14:36 2012

Copyright (c) 1982, 2005, Oracle. All rights reserved.


用户名: system@test2.4
口令:

连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
输入数组提取缓冲区大小: 4096 > ^C

D:\>imp

Import: Release 10.2.0.1.0 - Production on 星期五 1月 13 10:16:44 2012

Copyright (c) 1982, 2005, Oracle. All rights reserved.

用户名: gtlions@test2.4
口令:

连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

导入文件: EXPDAT.DMP> 1.dmp

输入插入缓冲区大小 (最小为 8192) 30720>^

从以上测试可以看出windows2003平台下,默认的buffer大小在EXP情况下是4096,IMP情况下是30720,在我这个案例中将buffer增加到81920即可解决问题,下面描述下当时解决这个问题过程和之后的一些思考。
一开始的时候我考虑的是表记录过大造成的,因为从buffer的描述可以看出似乎是针对记录长度而言的,因此最初的诊断方向是从表结构的来考虑,但是查看了下我操作的表结构(本次就导入一张表),所有字段加起来才不过4000,于是觉得不应该是这个问题,后来仔细看了00032的解释,觉得应该从这个错误入手解决才对,因此做了个如下测试:
创建一个分区表,逐步增加分区数量,然后做导出和导入操作;增加分区数量就可以增加表的创建语句长度,终于在反复测试之后,增加到一定长度的DDL语句在IMP的时候再次抛出了这个错误。
表结构的DDL语句可以通过Length(Dbms_Metadata.Get_Ddl('TABLE', 'T_LARGESQL_TEST'))或者dbms_lob.getlength (dbms_metadata.get_ddl ('TABLE', 'T_LARGESQL_TEST'))来获得,这个出来的结果是byte单位,与默认的30720进行比较可以看到结果了。
-The End-


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics