Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a shell script that if run manually or via Cron executes fine and loads a delimited file using sqlldr to the database successfully.

However via Autosys the script executes, sqlldr says it was successful, however the data is never actually loaded into the database.

Has anyone ever experienced this before with the sqlldr/Autosys combination, and if so, knows of a workaround/fix?

share|improve this question

Could be a bunch of reasons. One that I experienced was that, with a batch job, one of the startup scripts was bypassed and the LANG environment variable was unset, which affected the langauge settings for the database connection, including the default date format/language, which meant that records were rejected because the dates were invalid.

Less obscure ones may be path related (couldn't find the datafile, the control file) or security related (database function may try to record a terminal).

SQLLDR should produce a LOG file and a BAD file of rejected records, which may give a hint

share|improve this answer

This is the script


export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_2
export ORACLE_SID=orcl
. oraenv

sqlldr system/123456@orcl control=test.ctl,DATA=test.dat,ERRORS=100000000,MULTITHREADING=true,BAD=test.bad

cat test.bad >> rejected.txt
share|improve this answer

Where is the "oraenv" being dotted in from by the . oraenv line. Could it be that when run from autosys the pwd is different?

Try putting "set -x" in the script after the !/bin/sh in your script.

Should'nt that be a !#/bin/sh rather than !/bin/sh

Autosys should be able to generate some STDERR/STDOUT logs. Can you post those?

share|improve this answer

This is correct Syntax to run through CRONTAB or any other Scheduling system for sqlldr

export LD_LIBRARY_PATH=/oracle/ora9/lib:$LD_LIBRARY_PATH export ORACLE_HOME=/oracle/ora9 export PATH=/oracle/ora9/bin:$PATH

sqlldr userid=user/password@db \ control=/Path/to/control/file.ctl \ data=/give/datafile/path/datfile \ log=same for log \ bad=same for bad errors=999

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.