PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.security.ssh > sqlplus "command not found" connecting with ssh
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.security.ssh SSH secure remote login and tunneling tools.

sqlplus "command not found" connecting with ssh

Réponse
 
LinkBack Outils de la discussion
Vieux 11/12/2006, 12h41   #1
_mamarin_
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut sqlplus "command not found" connecting with ssh

Hi you all,

I'm trying to execute an script which uses sqlplus from a remote ssh
client.
The script runs ok executing it from the server.

I'm executing the following line: ssh user@host script.sh
The script only connects sqlplus (sqlplus user@pass/DB_SID)
And I get the followin message:
bash: sqlplus: command not found


Any ideas?

Thanks a lot

  Réponse avec citation
Vieux 11/12/2006, 12h51   #2
Doug Spencer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sqlplus "command not found" connecting with ssh

On 11 Dec 2006 04:41:38 -0800
"_mamarin_" <ma.marin.m@gmail.com> wrote:

> Hi you all,
>
> I'm trying to execute an script which uses sqlplus from a remote ssh
> client.
> The script runs ok executing it from the server.
>
> I'm executing the following line: ssh user@host script.sh
> The script only connects sqlplus (sqlplus user@pass/DB_SID)
> And I get the followin message:
> bash: sqlplus: command not found
>
>
> Any ideas?
>
> Thanks a lot
>


You probably need to either specify the entire path to SQLPlus, similar to /opt/oracle/920/bin/sqlplus, or set your environment PATH prior to running SQLPlus to include the directory where SQLPlus exists.

Doug

--
For UNIX, Linux and security articles
visit http://SecurityBulletins.com/
  Réponse avec citation
Vieux 11/12/2006, 13h41   #3
_mamarin_
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sqlplus "command not found" connecting with ssh

Thanks to you all...

"sourcing" the bash_profile into my script was the besto option at
least!!

#!/bin/bash
.. ~/.bash_profile



Doug Spencer ha escrito:

> On 11 Dec 2006 04:41:38 -0800
> "_mamarin_" <ma.marin.m@gmail.com> wrote:
>
> > Hi you all,
> >
> > I'm trying to execute an script which uses sqlplus from a remote ssh
> > client.
> > The script runs ok executing it from the server.
> >
> > I'm executing the following line: ssh user@host script.sh
> > The script only connects sqlplus (sqlplus user@pass/DB_SID)
> > And I get the followin message:
> > bash: sqlplus: command not found
> >
> >
> > Any ideas?
> >
> > Thanks a lot
> >

>
> You probably need to either specify the entire path to SQLPlus, similar to /opt/oracle/920/bin/sqlplus, or set your environment PATH prior to running SQLPlus to include the directory where SQLPlus exists.
>
> Doug
>
> --
> For UNIX, Linux and security articles
> visit http://SecurityBulletins.com/


  Réponse avec citation
Vieux 11/12/2006, 15h34   #4
Chuck
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sqlplus "command not found" connecting with ssh

_mamarin_ wrote:
> Thanks to you all...
>
> "sourcing" the bash_profile into my script was the besto option at
> least!!
>




That's what you needed to do. Remember that when you remotely execute a
script, it's just like executing it from cron - you get a bare minimum
shell environment. If any command in your script depends on environment
variables like PATH or LD_LIBRARY_PATH, it's a good practice to
explicitly set them in your script. Sqlplus us one such command. Oracle
provides a script named oraenv for doing that. You source it in your script.

export ORACLE_SID=YOURSID
export ORAENV_ASK=NO
.. oraenv # (or ./usr/local/bin/oraenv)
[ rest of script ]
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h14.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11217 seconds with 12 queries