[20170120]监听重启问题2.txt

[20170120]监听重启问题2.txt

--今天重启一台容灾的服务器的监听,想都没想直接lsnrctl stop,lsnrctl start.结果用户连接出现问题.
--只要不清楚这套系统的工作机制,自己在测试环境做一个测试,主要问题是监听配置修改了监听的别名.

1.环境:
SYS@book> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

2.一般监听的配置如下:
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

#SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF

SID_LIST_LISTENER =
   (SID_LIST =
    (SID_DESC =
      (SDU=32767)
      (GLOBAL_DBNAME = book)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0.4/dbhome_1)
      (SID_NAME = book)
      )
    )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)(RATE_LIMIT=YES))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.78)(PORT = 1521)(RATE_LIMIT=YES))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle
DIAG_ADR_ENABLED_LISTENER=OFF
USE_NS_PROBES_FOR_DCD=true
#DYNAMIC_REGISTRATION_LISTENER = off
INBOUND_CONNECT_TIMEOUT_LISTENER=100
CONNECTION_RATE_LISTENER=5

--//监听的别名是缺省LISTENER,这个是大部分单机数据库的配置.

3.而我们容灾的数据库使用别名,修改如下:

#SID_LIST_LISTENER =
SID_LIST_AAAA =
   (SID_LIST =
    (SID_DESC =
      (SDU=32767)
      (GLOBAL_DBNAME = book)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0.4/dbhome_1)
      (SID_NAME = book)
      )
    )

#LISTENER =
AAAA =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)(RATE_LIMIT=YES))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.78)(PORT = 1521)(RATE_LIMIT=YES))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

4.现在重启监听:
--如果按照平时的操作,我习惯执行如下:
$ lsnrctl stop;sleep 1;lsnrctl start

$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 20-JAN-2017 11:35:26

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                20-JAN-2017 11:34:38
Uptime                    0 days 0 hr. 0 min. 48 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/11.2.0.4/dbhome_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gxqyydg4)(PORT=1521)))
The listener supports no services
The command completed successfully

SYS@book> alter system register ;
System altered.

$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 20-JAN-2017 11:35:49

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                20-JAN-2017 11:34:38
Uptime                    0 days 0 hr. 1 min. 11 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/11.2.0.4/dbhome_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gxqyydg4)(PORT=1521)))
Services Summary...
Service "book" has 1 instance(s).
  Instance "book", status READY, has 2 handler(s) for this service...
Service "bookXDB" has 1 instance(s).
  Instance "book", status READY, has 1 handler(s) for this service...
The command completed successfully

--//注意看~~,别名是LISTENER,静态注册的监听不存在,我现在还搞不懂为什么会影响这套容灾系统.仅仅不存在静态注册的监听.

5.正确的启动方式:

lsnrctl stop;sleep 1;lsnrctl start aAAA

--//注:AAAA大小写一样,都没有问题

$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 20-JAN-2017 11:40:26
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     aAAA
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                20-JAN-2017 11:40:11
Uptime                    0 days 0 hr. 0 min. 14 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/gxqyydg4/aaaa/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.78)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "book" has 2 instance(s).
  Instance "book", status UNKNOWN, has 1 handler(s) for this service...
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Instance "book", status READY, has 2 handler(s) for this service...
Service "bookXDB" has 1 instance(s).
  Instance "book", status READY, has 1 handler(s) for this service...
The command completed successfully

--//注意看~~.别名现在是aAAA. 静态监听也注册了.

$ ps -ef | grep tnslsn[r]
oracle   59355     1  0 11:40 ?        00:00:00 /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/tnslsnr aAAA -inherit

--而如果执行前面的lsnrctl stop;sleep 1;lsnrctl start

$ ps -ef | grep tnslsn[r]
oracle   59385     1  4 11:44 ?        00:00:00 /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/tnslsnr LISTENER -inherit

6.总结:
--//重点问题不了解这套系统的工作机制.以后注意这些细节.缺少必要的文档,或者我根本没看这方面的文档.

时间: 2024-10-23 20:12:58

[20170120]监听重启问题2.txt的相关文章

[20160711]关闭监听的动态注册.txt

[20160711]关闭监听的动态注册.txt --这个我给别人解决dg日志不应用的问题.问题是没有设置静态注册,又关闭动态注册.自己还第一次知道存在这个参数 --DYNAMIC_REGISTRATION_LISTENER = off --再测试环境重复测试,做1个记录: 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------

通过监听设置实现登录控制

通过监听设置实现登录控制 作者:PrudentWoo  QQ:286507175 happy-wuweilong@hotmail.com WebTitle: http://www.prudentwoo.com    我们大家都知道一个问题,通常情况下,Oracle客户端只要获取了服务器端的监听信息就可以无止境的访问数据库了,尤其是很多DBA和系统管理员都喜欢将Oralce的sys和system等具有最高权限的用户的密码设置为非常简单,有的甚至就直接设置成'oracle','orcl','1234

[20161227]打开多个监听端口.txt

[20161227]打开多个监听端口.txt --安全等保的需求,需要在1台数据库打开2个监听端口,并且还不能是1521缺省端口.看了一些文档,做一些记录. --参考连接:http://blog.itpub.net/267265/viewspace-2083455/ 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ --

[20160418]修改oracle监听端口.txt

[20160418]修改oracle监听端口.txt --上午开发提出要修改oracle的监听端口,我以前测试遇到过一些问题: --链接: http://blog.itpub.net/267265/viewspace-758983/ -- 但是在11.2.0.4下遇到以前不一样的情况,时间太久了,测试在2013年做的,也许现在存在一些变化. 1.无静态注册监听: SYS@book> @ &r/ver1 PORT_STRING                    VERSION       

oracle-linux下Oracle安装之后重启监听失败。具体情况见下 、还往大家帮忙

问题描述 linux下Oracle安装之后重启监听失败.具体情况见下 .还往大家帮忙 我的操作是安装oracle之后.尝试连接 [oracle@linux64 ~]$ sqlplus / as sysdba Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing

[20160513]Restrict Session与静态监听.txt

[20160513]Restrict Session与静态监听.txt --给同事讲解动静态监听时,一次测试,当执行后alter system enable restricted session;发现远程用户依旧可以登录,检查发现是静态 --监听注册搞的鬼,做一个记录.并且把各种情况做一个总结: 1.环境: SYS@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER --------------------

[20130422]修改oracle监听端口.txt

[20130422]修改oracle监听端口.txt 昨天朋友想尝试修改oracle的缺省监听端口,测试没有通过,而我在我的测试机器通过,通过对比监听文件,我发现其中的差异,问题出在动态注册以及静态注册的问题,把一些测试记录下来,便于理解动态以及静态注册监听的问题. 1.测试环境: SQL> @verBANNER--------------------------------------------------------------------------------Oracle Databa

AIX ha切换不成功并重启主机导致oracle监听无法启动的处理

    2015年9月19日,ERP资金系统应急演练,切换AIX ORACLE双机数据库到备机,结果没有成功切换,导致数据库监听无法正常启动,下面是故障的排查及处理过程.     通过沟通发现,HA切换失败后监听就无法正常启动.数据库能正常启动,后来进行主节点重启,重启后监听程序依然无法启动.无论是启动监听.还是查看监听状态,命令都停留在connecting阶段,如下图所示:     检查监听的告警日志,发现报错与网卡适配器相关,如下图所示:     根据错误信息怀疑是监听程序引用的IP有问题,

断开网线后监听服务器配置

笔记本拔掉网线后,从服务启动ORACLE监听服务器时报错(如下图所示) 通过命令启动查看具体错误信息如下所示: 查看具体的报错日志信息log.xml,如下所示: <msg time='2012-06-30T13:58:04.381+08:00' org_id='oracle' comp_id='tnslsnr' type='UNKNOWN' level='16' host_id='KERRY-PC' host_addr='fe80::bdcd:f603:9ae2:a99%16'> <tx