Visit Our UNIX and Linux User Community

sqlplus: not found

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sqlplus: not found
# 1  
Old 10-21-2009
Error sqlplus: not found

Hi All ,
At the end I have to post my problem thinking I'll be able to get a clue.

I have done a shell script to access a table in our database to extract some logs .
Script is working when executed manually ,but when I set it up in cronjob it is not working. I know thins should be a environment issue but i cant correct it .I red some posts and did some adjustments to the script but still not successful.

My script is -

set -x

#export ORACLE_SID=ictprd
#export ORACLE_BASE=/opt/apps/oracle/product
#export ORACLE_HOME=${ORACLE_BASE}/10204
#export TNS_ADMIN=${ORACLE_HOME}/network/admin
#export ORACLE_OWNER="oracle"
#export ORACLE_LIB_DIR=lib


prvdate=`cat pdate.log`

sdate=`date "+%Y/%m/%d %T"`

echo $sdate > pdate.log

. ${HOME}/.profile

sqlplus -s  yyyyy/dddd@xxx <<EOF


spool msglg.log

SELECT *****
WHERE time_logged BETWEEN to_date('$prvdate','yyyy/mm/dd hh24:mi:ss') AND to_date('$sdate','yyyy/mm/dd hh24:mi:ss') AND fk_seve <= 8 ;
spool off

if [[ -s msglg.log ]] ; then 
cat msglg.log | mailx -s "CRITICAL AND ERROR  MESSAGE" $mlidd 
rm msglg.log


when i redirect script output from cron it says "sqlplus not found"


Last edited by pludi; 10-21-2009 at 10:45 AM.. Reason: code tags please...
# 2  
Old 10-21-2009
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums
# 3  
Old 10-21-2009
My script is working , no issues

Previous Thread | Next Thread
Test Your Knowledge in Computers #875
Difficulty: Medium
The primary mission of is to be a shell script writing forum.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Problem on SQLplus command ""bash: sqlplus: command not found""

Hi all, i face an error related to my server ""it's running server"" when i use sqlplus command $ sqlplus bash: sqlplus: command not found the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup. i already check the directory... (4 Replies)
Discussion started by: clerck
4 Replies

2. UNIX for Dummies Questions & Answers

Unable to configure Oracle sqlplus V12 properly. Need Help. Resources could'nt be found elsewhere .

I installed Oracle sqlplus on My Ubuntu 14.04 64bit version as per the instructions on: help.ubuntu page (Unable to post the URL as i'm new user here). I'm totally new to SQL and now i'm learning queries in my college. I installed 64bit version of sqplus and run it executing the command:... (14 Replies)
Discussion started by: arjunmayilvagan
14 Replies

3. Shell Programming and Scripting

Sqlplus error - sqlplus -s <login/password@dbname> : No such file or directory

i am using bash shell Whenever i declare an array, and then using sqlplus, i am getting sqlplus error and return code 127. IFS="," declare -a Arr=($Variable1); SQLPLUS=sqlplus -s "${DBUSER}"/"${DBPASS}"@"${DBASE} echo "set head off ; " > ${SQLCMD} echo "set PAGESIZE 0 ;" >> ${SQLCMD}... (6 Replies)
Discussion started by: arghadeep adity
6 Replies

4. Shell Programming and Scripting

Sqlplus Help

When i run the following script am getiing the output correct but i want to get it in the form of a table, could any one help me please. the script is a s follows count=`sqlplus -s $ORACLE_ACCOUNT << EOF set heading off set wrap on set feedback off column ChangeNumber format a12 column... (9 Replies)
Discussion started by: jhon1257
9 Replies

5. UNIX for Dummies Questions & Answers

SQLPLUS not found

hi, I am new to unix and trying to connect to oracle from unix. I typed the below command and the error is sqlplus not found $ sqlplus -ksh: sqlplus: not found can someone please tell me what is missing? I see that oracle is available on this unix box in the path /opt/oracle as... (7 Replies)
Discussion started by: Vijay81
7 Replies

6. Ubuntu

sqlplus: command not found

I installed Oracle in Ubuntu installation was well,i could even open isqlplus( http://ubuntu.ubuntu-domain:5560/isqlplus/workspace.uix ) and execute some queries..But,back in terminal when i try to login to sqlplus i am getting error (20 Replies)
Discussion started by: sandy0594
20 Replies

7. Shell Programming and Scripting

sqlplus : not found

Hi, Below is my script: #!/bin/sh sqlplus uname/pwd@instance <<EOF set wrap off set feedback off set pagesize 0 set verify off set trimspool on set linesize 5000 spool /arboru02/FX/scripts/customer_profile_def.txt select... (1 Reply)
Discussion started by: ss_ss
1 Replies

8. HP-UX

sqlplus: command not found

hi, i need bash shell script run on the crontab(Unix tru64). i have write my shell. it's using sqlplus command and connect to oracle db. execute cron job when i have error messege: "sqlplus: command not found" have you any suggestion? (4 Replies)
Discussion started by: Tlg13team
4 Replies

9. Shell Programming and Scripting


I am looking to loop round a load of files and execute each in sqlplus, I have looked at the forum to see what was posted in the past, but most of the examples seem to use the sql being passed in through the script, which is not really what I am looking for, can someone tell me if the code below is... (9 Replies)
Discussion started by: LiquidChild
9 Replies

10. Shell Programming and Scripting

how can i check in csh if command found or not found ?

hello all im trying to use in sun Solaris the information received from the top command now i several machines that dont have install the top program so when im running the script im geting error saying after im running this code : set MemoryInfo = `top | grep Memory` if (... (2 Replies)
Discussion started by: umen
2 Replies

Featured Tech Videos