总有些莫名其妙的错误

昨天晚上因为服务器机房电路检修,所有的服务器都停机。今天早上八点半就被电话吵醒,说是服务系统不能访问。赶紧的爬起来打开电脑,访问系统,出现错误ORA-12541:TNS:没有监听器。
赶紧的在网上搜索了一下解决办法,登陆数据库服务器,执行lsnrctl命令

$ lsnrctl start

LSNRCTL for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production on 10-MAY-2
008 09:27:08

Copyright (c) 1991, 2006, Oracle Corporation.  All rights reserved.

Starting /i2_dev/oracle/product/9.2/bin/tnslsnr: please wait...

TNSLSNR for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
Log messages written to /i2_dev/oracle/product/9.2/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=i2arptest)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 9.2.0.8.
0 - Production
Start Date                10-MAY-2008 09:27:08
Uptime                    0 days 0 hr. 0 min. 2 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Log File         /i2_dev/oracle/product/9.2/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=i2arptest)(PORT=1521)))
The listener supports no services
The command completed successfully

其中出现The listener supports no services信息表示没有服务。想到是不是要重启一下数据库服务。登陆sqlplus,关闭数据库,提示数据库没有启动。原来问题出在这里,而不是tns没有启动监听的问题!

$ sqlplus "/as sysdba"

SQL*Plus: Release 9.2.0.8.0 - Production on Sat May 10 09:27:31 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2887748496 bytes
Fixed Size                   744336 bytes
Variable Size             738197504 bytes
Database Buffers         2147483648 bytes
Redo Buffers                1323008 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Producti
on
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production

然后重新查看可用的服务,一切正常了。

$ lsnrctl services

LSNRCTL for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production on 10-MAY-2
008 09:28:13

Copyright (c) 1991, 2006, Oracle Corporation.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
Services Summary...
Service "SISDB" has 1 instance(s).
  Instance "SISDB", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "SISDBXDB" has 1 instance(s).
  Instance "SISDB", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1002 state:ready
         DISPATCHER
         (ADDRESS=(PROTOCOL=tcp)(HOST=i2arptest)(PORT=32793))
The command completed successfully

【特别注意,这里如果再次执行lsnrctl stop 关闭TNS,然后再lsnrctl start开启,这个时候又会出现The listener supports no services的提示!看下面的输出信息,如果出现这种情况,则要再次执行数据库的关闭和启动操作!】
$ lsnrctl stop

LSNRCTL for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production on 10-MAY-2
008 09:29:35

Copyright (c) 1991, 2006, Oracle Corporation.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
The command completed successfully
$ lsnrctl start

LSNRCTL for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production on 10-MAY-2
008 09:29:42

Copyright (c) 1991, 2006, Oracle Corporation.  All rights reserved.

Starting /i2_dev/oracle/product/9.2/bin/tnslsnr: please wait...

TNSLSNR for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
Log messages written to /i2_dev/oracle/product/9.2/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=i2arptest)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 9.2.0.8.
0 - Production
Start Date                10-MAY-2008 09:29:42
Uptime                    0 days 0 hr. 0 min. 2 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Log File         /i2_dev/oracle/product/9.2/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=i2arptest)(PORT=1521)))
The listener supports no services
The command completed successfully
$ lsnrctl services

LSNRCTL for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production on 10-MAY-2
008 09:29:55

Copyright (c) 1991, 2006, Oracle Corporation.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
The listener supports no services
The command completed successfully

按照道理,到这一步应用应该已经正常了。可以访问Web,提示另外一个错误:ORA-12514:TNS:监听进程不能解析SERVICE_NAME。
这个错误很难理解了,因为我在web服务器上发布了两个应用,一个就是出现错误提示的应用,另外一个是用来做压力测试的,两个应用的数据库都是同一台机器的同一个Services Name。现在的情况是压力测试的应用可以访问,没有出现ORA错误提示,但是正式的服务就出现这个提示。
赶紧的远程登陆到Web的服务器上,两个应用的web.config文件配置都是一样的,除了数据库用户名不一样。这个错误太奇怪了。
因为我在杭州出差,通过VPN链接到公司的网络速度太慢,而且几分钟就断开一次,很烦人,不好操作。
然后通过Oracle客户端的Oracle Configuration Assistant重新配置了一下本地服务命名,重新配置的时候,还可以测试了一下数据库链接,是正常的。但是Web服务还是不行。
实在没有办法,重新配置了一个新的本地服务命名,修改一下Web.config文件,重新启动一下IIS服务。应用正常了!
这事儿弄的,不知道什么原因,也不知道为什么就好了。

 

PS:这两天笔记本电脑在客户的公司就是不能上网,搞的很郁闷。详情参考http://www.dlog.cn/wyonge/diary/61689442。看来明天要重装电脑了!今天晚上头有点痛,估计是还没有适应杭州的天气,有点感冒了!

转载于:https://my.oschina.net/yonge/blog/72

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值