为了解决Oracle 12.2监听无法启动的问题,需要按照以下步骤进行操作:
确认监听进程是否在运行
在解决问题之前,先要确认是否存在监听进程。可以通过执行以下命令来检查监听进程:
ps -ef | grep tns
如果没有监听进程运行,需要执行以下步骤来启动监听进程。
启动监听进程
- 检查“listener.ora”文件的配置
在运行监听进程之前,需要确保“listener.ora”文件的配置是正确的。在Oracle 12.2中,该文件通常位于“$ORACLE_HOME/network/admin/”目录下。打开文件,检查其中的监听器名称和端口号是否正确。示例如下:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = my_global_database_name)
(SID_NAME = my_sid)
(ORACLE_HOME = /u01/app/oracle/product/12.2.0/dbhome_1)
)
)
- 启动监听进程
如果监听进程没有在运行,需要执行以下步骤来启动监听进程:
lsnrctl start
执行后,会显示类似下面的信息:
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 18-AUG-2017 10:41:02
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Starting tnslsnr: please wait...
TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/myhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myhost)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 17-AUG-2017 11:48:34
Uptime 1 days 22 hr. 50 min. 51 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/myhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myhost)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "pdb1" has 1 instance(s).
Instance "cdb2", status READY, has 1 handler(s) for this service...
Service "pdb1XDB" has 1 instance(s).
Instance "cdb2", status READY, has 1 handler(s) for this service...
Service "pdb2" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
The command completed successfully
如果监听进程已经在运行,会显示类似下面的信息:
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 18-AUG-2017 11:06:59
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Starting tnslsnr: please wait...
TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/myhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myhost)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
总结
以上是解决Oracle 12.2监听无法启动的方法和步骤。通过检查监听进程的运行状态和配置文件的正确性,可以解决大部分的监听无法启动的问题。如果问题仍然存在,建议参考Oracle官方文档进行排查。
下面是两个示例说明:
示例1
如果在执行“lsnrctl start”命令时,出现以下错误:
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 18-AUG-2017 11:06:59
Copyright (c) 1991, 2016, Oracle. All rights reserved.
LSNRCTL> start
Starting /u01/app/oracle/product/12.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/myhost/listener/alert/log.xml
Failed to start listener: TNS-01106: Listener using listener name LISTENER has already been started
TNS-12560: TNS:protocol adapter error
TNS-00530: Protocol adapter error
说明监听进程已经在运行了,可以使用“status”命令来检查其状态。如果想重新启动监听进程,可以使用“stop”命令停止进程,然后再使用“start”命令启动进程。
示例2
如果在执行“lsnrctl start”命令时,出现以下错误:
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 18-AUG-2017 11:06:59
Copyright (c) 1991, 2016, Oracle. All rights reserved.
LSNRCTL> start
Starting /u01/app/oracle/product/12.2.0/dbhome_1/bin/tnslsnr: please wait...TNS-12537: TNS:connection closed
TNS-12560: TNS:protocol adapter error
TNS-00507: Connection closed
Linux Error: 29: Illegal seek
说明启动监听进程时出现了错误。检查“tnsnames.ora”和“listener.ora”文件中的配置是否正确,确认所需的TCP/IP协议端口是否在网络配置中启用。如果问题仍然存在,建议从Oracle官方文档中查询解决方案。
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:Oracle 12.2监听无法启动解决方法 - Python技术站