Sqlplus not working through ssh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sqlplus not working through ssh
# 1  
Old 04-16-2016
Sqlplus not working through ssh

Hi Gurus,

I was trying to execute sqlplus command remotely like

ssh -q IP venkat@"which sqlplus"

am getting error as which: no sqlplus in (/usr/local/bin:/bin:/usr/bin)

if i connect manually and executing which sqlplus it working fine.
Please help to fix the issue.

Regard's
Venky
# 2  
Old 04-16-2016
That ssh command can't possibly work, and I'd be surprised if the error msg mentioned would show up. You need
- a target machine
- the remote command separated by a white space

What is the IP parameter for?
# 3  
Old 04-16-2016
Hi Rudic,

Sorry its a typo

ssh -q venkat@IP_ADDRESS "which sqlplus"

Regard's
Venky
# 4  
Old 04-16-2016
Pls. post the result of
Code:
ssh -q venkat@IP_ADDRESS "echo $PATH"

and
Code:
echo $PATH

when "connect(ed) manually".
# 5  
Old 04-16-2016
Hi Rudic,

here is the output in remote exec

/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/venkat/bin

when manually

Code:
echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/venkat/bin

regard's
venky

Last edited by RudiC; 04-16-2016 at 10:02 AM.. Reason: Corrected (i)code tags.
# 6  
Old 04-16-2016
Somewhat surprising... the PATH mentioned in the error msg in post#1 is much shorter that the one you show in post#5. Is that for the same user? Where does sqlplus actually reside? What are the permissions on it? How do you "manually" login?
# 7  
Old 04-16-2016
Oracle is almost never installed in the /usr tree, and should not be there. Those PATH variables will not work for a "normal" oracle install.

Normally oracle uses $ORACLE_HOME, wherever $ORACLE_HOME points

Please post the output of:
Code:
echo 'HERE' 
set
echo 'THERE' 
ssh venkat@$IP_ADDRESS  set

Your problem is in how the environment is defined on the remote machine - assuming sqlplus works on your local machine

$ORACLE_HOME must be defined correctly to start with and whatever $ORACLE_HOME/bin is, has to be in the PATH variable as well. Note: $ORACLE_HOME/bin could end with some different subdirectory, not just simply "/bin" on machines that have both old versions and newer versions of oracle (32 bit vs 64 bit)
installed.
The reason sqlplus needs the ORACLE_HOME variable defined is to find adjunct files like .msb files. Without it defined, sqlplus will start (sort of) then you get some really odd error messages.

Last edited by jim mcnamara; 04-16-2016 at 10:33 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

"SQLPLUS -S " is not working in one environment where same code is working in another

"SQLPLUS -S " is not working in one environment where same code is working in another getting below error =================================== SQL*Plus: Release 11.2.0.3.0 Production Copyright (c) 1982, 2011, Oracle. All rights reserved. Use SQL*Plus to execute SQL, PL/SQL and SQL*Plus... (1 Reply)
Discussion started by: yogendra.barode
1 Replies

2. Shell Programming and Scripting

Ssh does not support sqlplus and sudo -i?

Hey everybody, currently I am having an issue that I need to open an ssh session to a remote host, once on the remote host I need to use sudo and then execute sqlplus. Once the sqlplus call is open I need to execute one command while the sqlplus is active. For example show sga. I already got so... (3 Replies)
Discussion started by: h1kelds
3 Replies

3. Shell Programming and Scripting

Working with UTF char sqlplus

I have below SQL that I wasnt to run from a solaris machine using sqlplus select * from TABLE_NAME where regexp_like(field_value, 'Α|Β|Γ|Δ|Ε|Ζ|Η|Θ|Ι|Κ|Λ|Μ|Ν|Ξ|Ο|Π|Ρ|Σ|Τ|Υ|Φ|Χ|Ψ|Ω|α|β|γ|δ|ε|ζ|η|θ|ι|κ|λ|μ|ν|ξ|ο|π|ρ|σ|τ|υ|φ|χ|ψ|ω'); When I cat the file UTF char shows perfect however when i run... (1 Reply)
Discussion started by: varun22486
1 Replies

4. AIX

SQLPLUS -S option not working

Hi All, I am using the following script to run some sql on database but i am not getting the result. When i tried the same by removing "-s" option it is working fine but getting other things as well with my input as shown below. Can anyone please suggest why "-s" option is not working in AIX and... (2 Replies)
Discussion started by: ssk250
2 Replies

5. Shell Programming and Scripting

Ssh not supporting sudo and sqlplus commands

Hi Guys , I was facing an issue some thing like , I have to connect remote machine and should execute few commands over there , I am able to run some simple commands , but below commands are throws error like not found. eg : sudo su - username and sqlplus user/pwd@db , srvrmgr commands etc ... (8 Replies)
Discussion started by: chandini
8 Replies

6. UNIX for Dummies Questions & Answers

SSH tunnel working for ssh but not for sshfs

I'm trying to setup a link between my home pc (work-machine) and a server at work (tar-machine) that is behind a gateway (hop-machine) and not directly accessible. my actions: work-machine$ ssh -L 1234:tar-machine:22 hop-machine work-machine$ ssh -p 1234 user@127.0.0.1 - shh access on... (1 Reply)
Discussion started by: Vathau
1 Replies

7. Shell Programming and Scripting

Sqlplus Set Heading not Working

Hello, Could someone tell me why this still returns headings? echo "SELECT columnA from tableA group by columnA;" | sqlplus -s ${DB_CONNECT} set heading OFF | while read line do arr="$line" echo ${arr} let i=$i+1 done (2 Replies)
Discussion started by: flowervz
2 Replies

8. Solaris

SSH: internal working but external not working

Hi, This is a strange issue: We have an sftp server. Users can ssh to it from internal LAN without any issue, but they can not ssh to it externally via firewall. Here is what I got: OS is Solaris 9. No hosts.allow and hosts.deny files. Please help. Thank you in advance! (7 Replies)
Discussion started by: aixlover
7 Replies

9. Shell Programming and Scripting

sqlplus @ not working sqlplus \@ working..

Hi All, I am facing a strange problem on one of my unix servers. When i try to login using the standard method: it fails with below message >sqlplus REF1SSTDBO1/REF1SSTDBO1@TKS3N10G > TKS3N10G ksh: TKS3N10G: not found But it works perfectly when i escape with ;\ >sqlplus... (3 Replies)
Discussion started by: kunwar
3 Replies

10. Shell Programming and Scripting

Multiple SQLPLUS background processes not working properly

Hi All, I am running 25 background process from a Unix shell script which calls a single Oracle procedure with different paramenters each time. These 25 process creates 25 different files. When i run these 25 Background SQLPLUS processes, few files are not created completly but if i run 25... (1 Reply)
Discussion started by: rawat_me01
1 Replies
Login or Register to Ask a Question