Re: lsnrctl pwd in script

  • From: "Radoulov, Dimitre" <cichomitiko@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Thu, 11 Oct 2007 12:11:29 +0200

} 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

--
//www.freelists.org/webpage/oracle-l


Other related posts: