Trace/trap all ORA- errors?
Hi,
Oracle 9.2, Solaris.
Is it possible to trace/trap all ORA- error events.
I can turn tracing on for a particular event, as such...
alter system set events='942 trace name errorstack forever, level 8'
However, what if I want to trap every ORA- ( < 10000 ) errors? Is this possible?
Thanks.
Check database trigger on SERVERERROR.
However never have used it myself, so you should test it carefully.
Oops forgot the link
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg14evt.htm#998000
Gints Plivna
http://www.gplivna.eu
Message was edited by:
gintsp
Similar Messages
-
How to be notified for all ORA- Errors recorded in the alert.log file
based on Note:405396.1, I Changed the Matches Warning from the default value ORA-0*(600?|7445|4[0-9][0-9][0-9])[^0-9] to ORA-* in order to receive an warning alert for all ORA- errors.
but I just recieved the alert like the following:
Metric=Generic Alert Log Error
Time/Line Number=Mon Feb 25 23:52:21 2008/21234
Timestamp=Feb 26, 2008 12:06:03 AM EST
Severity=Warning
Message=ORA-error stack (1654, 1654, 1654) logged in /opt/oracle/admin/PRD/bdump/alert_PRD.log.
Notification Rule Name=Alert Log Error
Notification Rule Owner=SYSMAN
as you can see, the message only indicate the ORA-1654, nothing else.
How to set in 10g grid control to get the details alert that in the alert log like:
"ORA-1654: unable to extend index ADM.RC_BP_STATUS by 1024 in tablespace PSINDEX"
I can't believe Oracle 10g Grid control only provide the ORA- number without detailsGo to your database target.
On the home tab, on the left hand side under Diagnostic Summary, you'll see a clickable date link next to where it says 'Alert Log'. Click on that.
next click on Generic Alert Log Error Monitoring Configuration (its at the bottom)
In the alert thresholds put:
ORA-0*(600?|7445|4[0-9][0-9][0-9])[^0-9]
I believe that will pick anything up but experiment, its only perl.
If you want to test this use the DBMS_System.ksdwrt package but I would advise you only do so on a test database. If you've never heard of it, google it. Its a way of writing to your alert log.
Make sure you have your emails sent to long format as well. -
How to find all ORA error code and the message in Oracle10g?
Does anyone knows how to list all ORA error code and message in SQL Plus or find a full list of ORA error code in documentation?
If you want ALL Oracle ORA error codes in single page or even downloadable (html or pdf format) then check following post.
http://www.oratraining.com/blog/2010/08/complete-list-of-all-oracle-ora-errors/
Regards,
Tushar
Edited by: oratraining on Aug 18, 2010 12:20 AM -
How to get ORA errors in alertlog file using shell script.
Hi,
Can anyone tell me how to get all ORA errors between two particular times in an alertlog file using shell script.
ThanksHi,
You can define the alert log as an external table, and extract messages with SQL, very cool:
http://www.dba-oracle.com/t_oracle_alert_log_sql_external_tables.htm
If you want to write a shell script to scan the alert log, see here:
http://www.rampant-books.com/book_2007_1_shell_scripting.htm
#!/bin/ksh
# log monitoring script
# report all errors (and specific warnings) in the alert log
# which have occurred since the date
# and time in last_alerttime_$ORACLE_SID.txt
# parameters:
# 1) ORACLE_SID
# 2) optional alert exclusion file [default = alert_logmon.excl]
# exclude file format:
# error_number error_number
# error_number ...
# i.e. a string of numbers with the ORA- and any leading zeroes that appear
# e.g. (NB the examples are NOT normally excluded)
# ORA-07552 ORA-08006 ORA-12819
# ORA-01555 ORA-07553
BASEDIR=$(dirname $0)
if [ $# -lt 1 ]; then
echo "usage: $(basename) ORACLE_SID [exclude file]"
exit -1
fi
export ORACLE_SID=$1
if [ ! -z "$2" ]; then
EXCLFILE=$2
else
EXCLFILE=$BASEDIR/alert_logmon.excl
fi
LASTALERT=$BASEDIR/last_alerttime_$ORACLE_SID.txt
if [ ! -f $EXCLFILE ]; then
echo "alert exclusion ($EXCLFILE) file not found!"
exit -1
fi
# establish alert file location
export ORAENV_ASK=NO
export PATH=$PATH:/usr/local/bin
. oraenv
DPATH=`sqlplus -s "/ as sysdba" <<!EOF
set pages 0
set lines 160
set verify off
set feedback off
select replace(value,'?','$ORACLE_HOME')
from v\\\$parameter
where name = 'background_dump_dest';
!EOF
`
if [ ! -d "$DPATH" ]; then
echo "Script Error - bdump path found as $DPATH"
exit -1
fi
ALOG=${DPATH}/alert_${ORACLE_SID}.log
# now create awk file
cat > $BASEDIR/awkfile.awk<<!EOF
BEGIN {
# first get excluded error list
excldata="";
while (getline < "$EXCLFILE" > 0)
{ excldata=excldata " " \$0; }
print excldata
# get time of last error
if (getline < "$LASTALERT" < 1)
{ olddate = "00000000 00:00:00" }
else
{ olddate=\$0; }
errct = 0; errfound = 0;
{ if ( \$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
{ if (dtconv(\$3, \$2, \$5, \$4) <= olddate)
{ # get next record from file
next; # get next record from file
# here we are now processing errors
OLDLINE=\$0; # store date, possibly of error, or else to be discarded
while (getline > 0)
{ if (\$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
{ if (errfound > 0)
{ printf ("%s<BR>",OLDLINE); }
OLDLINE = \$0; # no error, clear and start again
errfound = 0;
# save the date for next run
olddate = dtconv(\$3, \$2, \$5, \$4);
continue;
OLDLINE = sprintf("%s<BR>%s",OLDLINE,\$0);
if ( \$0 ~ /ORA-/ || /[Ff]uzzy/ )
{ # extract the error
errloc=index(\$0,"ORA-")
if (errloc > 0)
{ oraerr=substr(\$0,errloc);
if (index(oraerr,":") < 1)
{ oraloc2=index(oraerr," ") }
else
{ oraloc2=index(oraerr,":") }
oraloc2=oraloc2-1;
oraerr=substr(oraerr,1,oraloc2);
if (index(excldata,oraerr) < 1)
{ errfound = errfound +1; }
else # treat fuzzy as errors
{ errfound = errfound +1; }
END {
if (errfound > 0)
{ printf ("%s<BR>",OLDLINE); }
print olddate > "$LASTALERT";
function dtconv (dd, mon, yyyy, tim, sortdate) {
mth=index("JanFebMarAprMayJunJulAugSepOctNovDec",mon);
if (mth < 1)
{ return "00000000 00:00:00" };
# now get month number - make to complete multiple of three and divide
mth=(mth+2)/3;
sortdate=sprintf("%04d%02d%02d %s",yyyy,mth,dd,tim);
return sortdate;
!EOF
ERRMESS=$(nawk -f $BASEDIR/awkfile.awk $ALOG)
ERRCT=$(echo $ERRMESS|awk 'BEGIN {RS="<BR>"} END {print NR}')
rm $LASTALERT
if [ $ERRCT -gt 1 ]; then
echo "$ERRCT Errors Found \n"
echo "$ERRMESS"|nawk 'BEGIN {FS="<BR>"}{for (i=1;NF>=i;i++) {print $i}}'
exit 2
fi -
Hey,
Anyonde knows where can i find a list of all ORA-* error codes?
tksHey,
I work with an application, developed on a technology called 'NS-DK' (don't bother to google it, is very hard to find out anything about it ...)
Every time the database returns an error, the aplication immediately shuts de database local connection, and uses the NS-DK libraryes to decode the message.
However, after a upgrade to a more recent version of NS-DK, the Oracle errors are not being decoded correctly, and NS-DK support are not being very helpfull in solving the issue, so we are trying to develop a simple patch to temporarily solve the problem.
Reconnect to database to decode the errors is out of question, since it implicates lots of 'codding hours'.
Call Windows executables is not possible too, since the application runs over a 'pillow', without privileges to execute anything.
That's why i need the file. :)
tks -
Trapping ora- errors in alert.log
hello everyone,
A classical question that I think every DBA has encountered.
We have about 40 oracle database servers, some with 9i, others with 10g, still others with both. Some on Linux, others on Solaris.
My question is, how to trap ora- errors in the alert.log of these database and having them being sent as an email.
It's not an easy question to answer, I know. But I'd like to get ideas from your experiences in implementing the same thing in your environments.
Many thnx.
HiruyaHi,
this let you look for errors :
utl_file.get_line(vInHandle, vNewLine);
IF vNewLine like ('%ORA-%') then
Then this let you to mail the errors :
utl_smtp.mail
Here is my complete script :
SET SERVEROUT ON
DECLARE
c utl_smtp.connection;
vInHandle utl_file.file_type;
vNewLine VARCHAR2(250);
vMessage VARCHAR2(250);
I pls_integer := 0;
LC$Fic_in Varchar2(128) := 'db1ALRT.LOG'; -- a adapter sur votre configuration
LC$Dir_in Varchar(30) := 'C:\oracle\admin\db1\bdump';
PROCEDURE send_header(name VARCHAR2, header VARCHAR2) AS
BEGIN
utl_smtp.write_data(c,name ||':'|| header || UTL_TCP.CRLF);
END;
BEGIN
vInHandle := utl_file.fopen(LC$Dir_in, LC$Fic_in, 'R');
LOOP
BEGIN
utl_file.get_line(vInHandle, vNewLine);
IF vNewLine like ('%ORA-%') then
vMessage:=vMessage||chr(10)||vNewLine;
END IF;
EXCEPTION
WHEN OTHERS THEN
EXIT;
END;
END LOOP;
utl_file.fclose(vInHandle);
-----------------------SEND A MAIL---------------------------
c := utl_smtp.open_connection(‘smtpserver’,25);
utl_smtp.helo(c, ‘something.com');
utl_smtp.mail(c, [email protected]');
utl_smtp.rcpt(c, ‘[email protected]');
utl_smtp.open_data(c);
send_header('From', '"someone" <[email protected]>');
send_header('To', '"Recipient" < [email protected] >');
send_header('Subject', 'DB1 ERREUR ALERT LOG');
utl_smtp.write_data(c, UTL_TCP.CRLF ||vMessage);
utl_smtp.close_data(c);
utl_smtp.quit(c);
EXCEPTION
WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
BEGIN
utl_smtp.quit(c);
EXCEPTION
WHEN utl_smtp.transient_error
OR utl_smtp.permanent_error THEN
NULL;
END;
raise_application_error(-20000, SQLERRM);
END fopen;
/ -
Errors in file /apps/oh2/diag/rdbms/bsdp12/BSDP122/trace/BSDP122_q01c_5899122.trc:
ORA-00904: "UTL_RAW"."CAST_FROM_NUMBER": invalid identifier
DB version 11.2.0,.4
and Replication getting ab-ended with below error
SourceLine
: [817]
2015-03-29 14:07:12 ERROR OGG-00665 OCI Error executing single row select (status = 26695-ORA-26695: error on call to dbms_lock.release: return code 4
ORA-06512: at "SYS.DBMS_LOGREP_UTIL", line 197
ORA-06512: at "SYS.DBMS_LOGREP_UTIL", line 240
ORA-06512: at "SYS.DBMS_LOGREP_UTIL", line 493
ORA-06512: at "SYS.DBMS_APPLY_ADM_INTERNAL", line 2375
ORA-26790: Requesting a lock on set_dml_conflict_handler "" timed out
ORA-06512: at "SYS.DBMS_XSTREAM_GG_ADM", line 335
ORA-06512: at line 1), SQL<DECLARE PRAGMA AUTONOMOUS_TRANSACTION;BEGIN dbms_xstream_gg_adm.set_dml_conflict_handler(
apply_name=>:1, source_object=>:2, object=>:
3,
conflict_handler_name=>:4, operation_name=>:5, conflict_type=>:6,
method_name=>:7, column_list=>:8, resolution_column=>:9);END;>.
Thanks -
I wanted to know when the ORA- errors are reported into the alert.log file?
And which tye of errors are reported into it?
And if i wanted to log all the ORA-errors in the alert log then is there any setting for that?You can find the type of errors reported in the link above.
Also, you maynot like to log ORA-00942: table or view does not exist, ORA-00904: : invalid identifier type of errors in alert.log - right? You may want to research at setting up events for generating trace files on specific error numbers you are looking at. That might resolve your problem - hth. -
Need help to trace the place where error occuring in Web UI of type System
Hi All,
Need help to trace the place where error occurring in Web UI of type System error,
this error coming while saving the corporate account creation,
error message description : - System error: Interruption in Routine READ TABLE GT_CHAR_VAL, CHAR_NAME = PVTLTD_CLEAN_SEGMENT
System error: Interruption in Routine READ TABLE GT_CHAR_VAL, CHAR_NAME = PVTLTD_CLEAN_CLASS-CP
thanking you.
Best Regards,
VijHydHi Nagaraj,
See that the mandatory SICF setting are enabled or Active in the SICF Services. Follow the steps as below:-
Enter the TCode SICF
Execute the same for Hierarchy Type SICF.
Check the following SAP Note 1295006.
If every thing is Active then, the IC Agent role will open.
Still if it is not opening Let me know.
regards,
Sarangamath -
Defaulting Rules using PL/SQL Api - ORA error
Hi All,
Iam using the PLSQL api for OM defaulting rules. Based on the item in the Sales order line, Line type has to be defaulted.
I have put debug messages and iam able to see successful execution and the required Line type value is returned. No exception is raised.
Error ORA-06502 PL/SQL numberic to value error. Character to number conversion error is thrown outside the custom package.
PLSQL api is coded as below.
CREATE OR REPLACE PACKAGE BODY xx_default_ordertype IS
G_PKG_NAME CONSTANT VARCHAR2(30) := 'XX_DEFAULT_ORDERTYPE';
FUNCTION get_trans_type
p_database_object_name IN VARCHAR2,
p_attribute_code IN VARCHAR2
RETURN varchar2 IS
l_trans_type VARCHAR2(30);
-- l_item_id NUMBER := ONT_LINE_DEF_HDLR.g_record.ORDERED_ITEM_ID;
BEGIN
SELECT b.name
INTO l_trans_type
FROM OE_TRANSACTION_TYPES_tL b,
oe_transaction_types_all a
WHERE a.transaction_type_id=b.transaction_type_id
AND attribute1=ONT_LINE_DEF_HDLR.g_record.INVENTORY_ITEM_ID;
RETURN l_trans_type;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN l_trans_type;
WHEN OTHERS THEN
insert_sstab(7,'in exception');
IF OE_MSG_PUB.Check_Msg_Level (OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
OE_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'xx_default_ordertype');
END IF;
RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
END get_trans_type;
END xx_default_ordertype;
Not able to figure out where the ORA error is getting raised from.
Kindly help
Edited by: user11969666 on Mar 19, 2011 7:47 AMbtw, I did try your test and it didn't error for me:
CREATE OR REPLACE PACKAGE xx_default_ordertype IS
FUNCTION get_trans_type
p_database_object_name IN VARCHAR2,
p_attribute_code IN VARCHAR2
RETURN varchar2;
end xx_default_ordertype;
CREATE OR REPLACE PACKAGE BODY xx_default_ordertype IS
FUNCTION get_trans_type
p_database_object_name IN VARCHAR2,
p_attribute_code IN VARCHAR2
RETURN varchar2 IS
l_trans_type OE_TRANSACTION_TYPES_tL.name%TYPE :='a';
BEGIN
RETURN l_trans_type;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN l_trans_type;
END get_trans_type;
END xx_default_ordertype;
begin
dbms_output.put_line(xx_default_ordertype.get_trans_type('X','Y'));
end;
/ -
Create custom rule: Looking for ORA errors in the alert log
I would like to create a rule to notify me when ORA errors are generated to the alert log. When I try to create a rule, I seem to only be able to choose from predefined lists. Has anyone configured a rule for this?
Grrr. This is for 10.2 Grid:
Go to databases --> select your database
Under Diagnostic summary, you'll see:
Alert Log 28-Dec-2006 09:19:48
The date part is a clickable link, click on it. Scroll to the bootom of the next page and click on:
"Generic Alert Log Error Monitoring Configuration"
Now read the page very carefully, its all self explanatory. The reason who haven't had some errors reported is because of that filter. Now set it up the way you want it.
Good luck
Bazzza -
Not clearable : 1 distinct types of ORA- errors have been found in the alert log.
( Correct me if I'm wrong.)
What could be the reason for the fact that the event "1 distinct types of ORA- errors have been found in the alert log." is not clearable?
Even if the problem is solved, the ORA- error will still be in the alert.log.
Therefore the event would eventually only disappear after 7 days.
Doesn't sound very logical to me.- The event page showing a warning event for "Generic Alert Log Error Status" metric,
- "Generic Alert Log Error Status" event is a statefull metric,
- On each evaluation of the metric defined as 'Statefull', the Cloud Control Agent recalculates the severity,
- This means, EM Agent scans the alert log for ORA errors, "Generic Alert Log Error Status" will return the number of ORA error found,
- Whenever the returned number is grater than the assigned thresholds of "Generic Alert Log Error Status", an alert is raised on EM console,
- On the next scan of alert log file, this alert will be cleared ONLY if the collected value is less than the assigned threshold,
- By checking your system, the warning threshold of "Generic Alert Log Error Status" is 0, so whenever a single ORA error is found in alert log, a warning event will be raised and you will not be able to clear it manually as this is a stateful metric.
There are three cases where this alert can be cleared:
1. The agent found 0 ORA errors in Alert log, then the alert will be cleared automatically
2. Manual clear: By disabling/enabling the metric
3. Manual clear and further not receiving similar alerts frequently: By assigning higher thresholds values
So, I suggest to disable the metric, then, enable it after some time as follows as follows:
- Go to the problematic database home page >> open the 'Oracle Database' drop-down menu >> 'Monitoring' >> 'Metric and Collection Settings',
- Choose 'All metrics' from the 'View' drop-down list >> search for the 'Generic Alert Log Error Status' metric,
- Click the pencil icon under 'Edit' column opposite to the above metric >> remove the Warning Threshold (make it empty) >> 'Continue' >> 'OK'.
- Wait for the next collection schedule in order for the warning events to be cleared, then, enable the metric again with the same steps (setting Warning Threshold=0).
References:
Note 604385.1 Receiving "Clear" Notifications Unexpectedly for 'Generic Alert Log Error Status' Metric
Note 733784.1 What are Statefull and Stateless Metrics in Enterprise Manager - Explanation and Example
HTH
Mani -
SNMP trap on OutOfMemory Error Log record
I would like to implement SNMP trap on OutOfMemory Error Log record.
In theory SNMP LogFilter with Severity Level "Error" and Message Substring "OutOfMemory" should do the trick.
In reality it does not work (doh)(see explanations below), I wonder if someone managed to make it work.
Log entry has following format:
----------- entry begin ----------
####<Nov 12, 2003 3:09:23 PM EST> <Error> <HTTP> <ustrwd2021> <local> <ExecuteThread: '14' for queue: 'default'> <> <> <101020> <[WebAppServletContext(747136,logs2,/logs2)] Servlet failed with Exception>
java.lang.OutOfMemoryError
<<no stack trace available>>
------------ entry end ------------
Notice that java.lang.... is NOT part of the log record, yep it seems that exception stack trace is not part of log record! Thus filter could be applied only to "<[WebAppServletContext(747136,logs2,/logs2)] Servlet failed with Exception>" string, which is really useless.
Here is fragment of trap data (i had to remove Message Substring in order to get Error trap to work)
1.3.6.1.4.1.140.625.100.50: trapLogMessage: [WebAppServletContext(747136,logs2,/logs2)] Servlet failed with ExceptionAndriy,
I dont think you could do much here, since Outofmemory is not part of
log record SNMP agent cannot filter on this. I would be curious to hear
if anyone got it to work using SNMP.
sorry,
-satya
Andriy Potapov wrote:
I would like to implement SNMP trap on OutOfMemory Error Log record.
In theory SNMP LogFilter with Severity Level "Error" and Message Substring "OutOfMemory" should do the trick.
In reality it does not work (doh)(see explanations below), I wonder if someone managed to make it work.
Log entry has following format:
----------- entry begin ----------
####<Nov 12, 2003 3:09:23 PM EST> <Error> <HTTP> <ustrwd2021> <local> <ExecuteThread: '14' for queue: 'default'> <> <> <101020> <[WebAppServletContext(747136,logs2,/logs2)] Servlet failed with Exception>
java.lang.OutOfMemoryError
<<no stack trace available>>
------------ entry end ------------
Notice that java.lang.... is NOT part of the log record, yep it seems that exception stack trace is not part of log record! Thus filter could be applied only to "<[WebAppServletContext(747136,logs2,/logs2)] Servlet failed with Exception>" string, which is really useless.
Here is fragment of trap data (i had to remove Message Substring in order to get Error trap to work)
1.3.6.1.4.1.140.625.100.50: trapLogMessage: [WebAppServletContext(747136,logs2,/logs2)] Servlet failed with Exception -
How to read ora error stack?
Hi,
Db : 11.2
We got the below error in alert log.For understanding purpose,Arch session was killed or Rman session was killed? So cannot be archived. Is it right?
The session was killed Hence
ORA-16038: log 6 sequence# 26202 cannot be archived
ORA-00028: your session has been killed
ORA-00312: online log 6 thread 2: '+ARCH_IT03/it03/onlinelog/group_6.1122.794731693'
ORA-00312: online log 6 thread 2: '+DATA_IT03/it03/onlinelog/group_6.271.794731695'
How to read ora error stack? From Top to bottom or bottom to top
Br,
Raj975791 wrote:
Hi,
Db : 11.2
We got the below error in alert log.For understanding purpose,Arch session was killed or Rman session was killed? So cannot be archived. Is it right?
The session was killed Hence
ORA-16038: log 6 sequence# 26202 cannot be archived
ORA-00028: your session has been killed
ORA-00312: online log 6 thread 2: '+ARCH_IT03/it03/onlinelog/group_6.1122.794731693'
ORA-00312: online log 6 thread 2: '+DATA_IT03/it03/onlinelog/group_6.271.794731695'
How to read ora error stack? From Top to bottom or bottom to top
Br,
Raj
Yes
The messages are all related to the same issue. There really isn't any issue of 'which comes first'. -
In the passed I used an Oracle site with a description of all the ORA error messages. Now I can not find this site anymore. Does anyone know the link to this site?
kind regards,If you are searching for a specific error message you might try
http://otn.oracle.com/pls/db92/db92.error_search?remark=homepage&prefill=ORA-
Maybe you are looking for
-
I have an iPad 3. I tried two, One was a worthless piece of junk I wasted $2.99 on and the other is pretty good ($1.99) except is does not do a function I would like to use as advertised ( which is to create a sticking note that works like an app by
-
Hi experts, While user making outgoing payment through T code : F-53,they want to put more words in text block.So that they can see the details of expenses incurred from text block.Now user can accomodate upto 50 words in that text block and they wan
-
Reader XI still gives "insufficient data for image" error
Our fax machine creates .pdf files of the faxes and recently our back office has had trouble printing them. When I look at them they give an "insufficient data for image" error, but only on one page each. I've tried upgrading to reader XI but the pro
-
I downloaded 7.0 when I try to itunes. it says: Quicktime version 7.0d0 is installed, itunes requires quicktime version 7.1.3 or later. Please re install itunes. I downloaed again and choose repair. That did not fix it. I went to quicktime and there
-
SAP CERTIFIED DEVELOPMENT PROFESSIONAL - ABAP SYSTEM INTERFACES WITH SAP
Hello Experts I am Atush Rohan, I have done my "SAP Certified Development Associate - ABAP with SAP NetWeaver 7.0" on 3rd April 2009. I want to appear for "SAP Certified Development Professional - ABAP System Interfaces with SAP NetWeaver 7.0". I hav