温馨提示×

debian下lsnrctl如何启动

小樊
37
2026-09-24 22:41:32
栏目: 智能运维

在 Debian 下使用 lsnrctl 启动 Oracle 监听(Listener),一般步骤如下:


1. 确认环境

lsnrctl 是 Oracle Database 自带的工具,需要先安装 Oracle 数据库软件(通常是 Oracle 19c / 21c 等)。

确认:

which lsnrctl

如果没有命令,说明 Oracle 环境变量未配置。


2. 切换到 Oracle 用户

Oracle 一般不建议用 root 启动:

su - oracle

3. 配置环境变量

执行 Oracle 环境变量(根据实际安装路径):

export ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orcl

(若已有 .bash_profile,可直接 source ~/.bash_profile)


4. 启动监听

lsnrctl start

如果监听名不是默认 LISTENER:

lsnrctl start LISTENER

5. 检查监听状态

lsnrctl status

看到类似:

STATUS of the LISTENER
----------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux
...
Services Summary...

说明启动成功。


6. 常见问题

(1) TNS-01106: Listener using listener name LISTENER already started

说明监听已在运行。

(2) TNS-12545: Connect failed because target host or object does not exist

检查:

  • /etc/hosts
  • listener.ora 中的 HOST

(3) Debian 未安装 Oracle

Debian 官方源 没有 Oracle,需手动安装 Oracle 或改用 PostgreSQL / MySQL。


如果你愿意,可以告诉我:

  • Oracle 版本
  • 是否刚装好
  • 报错信息

我可以一步步帮你排错。

0 踩