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: shutdown password protected listener

Re: shutdown password protected listener

From: Mark Brinsmead <pythianbrinsmead_at_gmail.com>
Date: Tue, 2 Jan 2007 21:13:41 -0700
Message-ID: <cf3341710701022013x6d113a38r9e598c7dc4058cf0@mail.gmail.com>


You need to put everything in a single invokation of LSNRCTL. Like this:

#!/bin/sh
PWD=${2} case "$1" in

       'start')
               su - oracle -c "/oracle_home/bin/lsnrctl start LISTENER_ORCL"

       'stop')
               su - oracle -c "/usr/local/bin/stop_listener $PWD"

/usr/local/bin/stop :

#!/bin/sh

/oracle_home/bin/lsnrctl << EOF

   set current_listener LISTENER_ORCL
   set password ${1}
   stop
EOF Alternatively, you could just find the process ID for the listener, and kill it...

On 1/2/07, Joe Smith <joe_dba_at_hotmail.com> wrote:
>
> How do I shutdown the LISTENER with a password in a script. I have this
> default script called "oracle".
>
> It starts and stops the databases and listener. When I changed the
> default
> listener settings for security reasons starting the listener is easy, it
> does not require the password. However shutting down down the listener is
> the problem.
>
> PWD=${2}
>
> case "$1" in
> 'start')
> su - oracle -c "/oracle_home/bin/lsnrctl start
> LISTENER_ORCL"
>
> 'stop')
> su - oracle -c "/oracle_home/bin/lsnrctl set
> current_listener
> LISTENER_ORCL"
> su - oracle -c "/oracle_home/bin/lsnrctl set password
> ${2}"
> su - oracle -c "/oracle_home/bin/lsnrctl stop"
>
>
>
> this last command fails. It points to the default listener LISTENER. Not
> the correct listener,
> i.e. LISTENER_ORCL.
>
> How do I shutdown a password protected listener thru a shell script?
>
>
>
> thanks.
>
> _________________________________________________________________
> Fixing up the home? Live Search can help
>
> http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&locale=en-US&source=hmemailtaglinenov06&FORM=WLMTAG
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

-- 
Cheers,
-- Mark Brinsmead
   Senior DBA,
   The Pythian Group
   http://www.pythian.com/blogs

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jan 02 2007 - 22:13:41 CST

Original text of this message

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