為oracle listener set password

paulyibinyi發表於2008-09-13

為監聽器設定密碼 防止遠端使用者關閉

C:\Documents and Settings\yibin>lsnrctl

LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 13-9月 -2008 08:23
:07

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

歡迎來到LSNRCTL,請鍵入"help"以獲得資訊。

LSNRCTL> help
以下操作可用
星號 (*) 表示修改符或擴充套件命令:

start               stop                status
services            version             reload
save_config         trace               change_password
quit                exit                set*
show*

LSNRCTL> change_password
Old password:
New password:
Reenter new password:
正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
LISTENER的口令已更改
命令執行成功
LSNRCTL> set password
Password:
命令執行成功
LSNRCTL> save_config
正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
儲存的LISTENER配置引數。
監聽器引數檔案          D:\oracle\ora92\network\admin\listener.ora
舊的引數檔案D:\oracle\ora92\network\admin\listener.bak
命令執行成功
LSNRCTL>

而這時關閉監聽器則需要密碼了

C:\Documents and Settings\yibin>lsnrctl stop

LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 13-9月 -2008 08:29
:07

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
TNS-01169: 監聽器尚未識別口令

透過用以下命令設定密碼來關閉監聽

C:\Documents and Settings\yibin>lsnrctl

LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 13-9月 -2008 08:30
:04

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

歡迎來到LSNRCTL,請鍵入"help"以獲得資訊。

LSNRCTL> set password
Password:
命令執行成功
LSNRCTL> stop
正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
命令執行成功
LSNRCTL>

而再本機啟動監聽時 是不需要密碼的

C:\Documents and Settings\yibin>lsnrctl start

LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 13-9月 -2008 08:32
:06

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

啟動tnslsnr:請稍候...

TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Production
系統引數檔案為D:\oracle\ora92\network\admin\listener.ora
寫入D:\oracle\ora92\network\log\listener.log的日誌資訊
監聽:(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC0ipc)))
監聽:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=yibin.hnisi.com.cn)(PORT=1521)))


正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
LISTENER 的 STATUS
------------------------
別名                      LISTENER
版本                      TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Produc
tion
啟動日期                  13-9月 -2008 08:32:07
正常執行時間              0 天 0 小時 0 分 0 秒
跟蹤級別                  off
安全性                    ON
SNMP                      OFF
監聽器引數檔案          D:\oracle\ora92\network\admin\listener.ora
監聽器日誌檔案          D:\oracle\ora92\network\log\listener.log
監聽端點概要...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC0ipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=yibin.hnisi.com.cn)(PORT=1521)))
服務摘要..
服務 "PLSExtProc" 包含 1 個例程。
  例程 "PLSExtProc", 狀態 UNKNOWN, 包含此服務的 1 個處理程式...
命令執行成功

監聽器的安全性也由off變成on了

遠端使用者是否能 start listener  有待驗證

 

要是密碼丟失了 可以嘗試用以下幾種方法

1. Open the listener.ora and find the following line:     "filepasswords_listener= "             Type "pwd" after the = sign. Stop the listener and restarted it.      
   1a. Then perform. the following:                 LSNRCTL> set password pwd              command  successfully              LSNRCTL> stop              command  successfully      
2. If the previous step does not work, try commenting out the following line     on the listener.ora file:            #passwords_listener= xxxx      
2a. Stop the listener process. Restart and stop listener again.      
3. Verify that the passwords_listener parameter has a value - it cannot be     set to a blank password.

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-446959/,如需轉載,請註明出處,否則將追究法律責任。

相關文章