[20151210]oerr显示错误信息.txt

简介: [20151210]oerr显示错误信息.txt --以前写过1篇windows下使用oerr的方法,实际上12c已经自带,我现在使用client端是12c,但是没有oraus.msg文件,从别的os 拷贝过 --来就可以使用。

[20151210]oerr显示错误信息.txt

--以前写过1篇windows下使用oerr的方法,实际上12c已经自带,我现在使用client端是12c,但是没有oraus.msg文件,从别的os 拷贝过
--来就可以使用。可以参考我的链接:
http://blog.itpub.net/267265/viewspace-1251067/

不过我总觉的oracle 不够智能,应该直接输入
oerr ora-00001 就可以查看错误。自己顺手写一个小脚本:

$ cat /usr/local/bin/oerrx
#! /bin/bash

a=`echo $1 | cut -d"-" -f1`
b=`echo $1 | cut -d"-" -f2`
echo ''
oerr $a $b
echo ''


$ oerrx ora-00001

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 insert the key.

--这样就可以直接查询了。

--我还建立sql脚本:
$ cat oerrx.sql
host oerrx &&1

--这样sqlplus下直接输入 @ oerrx ora-0001 就可以了。

--如果windows的服务器,没有oerr的命令,可以自己写一个脚本,内容如下:

$ cat oerr.sql
prompt
SET serveroutput ON SIZE 1000000
SET feedback off
EXEC dbms_output.put_line('Error ' || &&1 || ' is : ' ||sqlerrm(-1 * &&1));
prompt
undefine 1
SET feedback ON

--缺点是提示太简单。没有后面的相关信息。

目录
相关文章
|
运维 Oracle 关系型数据库
[20160604]浅谈出错提示.txt
[20160604]浅谈出错提示.txt --这个问题主要由于上个礼拜正常上班时间遇到的问题,导致整个业务停顿10分钟上下,出错提示"解析URL错误",实际上这个问题我遇到过 --一次,当时不是我解决的,我提交软件组,我记得对方提到1台服务器服务出现问题,重启服务就ok了.
1192 0
[20160111]使用提示no_unnest.txt
[20160111]使用提示no_unnest.txt --今天被人问及这个提示,我记忆使用这个提示,就会出现filter过滤条件.我以前遇到这种语句,一般两者提示都使用看看那个效果好.
780 0
|
SQL 索引
[20140121]with+提示Materialize.txt
  昨天看别人的awr报表,发现有一条不良的sql语句使用with+Materialize,开始我觉得得使用提示Materialize不好. 我记得第一次知道这个with命令实际上看jonathanlewis这本书,发现他很喜欢使用Materialize提示.
751 0
|
SQL Oracle 关系型数据库
[20170112]为什么提示不一样.txt
[20170112]为什么提示不一样.txt --问题链接:http://www.itpub.net/thread-2074643-1-1.html --自己也测试看看: 1.
868 0
|
前端开发 数据可视化 Linux
VS Code 常用的一些命令
VS Code 常用的一些命令
|
C++ iOS开发
C++ code: 将程序的输出,保存到txt文档中,且每35个数,自动换行
// write the predicted score into txt files       ofstream file("/home/wangxiao/Downloads/caffe-master/wangxiao/bvlc_alexnet/predict_score.
控制台图片路径错误,显示[object Module],解决办法
控制台图片路径错误,显示[object Module],解决办法
164 0
|
C#
c#——将错误日志记录在txt文本里
c#——将错误日志记录在txt文本里
354 0
c#——将错误日志记录在txt文本里