标签:
第 1章 数据库服务器监听错误
1.1.1数据库监听错误
1.1.1.1 问题及现象
服务器环境为ORACLE11G RAC环境,系统启动后,监听没起来。
[oracle@RAC4 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 29-JUN-2015 10:44:45
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
1.1.1.2 检查思路
当时同事已经检查过CRS、也尝试过使用命令启动监听等步骤。但是启动监听的时候会有以下报错。
[oracle@RAC4 ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 29-JUN-2015 10:51:46
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Log messages written to /u01/app/oracle/diag/tnslsnr/RAC4/listener/alert/log.xml
Error listening on: (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12542: TNS:address already in use
TNS-12560: TNS:protocol adapter error
TNS-00512: Address already in use
Linux Error: 98: Address already in use
Listener failed to start. See the error message(s) above...
居然说系统已使用,那么理所当然的就去查看1521端口和lsn进程
[root@RAC4 ~]# ps-ef | grep lsn
grid 52181 1 0 10:04? 00:00:11/u01/*/*/bin/tnslsnrLISTENER_SCAN1 -inherit
root 101600 100759 0 22:30 pts/0 00:00:00 grep lsn
[root@RAC4 ~]#netstat-anp | grep 1521
tcp 0 0xxx.xxx.xxx.xxx:1521 0.0.0.0:* LISTEN 52181/tnslsnr (有些内容不便列出)
发现1521端口和/u01/11.2.0/grid/bin/tnslsnrLISTENER_SCAN1-inherit进程存在,所以尝试杀掉此进程
[root@RAC4 ~]#kill -9 52181
-bash: kill:(52181) - No suchprocess
杀掉后发现系统提示没有这个进程,再次查询
[root@RAC4 ~]# ps-ef |grep lsn
grid 104147 1 0 23:23? 00:00:00/u01/*/*/bin/tnslsnrLISTENER_SCAN1 -inherit
root 104379 104353 0 23:28 pts/0 00:00:00 grep lsn
又有了,应该是父进程自动又给他启动了,查看其父进程是init进程。
[grid@RAC4 ~]$pstree 1
init─┬─MBADataMover───MBADataMover───MBADataMover
├─2*[tnslsnr───2*[{tnslsnr}]]
1.1.1.3 出现问题的原因
因为我记得在书上看到过,11G的RAC中SRVCTL可以管理监听,于是尝试使用此命令来启动监听。
1.1.1.4 解决方法
[grid@RAC4 ~]$srvctl start listener -n RAC4
[grid@RAC4~]$ exit
logout
[root@RAC4~]# su -oracle
[oracle@RAC4~]$lsnrctl status;
LSNRCTLfor Linux:Version 11.2.0.3.0 - Production on 01-JUL-2015 11:32:45
Copyright(c) 1991,2011, Oracle. All rightsreserved.
Connectingto(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUSof theLISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version11.2.0.3.0 - Production
StartDate 01-JUL-2015 10:38:57
Uptime 0 days 0 hr. 53 min. 47 sec
TraceLevel off
Security ON: Local OS Authentication
SNMP OFF
ListenerParameterFile /u01/11.2.0/grid/network/admin/listener.ora
ListenerLogFile /u01/app/oracle/diag/tnslsnr/RAC4/listener/alert/log.xml
ListeningEndpointsSummary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=11.10.110.23)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=11.10.110.25)(PORT=1521)))
ServicesSummary...
Service"+ASM"has 1 instance(s).
Instance"+ASM2", status READY, has1 handler(s) for this service...
Service"RAC3"has 1 instance(s).
Instance"RAC32", status READY, has1 handler(s) for this service...
Service"RAC3XDB"has 1 instance(s).
Instance"RAC32", status READY, has1 handler(s) for this service...
Service"RACDB007"has 1 instance(s).
Instance "RACDB0072",status READY, has1 handler(s) for this service...
Service"RACDB007JL_BJ"has 1 instance(s).
Instance"RACDB007JL2", status READY,has 1 handler(s) for this service...
Service"RACDB007JL_BJXDB"has 1 instance(s).
Instance"RACDB007JL2", status READY,has 1 handler(s) for this service...
Service"RACDB007XDB"has 1 instance(s).
Instance"RACDB0072", status READY, has1 handler(s) for this service...
The commandcompleted successfully
1.1.1.5 知识点
经过这次问题的解决,发现oracle 11G的RAC中有很多功能都通过集群命令来控制,而不能单一的通过单机管理的方法来控制集群的某些功能
版权声明:本文为博主原创文章,未经博主允许不得转载。
TNS-12541,TNS-12560,TNS-00511,TNS-12542,TNS-12560,TNS-00512数据库启动监听报错
标签:
原文地址:http://blog.csdn.net/bzfys/article/details/46708407