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: Radoulov, Dimitre <cichomitiko_at_gmail.com>
Date: Thu, 11 Oct 2007 12:11:29 +0200
Message-ID: <470DF6D1.9030809@gmail.com>


} Has anybody scripted out changing the LISTENER password and got it to work?

If you have zsh
(you should add error checking and turn parameters to variables, this is only an example):

xubuntu% cat chpasslsnr
#!/usr/local/bin/zsh
result=""
zmodload zsh/zpty
zpty lsnr lsnrctl

zpty -r lsnr line "*>";print "$line";zpty -w lsnr "set cur"
zpty -r lsnr line "*>";print "$line";zpty -w lsnr "set password"
zpty -r lsnr line "*assword:" ;print "$line";zpty -w lsnr "oracle"
zpty -r lsnr line "*>";print "$line";zpty -w lsnr "change_password"
zpty -r lsnr line "*ld password:";print "$line"; zpty -w lsnr "oracle"
zpty -r lsnr line "*ew password:";print "$line"; zpty -w lsnr "elcaro"
zpty -r lsnr line "*eenter new password:";print "$line"; zpty -w lsnr "elcaro"
zpty -r lsnr line "*successfully";print "$line"; zpty -w lsnr "save_config"
zpty -r lsnr line "*successfully";print "$line"; zpty -w lsnr "exit"

xubuntu% ./chpasslsnr

LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 11-OCT-2007 12:03:55

Copyright (c) 1991, 2007, Oracle. All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL>
 Current Listener is LISTENER
LSNRCTL>
 Password:  

The command completed successfully
LSNRCTL>
 Old password:  

New password:  

Reenter new password:  

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) Password changed for LISTENER
The command completed successfully

LSNRCTL> Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) Saved LISTENER configuration parameters. Listener Parameter File /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora Old Parameter File /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.bak The command completed successfully

Dimitre

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Oct 11 2007 - 05:11:29 CDT

Original text of this message

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