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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: lsnrctl pwd in script

Re: lsnrctl pwd in script

From: arun chakrapani rao <arunchakrapanirao_at_gmail.com>
Date: Wed, 10 Oct 2007 18:14:29 -0400
Message-ID: <a85d265d0710101514g14c370e3v4335c2b5aa15ed29@mail.gmail.com>


Thanks for this input.
I was looking for a way to move my listener logs instead of doing a dev null everytime before copying it across.
Was wondering how to get this done.
this helps me a lot.
thanks
Arun

On 10/10/07, Jared Still <jkstill_at_gmail.com> wrote:
>
>
> On 10/10/07, Joe Smith <joe_dba_at_hotmail.com> wrote:
> >
> > Has anybody scripted out changing the LISTENER password and got it to
> > work?
> >
> > I have tried a number of ways and still get errors. I can do it by
> > hand. So, I know it works.
> >
> > ${ORACLE_HOME}/bin/lsnrctl <<EOF
> > set current_listener LISTENER
> > start
> > change_password
> > ${PASSWORD}
> > ${PASSWORD}
> > ${PASSWORD}
> > save_config
> > EOF
> >
> >
> That will not work from a shell script.
>
> The EOF operator allows the shell to take input from the script (a 'here'
> document)
> but does not allow passing data to an interactive command, which is what
> the
> change_password command is.
>
> The EOF redirects STDIN from the script, but the change_password command
> does
> not read STDIN, it reads from a terminal. (unix experts feel free to
> clarify or correct
> this. This means you Tim G. :)
>
> There are packages designed to mimic interactive input to make this kind
> of thing possible.
> Expect was originally written in TCL. There is also a Perl version, an
> example of which is
> provided as a text attachment.
>
> I just tested this on an 8i listener, worked fine.
>
> The script requires Perl (of course) and the Expect.pm module.
>
> --
> Jared Still
> Certifiable Oracle DBA and Part Time Perl Evangelist
>
>
>

-- 
thanks
Arun

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Oct 10 2007 - 17:14:29 CDT

Original text of this message

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