Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sqlplus: not found.

Status
Not open for further replies.

tekpr00

IS-IT--Management
Jan 22, 2008
186
CA
Hello All,

I have a code that is calling login into database via sqlplus.

When I run the script from command line. It was able to log into the database. However, when I call the script from cronatb it says sqlplus: not found.

Here is the sameple of the script.

#!/bin/ksh
#at -k -m -f /export/home/oracle/batch/run_dump 0030
#
exec >/export/home/oracle/batch/dump_`date '+%Y%m%d'`.log 2>&1
#
ORACLE_SID=sid; export ORACLE_SID
ORALCE_HOME=/appl/oracle/10.1.0/bin; export ORACLE_HOME
export PATH=$ORACLE_HOME/bin:$PATH
sqlplus sidprod/`cat /export/home/oracle/batch/.ora_passwd`<<!
select sysdate from dual;
exit

Again, this executed fine from command line, however, calling it from crontab gives error sqlplus not found.

Here is the entry for crontab:
02 14 * * * /export/home/oracle/batch/dump_wrapper.sh >> /dev/null 2>&1

Please help
 
Your error strongly suggests that your $ORACLE_HOME/bin directory isn't in your PATH variable when cron executes the script. If you are giving an accurate representation of your script, the cause is that you mistyped "ORACLE_HOME" as "ORALCE_HOME" within the script.
 
Typically (even when spelled correctly) you don't include the bin in the home...
ORALCE_HOME=/appl/oracle/10.1.0/bin; export ORACLE_HOME

should be

ORACLE_HOME=/appl/oracle/10.1.0; export ORACLE_HOME
 
Hi,
dbtoo2001 is correct, you have the correct way to add the bin to your path:
tekpr0 said:
export PATH=$ORACLE_HOME/bin:$PATH
but do not use the bin part in the ORACLE_HOME setting, otherwise Oracle will look for SqlPlus in $ORACLE_HOME/bin/bin




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
thanks all, this is now resolved by adding this to the crontab.

. /etc/profile; . $HOME/.profile;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top