Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit

PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling & Exit

2005-08-31       - By Marquez, Chris

Reply:     1     2     3     4     5     6     7     8     9     10     >>  

Ron,

>>typeset -i rc=`path_to_script [arg1 ...]`

I think I get it?
This line appears to retrieve RC to imp_wrapper.sh, from imp_script.sh and
interrogate?
But what (line/code) executes the imp_script.sh?...the same line?

PS If you solve this one for me too I going have to start referencing you in my
shell script and crediting you in my status reports!
;o)

Thanks,

Chris Marquez

-- --Original Message-- --
From: Reidy, Ron [mailto:Ron.Reidy@(protected)]
Sent: Wed 8/31/2005 11:19 AM
To: Marquez, Chris; oracle-l@(protected)
Subject: RE: PART II: - Beyond a basic Oracle EXP/IMP shell script: Error
Handling & Exit Status?

to trap the error code:

typeset -i rc=`path_to_script [arg1 ...]`
if [[ $rc -ne 0 ]]; then
 # exit appropriately
fi

You might also want to liik at this: http://www.samag.com/documents/s=9238
/sam0408f/0408f.htm


-- ---- ---- ----
Ron Reidy
Lead DBA
Array BioPharma, Inc.

-- --Original Message-- --
From: oracle-l-bounce@(protected) [mailto:oracle-l-bounce@(protected)]On
Behalf Of Marquez, Chris
Sent: Wednesday, August 31, 2005 9:11 AM
To: oracle-l@(protected)
Subject: PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling
& Exit Status?




In my original quest for help I was working with one script.
(btw with you help/code I did complete this task...works well, thanks!)

Now I have a new problem that I do not know how to deal with.
I have a wrapper script involved this time.

Something like this;

=====
imp_wrapper.sh
...

#RUN THIS SCRIPT
script1.sh

#RUN THIS FUNCTION
do func1

#RUN THE IMP SCRIPT
imp_script.sh

#RUN THIS SCRIPT
script2.sh

#RUN THIS FUNCTION
do func2

# RETURN CODE: Set next Return Code.
RC=$?
echo 'RETURN CODE' >> $log_file 2>&1
echo $RC >> $log_file
=====

My imp_script.sh has "trap" code and "RETURN CODE" syntax/value also in the
script.

But I need to be able to STOP/EXIT/END the parent script; imp_wrapper.sh and
set $?=1 when child scrip; imp_script.sh fails with RC=1?

Meaning if import.sh; RC=1, then I want imp_wrapper.sh; RC=1 immediately and
exit?

This confuses me and I have no idea how to pass child (exit) RC to the parent
script.

Thanks in advance,

Chris Marquez
Oracle DBA



This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is
intended
to be for the use of the individual or entity named above. If you are not the
intended recipient, please be aware that any disclosure, copying, distribution
or use of the contents of this information is prohibited. Please notify the
sender  of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7232.39">
<TITLE>RE: PART II: - Beyond a basic Oracle EXP/IMP shell script: Error
Handling &amp; Exit Status?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Ron,<BR>
<BR>
&gt;&gt;typeset -i rc=`path_to_script [arg1 ...]`<BR>
<BR>
I think I get it?<BR>
This line appears to retrieve RC to imp_wrapper.sh, from imp_script.sh and
interrogate?<BR>
But what (line/code) executes the imp_script.sh?...the same line?<BR>
<BR>
PS If you solve this one for me too I going have to start referencing you in my
shell script and crediting you in my status reports!<BR>
&nbsp;;o)<BR>
<BR>
Thanks,<BR>
<BR>
Chris Marquez<BR>
<BR>
-- --Original Message-- --<BR>
From: Reidy, Ron [<A HREF="mailto:Ron.Reidy@(protected)">mailto:Ron
.Reidy@(protected)</A>]<BR>
Sent: Wed 8/31/2005 11:19 AM<BR>
To: Marquez, Chris; oracle-l@(protected)<BR>
Subject: RE: PART II: - Beyond a basic Oracle EXP/IMP shell script: Error
Handling &amp; Exit Status?<BR>
<BR>
to trap the error code:<BR>
<BR>
typeset -i rc=`path_to_script [arg1 ...]`<BR>
if [[ $rc -ne 0 ]]; then<BR>
&nbsp; # exit appropriately<BR>
fi<BR>
<BR>
You might also want to liik at this: <A HREF="http://www.samag.com/documents/s
=9238/sam0408f/0408f.htm">http://www.samag.com/documents/s=9238/sam0408f/0408f
.htm</A><BR>
<BR>
<BR>
-- ---- ---- ----<BR>
Ron Reidy<BR>
Lead DBA<BR>
Array BioPharma, Inc.<BR>
<BR>
&nbsp;-- --Original Message-- --<BR>
From: oracle-l-bounce@(protected) [<A HREF="mailto:oracle-l-bounce@(protected)
.org">mailto:oracle-l-bounce@(protected)</A>]On Behalf Of Marquez, Chris<BR>
Sent: Wednesday, August 31, 2005 9:11 AM<BR>
To: oracle-l@(protected)<BR>
Subject: PART II: - Beyond a basic Oracle EXP/IMP shell script: Error Handling
&amp; Exit Status?<BR>
<BR>
<BR>
<BR>
<BR>
In my original quest for help I was working with one script.<BR>
(btw with you help/code I did complete this task...works well, thanks!)<BR>
<BR>
Now I have a new problem that I do not know how to deal with.<BR>
I have a wrapper script involved this time.<BR>
<BR>
Something like this;<BR>
<BR>
=====<BR>
imp_wrapper.sh<BR>
...<BR>
<BR>
#RUN THIS SCRIPT<BR>
script1.sh<BR>
<BR>
#RUN THIS FUNCTION<BR>
do func1<BR>
<BR>
#RUN THE IMP SCRIPT<BR>
imp_script.sh<BR>
<BR>
#RUN THIS SCRIPT<BR>
script2.sh<BR>
<BR>
#RUN THIS FUNCTION<BR>
do func2<BR>
<BR>
# RETURN CODE: Set next Return Code.<BR>
RC=$?<BR>
echo 'RETURN CODE' &gt;&gt; $log_file 2&gt;&amp;1<BR>
echo $RC &gt;&gt; $log_file<BR>
=====<BR>
<BR>
My imp_script.sh has &quot;trap&quot; code and &quot;RETURN CODE&quot; syntax
/value also in the script.<BR>
<BR>
But I need to be able to STOP/EXIT/END the parent script; imp_wrapper.sh and
set $?=1 when child scrip; imp_script.sh fails with RC=1?<BR>
<BR>
Meaning if import.sh; RC=1, then I want imp_wrapper.sh; RC=1 immediately and
exit?<BR>
<BR>
This confuses me and I have no idea how to pass child (exit) RC to the parent
script.<BR>
<BR>
Thanks in advance,<BR>
<BR>
Chris Marquez<BR>
Oracle DBA<BR>
<BR>
<BR>
<BR>
This electronic message transmission is a PRIVATE communication which contains
<BR>
information which may be confidential or privileged. The information is
intended<BR>
to be for the use of the individual or entity named above. If you are not the
<BR>
intended recipient, please be aware that any disclosure, copying, distribution
<BR>
or use of the contents of this information is prohibited. Please notify the<BR>
sender&nbsp; of the delivery error by replying to this message, or notify us by
<BR>
telephone (877-633-2436, ext. 0), and then delete it from your system.<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>