LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error with Unix script (https://www.linuxquestions.org/questions/linux-newbie-8/error-with-unix-script-4175529782/)

evo2 01-06-2015 10:46 PM

Hi,

do you source something to setup your environment to use the oracle db in your login shell? If so, have you consider sourcing the same thing in your cron script? Did you check your .bashrc, .profile, etc...?

Evo2.

santosh0782 01-08-2015 10:00 PM

Hi,

I have exported all the oracle env variables and it worked for today's run,Thanks a lot. i'll check another run as well.
modified code:
Code:

#!/usr/bin/ksh
#--------------------------------------------------------------------------------------------------------------#
export PATH=$PATH:/usr/oracle/client_11g/product/11.2.0/client11g/bin
ORACLE_PATH=/usr/oracle/client_11g/product/11.2.0/client11g/bin ; export ORACLE_PATH
ORACLE_SID=BARP2 ; export ORACLE_SID
ORACLE_HOME=/usr/oracle/client_11g/product/11.2.0/client11g ; export ORACLE_HOME
#qz='sqlplus barcqz/xdr56yhn@BARP2'
#wdc='sqlplus barcwdc/xdr56yhn@BARP2'
#--------------------------------------------------------------------------------------------------------------#
sqlplus barcqz/xdr56yhn@BARP2 <<EOF
update qz_dates set QZ_DT = sysdate;
update qz_dates_back set QZ_DT = sysdate;
update wdc_dates set WDCDATE = sysdate;
update WDC_PAY_EXRATE set WPESENTDATE = to_char(sysdate,'DD-MON-YY:HH:MI:SS') ;
update WDC_OU_STARTTIME set WOSBUSINESSDATE =sysdate;
commit;
exit
EOF

sqlplus barcwdc/xdr56yhn@BARP2 <<EOF
update WDC_PAY_EXRATE set WPESENTDATE=(substr(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),1,10)||'T'||substr(to_char(sysdate,'yyyy-mm-dd hh24:mi:ss'),12,19));
commit;
exit
EOF

Thanks a lot :-)

sag47 01-09-2015 01:41 AM

You're welcome.

santosh0782 01-19-2015 10:18 PM

script is working fine. Thanks a lot for all your help :-)


All times are GMT -5. The time now is 11:36 PM.