系统命令OERR查看oracle错误信息

参考文档:http://blog.itpub.net/23718752/viewspace-2082156/

oracle出现ORA-的错误信息时,可以使用系统命令oerr直接查看错误相关信息。

oerr命令得到的错误信息是$ORACLE_HOME/bin/路径下的bash文件oerr调用perl文件oerr.pl实现的。

本次测试系统版本是redhat6.6。

文件信息:

[oracle@ bin 10:47:09]$ pwd
/u01/app/oracle/product/12.1.0.2/bin
[oracle@ bin 10:47:10]$
[oracle@ bin 10:47:10]$ ll *err*
-rwxr-xr-x. 1 oracle dba  703 Jan  1  2000 oerr
-rw-r--r--. 1 oracle dba 4921 Jan  1  2000 oerr.pl

 oerr命令后面接两个参数,格式为‘oerr  错误类型   错误编号’,除了可以查看ora类型的错误,还可以看tns等类型的错误:

[oracle@ bin 10:54:34]$ oerr ora 1
00001, 00000, "unique constraint (%s.%s) violated"
// *Cause: An UPDATE or INSERT statement attempted to insert a duplicate key.
//         For Trusted Oracle configured in DBMS MAC mode, you may see
//         this message if a duplicate entry exists at a different level.
// *Action: Either remove the unique restriction or do not i nsert the key.

[oracle@ ~ 11:19:01]$ oerr  tns  505
00505, 00000, "Operation timed out"
// *Cause: The requested operation could not be completed within the timeout
// period.
// *Action: For further details, turn on tracing and reexecute the operation.

 从文件oerr.pl中可以看到有使用一个配置文件$ORACLE_HOME/lib/facility.lis,其中就有相关参数信息。文件中有说明参数格式为facility:component:rename:description。

[oracle@ ~ 11:21:35]$ cat $ORACLE_HOME/lib/facility.lis
#
# $Id: facility.lis /st_buildtools_12.1/2 2014/05/23 11:28:50 chchatte Exp $
# Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
#
# Definition of the Oracle facilities and corresponding component names.
#
# The entries in this file are colon separated defining, for each
# facility (field 1), the component name (field 2), the "real" facility
# name for facilities with aliases (field 3) with a value of "*" for
# facilities without renamings and an optional facility description
# (field 4)
#
#       facility:component:rename:description
#
acfs:usm:*:
acfsk:usm:*:
advm:usm:acfs:
advmk:usm:*:
afd:usm:*:
afdk:usm:*:
......
ora:rdbms:*:
......
tns:network:*:
......

存放错误信息的文件在$ORACLE_HOME/rdbms/mesg/oraus.msg这里。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值