linux下oracle lsnrctl启动慢的解决方式

 

今天启动很久没动的oracle时发现启动监听的速度超级慢,以下为启动信息。

oracle@tomato:~$ lsnrctl start

 

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-FEB-2011 16:15:04

 

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

 

Starting /opt/oracle/product/db/bin/tnslsnr: please wait...

 

TNSLSNR for Linux: Version 10.2.0.1.0 - Production

System parameter file is /opt/oracle/product/db/network/admin/listener.ora

Log messages written to /opt/oracle/product/db/network/log/listener.log

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production

Start Date                14-FEB-2011 16:15:04

Uptime                    0 days 0 hr. 3 min. 55 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /opt/oracle/product/db/network/admin/listener.ora

Listener Log File         /opt/oracle/product/db/network/log/listener.log

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(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

 

从上面的启动信息可以看出,启动监听消耗了3分55秒,天阿,这么久。。。

 

如果你也遇到了和我一样的问题,那么你不妨试试以下的解决方法:

1.首先查看oracle的listener.ora和tnsnames.ora文件。

   SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (SID_NAME = PLSExtProc)

      (ORACLE_HOME = /opt/oracle/product/db)

      (PROGRAM = extproc)

    )

  )

 

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))

    )

  )

 上面红色的标记代表oracle解析时的HOST(oracle监听启动慢,是因为需要逐个匹配/etc/hosts中的配置)

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

如果你的listener.ora和tnsnames.ora里的HOST不一致,请修改成一样的。

2.然后查看/etc/hosts文件的信息
   vi /etc/hosts

192.168.0.101   tomato  # Added by NetworkManager
127.0.0.1       localhost.localdomain   localhost
::1     tomato  localhost6.localdomain6 localhost6
127.0.1.1       tomato
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

  通过查看hosts信息,发现第一行为192.168.0.101   tomato,,而我的实际ip为192.168.16.16...

3.将127.0.0.1 tomato (tomato为你的用户名) 添加到/etc/hosts文件中的第一行
      vi /etc/hosts

 


127.0.0.1   tomato
192.168.0.101   tomato  # Added by NetworkManager
127.0.0.1       localhost.localdomain   localhost
::1     tomato  localhost6.localdomain6 localhost6
127.0.1.1       tomato
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

 


4.再次执行lsnrctl start之后一切正常,监听启动完全正常

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值