Hi,
When run the script directly...it executes as expected. But when put it in crontab the job fails with this error:
[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
Scott
2
Most probably.
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
1 Like
Setting the Oracle Home, SID doesn't help. Still getting the same error mentioned earlier. Any other thoughts please.
Yoda
4
Can you source your profile file in the cron entry and re-try?
* * * * * . .profile; <your script>
1 Like
Hi Bipinajith,
Thanks a lot. Its working after making changes as you suggested.
Hi..
i am facing the same issue. tried with the solution provided, not working. help me with this.
here is my cron entry
* * * * * . .profile; 30 13 * * * /home/sbluser/scripts/FullCompile.sh
thanks in advance,
can you try it to run job in one single crontab entry as mentioned by Bipinajith.
* * * * * . .profile; /home/sbluser/scripts/FullCompile.sh
if it is not working then let us know what error you are getting.
Hello Vikram..
I am running the cron with single entry only as given earlier. then also getting that error.
here are the error logs.
2013-03-05 17:38:21
2013-03-05 17:38:21 Connecting to the database...
2013-03-05 17:38:21 [DataDirect][ODBC lib] Connection not open
2013-03-05 17:38:21
2013-03-05 17:38:21 08003: [DataDirect][ODBC lib] Connection not open
2013-03-05 17:38:21 Unable to connect to the database...
2013-03-05 17:38:21 Unable to start common api.
2013-03-05 17:38:21 Error in initiate function..
2013-03-05 17:38:21 Elapsed time: 0 sec.
2013-03-05 17:38:21 (logapi.cpp (184) err=1 sys=0) SBL-GEN-00001: (logapi.cpp: 184) error code = 1, system error = 0, msg1 = (null), msg2 = (null), msg3 = (null), msg4 = (null)
---------- Post updated at 03:44 AM ---------- Previous update was at 03:36 AM ----------
Hi Vikram..
as you suggested ran the below given entry.. but its nt picking the shell script (FullCompile.sh) here.
10 14 * * * . .profile; /home/sbluser/scripts/FullCompile.sh
when the ran the below given entry, got the error as above.
* * * * * . .profile; 30 13 * * * /home/sbluser/scripts/FullCompile.sh
please help me on this.