Home » RDBMS Server » Server Utilities » sqlldr - exit error code 2 in unix (merged)
sqlldr - exit error code 2 in unix (merged) [message #225043] Fri, 16 March 2007 13:06 Go to next message
Niyam
Messages: 3
Registered: March 2007
Junior Member
Hi,

I am getting exit error code 2 when I try to use sqlldr in shell script. It gives error 2 and my script fails. The code I used is as follows:

sqlldr $o_user@$DB CONTROL=cmbrrd0002.ctl LOG=cmbrrd0002.log BAD=cmbrrd0002.bad DATA=$LOAD_DATA_FROM/${DATA_FILE} >> $DETAILLOG << ENDOFSQL
$o_pass
ENDOFSQL

I found out the error code 2 means incorrect usage of command if that is true then what is the correct usage of sqlldr in unix shell script.
Thanks in advance for your help!
Re: sqlldr - exit error code 2 in unix [message #225046 is a reply to message #225043] Fri, 16 March 2007 13:47 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Niyam wrote on Fri, 16 March 2007 14:06
I found out the error code 2 means incorrect usage of command if that is true then what is the correct usage of sqlldr in unix shell script.

Just curious where you saw error code 2 is incorrect usage of command? The documentation indicates that it's one of the following:
  • All or some rows rejected
  • All or some rows discarded
  • Discontinued load

Error code 1 would indicate "Command-line or syntax errors".
Re: sqlldr - exit error code 2 in unix [message #225055 is a reply to message #225046] Fri, 16 March 2007 15:52 Go to previous messageGo to next message
Niyam
Messages: 3
Registered: March 2007
Junior Member
Hi Brian,

Thank you so much for your quick reply. I found that information (incorrect usage) by google search on
"unix error code 2".
But how do we ignore this error and continue with the
script? I know there are some duplicate records which
should not load, because I created unique index on
a field.
I was able to echo the error to the logfile and continue
with the process. Please advise if you have any better
solution than that, to ignore that error and continue
with the process.

Thank you very, very much!
Re: sqlldr - exit error code 2 in unix [message #225068 is a reply to message #225055] Fri, 16 March 2007 19:26 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
If you know there are going to be errors and you want to ignore those records and continue with the load, you can specify ERRORS on the command line when you run sqlldr. You can set ERRORS to a high value (ie. ERRORS=9999999).

HTH
Re: sqlldr - exit error code 2 in unix [message #225317 is a reply to message #225068] Mon, 19 March 2007 12:27 Go to previous messageGo to next message
Niyam
Messages: 3
Registered: March 2007
Junior Member
Hi Brian,

Thank you for your reply. Load has been successful all the time but I should not check the error condition (since I know there are going to be some errors) in order to continue the process I guess. But adding errors=9999999 and checking the error condition with $? will have the same result which will abort the process.
I really appreciated your time/effort in replying to my questions. Thanks very much and have a great day!
Re: sqlldr - exit error code 2 in unix [message #408588 is a reply to message #225068] Wed, 17 June 2009 00:40 Go to previous messageGo to next message
ctbalamurali
Messages: 11
Registered: June 2009
Junior Member
Hi pls provide your suggestion,

I'm using following command to th data.

sqlldr callctestapp/big5#ben@COMPASS_QA_APP, control=./EOBReportMember.ctl, log=../logs/reportMember.log, ERRORS=9999999

Flat file have 3 records, among hem 1 is dplicate. So two records are ussesfully loaded into the table.


But while running echo $? it give 2. Hence the script is getting failed. Can you please give your suggetion on this. Thanks in advance
Re: sqlldr - exit error code 2 in unix [message #408688 is a reply to message #408588] Wed, 17 June 2009 05:39 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Exit code 2 simply indicates warning.
Re: sqlldr - exit error code 2 in unix [message #408729 is a reply to message #408688] Wed, 17 June 2009 07:28 Go to previous message
ctbalamurali
Messages: 11
Registered: June 2009
Junior Member
Thanks for reply.

I'm using "set -e" command in shell script whic call the sqlldr. This makes the exit from the firther execution.

How to handle exit code - warning 2 in shellscript? Whether "set -e" should not be used in shell script while calling sqlldr? How thi scenario is usually handled? Please advise.

Previous Topic: issue with import
Next Topic: sqlldr using decode for converting amount fields
Goto Forum:
  


Current Time: Thu Dec 08 14:39:56 CST 2016

Total time taken to generate the page: 0.10267 seconds