在 Linux 上,lsnrctl 是 Oracle 监听程序(Listener) 的管理工具。重启监听通常分两步:先停止,再启动。
lsnrctl stop
如果是多个监听(如 LISTENER2):
lsnrctl stop LISTENER2
lsnrctl start
或指定监听名:
lsnrctl start LISTENER2
lsnrctl status
或指定监听:
lsnrctl status LISTENER_NAME
一般必须使用 oracle 用户:
su - oracle
确保已加载 Oracle 环境:
export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
❌ command not found: lsnrctl
→ 环境变量未配置或不在 oracle 用户下
❌ 权限不足
→ 不要用 root 直接执行
su - oracle
lsnrctl stop
lsnrctl start
lsnrctl status
如果你有 RAC / Grid / 多个监听 / systemd 管理,可以告诉我环境,我可以给你更精确的命令。