如何更改oracle監聽器的埠

paulyibinyi發表於2008-05-07

我們知道oracle 預設監聽器埠為1521,為了安全起見如何更改成我們自己定義的埠呢 如1523:

首先 lsnrctl stop

更改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 = d10063)(PORT = 1523))
      )
      (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 = gsid)
      (ORACLE_HOME = D:\oracle\ora92)
      (SID_NAME = paul)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = paul)
      (ORACLE_HOME = D:\oracle\ora92)
      (SID_NAME = paul)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = test)
      (ORACLE_HOME = D:\oracle\ora92)
      (SID_NAME = test)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = copy)
      (ORACLE_HOME = D:\oracle\ora92)
      (SID_NAME = copy)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = pubtest)
      (ORACLE_HOME = D:\oracle\ora92)
      (SID_NAME = pubtest)
    )
  )

 

tnsnames.ora 檔案

PUBTEST1523 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = d10063)(PORT = 1523))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = pubtest)
    )
  ) 

 

然後再lsnrctl start

就ok了

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

相關文章