Issue on running sqlldr while using rsh
Posted: Sun Dec 30, 2007 1:03 am
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.
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.