Q

Error while loading shared library

I created my backup scripts. When I set the script in the cron it does not execute, but it can be done at the shell command. The error message is as follows: "error while loading shared library:libclntsh.so.9.0:cannot open shared object file: no such file or directory." I checked the link in ORACLE_HOME/lib and it exists.

I created my backup scripts. When I set the script in the cron it does not execute, but it can be done at the shell command. The error message is as follows: "error while loading shared library:libclntsh.so.9.0:cannot open shared object file: no such file or directory." I checked the link in ORACLE_HOME/lib and it exists. I need help.
When a shell script executes, it knows nothing of the environment variables you have set up for your session. So you'll have to code your $ORACLE_HOME and $LD_LIBRARY_PATH environment variables in your script as well. The script works in your session because you have these env vars defined. But running in cron runs without these env vars. A good way to test your cron scripts is to run them in your session with the "sh -x" command similar to the following:
sh -x scriptname
This comes the closest to mimicing how cron runs your script.
This was first published in February 2006

Dig deeper on Oracle database backup and recovery

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close