在 Debian 上,lsnrctl 是 Oracle 数据库监听程序(Listener) 的管理工具,并不是 systemd 服务名。停止方式如下:
lsnrctl stop
如果是特定监听名:
lsnrctl stop LISTENER
lsnrctl status
显示 TNS-12541: TNS:no listener 表示已停。
lsnrctl 对应的 systemd 服务(如 oracle-listener)oracle 用户启动command not found:su - oracle
export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
可自建服务文件(示例):
[Unit]
Description=Oracle Listener
[Service]
User=oracle
Environment=ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
ExecStart=/u01/app/oracle/product/19.0.0/dbhome_1/bin/lsnrctl start
ExecStop=/u01/app/oracle/product/19.0.0/dbhome_1/bin/lsnrctl stop
[Install]
WantedBy=multi-user.target
然后:
systemctl stop oracle-listener
如果你能贴出 Oracle 版本 / 监听名 / 报错信息,我可以给你更精确的步骤。