Hi There,
Appreciate if anyone can help.
I am running a dsjob using remote shell. Where the source file is placed in different host and the dsjob will do rsh to do sqlldr. However, I encountered the below error that
Func_Sqlldr[27]: sqlldr: not found
and the log file wasn't there also.
Here i posted my sqlload function for reference:
Func_Sqlldr() {
CONNECTION_STRING="${USER_ID}/${PASSWORD}@${DATA_SOURCE_NAME}"
DATA_PATH=${1}
CTL_FILE=${2}
cd ${DATA_PATH}
for PROCESS_FILE in `ls -1 *`
do
DATA_FILE="${DATA_PATH}${PROCESS_FILE}"
SQLLDR_LOG_FILE="${LOG_PATH}/${PROCESS_FILE}_trn.log"
SQLLDR_BAD_FILE="${LOG_PATH}/${PROCESS_FILE}.bad"
SQLLDR_ERROR_FILE="${LOG_PATH}/${PROCESS_FILE}_trn.error"
Func_Log_Writer "----------------------------------------------------------"
Func_Log_Writer "Start sqlldr ${PROCESS_FILE}"
Func_Log_Writer "Connection string=${CONNECTION_STRING}"
Func_Log_Writer "Data file=${DATA_FILE}"
Func_Log_Writer "Control file=${CTL_FILE}"
Func_Log_Writer "Log file=${SQLLDR_LOG_FILE}"
Func_Log_Writer "Bad file=${SQLLDR_BAD_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> "${SQLLDR_ERROR_FILE}"
SQLLDR_RETURN_CODE=$?
Func_Log_Writer "Sqlldr return code ${SQLLDR_RETURN_CODE}"
#*** Removing Source file ***
if [[ ${RETURN_CODE} != "1" ]]; then
Func_Remove_File "${DATA_FILE}"
fi
done
cd ${CONTROLLER_PATH}
}
Thanks.
Issue on running sqlldr while using rsh
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 76
- Joined: Mon Mar 05, 2007 9:26 pm
- Location: Malaysia
Welcome. :D
sqlldr isn't in your path on the remote system, hence it cannot be found. And there's no log file because you never launched sqlldr... unless you mean whatever Func_Log_Writer is supposed to do. If so, don't see how anyone can comment on that with no source.
So it seems you'll need to ensure your environment is correct over there, either in the remote user's .profile or better yet explicitly in your script. At the very least that would mean establishing the full pathname to sqlldr over there.
sqlldr isn't in your path on the remote system, hence it cannot be found. And there's no log file because you never launched sqlldr... unless you mean whatever Func_Log_Writer is supposed to do. If so, don't see how anyone can comment on that with no source.
So it seems you'll need to ensure your environment is correct over there, either in the remote user's .profile or better yet explicitly in your script. At the very least that would mean establishing the full pathname to sqlldr over there.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 76
- Joined: Mon Mar 05, 2007 9:26 pm
- Location: Malaysia
-
- Participant
- Posts: 76
- Joined: Mon Mar 05, 2007 9:26 pm
- Location: Malaysia
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: