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 gkittelson 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 2

Status
Not open for further replies.

TheDash

MIS
Mar 25, 2004
171
US
Hi,

I've been using sqlplus in scripts. Some from the cron run fine. But a new script that I have runs fine when run at command but complains sqlplus not found when run from cron. Any ideas?
 
as ALWAYS - check your PATH/LD_LIBRARY_PATH and/or hardwire paths to all your executables in script [that's being ran from cron].

Also you can '. <path2oracleHOME>/bin/ora.env' prior to doing anything with ORACLE.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Hi,

I am getting this now. All the executable paths seem to be ok.

Message file sp1<lang>.msb not found
Error 6 initializing SQL*Plus

When I say plain sqlplus (without path) inside it says sqlplus not found.

The sqlplus is

connect_oracle_sqlplus ()
{
/u01/app/oracle/product/8.1.7/bin/sqlplus -s /nolog << ENDSQL
whenever sqlerror exit 101
whenever oserror exit 102
connect $1/$2@$3;
set pagesize 0;
set heading off;
set termout off;
set feedback off;
set feed off;
set echo off;
set verify off;
set trimspool on;
set linesize 1000;
spool $4;
$5;
spool off;
ENDSQL
}

Any more ideas please?
 
as suggested originally:

try "sourcing" oraenv - it should be in your $ORACLE_HOME/bin

Also you can '. <path2oracleHOME>/bin/ora.env' prior to doing anything with ORACLE.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Just to see what you have different from your "online" and your "batch" add the following to your script (before any other commnand (other than the !/bin/(your_shell_of_choice))

env>/tmp/mytempenv
set>/tmp/mytempset

and then execute the "env" and "set" commands on your online section and compare.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Put the path you see when echoing $PATH as the user you're running it successfully as interactively as one of the first lines in your script. You might also include explicit export ORACLE_HOME=<your oracle home> and export ORACLE-SID=<sid> in the script too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top