oracle集群监听启动,在RAC中lsnrctl和srvctl操作监听区别

朋友今天询问了一个问题RAC中使用srvctl 操作监听和lsnrctl 操作监听结果不一样,下面我通过实验说明问题

0.listener.ora文件内容

LISTENER_RAC1 =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521)(IP = FIRST))

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.11)(PORT = 1521)(IP = FIRST))

)

)

SID_LIST_LISTENER_RAC1 =

(SID_LIST =

(SID_DESC =

(SID_NAME = PLSExtProc)

(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)

(PROGRAM = extproc)

)

)

1.srvctl 启动监听

rac1-> srvctl start listener -n rac1

rac1-> lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 11-MAR-2012 22:09:34

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

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

Alias LISTENER_RAC1

Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production

Start Date 11-MAR-2012 22:07:21

Uptime 0 days 0 hr. 2 min. 13 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener_rac1.log

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.21)(PORT=1521)))

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

rac1-> crs_stat -t

Name Type Target State Host

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

ora.....XFF.cs application ONLINE ONLINE rac1

ora....db1.srv application ONLINE ONLINE rac2

ora.devdb.db application ONLINE ONLINE rac2

ora....b1.inst application ONLINE ONLINE rac1

ora....b2.inst application ONLINE ONLINE rac2

ora....SM1.asm application ONLINE ONLINE rac1

ora....C1.lsnr application ONLINE ONLINE rac1

ora.rac1.gsd application ONLINE ONLINE rac1

ora.rac1.ons application ONLINE ONLINE rac1

ora.rac1.vip application ONLINE ONLINE rac1

ora....SM2.asm application ONLINE ONLINE rac2

ora....C2.lsnr application ONLINE ONLINE rac2

ora.rac2.gsd application ONLINE ONLINE rac2

ora.rac2.ons application ONLINE ONLINE rac2

ora.rac2.vip application ONLINE ONLINE rac2

srvctl操作监听,自动反馈到crs中

2.使用srvctl关闭监听

rac1-> srvctl stop listener -n rac1

rac1-> crs_stat -t

Name Type Target State Host

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

ora.....XFF.cs application ONLINE ONLINE rac1

ora....db1.srv application ONLINE ONLINE rac2

ora.devdb.db application ONLINE ONLINE rac2

ora....b1.inst application ONLINE ONLINE rac1

ora....b2.inst application ONLINE ONLINE rac2

ora....SM1.asm application ONLINE ONLINE rac1

ora....C1.lsnr application OFFLINE OFFLINE

ora.rac1.gsd application ONLINE ONLINE rac1

ora.rac1.ons application ONLINE ONLINE rac1

ora.rac1.vip application ONLINE ONLINE rac1

ora....SM2.asm application ONLINE ONLINE rac2

ora....C2.lsnr application ONLINE ONLINE rac2

ora.rac2.gsd application ONLINE ONLINE rac2

ora.rac2.ons application ONLINE ONLINE rac2

ora.rac2.vip application ONLINE ONLINE rac2

3.使用lsnrctl查看监听状态

rac1-> lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 11-MAR-2012 22:15:54

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

TNS-12541: TNS:no listener

TNS-12560: TNS:protocol adapter error

TNS-00511: No listener

Linux Error: 111: Connection refused

rac1-> lsnrctl

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 11-MAR-2012 22:16:55

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

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> status listener_rac1

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521)(IP=FIRST)))

TNS-12541: TNS:no listener

TNS-12560: TNS:protocol adapter error

TNS-00511: No listener

Linux Error: 111: Connection refused

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.11)(PORT=1521)(IP=FIRST)))

TNS-12541: TNS:no listener

TNS-12560: TNS:protocol adapter error

TNS-00511: No listener

Linux Error: 111: Connection refused

这里可以发现问题:

1)如果当前没有监听在运行,使用lsnrctl status的时候,会去检查默认的监听名称为listener的监听,如果该监听不存在不会使用hostname填充到hostname项中(注意下面的启动默认监听过程)

2)lsnrctl查看指定监听为listener_rac1,发现和listener.ora中配置相同

4.lsnrctl 关闭监听

rac1-> srvctl start listener -n rac1

rac1-> lsnrctl stop

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 11-MAR-2012 22:43:14

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

The command completed successfully

rac1-> crs_stat -t

Name Type Target State Host

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

ora.....XFF.cs application ONLINE ONLINE rac1

ora....db1.srv application ONLINE ONLINE rac2

ora.devdb.db application ONLINE ONLINE rac2

ora....b1.inst application ONLINE ONLINE rac1

ora....b2.inst application ONLINE ONLINE rac2

ora....SM1.asm application ONLINE ONLINE rac1

ora....C1.lsnr application OFFLINE OFFLINE

ora.rac1.gsd application ONLINE ONLINE rac1

ora.rac1.ons application ONLINE ONLINE rac1

ora.rac1.vip application ONLINE ONLINE rac1

ora....SM2.asm application ONLINE ONLINE rac2

ora....C2.lsnr application ONLINE ONLINE rac2

ora.rac2.gsd application ONLINE ONLINE rac2

ora.rac2.ons application ONLINE ONLINE rac2

ora.rac2.vip application ONLINE ONLINE rac2

这里可以说明问题:

1)lsnrctl stop虽然是要停止掉默认监听,但是也会停止掉非默认监听

2)lsnrctl stop如果默认监听不存在,那么注册host也为空

5.使用lsnrctl启动默认监听

rac1-> lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 11-MAR-2012 22:17:37

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

Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production

System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

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

Alias LISTENER

Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production

Start Date 11-MAR-2012 22:17:37

Uptime 0 days 0 hr. 0 min. 0 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521)))

The listener supports no services

The command completed successfully

rac1-> crs_stat -t

Name Type Target State Host

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

ora.....XFF.cs application ONLINE ONLINE rac1

ora....db1.srv application ONLINE ONLINE rac2

ora.devdb.db application ONLINE ONLINE rac2

ora....b1.inst application ONLINE ONLINE rac1

ora....b2.inst application ONLINE ONLINE rac2

ora....SM1.asm application ONLINE ONLINE rac1

ora....C1.lsnr application OFFLINE OFFLINE

ora.rac1.gsd application ONLINE ONLINE rac1

ora.rac1.ons application ONLINE ONLINE rac1

ora.rac1.vip application ONLINE ONLINE rac1

ora....SM2.asm application ONLINE ONLINE rac2

ora....C2.lsnr application ONLINE ONLINE rac2

ora.rac2.gsd application ONLINE ONLINE rac2

ora.rac2.ons application ONLINE ONLINE rac2

ora.rac2.vip application ONLINE ONLINE rac2

这里发现问题:

1)监听的ip只有主机名的一个,和srvctl启动的监听不一样

2)虽然监听启动了,crs中依然显示为offline状态

6.使用lsnrctl启动listener_rac1监听

LSNRCTL> start listener_rac1

Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production

System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener_rac1.log

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

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip)(PORT=1521)(IP=FIRST)))

STATUS of the LISTENER

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

Alias listener_rac1

Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production

Start Date 11-MAR-2012 22:19:04

Uptime 0 days 0 hr. 0 min. 0 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener_rac1.log

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.21)(PORT=1521)))

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

rac1-> crs_stat -t

Name Type Target State Host

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

ora.....XFF.cs application ONLINE ONLINE rac1

ora....db1.srv application ONLINE ONLINE rac2

ora.devdb.db application ONLINE ONLINE rac2

ora....b1.inst application ONLINE ONLINE rac1

ora....b2.inst application ONLINE ONLINE rac2

ora....SM1.asm application ONLINE ONLINE rac1

ora....C1.lsnr application ONLINE ONLINE rac1

ora.rac1.gsd application ONLINE ONLINE rac1

ora.rac1.ons application ONLINE ONLINE rac1

ora.rac1.vip application ONLINE ONLINE rac1

ora....SM2.asm application ONLINE ONLINE rac2

ora....C2.lsnr application ONLINE ONLINE rac2

ora.rac2.gsd application ONLINE ONLINE rac2

ora.rac2.ons application ONLINE ONLINE rac2

ora.rac2.vip application ONLINE ONLINE rac2

这里可以说明两个问题:

1)使用lsnrctl启动监听和srvctl启动一样

2)启动listener_rac1后,crs中监听资源变成online

7.问题原因分析

rac1-> srvctl config listener -n rac1

rac1 LISTENER_RAC1

通过这里可以发现,其实srvctl操作的监听就是LISTENER_RAC1,所以当我使用lsnrctl 操作LISTENER_RAC1监听时候crs会自动offline或者online,而lsnrctl 操作默认监听时crs不会online

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/397958.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

how to use webpart container in kentico

https://docs.kentico.com/k11/developing-websites/developing-websites-using-the-portal-engine/using-web-part-containers Webpart Container webpart container中的orangebox, SELECT * FROM dbo.CMS_WebPartContainer WHERE ContainerDisplayName LIKE %orange%; 把…

IE通过推理IE陈述的版本号

样例&#xff1a; 1. <!--[if !IE]> 除IE外都可识别 <![endif]--> 2. <!--[if IE]> 全部的IE可识别 <![endif]--> 3. <!--[if IE 5.0]> 仅仅有IE5.0能够识别 <![endif]--> 4. <!--[if IE 5]> 仅IE5.0与IE5.5能够识别 <![endif]--…

自己调试接口遇到的错误记录

200 请求成功500 请求失败 失败原因在http body里面403 未认证404 服务未找到 转载于:https://www.cnblogs.com/ruixin-jia/p/5734767.html

excel如何找到高频词_拟录取后:应届生和往届生档案哪里找;重灾院校区;高频词背诵表...

今日消息1、应届生和往届生档案哪里找&#xff1f;2、重灾院校区3、考研云督学班高频词背诵表汇总1、应届生和往届生档案哪里找&#xff1f;往年这个时候论文答辩、复试已经结束&#xff0c;已经进入毕业季&#xff01;现在你们毕业答辩结束了吗&#xff1f;你们都顺利上岸吗&a…

oracle 中表,oracle中表操作

1.1&#xff1a;创建一表空间 TABLESPACE01,初始大小50MB,允许自动增长数据库文件,每次增长10MBCREATE TABLESPACE TABLESPACE01LOGGINGDATAFILE’F:\TABLESPACE\DATA01.DBF’ SIZE 50MREUSE AUTOEXTEND ON NEXT 10M;1.2:创建用户 (oracle12c)此处创建用户报错&#xff0c;原因…

UDP Ping程序实现--第2关:接收并转发消息

✨创作不易&#xff0c;还希望各位大佬支持一下 &#x1f44d; 点赞&#xff0c;你的认可是我创作的动力&#xff01; ⭐️ 收藏&#xff0c;你的青睐是我努力的方向&#xff01; ✏️ 评论&#xff0c;你的意见是我进步的财富&#xff01; 任务描述 本关任务&#xff1a;在…

JAVA经典题--死锁案例

死锁原理: 两个线程相互等待对方释放同步监视器 例子程序: 1 public class TestDeadLock implements Runnable {2 3 public int flag 1;4 static Object o1 new Object(), o2 new Object();5 6 public void run() {7 if (flag 1) {8 s…

考研编程练习----排名

题目描述&#xff1a;今天的上机考试虽然有实时的Ranklist&#xff0c;但上面的排名只是根据完成的题数排序&#xff0c;没有考虑每题的分值&#xff0c;所以并不是最后的排名。给定录取分数线&#xff0c;请你写程序找出最后通过分数线的考生&#xff0c;并将他们的成绩按降序…

linux下安装dovecot

Dovecot是一个开源的&#xff0c;为Linux/Unix-like系统提供IMAP,POP3服务的软件。主要是为了安全产生的&#xff0c;不管大小应用&#xff0c;Dovecot都是一个非常优秀的选择。它非常快&#xff0c;配置简单&#xff0c;不需要专业的管理员&#xff0c;而且它也非常节省内存。…

放大镜_指甲钳上有放大镜?再也不怕夹到肉了

扒姬说&#xff1a;剪指甲钳最害怕什么&#xff0c;是没注意夹到肉有没有。尤其是近视的人和手脚不便的老人&#xff0c;或者是给较小的宝宝剪指甲时&#xff0c;总是看不清指甲边缘的形状、刀口的位置&#xff0c;一不小心就会夹到手指、脚趾。今天&#xff0c;扒姬推荐一个特…

linux学习规划

转载于:https://www.cnblogs.com/Alight/p/4601510.html

oracle如何在本地建库,oracle在本地建库

oracle数据库本地建库&#xff0c;需要使用oracle安装路径下面的-配置和移植工具-Database Configuration Assistant 通过一次点击下一步进行建库。 在库建好后&#xff0c;使用系统账号 User:sys password:sys Connect as SYSDBA在客户端进行登录 --创建表空间 Create tablesp…

「BZOJ1485」[HNOI2009] 有趣的数列 (卡特兰数列)

「BZOJ1485」[HNOI2009] 有趣的数列 Description 我们称一个长度为2n的数列是有趣的&#xff0c;当且仅当该数列满足以下三个条件&#xff1a; (1)它是从1到2n共2n个整数的一个排列{ai}&#xff1b; (2)所有的奇数项满足a1<a3<…<a2n-1&#xff0c;所有的偶数项满足a2…

wedo2.0编程模块介绍_能量黑科技模块系列十:RFID魔块

RFID魔块RFID此模块可以对套件配套的RFID卡或者空白RFID卡进行读写&#xff0c;用于权限验证的DIY制作。常规的公交卡、地铁卡是无法进行写入&#xff0c;但可以读取UID号。配套RFID卡内存为1K&#xff0c;有16个分区&#xff0c;每个分区有3个数据块可进行写入此模块可以对套件…

Android 6.0权限问题

Android 6.0 open failed: EACCES (Permission denied) 对于6.0权限问题&#xff0c;报错如上&#xff1a; 解决方案&#xff1a; Android 6.0 (Marshmallow). 添加新的权限模型&#xff0c;需要在运行时动态获取所需要的权限。 首先判断手机系统版本是否在6.0然后才是支持运行…

[SoapUI] 通过SoapUI发送POST请求,请求的body是JSON格式的数据

通过SoapUI发送POST请求&#xff0c;请求的body是JSON格式的数据&#xff1a; data{"currentDate":"2015-06-19","reset":true} 而且通过Fiddler抓取页面报文 Content-Type 是 application/x-www-form-urlencoded 一开始我将Content-Type appl…

oracle -239报错,解决: ./check_oracle_health --connect orcl --mode connection-time 报错的问题...

错误提示./check_oracle_health --connect orcl --mode connection-timeCRITICAL - cannot connect to orcl. install_driver(Oracle) failed: Cant locate DBD/Oracle.pm in INC (INC contains: . /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_per…

【python 3.6】调用另一个文件的类的方法

文件1&#xff1a;test12.py 文件2&#xff1a;test13.py 文件1 如下&#xff1a; #!/usr/bin/python # -*- coding: utf-8 -*-class abcd(object):def __init__(self):passdef pr(self):return("KKKKKKK") if __name__"__main__":abcd().pr() 文件2&#…

el-button 图标显示在字后边_Excel和Visio联姻,自动生成跨职能流程图,还能用图标标记状态,太牛了!...

正文共&#xff1a;1332 字 21 图预计阅读时间&#xff1a; 4 分钟Visio是Office软件系列中的负责绘制流程图和示意图的软件&#xff0c;创建具有专业外观的Visio图表&#xff0c;以便用户更好地理解和分析。企业管理中&#xff0c;业务流程在不同部门间流转&#xff0c;涉及提…

mybatisGenerator 代码自动生成报错 Result Maps collection already contains value for BaseResultMap...

由于mybatis简单易学&#xff0c;比起Hibername来&#xff0c;更容易上手&#xff0c;代码也能自动生成。这几天研究了下代码自动生成的&#xff0c;参考&#xff1a;http://0609xiaohua.iteye.com/blog/1453570但是把代码复制进来&#xff0c;运行了下&#xff0c;却跑不起来&…