日期:2014-01-09  浏览次数:20436 次

今天现场任务人员报告在IMP一个dmp文件时报超出最大游标数的错误,ORA-01000: maximum open cursors exceeded。
讯问了一下基本情况,上metalink查了一下,IMP中基本就没有提及任何有关ORA-01000的错误,这就有些疑惑了。这时候,通过邮件收完了dmp文件,本人模仿测试了一下,发现其实错误的缘由基本不是ORA-01000,而是IMP-00093,只是由于太多的IMP-00093错误耗费了大量的cursor,导致一个session中的cursor数超过了定义的300,所以在最后就开始报ORA-01000错误了。

IMP-00093: Inconsistency between dumpfile constraint definition for table ACCOUNT with columns ("ACCTID" , "CURRENCYID")

首先查错误文档,基本上没有什么有意义的提示。
 IMP-00093 Inconsistency between dumpfile constraint definition for table string with columns (string)

Cause: Import failed to locate a base table for a constraint that was defined in the dump file and statistics were not imported.

Action: Check to see if the table and constraint exist. If the table and constraint exist, then report this to Oracle Support Services as an Import internal error.

再次查metalink,果然,又是一个bug。

Bug 2834541 - IMP-93 on import when using the TOUSER parameter

Bug No. 2834541

这个bug在9.2.0.6和10.1.0.3中被修复,起因是在导入的过程中要导入系统生成的约束,类似SYS_C0027639, 但是metalink上只提到了这个缘由,但是以前很多次的imp应该都是有这样系统生成的约束名,并没有报错过,所以应该还是有另外的要素参杂其中的,比如统计信息的生成。没有继续研讨。

处理方法:在IMP时使用indexes=no或者statistics=none参数,当然后者比较好一些。

问题是处理了,但是多说一点,在设计schema时,最好手动指定所有约束的名字,这是一个好的习惯。