LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-06-2015, 11:46 PM   #16
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288

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.
 
Old 01-08-2015, 11:00 PM   #17
santosh0782
Member
 
Registered: Nov 2013
Posts: 132

Original Poster
Rep: Reputation: Disabled
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 :-)
 
Old 01-09-2015, 02:41 AM   #18
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,850
Blog Entries: 36

Rep: Reputation: 455Reputation: 455Reputation: 455Reputation: 455Reputation: 455
You're welcome.
 
Old 01-19-2015, 11:18 PM   #19
santosh0782
Member
 
Registered: Nov 2013
Posts: 132

Original Poster
Rep: Reputation: Disabled
script is working fine. Thanks a lot for all your help :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Appending Error to a File in unix script Saratha Linux - Newbie 4 04-19-2013 04:19 AM
script to telnet unix to unix and do some task divyashree Programming 10 07-27-2012 03:28 AM
Unix script help javaholics Linux - General 2 04-20-2010 10:19 AM
Unix Script Help Need deven1174 Programming 41 11-06-2009 01:14 PM
How to schedule unix script periodically from unix os level??? gopi_20us Programming 2 03-11-2002 07:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration