views:

141

answers:

1

I created an app which is need to run in linux started by crontab. An error happened when it tried to connect oracle database: it returned SQLO_INVALID_DB_HANDLE. But if started it manually everything is okay.

I bet there are no path-related mistakes here, because everything goes well except the connection to the Oracle database. Oracle8 functions are used in my code.

thanks

+3  A: 

Oracle uses a couple of environment variables, like ORACLE_HOME, TNS_HOME, ORACLE_SID. They might be missing from your crontab environment.

Thilo
+1 try wrapping your app with a shell script that sets the environment variables and see if that fixes the problem.
ConcernedOfTunbridgeWells
I tried to export my root env into crontab script, that works, thanx
Macroideal