首页 > 数据库 >【Oracle RAC Database】Single Client Access Name(SCAN)

【Oracle RAC Database】Single Client Access Name(SCAN)

时间:2023-08-19 20:31:57浏览次数:71  
标签:status ... RAC SCAN Database LISTENER VIP 节点

SCAN的作用是简化客户端连接数据库的配置,无论集群增加还是删除节点SCAN名称会一直保持不变,客户端不需要做任何的修改。SCAN是一个名称,通过DNS被解析成最多3个IP地址(SCAN VIP)

SCAN VIP的作用是接收客户端连接,SCAN VIP必须与集群的公网资源处于相同的子网,每一个SCAN VIP都会有对应的SCAN LISTENER,并且SCAN LISTENER只会监听对应的SCAN VIP,而且它们必须运行在同一个节点。SCAN VIP会均匀地分布在集群的各个节点,例如:一个包含了8个节点的集群,会选择其中3个节点运行SCAN VIP,当运行SCAN VIP的节点出现问题时,SCAN VIP会漂移到其他正常节点,对于一个两节点的集群,如果配置了3个SCAN VIP,一定会有一个节点存在两个SCAN VIP ,另一个节点存在一个SCAN VIP。

SCAN VIP和SCAN LISTENER以集群资源的形式存在,由集群的代理进程进行统一管理,SCAN VIP依赖于集群的公网资源,而SCAN LISTENER依赖于对应的SCAN VIP资源,当本地节点出现问题SCAN VIP漂移到其他节点后,对应的SCAN LISTENER也需要随着SCAN VIP一起漂移。

通过SCAN连接到数据库

阶段1:每个节点的PMON进程通过访问数据库信息将本地实例提供的服务注册到本地节点的监听程序和每一个SCAN监听程序。其中local_listener指定了PMON需要注册的本地监听程序位置,而remote_listener指定了需要注册的SCAN监听程序位置,之后,无论是本地节点的监听程序,还是SCAN监听程序都已经为接收客户端的连接做好准备。

阶段2:客户端通过tnsnames.ora中的别名向SCAN监听程序发起连接,由于SCAN监听程序分布在集群的不同节点,连接到哪个节点取决于DNS将SCAN名解析成哪一个节点的SCAN VIP(DNS使用轮询的方式返回SCAN对应的IP地址)。

阶段3:SCAN监听程序在收到了客户端发送的请求后,根据每个节点的负责情况,将客户端连接转发给负载最低的节点本地监听程序,之后对应节点的本地监听程序完成与客户端的连接。

[grid@node01 ~]$ srvctl config scan
SCAN name: cluster.gscaifu.com, Network: 1/192.168.1.0/255.255.255.0/enp0s10
SCAN VIP name: scan1, IP: /cluster.gscaifu.com/192.168.1.202
SCAN VIP name: scan2, IP: /cluster.gscaifu.com/192.168.1.201
SCAN VIP name: scan3, IP: /cluster.gscaifu.com/192.168.1.203

[grid@node01 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node node02
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node node01
SCAN VIP scan3 is enabled 
SCAN VIP scan3 is running on node node01

[grid@node01 ~]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521

[grid@node01 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node node02
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node node01
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node node01
[grid@node01 ~]$ lsnrctl status LISTENER

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-AUG-2023 18:57:17

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                19-AUG-2023 17:09:25
Uptime                    0 days 1 hr. 47 min. 52 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0.4/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/node01/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.101)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.111)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "core" has 1 instance(s).
  Instance "core1", status READY, has 1 handler(s) for this service...
Service "coreXDB" has 1 instance(s).
  Instance "core1", status READY, has 1 handler(s) for this service...
Service "soe" has 1 instance(s).
  Instance "core1", status READY, has 1 handler(s) for this service...
The command completed successfully


[grid@node01 ~]$ lsnrctl status LISTENER_SCAN2

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-AUG-2023 18:58:07

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN2
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                19-AUG-2023 17:09:24
Uptime                    0 days 1 hr. 48 min. 42 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0.4/grid/network/admin/listener.ora
Listener Log File         /u01/app/11.2.0.4/grid/log/diag/tnslsnr/node01/listener_scan2/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.201)(PORT=1521)))
Services Summary...
Service "core" has 2 instance(s).
  Instance "core1", status READY, has 1 handler(s) for this service...
  Instance "core2", status READY, has 1 handler(s) for this service...
Service "coreXDB" has 2 instance(s).
  Instance "core1", status READY, has 1 handler(s) for this service...
  Instance "core2", status READY, has 1 handler(s) for this service...
Service "soe" has 1 instance(s).
  Instance "core1", status READY, has 1 handler(s) for this service...
The command completed successfully

标签:status,...,RAC,SCAN,Database,LISTENER,VIP,节点
From: https://blog.51cto.com/dbprofessional/7151907

相关文章

  • tracer ftrace笔记(20)—— Systrace中tag汇总
    一、视频显示1.HW_VSYNC_ON_XXX(1)类型布尔值,1表示HWVSYNC信号开关被打开,0表示开关被关闭。(2)时机HWVYSNC硬件信号被打开和关闭的时候。(3)解释HW_VSYNC_ON_XXX后面的XXX一般是一串数字,代表的是displayid,如果你的机器有外接了显示器,那么可以通过displayid......
  • 【Oracle Real Application Cluster Database】创建Service资源
    每个数据库都有一个或多个service名称,service名称是提供给客户端连接到数据库实例的名称。创建数据库会默认创建与数据库同名的service,默认的service实现所有实例的负载均衡,可以认为数据库的所有实例是默认创建的service的首选节点。手工创建的service资源区分首选节点与备用节点......
  • 【Oracle Real Application Cluster Database】集群删除节点
    [grid@node01~]$srvctlstoplistener-nnode03[grid@node01~]$srvctlstopinstance-dcore-nnode03[oracle@node01~]$dbca-silent-deleteInstance-nodeListnode03-gdbNamecore-instanceNamecore3-sysDBAUserNamesys-sysDBAPassword1QAZ2wsx......
  • Debug 利器:pstack & strace
    Debug利器:pstack&strace 2019-12-0504:15  陈心朔 阅读(8026) 评论(4)  编辑  收藏  举报工作中难免会遇到各种各样的bug,对于开发环境or测试环境的问题还好解决,可以使用gdb打断点或者在代码中埋点来定位异常;但是遇到线上的bug就很难受了,由于生产环境......
  • pstack,strace,gdb工具使用
    pstack,strace,gdb工具使用MySQL的几种调式分析工具介绍MySQL的几种调式分析工具,常用的有如下4种:pstackgdbstraceperf如下分别介绍之。pstack注意:pstack所追踪的是用户态调用栈获取堆栈信息问题线程的定位负载较低mysql_pid=23632pstack$mysql_pid>pstack.infopt-pmp对堆栈......
  • Oracle 12C 新特性-扩展数据类型,在12c中,与早期版本相比,诸如VARCHAR2, NAVARCHAR2以及
    1.查看参数max_string_size默认值SQL>showparametermax_string_sizeNAME                   TYPE                 VALUE---------------------------------------------------------------------......
  • Visual Studio 2022 没有MySQLDatabase数据源
    解决办法: ①下载安装MySQLODBC驱动②运行ODBC数据源管理器③添加MySQL数据源,填入相应信息,测试通过即可④打开VS 工具>>连接到数据库,选择MicrosoftODBCDataSource⑤下拉列表中选择刚才新建的ODBC数据源,确定。       由此,在VS的侧边栏就可以对MySQL......
  • EinScan-S软件构建物体的空间三维模型:编码结构光
      本文介绍基于EinScan-S软件,实现编码结构光方法的空间三维模型重建的具体操作。(基于EinScan-S的编码结构光方法空间三维模型重建)  上一篇文章3DSOM软件基于物体的照片构建空间三维模型的方法详细介绍了基于3DSOM的侧影轮廓方法物体空间三维模型重建;接下来,本文我们将在一款......
  • 【Oracle Real Application Cluster Database】集群增加节点
    [grid@node03~]$ssh-keygen[grid@node03~]$ssh-copy-id-i~/.ssh/id_rsa.pubgrid@node03[grid@node03~]$ssh-copy-id-i~/.ssh/id_rsa.pubgrid@node01[grid@node03~]$(sshnode01"date;hostname";sshnode03"date;hostname")SatAug19......
  • Systrace看GPU渲染花费时间之Fence
    一、前言如上图所示的Systrace中,VSYNC-app基本上没有什么变化,但是VSYNC-sf却一直在更新有可能是什么原因?VSYNC-app的作用通知app去开始进行绘制渲染更新UI了,DispSync按照屏幕的刷新率的速率去通知app,因此app会以跟屏幕刷新率匹配的速率去绘制渲染更新UI。而在手......