在 Ubuntu 系统中,lsnrctl
是 Oracle 数据库监听器的命令行工具,用于管理和监控 Oracle 数据库监听器的状态。要使用 lsnrctl
查看服务状态,请按照以下步骤操作:
打开终端(Terminal)。
输入 lsnrctl status
命令,然后按 Enter 键。这将显示监听器的当前状态,包括正在监听的服务和实例。
示例输出:
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 01-JAN-2021 12:34:56
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 01-JAN-2021 12:30:00
Uptime 0 days 0 hr. 4 min. 56 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/hostname/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hostname)(PORT=1521)))
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 "XEPDB1", status READY, has 1 handler(s) for this service...
The command completed successfully
在这个示例中,监听器正在监听两个服务:CLRExtProc 和 xe。每个服务的状态都显示为 READY,表示它们已准备好接受连接。
请注意,您需要根据实际情况替换示例输出中的主机名、端口号和服务名。