Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1550
  • Last Modified:

Oracle sqlldr and Unix shell script

I have to run 5 sqlldr control files one by one.
If one of the file gets error then I have to stop the process.Dont need to run next control file.

So every control file I am checking the bad file is created or not if created then I am going to write odwn there exit.
if [ -s /home/loc/etc/loader_bad_1.bad ]
then
   echo "File is available"
   exit;
else
      echo "File is not available"
fi

if [ -s /home/loc/etc/loader_bad_2.bad ]
then
   echo "File is available"
   exit;
else
      echo "File is not available"
fi

if [ -s /home/loc/etc/loader_bad_3.bad ]
then
   echo "File is available"
   exit;
else
      echo "File is not available"
fi

-- Upto 5 control files.

Could you please tell me Is it right way  ?
0
digs developer
Asked:
digs developer
1 Solution
 
digs developerAuthor Commented:
please help .
0
 
johnsoneSenior Oracle DBACommented:
Isn't this a duplicate of your other question -> http://www.experts-exchange.com/Database/Oracle/Q_28488908.html
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
Basically you are on the right way. I'd suggest a loop though:

for a in load1 load2 load3 load4 load5
do
sqlldr control=$a.ctl log=$a.log bad=$a.bad ...
if [ -s $a.bad ]
then
echo "$a did not load"
exit 1
else
echo "$a OK"
fi
done;

Open in new window

0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now