Rsh & Sqlldr

Dear expert,

Can we invoke sqlldr command remotely.
When I try rsh command in machine 10.1.65.116, it's failed on sqlloader command. However, nothing wrong on the shell scripts or environment setting of the remote environment, I able to execute in the scripts in remote machine.

in machine 10.1.65.116
$ rsh 10.1.65.176 -l ciopr01 ksh sqlldr.ksh
Result : sqlldr: not found
<<<Dun not understand why >>>

in machine 10.1.65.176
$ ksh sqlldr.ksh
Result : Data successfully loaded

Regards

This is going to be a matter of env variables , at least u need to load the PATH to reach sqlldr inside the sqlldr.ksh script.

Regards.

All the paths inside sqlldr.ksh is hardcode and I'm able to execute the script in machine B (10.1.65.176).
I failed execute the scripts via remotely in machine A (10.1.65.116)

For verify the problem:

rsh 10.1.65.176 -l ciopr01 ksh "which sqlldr"

To solve you need to build a new script , ex Loader.sh , with to functions:

1) Load the var and export it.

2) Run the sqlldr.ksh

Then:

rsh 10.1.65.176 -l ciopr01 ksh "Loader.sh"

I have tried to put env setting below inside Sqlldr.ksh
"
LD_LIBRARY_PATH=/oracle/product/10.1.0.4/CIDM/bin/
export $LD_LIBRARY_PATH
"

But, it showed error message :
/oracle/product/10.1.0.4/CIDM/bin/: is not an identifier

remove the $ from your export line

export LD_LIBRARY_PATH

No, is still not working after removing the '$' sign from shell scriipt.
I still will get " sqlldr: not found" error message

I have try command below to check sqlldr env variables, but it still could not work.

$ ldd -s sqlldr
--
LD_LIBRARY_PATH=/oracle/product/10.1.0.4/CIDM/lib32:/oracle/product/10.1.0.4/CIDM/lib:/usr/lib
export LD_LIBRARY_PATH
---

it looks like your PATH variable is not setup correctly. Verify the path to the sqlldr program and add it to the script.

ie:

export PATH=$PATH:/my/path/to/the/sqlldr/binary

Actually, I'm able to print all the paths of remote host. Therefore, I can conclude that the env setting should be correct.

<<In remote host>>
$ echo "Oracle= ${ORACLE_HOME}"
RESULT:
Oracle=/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/fcms/bin:/usr/contrib/kwdb/bin:/usr/bin/X11:/opt/graphics/common/bin:/opt/upgrade/bin:/usr/contrib/bin/X11:/opt/ipf/bin:/opt/resmon/bin:/opt/perf/bin:/opt/prm/bin:/opt/ignite/bin:/opt/aCC/bin:/opt/sec_mgmt/bastille/bin:/opt/caliper/bin:/opt/gnome/bin:/opt/mozilla:/opt/wbem/bin:/opt/wbem/sbin:/opt/mx/bin:/opt/sec_mgmt/spc/bin:/opt/langtools/bin:/oracle/product/10.1.0.4/CIDM/bin:.

However, I encounter I dun have privilege to print all the path of remote host from local host.
RESULT:
Oracle= /oracle/product/10.1.0.4/CIDM
DATA_PATH=/recovery/dmprod/prepaid_loading/input/inp/
CTL_FILE=/recovery/dmprod/prepaid_loading/scripts/control/TRANSNT_SRC_LOG_INP.ctl
/usr/bin:/usr/ccs/bin:/usr/bin/X11:/usr/contrib/bin:/usr/local/bin:
Func_Sqlldr[18]: sqlldr: not found

<<my script>>
echo "Oracle= ${ORACLE_HOME}"
Func_Sqlldr "${DATA_PATH}" "${CTL_FILE}"

Func_Sqlldr() {

CONNECTION_STRING="${USER_ID}/${PASSWORD}@${DATA_SOURCE_NAME}"
for PROCESS_FILE in `ls -1 *`
do
DATA_FILE="${DATA_PATH}${PROCESS_FILE}"
echo $PATH
echo "I am in sqlldr"
echo "PROCESS_FILE ==${PROCESS_FILE}"

   sqlldr\\
   userid=$\{CONNECTION_STRING\}\\
   control=$\{CTL_FILE\}\\
   data=$\{DATA_FILE\}\\
   log=$\{SQLLDR\_LOG_FILE\}\\
   bad=$\{SQLLDR\_BAD_FILE\}\\
   errors=$\{REC\_ERROR_ALLOW\}\\
   rows=$\{ROWS\}\\
   bindsize=$\{BINDSIZE\}\\
   direct=$\{DIRECT\}\\
   silent=$\{SILENT\} 2&gt; $\{SQLLDR\_ERROR_FILE\}
       echo "complete"
done

}

Second, I try to hardcode the env path of sqlldr
Func_Sqlldr() {

CONNECTION_STRING="${USER_ID}/${PASSWORD}@${DATA_SOURCE_NAME}"
for PROCESS_FILE in `ls -1 *`
do
DATA_FILE="${DATA_PATH}${PROCESS_FILE}"
echo $PATH
echo "I am in sqlldr"
echo "PROCESS_FILE ==${PROCESS_FILE}"

   /oracle/product/10.1.0.4/CIDM/bin/sqlldr\\
   userid=$\{CONNECTION_STRING\}\\
   control=$\{CTL_FILE\}\\
   data=$\{DATA_FILE\}\\
   log=$\{SQLLDR\_LOG_FILE\}\\
   bad=$\{SQLLDR\_BAD_FILE\}\\
   errors=$\{REC\_ERROR_ALLOW\}\\
   rows=$\{ROWS\}\\
   bindsize=$\{BINDSIZE\}\\
   direct=$\{DIRECT\}\\
   silent=$\{SILENT\} 2&gt; $\{SQLLDR\_ERROR_FILE\}
       echo "complete"
done

}

However, encounter a new error message again
�Message 2100 not found; No message file for product=RDBMS, facility=ULMessage 2100 not found; No message file for product=RDBMS, facility=UL�