Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: how to store orace errors in database (UNIX scripting challen
Ok guys,
spent my weekend on learning sed.
heres what i hv cooked up, just for fun
a shell script to get all ora errors into a SDF format, which can be uploaded into a table using sql*loader.
issues faced and asking for answers
* how to insert a new-line. so broke the sed into next line to insert the
new line char.
* typeset was not working with /bin/ksh (maybe not ksh93), so used
/usr/dt/bin/dtksh
* how to install ksh93 on release 5.7 ? * what are the licensing issues related to installing ksh93 * why dont i hv ksh93? why why why? :) * its very sloooowwwww script starts here >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#/usr/dt/bin/dtksh
errfile=err.dat #error data file typeset -Z5 count #fixed width var count=1 typeset -L256 errm errcause erraction #fixed width varwhile [ count -ne 20001 ]
var=`oerr ora $count` if [ -n "$var" ] then echo $var | sed 's/\/\/ \*Cause: /\ /;s/\/\/ \*Action:/\ /;s/ \/\/ / /g' >$tmpfile #remove "*Cause" "*Action" "//" and add newline instead errm=`sed -n 1p $tmpfile` errcause=`sed -n 2p $tmpfile` erraction=`sed -n 3p $tmpfile` echo "$errm""$errcause""$erraction" >>$errfile fi count=`expr $count + 1`
<<<<<<<<<<<<<<<<<<<<<<<secript ends here
is there any oracle site where i can dump this script for everybody's use?
-Mandar
> > ____________________Reply Separator____________________
> > Author: "kaushikdas" <kaushikdas/iffco_at_iffco.nic.in>
> > Date: 3/21/2001 11:35 PM
> >
> >
> >
> > Hello I am Kaushik Das from india .I am new to your group.
> > I had a query ,i hope some one will reply to this mail.
> >
> > Just like we can store help of sql commands in HELP table in
> > oracle database.In a semilar way can we store ORACLE errors
> > in database
> >
> > for example to see oracle error 0000 in unix we write
> oerr ora 0000
> info of this
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mandar Ghosalkar INET: MandarG_at_gsr-inc.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Mon Mar 26 2001 - 19:54:57 CST
![]() |
![]() |