oracle 監聽配置多個埠

paulyibinyi發表於2008-10-31

  oracle監聽可以配置多個埠,滿足不同的客戶端應用

  以下是配置和測試步驟

listener.ora 配置

# LISTENER.ORA Network Configuration File: D:\oracle\ora92\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = yibin)(PORT = 1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = yibin)(PORT = 1526))
        (ADDRESS = (PROTOCOL = TCP)(HOST = yibin)(PORT = 1528))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
      )
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = D:\oracle\ora92)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = test)
      (ORACLE_HOME = D:\oracle\ora92)
      (SID_NAME = test)
    )
  )

紅色部分為新增加的埠

C:\Documents and Settings\yibin>lsnrctl stop

LSNRCTL for 32-bit Windows: Version 9.2.0.8.0 - Production on 31-10月-2008 21:02
:43

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

正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=yibin)(PORT=1521)))
命令執行成功

C:\Documents and Settings\yibin>lsnrctl start

LSNRCTL for 32-bit Windows: Version 9.2.0.8.0 - Production on 31-10月-2008 21:02
:46

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

啟動tnslsnr:請稍候...

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

監聽:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=yibin.hnisi.com.cn)(PORT=1526)))

監聽:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=yibin.hnisi.com.cn)(PORT=1528)))

監聽:(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC0ipc)))

正在連線到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=yibin)(PORT=1521)))
LISTENER 的 STATUS
------------------------
別名                      LISTENER
版本                      TNSLSNR for 32-bit Windows: Version 9.2.0.8.0 - Produc
tion
啟動日期                  31-10月-2008 21:02:46
正常執行時間              0 天 0 小時 0 分 0 秒
跟蹤級別                  off
安全性                    OFF
SNMP                      OFF
監聽器引數檔案          D:\oracle\ora92\network\admin\listener.ora
監聽器日誌檔案          D:\oracle\ora92\network\log\listener.log
監聽端點概要...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=yibin.hnisi.com.cn)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=yibin.hnisi.com.cn)(PORT=1526)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=yibin.hnisi.com.cn)(PORT=1528)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC0ipc)))
服務摘要..
服務 "PLSExtProc" 包含 1 個例程。
  例程 "PLSExtProc", 狀態 UNKNOWN, 包含此服務的 1 個處理程式...
服務 "test" 包含 1 個例程。
  例程 "test", 狀態 UNKNOWN, 包含此服務的 1 個處理程式...
命令執行成功

C:\Documents and Settings\yibin>

 

tnsnames.ora 配置

TEST.HNISI.COM.CN =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = yibin)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )

TEST26.HNISI.COM.CN =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = yibin)(PORT = 1526))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )

TEST28.HNISI.COM.CN =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = yibin)(PORT = 1528))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test)
    )
  )

tnsping 測試

C:\Documents and Settings\yibin>tnsping test

TNS Ping Utility for 32-bit Windows: Version 9.2.0.8.0 - Production on 31-10月-2
008 21:04:25

Copyright (c) 1997, 2006, Oracle Corporation.  All rights reserved.

已使用的引數檔案:
D:\oracle\ora92\network\admin\sqlnet.ora


已使用 TNSNAMES 介面卡來解析別名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = yibin)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME
 = test)))
OK(30毫秒)

C:\Documents and Settings\yibin>tnsping test26

TNS Ping Utility for 32-bit Windows: Version 9.2.0.8.0 - Production on 31-10月-2
008 21:04:33

Copyright (c) 1997, 2006, Oracle Corporation.  All rights reserved.

已使用的引數檔案:
D:\oracle\ora92\network\admin\sqlnet.ora


已使用 TNSNAMES 介面卡來解析別名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = yibin)(PORT = 1526))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME
 = test)))
OK(30毫秒)

C:\Documents and Settings\yibin>tnsping test28

TNS Ping Utility for 32-bit Windows: Version 9.2.0.8.0 - Production on 31-10月-2
008 21:04:36

Copyright (c) 1997, 2006, Oracle Corporation.  All rights reserved.

已使用的引數檔案:
D:\oracle\ora92\network\admin\sqlnet.ora


已使用 TNSNAMES 介面卡來解析別名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = yibin)(PORT = 1528))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME
 = test)))
OK(30毫秒)

C:\Documents and Settings\yibin>

 

 

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

相關文章