作为Oracle用户,你应该对OERR工具不陌生。这是一个非常实用的工具,利用该工具可以迅速获取Oracle的错误信息,帮助解决问题。如:
$ oerr ora 1652
01652, 00000, "unable to extend temp segment by %s in tablespace %s"
// *Cause: Failed to allocate an extent of the required number of blocks for
// a temporary segment in the tablespace indicated.
// *Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more
// files to the tablespace indicated.
Cause描述的是导致错误的原因,Action描述的是错误解决方案。对于ORA-XXXXX错误,当你不知道如何解决时,我相信你都会去使用OERR工具来帮助解决。但是,你可能不知道,OERR的用途不仅仅在于ORA错误,它还能用于其它类型的错误。如:
$ oerr lrm 112
112, 0, "multiple values not allowed for parameter ‘%.*s‘"
// *Cause: An attempt was made to specify multiple values for a parameter which
// can take only one value.
// *Action: Do not specify more than one value for this parameter.
这是在使用expdp时使用directory参数不当时可能会产生的错误。你同样也可以使用OERR工具来获取详细的错误信息。再比如:
$ oerr exp 91
00091, 00000, "Exporting questionable statistics."
// *Cause: Export was able export statistics, but the statistics may not be
// usuable. The statistics are questionable because one or more of
// the following happened during export: a row error occurred, client
// character set or NCHARSET does not match with the server, a query
// clause was specified on export, only certain partitions or
// subpartitions were exported, or a fatal error occurred while
// processing a table.
// *Action: To export non-questionable statistics, change the client character
// set or NCHARSET to match the server, export with no query clause,
// export complete tables. If desired, import parameters can be
// supplied so that only non-questionable statistics will be imported,
// and all questionable statistics will be recalculated.
$ oerr imp 17
00017, 00000, "following statement failed with ORACLE error %lu:"
// *Cause: Import failed to execute the statement from the export file
// because of an Oracle error.
// *Action: Look up the accompanying Oracle message in the ORA message
// chapters of this manual and take appropriate action.
这是在使用EXP和IMP时可能产生的错误,同样的,我们也可以使用OERR工具来检索错误信息。
以上只是举例,OERR能检索的错误还有很多,包括CLSR、OCI、TNS、UDE等等。但是这些在Oracle官方文档里并没有说明,还需要各位自己去多多实践。
原文:http://blog.itpub.net/13885898/viewspace-1651585/