TNS-12541 TNS-12560 TNS-00511 Linux Error: 111 解决方法
来源:互联网 发布:超极本推荐 知乎 编辑:程序博客网 时间:2024/04/27 20:40
今天在做ORACLE数据库和torquebox的连接
在配置好driver之后 rake的时候发现如下异常:
java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection>
数据库链接失败..
打开sqlplus 链接一切正常..
反复修改database.yaml后,仍然报错。
于是netstat查看端口
发现列表中并没有1521端口。
可能是防火墙把端口屏蔽掉了
于是
iptables -I INPUT -p tcp --dport 1521 -j ACCEPTiptables -I FORWARD -p tcp --dport 1521 -j ACCEPT
开放1521端口,再试..
仍然不行...
查看下oracle监听服务:
lsnrctl status结果如下:
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 01-AUG-2012 16:07:46Copyright (c) 1991, 2011, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: 111: Connection refusedConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=wodeoraclefuwuqi)(PORT=1521)))TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: 111: Connection refused
找到问题原因了,上网google,发现这个问题和IP有关系,之前在调整apache虚拟服务器的时候,为了测试把/etc/hosts里的这一行:
127.0.0.1 localhost.localdomain localhost
删掉了,重新加上, 然后
lsnrctl start
之后
lsnrctl status结果如下:
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 01-AUG-2012 16:11:35Copyright (c) 1991, 2011, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.2.0 - ProductionStart Date 01-AUG-2012 16:11:27Uptime 0 days 0 hr. 0 min. 8 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFDefault Service XEListener Parameter File /u01/app/oracle/product/11.2.0/xe/network/admin/listener.oraListener Log File /u01/app/oracle/diag/tnslsnr/sstdevel/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wodeoraclefuwuqi)(PORT=1521)))Services Summary...Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...The command completed successfully重新进入rails目录 rake db:migrate 搞定!
- TNS-12541 TNS-12560 TNS-00511 Linux Error: 111 解决方法
- TNS-12541 TNS-12560 TNS-00511 Linux Error: 111: Connection refused
- TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error:
- Linux TNS-12541 TNS-12560 TNS-00511 NO LISTENER
- TNS-12537, TNS-12560,TNS-00507 解决方法
- TNS-12541,TNS-12560,TNS-00511,TNS-12542,TNS-12560,TNS-00512数据库启动监听报错
- Oracle 监听 启动报错 tns-12560 tns-00530 linux error:20:not a directory 解决方法
- Oracle 监听 启动报错 tns-12560 tns-00530 linux error:20:not a directory 解决方法
- TNS-12537, TNS-12560, TNS-00507 Linux Error: 29: Illegal seek error When Starting the Listener
- TNS-12537, TNS-12560,TNS-00507 Linux Error: 29: Illegal seek error
- TNS-12541: TNS:no listener TNS-12560 TNS-00511: No listener
- tns
- TNS-12560: TNS:protocol adapter error and Linux Error: 111: Connection refused
- TNS-12537: TNS:connection closed TNS-12560: TNS:protocol adapter error TNS-00507: Connection clos
- TNS-12560: TNS:protocol adapter error
- TNS-12560: TNS:protocol adapter error 小记
- TNS-12560: TNS:protocol adapter error
- TNS-12560: TNS:protocol adapter error
- 飞鸽传书有关举证不够严谨
- GT2440--U-Boot分析(四)
- 革命的时刻-早起
- Use StringBuilder to create large string
- 七步教你制定网站SEO整体优化方案
- TNS-12541 TNS-12560 TNS-00511 Linux Error: 111 解决方法
- Excel MID函数截取文字
- 一个失败的作品,QQ找茬作弊器
- Windows Forms概述
- DNSPod和新网的解析
- Ubuntu11.10(32位)编译android常见错误(30种常见的)
- Hibernate事务管理
- 输入16进制ASCII转数字的小测试程序
- 285. Make hay while the sun shines. 良机勿失