Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sqlplus "command not found" connecting with ssh

Re: sqlplus "command not found" connecting with ssh

From: Matthias Hoys <anti_at_spam.com>
Date: Mon, 11 Dec 2006 23:37:22 +0100
Message-ID: <457ddda3$0$30047$ba620e4c@news.skynet.be>

"zauberberg" <jwberg_at_verizon.net> wrote in message news:1165861817.628176.283780_at_73g2000cwn.googlegroups.com...
>
> _mamarin_ wrote:
>> Thanks to you all...
>>
>> "sourcing" the bash_profile into my script was the besto option at
>> least!!
>>
>> #!/bin/bash
>> . ~/.bash_profile
>>
>> :D
>>
>> Matthias Hoys ha escrito:
>>
>> > "_mamarin_" <ma.marin.m_at_gmail.com> wrote in message
>> > news:1165840799.769946.39610_at_16g2000cwy.googlegroups.com...
>> > > 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_at_host script.sh
>> > > The script only connects sqlplus (sqlplus user_at_pass/DB_SID)
>> > > And I get the followin message:
>> > > bash: sqlplus: command not found
>> > >
>> > >
>> > > Any ideas?
>> > >
>> > > Thanks a lot
>> > >
>> >
>> > Define the environment variables (ORACLE_HOME, ...) in the shell
>> > script, or
>> > use the full path to the sqlplus executable, or (the best solution
>> > maybe),
>> > "source" the .bash_profile file inside your script :
>> >
>> > #!/bin/bash
>> > . ~/.bash_profile
>> > sqlplus ...
>> >
>> >
>> > Matthias
>
> sourcing .bash_profile creates a dependency on the profile contents.
> You may want to code the ORACLE_HOME, ORACLE_SID, and PATH insde the
> script or inside an oracle specific environment script. I've seen
> batch jobs break when someone "cleans up" the .profile for the
> application user.
>

Well it's one way or the other one :-) Or you keep them centralized in 1 script, or you manually maintain 74.354 different shell scripts in 7.456 different directories :-) I don't think "cleaning up" .profile files is a good thing to do ;-)

Matthias Received on Mon Dec 11 2006 - 16:37:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US