Cron job fails with [DataDirect][ODBC lib] Connection not open error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cron job fails with [DataDirect][ODBC lib] Connection not open error
# 1  
Old 10-19-2012
Cron job fails with [DataDirect][ODBC lib] Connection not open error

Hi,

When run the script directly...it executes as expected. But when put it in crontab the job fails with this error:

Code:
[DataDirect][ODBC lib] Connection not open
 08003: [DataDirect][ODBC lib] Connection not open
  Unable to connect to the database...

how come it is not able to connect when cron job fires?... Do I need to set environment (Oracle Home, PATH..etc.,) in the script?

Appreciate your help.

---------- Post updated 10-19-12 at 04:01 PM ---------- Previous update was 10-18-12 at 07:16 PM ----------

Any inputs ..plz

Last edited by Scott; 10-19-2012 at 08:04 AM.. Reason: Code tags
# 2  
Old 10-19-2012
Quote:
Do I need to set environment (Oracle Home, PATH..etc.,) in the script?
Most probably.
Code:
ORAENV_ASK=NO
ORACLE_SID=DB1
. /usr/local/bin/oraenv # or wherever oraenv is located

I haven't used ODBC in about a hundred years, but I hope this helps Smilie
This User Gave Thanks to Scott For This Post:
# 3  
Old 10-24-2012
Setting the Oracle Home, SID doesn't help. Still getting the same error mentioned earlier. Any other thoughts please.
# 4  
Old 10-25-2012
Can you source your profile file in the cron entry and re-try?

Code:
* * * * * . .profile; <your script>

This User Gave Thanks to Yoda For This Post:
# 5  
Old 10-25-2012
Hi Bipinajith,

Thanks a lot. Its working after making changes as you suggested.
# 6  
Old 03-06-2013
Hi..

i am facing the same issue. tried with the solution provided, not working. help me with this.

here is my cron entry
Code:
* * * * * . .profile; 30 13 * * * /home/sbluser/scripts/FullCompile.sh

thanks in advance,

Last edited by Franklin52; 03-06-2013 at 04:14 AM.. Reason: Please use code tags for data and code samples
# 7  
Old 03-06-2013
can you try it to run job in one single crontab entry as mentioned by Bipinajith.

Code:
* * * * * . .profile;  /home/sbluser/scripts/FullCompile.sh

if it is not working then let us know what error you are getting.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Establish ODBC connection from Linux

Hi All, I want to establish a ODBC connection to a database from linux and query the tables of a database. Please let me know how I can achieve this. Thanks and Regards Nagaraja Akkivalli. (0 Replies)
Discussion started by: Nagaraja Akkiva
0 Replies

2. UNIX for Advanced & Expert Users

Cron job fails every now and then.

I added a shell script to cron that executes every 5-15 minutes. It's used to monitor multiple environments, so it has to ssh to each machine to check the status of that machine. Sometimes, I may have more than one instance of this script running at the same time. So, here's my problem. I've... (2 Replies)
Discussion started by: mrwatkin
2 Replies

3. UNIX for Dummies Questions & Answers

If FTP cron job fails to connect = quit

Im having a problem with my ftp CRON jobs. I have another related (but not the same question in shell scripting). My FTP CRON jobs connect to a server and drop some files off, if for some reason it cannot connect to the server (timesout/password wrong etc) instead of stopping, it tries again... (3 Replies)
Discussion started by: mokachoka
3 Replies

4. Shell Programming and Scripting

cron job error

HI am having a script file which is ok if i run from the server manually like <root@hostname:/space/canvas/home/lbs/current/internalcdrbackup/LES_CDR_Configuration/0/MSISDNcdrCount > /space/canvas/home/lbs/current/internalcdrbackup/LES_CDR_Configuration/0/MSISDNcdrCount.txt the... (2 Replies)
Discussion started by: aemunathan
2 Replies

5. Solaris

messages error can not open module /usr/lib/security/pam_unix_session.so.1

Hi, I always receive the following intermittent error on the /var/adm/messages, can someone help me please on what to do and what to check for these errors to disappear? What can be the problem with my ftp? Please see details of solaris below. Thanks in advance! SunOS 5.10 Generic_127111-08... (4 Replies)
Discussion started by: ayhanne
4 Replies

6. Solaris

/usr/lib/snmp/snmpdx: can't open the file - Error Messages while rebooting

I have an X4500 server running solaris 10 and when I reboot my system it displays the following errors messages. Could someone help me with this ??? NOTICE: pci8086,1011 - e1000g : Adapter 100Mbps full duplex copper link is up. Nov 8 17:41:46 /usr/lib/snmp/snmpdx: can't open the file Nov 8... (2 Replies)
Discussion started by: bharu_sri
2 Replies

7. Shell Programming and Scripting

Error in cron job;

Hi All, please help me out with this problem. While running my mail_out_original.ksh in CRT window, it disconnects from the server saying not connected Here is my code : (please see the attachment) ____________________________________________________________ #!/bin/ksh ## Load... (1 Reply)
Discussion started by: shruthinagaraj
1 Replies

8. Shell Programming and Scripting

Cron job fails, but works fine from command line

I have a very basic script that essentially sends a log file, via FTP, to a backup server. My cron entry to run this every night is: 55 23 * * * /usr/bin/archive_logs The script runs perfectly when executed manually, and actually worked via cron for about three weeks. However, it mysteriously... (3 Replies)
Discussion started by: cdunavent
3 Replies

9. Windows & DOS: Issues & Discussions

Oracle 9i ODBC connection

I am attempting to access an Oracle 9i database located on a Solaris server from an XP client. The server is running Oracle 9i9.2.0.1.0 and the XP is Oracle client 9i 9.2.0.1.0. When I start a listener on the server, the listener starts but I receive a message “The listener supports no services”. I... (3 Replies)
Discussion started by: jkuchar747
3 Replies

10. SCO

SCO ODBC connection to Vista?

Hi, I'm trying to make an odbc connection to a SCO db using Vista, but I'm having some troubles. In the past I have used Vision97 on either windows 98 and XP, but it will not install on Vista. Is there an alternative driver that I can use to make my connection? Any other workaround? Thanks, ... (1 Reply)
Discussion started by: knewknow
1 Replies
Login or Register to Ask a Question