Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi
I need to automate an sql loader process in unix. i already have an control file, data file.
All I need is to write a unix shell script. that accepts userid and pwd. it must set the oracle_home and call the sqlldr.
i have tried it but getting "ORACLE_HOME is not an valid identifier" error.
I will invoke this script from Appworx scheduler.Thanks in advance
Thanks & Regards
Raghu Raja

export LD_LIBRARY_PATH=/opt/oracle/product/9.2.0.5/lib:$LD_LIBRARY_PATH
export ORACLE_HOME=/opt/oracle/product/9.2.0
export PATH=/opt/oracle/product/9.2.0.5/bin:$PATH
sqlldr userid = ${userid=ops$NGPTQMS/JA3743@evncpad1.ae.ge.com}
control = ${/evncpaq1/apps/cp/cm/r11.5.10/geae/gl/include/PAY0001_test.ctl}
data = ${/evncpaq1/data/infile/mon_gross_det.dat}
log = ${/evncpaq1/data/infile/mon_gross_det.log}
discard = ${/evncpaq1/data/infile/mon_gross_det.dis}
#bad = ${BAD_FILE}
errors = 999if [$ ? -ne 0]
then echo "Error ! The sql loader call failed "
exit 1
fiwhen i execute
$ sh m_load.sh
i am getting err as
m_load.sh: LD_LIBRARY_PATH=/opt/oracle/product/9.2.0.5/lib:: is not an identifierThanks & Regards
Raghu Raja

I found some other errors in the script.
The correct one is as follows: (The space is important most of time in script and there is no blanks after \)
export LD_LIBRARY_PATH=/opt/oracle/product/9.2.0.5/lib:$LD_LIBRARY_PATH
export ORACLE_HOME=/opt/oracle/product/9.2.0
export PATH=/opt/oracle/product/9.2.0.5/bin:$PATHsqlldr userid=ops$NGPTQMS/JA3743@evncpad1.ae.ge.com \
control=${/evncpaq1/apps/cp/cm/r11.5.10/geae/gl/include/PAY0001_test.ctl} \
data=${/evncpaq1/data/infile/mon_gross_det.dat} \
log=${/evncpaq1/data/infile/mon_gross_det.log} \
discard=${/evncpaq1/data/infile/mon_gross_det.dis} \
errors=999#bad=${BAD_FILE} \
if [ $? -ne 0 ]; then
echo "Error ! The sql loader call failed "
exit 1
fi
Luke Chi

Thanks Luke and james for your efforts and replies.
actually my user name is "ops$ngptqms"
since $ngptqms refers to variable. i replaced it with "ops\$ngptqms" now its working fine.Thanks & Regards
Raghu Raja

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |