Skip to content

Instantly share code, notes, and snippets.

@tpjfern03
Created November 28, 2018 18:16
Show Gist options
  • Select an option

  • Save tpjfern03/36159199d21bdab1dc24ac42ba56ee92 to your computer and use it in GitHub Desktop.

Select an option

Save tpjfern03/36159199d21bdab1dc24ac42ba56ee92 to your computer and use it in GitHub Desktop.
Check Logs after Oracle Load
echo "Loading data....."
sqlldr schema/pw@sid control=hdc_stage_points.ctl rows=10000 bad=hdc_stage_points.bad log=hdc_stage_points.log errors=100000
# Wait until the data is loaded & log file is available
cat hdc_stage_points.log | grep "Rows successfully loaded." > temp.log
IFS=" "
while read -r records b c d; do
export RC=$records
#echo "${RC}"
done < temp.log
#echo "Result:${RC}"
if [[ "${RC}" -ne "0" ]]; then
#Data was loaded
echo `cat temp.log`
else
#Data Errors
echo "Data Load Errors..."
cat hdc_stage_points.log | grep "Rows not loaded because all WHEN clauses were failed" > temp.log
#RC=`cat temp.log | grep -i errors | wc -l`
echo `cat temp.log`
cat hdc_stage_points.log | grep "Rows not loaded because all fields were null" > temp.log
#RC=`cat temp.log | grep -i failed | wc -l`
echo `cat temp.log`
exit 1
fi
sleep 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment