在 Ubuntu 系統中,你可以使用 lsnrctl
命令來查看 Oracle 數據庫的監聽器狀態和監聽端口。以下是一些常用的 lsnrctl
命令示例:
啟動監聽器:
lsnrctl start
停止監聽器:
lsnrctl stop
查看監聽器狀態:
lsnrctl status
查看監聽器配置:
lsnrctl services
查看監聽器日志:
lsnrctl log
如果你想查看監聽器正在監聽的具體端口,可以使用 lsnrctl status
命令,輸出中會包含監聽器正在監聽的地址和端口信息。例如:
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully
此外,你還可以查看監聽器的詳細配置文件,通常位于 $ORACLE_HOME/network/admin/listener.ora
,以獲取更多關于監聽端口的信息。
請確保你有適當的權限來執行這些命令,通常需要以 Oracle 數據庫管理員身份登錄。