PL-SQL筆記3_Oracle Listener與Listener.ora檔案,lsnrctl(Listener control)

 

Oracle Net Listener : a separate process that runs on the database server computer. It receives incoming client connection requests and manages the traffic of these requests to the database server.

Listener.ora檔案 : is the configuration file for a listener. It can include the protocol address it is accepting connection requests on a list of the database and other services it is listening for, and control paramaters used by the listener.

預設windows安裝好的位置
C:\app\你的User名\product\21c\homes\OraDB21Home1\network\admin

配置檔案內文

# listener.ora Network Configuration File: C:\app\chous\product\21c\homes\OraDB21Home1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.

DEFAULT_SERVICE_LISTENER = XE

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\app\chous\product\21c\dbhomeXE)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\app\chous\product\21c\dbhomeXE\bin\oraclr.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = LAPTOP-86Q2OIMP.mshome.net)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )


lsnrctl(Listener control) : is a SQL*Net Utility used for controlling database listeners.

A listener is required for allowing remote (not local) clients to connect to the Oracle database via the network.


lsnrctl status 可以列出所有正在被監聽的服務狀態,常用於檢查連線狀態。

當發現Oracle資料庫無法連上就可能是TNS-12541: TNS:沒有監聽器
可以用以下指令來確認服務是不是沒啟用
lsnrctl status
netstat -ano | find ":1521"

可用powershell確認目前有Oracle字眼服務有哪些
Get-Service *Oracle* | Sort-Object Status,DisplayName | Format-Table -Auto

找到正確目前電腦上的Listener名稱之後再去cmd下指令將服務打開
net start OracleOraDB21Home1TNSListener





留言

這個網誌中的熱門文章

何謂淨重(Net Weight)、皮重(Tare Weight)與毛重(Gross Weight)

外貿Payment Term 付款條件(方式)常見的英文縮寫與定義

(2021年度)駕訓學科筆試準備題庫歸納分析_法規是非題