遠端控制監聽器

redhouser發表於2013-09-27
1,監聽器狀態
Linux + Oracle10.2.0.1.0
--os version
在Oracle10g/11g中,預設監聽器只能在本地管理:
[oracle@bnet95 admin]$ uname -a
Linux bnet95 2.6.18-164.el5xen #1 SMP Thu Sep 3 04:47:32 EDT 2009 i686 i686 i386 GNU/Linux

--database version
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

--監聽器預設安全設定
LSNRCTL> start listener2
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener2
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                26-SEP-2013 17:02:26
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication  <<==只能本地管理
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Services Summary...
Service "bnet" has 1 instance(s).
  Instance "bnet", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

2,遠端管理監聽器
Windows7 + Oracle11g
--在listener.ora中增加:
LISTENER95 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 22.11.97.95)(PORT = 1521))
    )
  )

--遠端控制
C:\Users\mh0575>lsnrctl
LSNRCTL for 32-bit Windows: Version 11.1.0.6.0 - Production on 26-9月 -2013 16:09:15
Copyright (c) 1991, 2007, Oracle.  All rights reserved.
歡迎來到LSNRCTL, 請鍵入"help"以獲得資訊。
LSNRCTL> status listener95
正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=1521)))
TNS-12541: TNS: 無監聽程式
 TNS-12560: TNS: 協議介面卡錯誤
  TNS-00511: 無監聽程式
   32-bit Windows Error: 61: Unknown error

==〉在Linux上啟動監聽器後
LSNRCTL> status listener95
正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=1521)))
TNS-01189: 監聽程式無法驗證使用者

3,設定監聽器密碼
Linux + Oracle10.2.0.1.0
--設定密碼
LSNRCTL> change_password listener2  
Old password:
New password:
Reenter new password:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
Password changed for LISTENER
The command completed successfully
--儲存設定
LSNRCTL> save_config listener2
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
Saved listener2 configuration parameters.
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Old Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.bak
The command completed successfully
==〉完成此步驟後,listener.ora中增加了:
#----ADDED BY TNSLSNR 26-SEP-2013 17:04:23---
PASSWORDS_listener2 = E154352CED22C60A
#--------------------------------------------

--啟動監聽器
LSNRCTL> start listener2
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener2
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                26-SEP-2013 17:07:34
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Password or Local OS Authentication 《==允許遠端訪問
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Services Summary...
Service "bnet" has 1 instance(s).
  Instance "bnet", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
 
4,遠端管理
Linux + Oracle10.2.0.1.0
--檢視狀態
LSNRCTL> status listener95
正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=1521)))
TNS-01169: 監聽程式尚未識別口令
 TNS-01189: 監聽程式無法驗證使用者

--設定密碼
LSNRCTL> set password
Password:
命令執行成功
--查詢狀態
LSNRCTL> status listener95
正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=1521)))
LISTENER 的 STATUS
------------------------
別名                      listener2
版本                      TNSLSNR for Linux: Version 10.2.0.1.0 - Production
啟動日期                  26-9月 -2013 17:02:26
正常執行時間              0 天 0 小時 2 分 51 秒
跟蹤級別                  off
安全性                    ON: Password or Local OS Authentication
SNMP                      OFF
監聽程式引數檔案          /u01/app/oracle/product/10.2.0/db_1/network/admin/list
ener.ora
監聽程式日誌檔案          /u01/app/oracle/product/10.2.0/db_1/network/log/listen
er2.log
監聽端點概要...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
服務摘要..
服務 "bnet" 包含 1 個例程。
  例程 "bnet", 狀態 UNKNOWN, 包含此服務的 1 個處理程式...
命令執行成功
--遠端停止監聽器
LSNRCTL> stop listener95
正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=1521)))
命令執行成功
--遠端啟動監聽器
LSNRCTL> start listener95
啟動tnslsnr: 請稍候...
TNSLSNR for 32-bit Windows: Version 11.1.0.6.0 - Production
系統引數檔案為D:\app32\Administrator\product\11.1.0\db_1\network\admin\listener.
ora
寫入d:\app32\administrator\diag\tnslsnr\BJ-MH0575-02\listener95\alert\log.xml的
日誌資訊
監聽該物件時出錯: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=15
21)))
TNS-12545: 因目標主機或物件不存在, 連線失敗
 TNS-12560: TNS: 協議介面卡錯誤
  TNS-00515: 因目標主機或物件不存在, 連線失敗
   32-bit Windows Error: 49: Unknown error
監聽程式未能啟動。請參閱上面的錯誤訊息...
5,刪除監聽器密碼
Linux + Oracle10.2.0.1.0
--刪除listener.ora中如下行:
#----ADDED BY TNSLSNR 26-SEP-2013 17:04:23---
PASSWORDS_listener2 = E154352CED22C60A
#--------------------------------------------
--重新啟動監聽器
LSNRCTL> status listener2
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener2
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                27-SEP-2013 09:26:27
Uptime                    0 days 0 hr. 0 min. 48 sec
Trace Level               off
Security                  ON: Password or Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Services Summary...
Service "bnet" has 1 instance(s).
  Instance "bnet", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL> stop listener2
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
The command completed successfully
LSNRCTL> start listener2
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener2
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                27-SEP-2013 09:27:37
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication  <<==只有OS認證
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Services Summary...
Service "bnet" has 1 instance(s).
  Instance "bnet", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

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

相關文章