在 Ubuntu 上,lsnrctl 是 Oracle Database 的监听控制工具,并不属于系统自带命令,通常只在安装了 Oracle 数据库(或 Oracle 客户端/Instant Client 的部分组件)后才会有。
下面给你几种查找和查看方式:
which lsnrctl
或
lsnrctl status
如果提示:
lsnrctl: command not found
说明 没有安装 Oracle 或环境变量未配置。
通常在:
$ORACLE_HOME/bin/lsnrctl
例如:
/u01/app/oracle/product/19.3.0/dbhome_1/bin/lsnrctl
查找命令:
find / -name lsnrctl 2>/dev/null
如果你找到了 lsnrctl,但命令不可用,需要设置环境变量:
export ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
然后执行:
lsnrctl status
lsnrctl status
lsnrctl services
lsnrctl start
lsnrctl stop
Ubuntu 默认没有 lsnrctl,它是 Oracle 专用工具,不是 MySQL / PostgreSQL 的。
如果你是:
systemctl status mysqlpg_lsclusters如果你愿意,可以告诉我:
我可以直接给你对应命令。