TNS-12541: TNS:no listener , TNS-12542: TNS:address already in use
查看数据库监听状态不对
$ lsnrctl status
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Production on 05-NOV-2012 08:54:08
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   IBM/AIX RISC System/6000 Error: 79: Connection refused
然后手动启动数据库报如下错误:
$ lsnrctl start
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Production on 05-NOV-2012 08:54:12
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Starting /oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Production
System parameter file is /oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /oracle/product/10.2.0/db_1/network/log/listener.log
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
TNS-12542: TNS:address already in use
 TNS-12560: TNS:protocol adapter error
  TNS-00512: Address already in use
   IBM/AIX RISC System/6000 Error: 67: Address already in use
Listener failed to start. See the error message(s) above...
/oracle/product/10.2.0/db_1/network/trace/listener.trc
明明监听没启动起,却说已经在运行了,后来终于找到原因,网上看到别人也碰到这个问题,说是HOSTS文件设置有问题,查看本机主机名和hosts文件,果然有问题,两个IP地址指向了同一个主机名,将一台主机删除后,再启动监听,一切OK。
用root用户进行修改:
# cat /etc/hosts
# Internet Address      Hostname        # Comments
# 192.9.200.1           net0sample      # ethernet name/address
# 128.100.0.1           token0sample    # token ring name/address
# 10.2.0.2              x25sample       # x.25 name/address
# 2000:1:1:1:209:6bff:feee:2b7f         ipv6sample      # ipv6 name/address
127.0.0.1               loopback localhost      # loopback (lo0) name/address
192.168.101.189   test
192.168.101.190   test
再次启动监听:
$ lsnrctl start
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Production on 05-NOV-2012 08:58:47
Copyright (c) 1991, 2010, Oracle.  All rights reserved.
Starting /oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Production
System parameter file is /oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Production
Start Date                05-NOV-2012 08:58:49
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      ON
Listener Parameter File   /oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
总结:/etc/hosts文件设置很重要,这里设置不正确,很多地方都要出错,特别是RAC,会报很多奇怪的错误,配置的时候要多注意。
REF:
http://www.linuxidc.com/Linux/2012-11/73694.htm
http://www.xifenfei.com/2152.html
TNS-12541: TNS:no listener , TNS-12542: TNS:address already in use的更多相关文章
- Oracle连接出现TNS:no listener或者ORA-12514: TNS:listener does not currently know
		1.Message 850 not found; No message file for product=network, facility=NL 提示框:TNS:no listener 解决办法: ... 
- ORA-12546: TNS: 权限被拒绝(ORA - 12546 TNS: Permission Denied)
		这个问题上网一查大都是说权限之类的问题,本人在经过第二次折腾之后发现,其实是自己的Oracle客户端工具在破解过程中被自己用防火墙禁止访问网络了,自己还在另一篇博文里记录过,竟然忘光了,BS一下自己! ... 
- ORA-12516:TNS:listener could not find available handler with matching protocol stack
		应用程序连接测试数据库时报ORA-12516:TNS:listener could not find available handler with matching protocol stack 检查 ... 
- Oracle ORA-12541:TNS:no listener错误解决方法 (转)
		前天装好的Oracle,昨天突然不好用了,从Oracle的错误提示来看,是说TNS:no listener ,估计是某种服务没有启动,打开windows管理工具->服务,一看,有一个Oracle ... 
- Troubleshooting Guide for ORA-12541 TNS: No Listener
		Server side checks (not platform specific): 1) Check the result on the server using tnsping to the ... 
- TNS-12560: TNS: 协议适配器错误
		TNS-12560: TNS: 协议适配器错误 Microsoft Windows [版本 5.2.3790] (C) 版权所有 1985-2003 Microsoft Corp. C:\Docu ... 
- TNS-12535: TNS:operation timed out案例解析
		一数据库突然连接不上,在自己电脑上使用SQL Developer也连接不上.立即使用SecureCRT连接上了这台服务器,从下面几个方面检查. 1:检查了数据库的状态是否正常 $ sqlplus / ... 
- oracle数据库的TNS配置
		TNS简要介绍与应用 Oracle中TNS的完整定义:transparence Network Substrate透明网络底层,监听服务是它重要的一部分,不是全部,不要把TNS当作只是监听器. TNS ... 
- Oracle TNS配置浅析
		1. 什么是TNS? TNS是Oracle Net的一部分,专门用来管理和配置Oracle数据库和客户端连接的一个工具,在大多数情况下客户端和数据库要通讯,必须配置TNS,当然在少数情况下,不用配置T ... 
- oracle 11G创建表空间、用户、配置监听和TNS
		最近总在安装各种版本的oralce数据库做测试,11G,32位的,64位的,12C的,每次都折腾表空间,用户.tns啥的,这里记录下,再也不用现用现百度找了 一.创建表空间.用户 在plsql工具中 ... 
随机推荐
- hdu5861(Road)
			题目链接:传送门 题目大意:有n个点 组成n-1段,每一段开着的时候都有花费Vi,有m组要求,对于每组要求 [x,y]之间可达,对于每一段你有一次开关的机会(最初都是关闭的) 问怎样安排段落得开闭时间 ... 
- bootstrap Table API和一些简单使用方法
			官网: http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/ 后端分页问题:后端返回”rows”.“”total,这样才能重新赋值 ... 
- angularJS中的ng-show、ng-if指令
			angularJS中的ng-show.ng-hide.ng-if指令都可以用来控制dom元素的显示或隐藏. 1. ng-show和ng-hide 根据所给表达式的值来显示或隐藏HTML元素.元素会渲染 ... 
- (转)SPDY
			SPDY:Google开发的基于传输控制协议(TCP)的应用层协议,目前已经被用于Google Chrome浏览器中来访问Google的SSL加密服务.SPDY并不是一种用于替代HTTP的协议,而是对 ... 
- E71自带铃声下载
			NOKIA-e71 E71系统自带铃声下载,有几个听着不错~ E71铃声下载 
- 160704、commons-beanutils.jar常用方法
			package com.test.beanutils; import java.lang.reflect.InvocationTargetException;import java.text.Pars ... 
- CodeForeces 665C Simple Strings
			C. Simple Strings time limit per test 2 seconds memory limit per test 256 megabytes input standard i ... 
- ORA-08002: sequence TESTTABLE1_ID_SEQ.CURRVAL is not yet defined in this session (未完全解决)
			说明: 断开连接后 重新连接执行序列号当前值查找 会报错. 解决方法一:先查询序列号下一个值 SELECT testTable1_ID_SEQ.nextval from dual; 
- HTTP协议及其POST与GET操作差异 & C#中如何使用POST、GET等
			转自: http://www.cnblogs.com/skynet/archive/2010/05/18/1738301.html 引言 HTTP协议我想任何IT人士都耳熟能详了,大家都能说出个所以然 ... 
- <2014 04 26> 《Coders at Work编程人生:15位软件先驱访谈录》
			什么是老派程序员?调试只用printf,关心数据结构,先整体或先局部,不知道OO.IDE.TDD.BDD等等为何物.Ken Thompson,Jamie Zawinski,Joe Armstrong, ... 
