This looks suspiciously like a problem with environment variables to me as well. It's been a while since I've used Oracle, so forgive me if I'm a little fuzzy on details. But I'd suggest you check not only
ORACLE_HOME, but (where appropriate)
- LD_LIBRARY_PATH,
- TNS_ADMIN, which points to TNSNAMES.ORA (this one consistently gave me grief for some reason), and
- TWO_TASK
Take a look at
this page for summary information on other Oracle environment variables.
I'd also suggest double checking %ENV from within your code to be 100% sure you are setting the environment variables correctly and double checking that TNSNAMES.ORA, library files, and the other files the environment variables are targeting are where you expect them to be based on the environment variables.
Hope this helps :-)