oracle SCAN

Oracle     SCAN

Introduction ....................................................................................... 1 

Network Requirements for Using SCAN2

Option 1 – Use the Corporate DNS2

Option 2 – Use the Oracle Grid Naming Service (GNS)4

Workaround if No DNS Server is Available at Installation Time4

SCAN Configuration with Oracle Grid Infrastructure 11g Release 25

SCAN Configuration with Oracle Grid Infrastructure 12c Release 16

Enabling Multiple-Subnet Support for SCAN7

Oracle Database Configuration Using SCAN10

Client Load Balancing using SCAN10

Multiple-Subnet Support and LISTENER_NETWORKS11

Version and Backward Compatibility12

Miscellaneous SCAN-related Configurations13

Using SCAN with Multiple Ports on the Same Subnet13

Using SCAN in a MAA Environment not using GDS14

Using SCAN in a MAA Environment using GDS14

Using SCAN with Oracle Connection Manager15

Summary and Conclusion……………………………………………… 15

介绍

使用SCAN的网络要求

选项1 - 使用公司DNS

选项2 - 使用Oracle网格命名服务(GNS)

解决方法如果在安装时没有DNS服务器可用

使用Oracle Grid Infrastructure 11g第2版的SCAN配置

使用Oracle Grid Infrastructure 12c第1版的SCAN配置

启用SCAN 7的多子网支持

使用SCAN 10的Oracle数据库配置

客户端负载平衡使用SCAN

多子网支持和LISTENER_NETWORKS

版本和向后兼容性

其他SCAN相关配置

在同一子网上使用具有多个端口的SCAN

在不使用GDS的MAA环境中使用SCAN

在使用GDS 14的MAA环境中使用SCAN

将SCAN与Oracle Connection Manager配合使用

摘要和结论


Introduction

Single Client Access Name (SCAN) is a feature used in Oracle Real Application Clusters

environments that provides a single name for clients to access any Oracle Database running

in a cluster. You can think of SCAN as a cluster alias for databases in the cluster. The benefit

is that the client’s connect information does not need to change if you add or remove nodes or

databases in the cluster

简介:

单一客户端访问名称(SCAN)是Oracle Real Application Clusters环境中使用的一种功能,它为客户端提供访问集群中运行的任何Oracle数据库的单一名称。 你可以将SCAN视为群集中数据库的群集别名。 其优点是,如果你在群集中添加或删除节点或数据库,客户端的连接信息不需要更改。

SCAN was first introduced with Oracle Real Application Clusters (RAC) 11g Release 2 and

provides additional functionality【附加功能】 in Oracle RAC 12c. Having a single name to access the cluster to connect to a database in this cluster allows clients to use EZConnect and the simple JDBC thin URL to access any database running in the cluster, independently【独立的,自主的 of the number of databases or servers running in the cluster and regardless on which server(s) in the cluster the requested database is actually active.

SCAN首次被引入了Oracle Real Application Clusters(RAC)11g R2,并在Oracle RAC 12c中提供了附加功能。 使用单个名称访问集群以连接到此集群中的数据库允许客户端使用EZConnect和单个JDBC简 URL访问集群中运行的任何数据库,而与集群中独立运行的数据库或服务器的数量无关,无论是在集群中哪个被请求的活跃状态的服务器

 

EZconnet   sqlplus system/manager@sales1-scan:1521/oltp 

JDBC connect jdbc:oracle:thin:@sales1-scan:1521/oltp

Example 1: Sample EZConnect and Thin JDBC Connect Strings

Network Requirements for Using SCAN

The default SCAN configuration is defined during the installation of Oracle Grid Infrastructure that is distributed with Oracle Database 11g Release 2 or higher. Oracle Grid Infrastructure is a single Oracle Home that contains Oracle Clusterware and Oracle Automatic Storage Management. You must install Oracle Grid Infrastructure first in order to use Oracle RAC 11g Release 2 or higher.

During the interview phase of the Oracle Grid Infrastructure installation, you will be prompted to provide a SCAN name. There are 2 options for defining the SCAN:

1. Define a SCAN using the corporate DNS (Domain Name Service)

2. Define a SCAN using the Oracle Grid Naming Service (GNS)

默认SCAN配置是在安装Oracle Grid Infrastructure期间定义的,与Oracle Database 11g第2版或更高版本一起发布。 Oracle Grid Infrastructure是一个单一的包含了Oracleware和Oracle自动存储管理的家目录。

你必须先安装Oracle Grid Infrastructure,才能使用Oracle RAC 11g R2或更高版本。

在Oracle Grid Infrastructure安装的访问阶段,将会提示你输入提供SCAN名称。 定义SCAN有2个选项:

1.使用公司DNS(域名服务)定义SCAN,

2.使用Oracle网格命名服务(GNS)定义SCAN,

Option 1 – Use the Corporate DNS

If you choose Option 1, you must ask your network administrator to create at least one single name that resolves to three IP addresses using a round-robin algorithm.  Three IP addresses are recommended considering load balancing【负载平衡】 and high availability requirements regardless of the number of servers in the cluster.  

 

选项1 - 使用公司DNS

如果选择选项1,你必须要求你的网络管理员至少创建一个名称

使用循环算法解析三个IP地址,建议三个IP地址是根据负载平衡和高可用性而不始考虑集群上服务器的数量。

The IP addresses must be on the same subnet as your default public network in the cluster. The name must be 15 characters or less in length, not including the domain, and it must be resolvable without the domain suffix (for example: “sales1-scan’ must be resolvable as opposed to “scan1-can.example.com”). The IPs must not be assigned to a network interface, since Oracle Clusterware will take care of it.  

 

IP地址必须与集群中的默认公用网络位于同一子网。 名字必须为15个字符或更少的长度,不包括域,并且必须是可解析的域后缀(例如:“sales1-scan”必须是可解析的,而不是“scan1-can.example.com”)。

不能将IP分配给网络接口,因为Oracle Clusterware会处理它。

 

sales1-scan.example.com  

IN A 133.22.67.194 IN A 133.22.67.193

IN A 133.22.67.192

Example 2: Sample DNS entry for SCAN

You can check the SCAN configuration in DNS using “nslookup”. If your DNS is set up to provide round-robin access to the IPs resolved by the SCAN entry, then run the “nslookup” command at least twice to see the round-robin algorithm work. The result should be that each time, the “nslookup” would return a set of three IPs in a different order.

 

你可以使用“nslookup”检查DNS中的SCAN配置。 如果你的DNS设置为提供循环访问由SCAN条目解析的IP,然后至少运行“nslookup”命令两次来看循环算法工作。 结果应该是每次”nslookup”将以不同的顺序返回一组三个IP。

 

First nslookup Second nslookup

Second nslookup

[oracle@mynode] nslookup sales1-scan

Server: 131.32.249.41

Address: 131.32.249.41#53

Non-authoritative answer:

Name: sales1-scan.example.com

Address: 133.22.67.192

Name: sales1-scan.example.com

Address: 133.22.67.193

Name: sales1-scan.example.com

Address: 133.22.67.194

 

[oracle@mynode] nslookup sales1-scan

Server: 131.32.249.41

Address: 131.32.249.41#53

Non-authoritative answer:

Name: sales1-scan.example.com

Address: 133.22.67.193

Name: sales1-scan.example.com

Address: 133.22.67.194

Name: sales1-scan.example.com

Address: 133.22.67.192

 

Example 3: Look up the SCAN configuration in DNS using “nslookup”

Note: If your DNS server does not return a set of three IPs as shown in figure 3 or does not round-robin, ask your network administrator to enable such a setup. Round-robin on DNS level allows for a connection request load balancing across SCAN listeners floating in the cluster. It is not required for SCAN to function as a whole and the absence of such a setup will not prevent the failover of a connection request to another SCAN listener, in case the first SCAN listener in the list is down.

注意:如果你的DNS服务器不返回一组三个IP,如图3所示,或者没有做循环算法,请你的网络管理员启用这样的设置。DNS级别的循环允许连接请求在浮动在集群中的SCAN侦听器之间进行负载平衡。 SCAN不需要作为一个整体运行,并且没有这样的设置不会阻止连接请求到另一个SCAN侦听器的故障切换,以防列表中的第一个SCAN侦听器关闭。

The Oracle Client typically handles failover of connections requests across SCAN listeners in the cluster. Oracle Clients of version Oracle Database 11g Release 2 or higher will not require any  special configuration to provide this type of failover. Older clients require considering additional configuration. It is therefore recommended that the minimum version of the client used to connect to a database using SCAN is of version Oracle Database 11g Release 2 or higher.

Oracle客户端通常处理集群中跨SCAN侦听器的连接请求的故障转移。 Oracle数据库11g第2版或更高版本的Oracle客户端不需要任何特殊配置来提供此类故障转移。 较旧的客户端需要考虑额外的配置。 因此,建议使用SCAN连接到数据库的客户端的最低版本为Oracle Database 11g第2版或更高版本。

Using client-side DNS caching may generate a false impression that DNS round-robin is not occurring from the DNS server. (DNS not return a set of three IPs as shown in figure 3). Client-side DNS caches are typically used to minimize DNS requests to an external DNS server as well as to minimize DNS resolution time. This is a simple recursive DNS server with local items.  

If the client-side DNS cannot be set up to provide round-robin locally or cannot be disabled, Oracle Clients using a JDBC:thin connect will typically attempt a connection to the SCAN-IP and SCANlistener which is returned first in the list. This basically disables the connection request load balancing across SCAN listeners in the cluster from those clients, but does not affect SCAN functionality as a whole. Oracle Call Interface (OCI) based database access drivers will apply an internal round-robin algorithm and do not need to be considered in this case.

  

 使用客户端DNS缓存可能会产生一个错误的印象,DNS循环不是从DNS服务器发生。 (DNS不返回一组三个IP,如图3所示)。 客户端DNS缓存通常用于最小化对外部DNS服务器的DNS请求以及最小化DNS解析时间。 这是一个简单的递归DNS服务器与本地项目。

如果客户端DNS无法设置为在本地提供轮询或无法禁用,则使用JDBC:瘦连接的Oracle客户端通常会尝试连接到列表中首先返回的SCAN-IP和SCANlistener。 这基本上禁用来自这些客户端的群集中的SCAN侦听器的连接请求负载平衡,但不会影响整个SCAN功能。 基于Oracle调用接口(OCI)的数据库访问驱动程序将应用内部循环算法,在这种情况下不需要考虑。

 

 

Option 2 – Use the Oracle Grid Naming Service (GNS)

If you choose option 2, you only need to enter the SCAN name during the interview. At some stage in the cluster configuration, three IP addresses will be acquired from【被收购/获得的】 either a DHCP service or using “Stateless Address AutoConfiguration” (SLAAC) when using IPv6 based IP addresses with Oracle RAC 12c (using GNS, however, assumes that you use some form of dynamic IP assignment on your public network) to create the SCAN. SCAN name resolution will then be provided by the GNS.   

 选项2 - 使用Oracle网格命名服务(GNS)

如果使用第二种方式,你只需在访问期间输入扫描名称。 在集群配置的某个阶段,三个IP地址将被通过DHCP服务或使用“无状态地址自动配置”(SLAAC)获得,当使用基于IPv6的IP地址与Oracle RAC 12c(使用GNS,但是,假设你使用一些 形式的公共网络上的动态IP分配)来创建SCAN。 然后,由GNS提供扫描名称解析。

 

Workaround if No DNS Server is Available at Installation Time 如果在安装时没有DNS服务器可用,如下解决 

Oracle Universal Installer (OUI) enforces providing a default SCAN resolution during the Oracle Grid Infrastructure installation, since the SCAN concept is an essential part during the creation of Oracle RAC 11g Release 2 or higher databases in the cluster. All Oracle Database 11g Release 2 or higher tools used to create a database (e.g. the Database Configuration Assistant (DBCA), or the Network Configuration Assistant (NetCA)) would assume its presence. Hence, OUI will not let you continue with the installation until you have provided a suitable SCAN resolution.  

Oracle通用安装程序(OUI)强制在Oracle Grid基础结构安装期间提供默认SCAN解决方案,因为SCAN概念是在集群中创建Oracle RAC 11g第2版或更高版本数据库时的重要组成部分。用于创建数据库(例如,数据库配置助手(DBCA)或网络配置助手(NetCA))的所有Oracle数据库11g第2版或更高版本工具都将假设其存在。因此,OUI不会让你继续安装,直到你提供了适当的SCAN解决方案。

However, in order to overcome the installation requirement without setting up a DNS-based SCAN resolution, you can use a hosts-file based workaround. In this case, you would use a typical hosts-file entry to resolve the SCAN to only 1 IP address and one IP address only. It is not possible to simulate the round-robin resolution that the DNS server does using a local host file. The host file look-up the OS performs will only return the first IP address that matches[匹配] the name. Neither will you be able to do so in one entry (one line in the hosts-file). Thus, you will create only 1 SCAN for the cluster. (Note that you will have to change the hosts-file on all nodes in the cluster for this purpose.)

但是,为了克服安装要求,而不设置基于DNS的SCAN解决方案,你可以使用基于主机文件的解决方法。在这种情况下,你将使用典型的主机文件条目将SCAN解析为仅1个IP地址和一个IP地址。不可能模拟DNS服务器使用本地主机文件执行的循环分辨率。操作系统执行的主机文件查找将仅返回与该名称匹配的第一个IP地址。你也不能在一个条目(主机文件中的一行)中这样做。因此,你将只为群集创建1个SCAN。 (请注意,为此目的,你必须更改群集中所有节点上的hosts文件。)

This workaround【工作区域】 might also be used when performing an upgrade from former (pre-Oracle Database 11g Release 2 or higher) releases. However, it is strongly recommended to enable the SCAN configuration as described under “Option 1” or “Option 2” in this paper shortly after the upgrade or the initial installation. In order to make the cluster aware of the modified SCAN configuration, delete the entry in the hosts-file and then issue: "srvctl modify scan -n <scan_name>" as the root user on one node in the cluster.  

此解决方法也可以用于从以前的(Oracle数据库11g第2版或更高版本)版本升级时使用。 但是,强烈建议在升级或初始安装后不久,启用本文中“选项1”或“选项2”下所述的SCAN配置。 为了使集群了解修改的SCAN配置,请删除hosts文件中的条目,然后以集群中一个节点上的root用户的身份发出:“srvctl modify scan -n <scan_name>”命令。

The scan_name provided can be the existing fully qualified name (or a new name), but should be resolved through DNS, having 3 IPs associated with it, as discussed. The remaining re-configuration  is then performed【自动执行】 automatically.  

提供的scan_name可以是现有的完全限定名(或新名称),但应通过DNS解析,具有与其关联的3个IP,如所讨论的。 然后自动执行剩余的重新配置。

SCAN Configuration with Oracle Grid Infrastructure 11g Release 2  

使用Oracle Grid Infrastructure 11g第2版的SCAN配置

During cluster configuration, several resources are created in the cluster for SCAN. For each of the 3 IP addresses that the SCAN resolves to, a SCAN VIP resource is created and a SCAN Listener is created. The SCAN Listener is dependent on the SCAN VIP and the 3 SCAN VIPs (along with their associated listeners) will be dispersed across the cluster.  

在群集配置期间,在SCAN的群集中创建多个资源。 对于SCAN解析到的3个IP地址中的每一个,创建SCAN VIP资源并创建SCAN侦听器。 SCAN侦听器依赖于SCAN VIP和3个SCAN VIP(及其关联的侦听器)将分散在集群中。

This means, each pair of resources (SCAN VIP and Listener) will be started on a different server in the cluster, assuming【傲慢的,不逊的,假设 the cluster consists of three or more nodes.  

这就意味着,每对资源(SCAN VIP和侦听器)将在集群中的不同服务器上启动,假设集群由三个或更多节点组成。

In case, a 2-node-cluster is used (for which 3 IPs are still recommended for simplification reasons), one server in the cluster will host two sets of SCAN resources under normal operations. If the node on which a SCAN VIP is running fails, the SCAN VIP and its associated listener will fail over to another node in the cluster. If by means of such a failure the number of available servers in the cluster becomes less than three, one server would again host two sets of SCAN resources. If a node becomes available in the cluster again, the formerly mentioned dispersion will take effect and relocate one set accordingly.  

在使用2节点群集(为了简化的原因仍推荐3个IP)的情况下,群集中的一个服务器将在正常操作下托管两组SCAN资源。 如果运行SCAN VIP的节点发生故障,则SCAN VIP及其关联的侦听器将故障转移到集群中的另一个节点。 如果通过这样的故障,集群中的可用服务器的数量变得小于三,一个服务器将再次托管两组SCAN资源。 如果节点在群集中再次可用,则前面提到的分散将生效并相应地重新定位一个集合。

 

[grid@mynode] 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@mynode] srvctl config scan 

SCAN name: sales1-scan, Network: 1/133.22.67.0/255.255.252.0/

SCAN VIP name: scan1, IP: /sales1-scan.example.com/133.22.67.192

SCAN VIP name: scan2, IP: /sales1-scan.example.com/133.22.67.193

SCAN VIP name: scan3, IP: /sales1-scan.example.com/133.22.67.194

Example 4: Sample SCAN configuration in Oracle Grid Infrastructure 11g Release 2

 

   

SCAN Configuration with Oracle Grid Infrastructure 12c Release 1

Oracle Grid Infrastructure 12c第1版的SCAN配置

Most of the SCAN design principles【原则】 as outlined for Oracle Grid Infrastructure 11g Release 2

remain with Oracle Grid Infrastructure 12c. However, based on customer requirements and feedback, the SCAN concept has been enhanced with Oracle Grid Infrastructure 12c as follows:

大多数SCAN设计原则如Oracle Grid Infrastructure 11g第2版所概述

仍然与Oracle Grid Infrastructure 12c。 但是,根据客户要求和反馈,Oracle Grid Infrastructure 12c的SCAN概念得到了增强,如下所示:

SCAN and Oracle Clusterware managed VIPs now support IPv6 based IP addresses

1. SCAN和Oracle Clusterware管理的VIP现在支持基于IPv6的IP地址

SCAN is by default restricted to only accept service registration from nodes in the cluster  

2. SCAN在默认情况下被限制为仅接受来自集群中的节点的服务注册

3. SCAN supports multiple subnets in the cluster (one SCAN per subnet)  

3.SCAN支持集群中的多个子网(每个子网一个SCAN)

Only the default SCAN (on the default network, typically network number 1) can be installed and configured during the OUI-based installation of the Oracle Grid Infrastructure. Multiple subnetsupport in the cluster needs to be enabled as a post-installation task. 在Oracle Grid Infrastructure的基于OUI的安装期间,只能安装和配置默认SCAN(在默认网络上,通常为网络号1)。 需要将群集中的多个子网支持作为安装后任务启用

These enhancements require changes in the configuration of the SCAN and SCAN_LISTENER:  

[grid@mynode]$ srvctl config scan 

SCAN name: sales1-scan.example.com, Network: 1 Subnet IPv4: 133.22.67.0/255.255.252.0/eth0

Subnet IPv6:

SCAN 0 IPv4 VIP: 133.22.67.194

SCAN name: sales1-scan.example.com, Network: 1 Subnet IPv4: 133.22.67.0/255.255.252.0/eth0

Subnet IPv6:

SCAN 1 IPv4 VIP: 133.22.67.193

SCAN name: sales1-scan.example.com, Network: 1 Subnet IPv4: 133.22.67.0/255.255.252.0/eth0

Subnet IPv6:

SCAN 2 IPv4 VIP: 133.22.67.192

 

[grid@mynode]$ srvctl config scan_listener SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521

Registration invited nodes:

Registration invited subnets:

SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521

Registration invited nodes:

Registration invited subnets:

SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521

Registration invited nodes:

Registration invited subnets:

Example 5: SRVCTL output examples

 

As you can see from the example output shown in Example 5, supporting IPv6 based IPs for SCAN (and thereby the Node VIPs) is an essential concept【本质概念 in Oracle Grid Infrastructure 12c SCAN. In example 5, IPv6 based IP addresses are not used and only one SCAN has been deployed in the cluster on network number one, which is assigned to the Network Interface Card (NIC) eth0.  

从示例5中所示的示例输出中可以看出,支持基于IPv6的IP(用于SCAN)(从而支持节点VIP)是Oracle Grid Infrastructure 12c SCAN中的一个重要概念。 在示例5中,不使用基于IPv6的IP地址,并且在分配给网络接口卡(NIC)eth0的网络1上的集群中仅部署了一个SCAN。

The example output in Example 5 also shows traces of the new security features in SCAN. By default, SCAN in Oracle Grid Infrastructure 12c will only accept a registration【注册】 of database instances (as part  of the Dynamic Database Instance registration with listeners) that are part of the cluster that a SCAN listener is assigned to.  

 示例5中的示例输出还显示了SCAN中新安全功能的跟踪。 默认情况下,Oracle Grid Infrastructure 12c中的SCAN将仅接受作为SCAN侦听器分配给的集群的一部分的数据库实例的注册(作为向侦听器注册的动态数据库实例的一部分)。

Note: In order to only allow database instance registration of databases hosted in the cluster, the default registration of database instances with their assigned SCAN(s) uses the private interconnect.  If – for some reason – databases that cannot access or do not use the private interconnect that is  defined for the cluster need to be registered with a respective SCAN listener, the SCAN listener can  be modified to allow additional registrations on a per (named) node or subnet basis as illustrated in Example 6 below. Note that invited nodes do not need to be present in the cluster when adding them to the list in order to pre-approve nodes that might join in future.  

注意:为了仅允许在群集中托管的数据库的数据库实例注册,数据库实例与其分配的SCAN的默认注册将使用专用互连。 如果由于某种原因,无法访问或不使用为集群定义的专用互连的数据库需要向相应的SCAN侦听器注册,则可以修改SCAN侦听器以允许在每个(命名)节点上进行附加注册 或子网基础,如下面的实施例6所示。 请注意,当将受邀节点添加到列表时,它们不需要出现在群集中,以便预先批准将来可能加入的节点。

 

[grid@mynode]$ srvctl modify scan_listener -invitednodes test –update

[grid@mynode]$ srvctl config scan_listener 

SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521 Registration invited nodes: test

Registration invited subnets:

SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521 Registration invited nodes: test

Registration invited subnets:

SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521 Registration invited nodes: test

Registration invited subnets:

Example 6: Modify SCAN Listener to allow registration from additional node(s)

 示例6:修改SCAN侦听器以允许从其他节点注册

 

Enabling Multiple-Subnet Support for SCAN

启用SCAN的多子网支持

In order to use a SCAN on more than one subnet in the cluster, you must first enable the use of multiple subnets in the cluster, which in general is a post-installation task, including the following steps:

为了在群集中的多个子网上使用SCAN,必须首先在群集中启用多个子网的使用,这通常是安装后任务,包括以下步骤:

Create additional subnet(s) on the (public) network(s)

Assign node VIPs to newly created subnet(s)

Create a node Listener for newly created subnet(s)

Create (a) SCAN(s) using the option one or two

1.在(公共)网络上创建其他子网,

2.将节点VIP分配给新创建的子网

3.为新创建的子网创建节点侦听器

4.使用选项一或二创建(a)扫描

Step 1 assumes that you either have multiple【多个】 network interface cards (NICs) that you plan on using for the public network communication in your Oracle RAC cluster, or you have one (set) of interface(s) that you want to use with multiple IP addresses from various network. Both can be established in various ways, while in either case, the Oracle Clusterware layer【层】 should be able to see multiple interfaces as determined by the oifcfg command as shown in Example 7.

步骤1假定您有多个网络接口卡(NIC),您计划在Oracle RAC集群中用于公共网络通信,或者有一个(组)接口要与多个来自多种网络IP一起使用 地址。 两者都可以以各种方式建立,而在任一情况下,Oracle Clusterware层应该能够看到由oifcfg命令确定的多个接口,如示例7所示。

 

[grid@mynode]$ oifcfg iflist eth0  133.22.67.0 eth1  192.168.122.0 eth1  169.254.0.0 eth2  10.1.1.0

 

[grid@mynode]$ oifcfg setif -global eth2/10.1.1.0:public 

[grid@mynode]$ oifcfg getif eth0  133.22.67.0  global  public

eth1  192.168.122.0  global  cluster_interconnect,asm eth2  10.1.1.0  global  public

 

[root@mynode]# srvctl add network -netnum 2  

-subnet 10.1.1.0/255.255.252.0/eth2

[root@mynode]# srvctl config network -netnum 2 

Network 2 exists

Subnet IPv4: 10.1.1.0/255.255.252.0/eth0, static

Subnet IPv6:

Example 7: Create additional subnets on the public network

Steps 2 to 4 from above list use Oracle Clusterware standard commands as shown in Example 8.  

#ADD node VIPs

[root@mynode]# srvctl add vip -node SalesSrv145 -netnum 2 -address SalesSrv 145v2/255.255.252.0 

[root@mynode]# srvctl add vip -node SalesSrv146 -netnum 2 -address SalesSrv 146v2/255.255.252.0 

[root@mynode]# srvctl add vip -node SalesSrv147 -netnum 2 -address SalesSrv 147v2/255.255.252.0

[root@mynode]# srvctl add vip -node SalesSrv148 -netnum 2 -address SalesSrv 148v2/255.255.252.0 

 

#ADD node listener on network number 2

[grid@mynode]$ srvctl add listener -listener ListNet2 -netnum 2 -endpoints "TCP:1528" 

 

#ADD SCAN on network number 2

[root@mynode]# srvctl add scan -scanname scantest -netnum 2  

#START node VIPs

[root@mynode]# srvctl start vip -vip SalesSrv145v2

[root@mynode]# srvctl start vip -vip SalesSrv146v2

[root@mynode]# srvctl start vip -vip SalesSrv147v2 [root@mynode]# srvctl start vip -vip SalesSrv148v2  

#START ListNet2 node listener on network number 2

[grid@mynode]$ srvctl start listener -listener ListNet2  [grid@mynode]$ srvctl status listener -listener ListNet2  

Listener LISTNET2 is enabled

Listener LISTNET2 is running on node(s): SalesSrv145, SalesSrv146, SalesSrv147 …  

#START SCAN on network number 2

[root@mynode]# srvctl start scan -netnum 2  

#Check configuration and status for SCAN [root@mynode]# srvctl config scan -netnum 2 

SCAN name: scantest, Network: 2

Subnet IPv4: 10.1.1.0/255.255.252.0/eth2

Subnet IPv6:

SCAN 0 IPv4 VIP: 10.1.1.250

 

[root@mynode]# srvctl status scan -netnum 2 

SCAN VIP scan1_net2 is enabled

SCAN VIP scan1_net2 is running on node SalesSrv146 

Example 8: Assign Node VIPs and Create SCAN on the newly created subnet

Notes for Examples 7 and 8:

Operations introduced with “[root@mynode]” need to be executed as a privileged user

Operations introduced with “[root@mynode]” may be executed as a privileged user

It is assumed that the names in “-address” as part of the “srvctl add vip” command resolve to a valid IP address either via DNS or /etc/hosts. Example:  

SalesSrv 145v2 needs resolve to a valid and unused IP address in the 10.1.1.0 subnet

SCAN “scantest.example.com” was not created using Option 1 or Option 2

Instead, “Workaround if No DNS Server is Available at Installation Time” was used

 

Note also that adding the SCAN to network number 2, does not automatically create a SCAN listener on this network. In order to make full use of SCAN on network number 2, you need to create and start a SCAN listener on this network.

 还请注意,将SCAN添加到网络号2,不会在此网络上自动创建SCAN侦听器。 为了充分利用网络号2上的SCAN,您需要在此网络上创建和启动SCAN侦听器。

#ADD SCAN_LISTENER to network number 2

[grid@mynode]$ srvctl add scan_listener -netnum 2 -listener testscan  -endpoints TCP:1528

 

[grid@mynode]$ srvctl config scan_listener -netnum 2 

SCAN Listener TESTSCAN_SCAN1_NET2 exists. Port: TCP:1528

Registration invited nodes:

Registration invited subnets:

 

[grid@mynode]$ srvctl start scan_listener -netnum 2

 

[grid@mynode]$ srvctl status scan_listener -netnum 2

SCAN Listener TESTSCAN_SCAN1_NET2 is enabled

SCAN listener TESTSCAN_SCAN1_NET2 is running on node SalesSrv146

Example 9:Adding a SCAN listener to the newly added SCAN configuration on netnum 2

Now that you have created another SCAN setup using a different subnet for public communication and created a respective node VIPs, node listener and SCAN listener, you will need to inform the database(s) using these SCANs how to register with them. The principles of databases instances registering with listeners and in particular with SCAN listeners has not changed with Oracle Database 12c compared to Oracle Database 11g Release 2 and will therefore be discussed in the generic part of this paper under the section “Multiple-Subnet Support and LISTENER_NETWORKS”.

 现在您已经使用不同的子网为公共通信创建了另一个SCAN设置,并创建了相应的节点VIP,节点侦听器和SCAN侦听器,您将需要使用这些SCAN通知数据库如何向它们注册。 使用Oracle Database 12c与Oracle Database 11g第2版相比,使用侦听器(特别是SCAN侦听器)注册的数据库实例的原理未更改,因此将在本文的“多子网支持和LISTENER_NETWORKS”一节中讨论 “。

   

Oracle Database Configuration Using SCAN

使用SCAN的oracle数据库配置

Ever since Oracle Database 11g Release 2, SCAN is an essential【基础的】 part of the Oracle RAC database configuration and therefore the REMOTE_LISTENER parameter is set to the SCAN per default, assuming that the database is created using standard Oracle tools (e.g. the formerly mentioned  DBCA). This allows the instances to register with the SCAN Listeners as remote listeners to  provide information on what services are being provided by the instance, the current load and a recommendation on how many incoming

connections should be directed to the instance.  

自Oracle Database 11g第2版以来,SCAN是Oracle RAC数据库配置的重要组成部分,因此REMOTE_LISTENER默认设置为SCAN,假定数据库是使用标准Oracle工具(例如前面提到的DBCA)创建的,则REMOTE_LISTENER参数将被设置为SCAN。 这允许实例向SCAN监听器注册为远程侦听器,以提供关于实例提供什么服务,当前负载以及关于应将多少传入连接定向到实例的建议的信息。

In this context【上下文】, the LOCAL_LISTENER parameter must be considered. The LOCAL_LISTENER parameter should be set to the node-VIP. If you need fully qualified domain names, ensure that LOCAL_LISTENER is set to the fully qualified domain name (e.g. node-VIP.example.com). By default, a node listener is created on each node in the cluster during cluster configuration. If you want to use multiple subnets with your cluster, additional node-VIPs should be configured after the initial installation as discussed in section “Enabling Multiple-Subnet Support for SCAN” of this paper.

在此上下文中,必须考虑LOCAL_LISTENER参数。 LOCAL_LISTENER参数应设置为node-VIP。 如果您需要完全限定域名,请确保LOCAL_LISTENER设置为完全限定域名(例如node-VIP.example.com)。 默认情况下,在群集配置期间在群集中的每个节点上创建节点侦听器。 如果要对群集使用多个子网,则应在初始安装后配置其他节点VIP,如本文“启用SCAN的多子网支持”部分所述。

Starting with Oracle Grid Infrastructure 11g Release 2 the node listener run out of the Oracle Grid Infrastructure home and listens on the node-VIP using the specified port (default port is 1521).   

Unlike in former database versions, it is not recommended to set your REMOTE_LISTENER parameter to a server side TNSNAMES alias【别名,化名 that resolves the host to the SCAN (e.g: HOST=sales1scan) in the address list entry, but use the simplified “SCAN:port” syntax as shown in Example 10.  

从Oracle Grid Infrastructure 11g第2版开始,节点侦听器运行于Oracle Grid Infrastructure主目录,并使用指定的端口(默认端口为1521)侦听节点VIP。

与以前的数据库版本不同,不建议将REMOTE_LISTENER参数设置为服务器端TNSNAMES别名,以将地址列表条目中的主机解析为SCAN(例如:HOST = sales1scan),但使用简化的“SCAN:port” 语法,如示例10所示。

 

NAME                       TYPE        VALUE

-------------------------- ----------- ------------------------------ local_listener             string      (DESCRIPTION=(ADDRESS_LIST=(AD                                        DRESS=(PROTOCOL=TCP)(HOST=133.

                                       22.67.111)(PORT=1521))))  

remote_listener            string      sales1-scan.example.com:1521 

Example 10: LOCAL and REMOTE_LISTENER default configuration

Note: if you use the easy connect naming method, you may need to modify your SQLNET.ORA to ensure that EZCONNECT is in the list when specifying the order of the naming methods used for  the client name resolution lookups (NAMES.DIRECTORY_PATH=(tnsnames, ldap, ezconnect)).

 注意:如果使用easy连接命名方法,您可能需要修改SQLNET.ORA,以确保在指定用于客户端名称解析查找的命名方法的顺序时,EZCONNECT在列表中(NAMES.DIRECTORY_PATH =(tnsnames ,ldap,ezconnect))。

Client Load Balancing using SCAN  客户端负载平衡使用SCAN

For clients connecting using Oracle SQL*Net 11g Release 2, three IP addresses will be received by the client by resolving the SCAN name through DNS as discussed. The client will then go through the list it receives from the DNS and try connecting through one of the IPs received. If the client receives an error, it will try the other addresses before returning an error to the user or application. This is similar to how client connection failover works in previous releases when an address list is provided in the client connection string.

对于使用Oracle SQL * Net 11g第2版连接的客户端,客户端将通过如所讨论的通过DNS解析SCAN名称来接收三个IP地址。 客户端然后将通过从DNS接收的列表,并尝试通过接收的IP之一连接。 如果客户端收到错误,它将在向用户或应用程序返回错误之前尝试其他地址。 这类似于在客户端连接字符串中提供地址列表时客户端连接故障转移在以前版本中的工作原理。

When a SCAN Listener receives a connection request, the SCAN Listener will check for the least loaded instance providing the requested service. It will then re-direct the connection request to the local listener on the node where the least loaded instance is running. Subsequently, the client will  be given the address of the local listener. The local listener will finally create the connection to the database instance.

 当SCAN侦听器接收到连接请求时,SCAN侦听器将检查提供所请求服务的最小负载实例。 然后它将连接请求重定向到运行最少负载实例的节点上的本地侦听器。 随后,客户端将被给予本地侦听器的地址。 本地侦听器将最终创建到数据库实例的连接。

 

Figure 1: Connection Load Balancing using SCAN - Illustrated

 

 

Multiple-Subnet Support and LISTENER_NETWORKS 多子网支持和LISTENER_NETWORKS参数

The Oracle 11g Release 2 documentation3 for the LISTENER_NETWORKS parameter says: “A

network may contain multiple local and remote【偏远的】 listeners. By default, all listeners are cross-registered【交叉注册】 with each other. By specifying a set of listeners in the LISTENER_NETWORKS initialization parameter, you can designate a subset of local listeners with a subset of remote listeners. Listeners specified by the LISTENER_NETWORKS parameter should not be specified by the LOCAL_LISTENER and REMOTE_LISTENER parameters.

LISTENER_NETWORKS参数的Oracle 11g第2版文档3说:“一个网络可能包含多个本地和远程侦听器。 默认情况下,所有侦听器都相互交叉注册。 通过在LISTENER_NETWORKS初始化参数中指定一组侦听器,可以使用远程侦听器的子集来指定本地侦听器的子集。 由LISTENER_NETWORKS参数指定的侦听器不应由LOCAL_LISTENER和REMOTE_LISTENER参数指定。

When using SCANs on multiple subnets, the LISTENER_NETWORKS parameter must be set  for all databases that are meant to be reached via different subnets with Oracle Grid Infrastructure  11g Release 2. With Oracle Grid Infrastructure 12c, the Oracle Database Agent manages the LISTENER_NETWORKS parameter as required by default. 

 在多个子网上使用SCAN时,必须为那些所有数据库不同子网访问的数据库设置LISTENER_NETWORKS参数,这就意味着可以通过不同子网访问Oracle Grid Infrastructure  11g Release 2.。对于Oracle Grid Infrastructure 12c,Oracle数据库代理根据需要管理LISTENER_NETWORKS参数为默认。

 

 

For more information on the LISTENER_NETWORKS parameter, see the Oracle documentation.  

Version and Backward Compatibility版本和后续兼容性

The successful use of SCAN to connect to an Oracle RAC database in the cluster depends on the ability of the client to understand and use the SCAN as well as on the correct configuration of the REMOTE_LISTENER parameter setting in the database as discussed. If the version of the Oracle Client connecting to the database as well as the Oracle Database version used are both Oracle Database 11g Release 2 or higher and the default configuration is used as described in this paper, no changes to the system are typically required.  

成功使用SCAN连接到集群中的Oracle RAC数据库取决于客户端理解和使用SCAN以及正如所讨论的数据库中的REMOTE_LISTENER参数设置的正确配置的方式。 如果连接到数据库的Oracle客户端的版本以及使用的Oracle数据库版本都是Oracle Database 11g  r2或更高版本,并且如本文所述使用默认配置,则通常不需要对系统进行任何更改。

 

The same holds true, if the Oracle Client version and the version of the Oracle Database that this client is connecting to are both pre-11g Release 2 version (e.g. Oracle Database 11g Release 1 or Oracle Database 10g Release 2, or older). In this case, the pre-11g Release 2 client would use a TNS connect descriptor that resolves to the node-VIPs of the cluster, while the Oracle pre-11g Release 2 database would still use a REMOTE_LISTENER entry pointing to the node-VIPs.  

如果客户端连接到的Oracle客户端版本和Oracle数据库的版本都是11g版本2之前的版本(例如,Oracle数据库11g第1版或Oracle数据库10g第2版或更早版本),则同样如此。 在这种情况下,11g前版本2客户端将使用解析到集群的节点VIP的TNS连接描述符,而Oracle前11g版本2数据库仍将使用指向节点VIP的REMOTE_LISTENER条目。

 

The disadvantage of this configuration is that SCAN would not be used and hence the clients are still exposed to changes every time the cluster changes in the backend. Similarly, if an Oracle Database 11g Release 2 or higher is used, but the clients remain on a former version. The solution is to change the Oracle client and / or Oracle Database REMOTE_LISTENER settings accordingly.  

此配置的缺点是SCAN不会被使用,因此客户端仍然暴露在更改每次集群在后端更改。 同样,如果使用Oracle数据库11g第2版或更高版本,但客户端保持在以前的版本。 解决方案是相应地更改Oracle客户端和/或Oracle数据库REMOTE_LISTENER设置。

The following cases need to be considered:  

 

Oracle Client Version

Oracle Database Version

Comment

Oracle Database 11g Release 2  or higher

Oracle Database 11g Release 2  or higher

No change required.

Oracle Database 11g Release 2  or higher

Pre- Oracle Database 11g Release 2

Add the SCAN VIPs as hosts to the REMOTE_LISTENER parameter.

Pre- Oracle Database 11g Release 2

Oracle Database 11g Release 2 or higher

Change the client TNSNAMES.ora to  include the SCAN VIPs (* see below). IF the database was upgraded using the DBUA from a pre-11g Rel. 2 database,  the DBUA will configure the

REMOTE_LISTENER parameter to point  to the node-VIPs as well as the SCAN.

更改客户端TNSNAMES.ora以包括SCAN VIP(*请参见下文)。 如果数据库使用DBUA从11g之前的版本升级。 2数据库,DBUA将配置

REMOTE_LISTENER参数指向节点VIP以及SCAN。

Pre- Oracle Database 11g Release 2

Pre- Oracle Database 11g Release 2

If you want to make use of SCAN (recommended):

add the SCAN VIPs as hosts to the

REMOTE_LISTENER parameter.

AND

Change the client TNSNAMES.ora to  include the SCAN VIPs (* see below).

Otherwise, no change required.

如果你想使用SCAN(推荐):

添加SCAN VIP作为主机

REMOTE_LISTENER参数。

更改客户端TNSNAMES.ora以包括SCAN VIP(*请参见下文)。

否则,不需要更改。  

Table 1: Oracle Client and Oracle Database Version Compatibility for SCAN oracle客户端oracle数据库对SCAN的版本兼容

Note:  If using a pre-11g Release 2 client (Oracle Database 11g Release or Oracle Database 10g Rel. 2, or older) you will not fully benefit from the advantages of SCAN.  

Reason: The Oracle Client will not be able to handle a set of three IPs returned by the DNS for SCAN. Hence, it will try to connect to only the first address returned in the list and will more or less ignore the others. If the SCAN Listener listening on this specific IP is not available or the IP itself is not available, the connection will fail. In order to ensure load balancing and connection failover with pre-11g Release 2 clients, you will need to change the TNSNAMES.ora of the client so that it would use 3 address lines, where each address line resolves to one of the SCAN VIPs.  

注意:如果使用11g版本2之前的客户端(Oracle数据库11g版本或Oracle数据库10g第2版或更早版本),您将无法充分利用SCAN的优势。

原因:Oracle客户端将无法处理DNS为SCAN返回的一组三个IP。 因此,它将尝试仅连接到列表中返回的第一个地址,并且会或多或少地忽略其他地址。 如果侦听此特定IP的SCAN侦听器不可用或IP本身不可用,则连接将失败。 为了确保与11g版本2客户端的负载平衡和连接故障转移,您需要更改客户端的TNSNAMES.ora,以便它将使用3个地址线,其中每个地址线解析为一个SCAN VIP。

 

sales.example.com =(DESCRIPTION=  

(ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON)

 (ADDRESS=(PROTOCOL=tcp)(HOST=133.22.67.192)(PORT=1521))  

 (ADDRESS=(PROTOCOL=tcp)(HOST=133.22.67.193)(PORT=1521))

 (ADDRESS=(PROTOCOL=tcp)(HOST=133.22.67.194)(PORT=1521)))

  (CONNECT_DATA=(SERVICE_NAME= salesservice.example.com)))

Example 11: TNSNAMES.ora for Oracle Database pre- 11g Release 2 Clients

 

 

Miscellaneous SCAN-related Configurations

其他SCAN相关配置

SCAN can be used in multiple configurations. This paper describes the recommended setup, which does not exclude other configurations, as long as you are aware of their implications. The following section discusse some less-common, configurations and will be updated over time as needed.  

 SCAN可用于多种配置。 本文介绍了建议的设置,不排除其他配置,只要您知道它们的含义。 以下部分讨论一些不常见的配置,并将根据需要随时间更新。

Using SCAN with Multiple Ports on the Same Subnet 在同一子网上使用具有多个端口的SCAN

For the purpose of allowing applications to maintain a distinguishable【可区别 connect string on host / port level using one SCAN as the host or to enable port-based firewall configurations, SCAN can be set up to support more than one port for the same subnet.  

为了允许应用程序使用一个SCAN作为主机在主机/端口级别上保持可区分的连接字符串,或者启用基于端口的防火墙配置,可以设置SCAN以支持同一子网的多个端口。

It needs to be noticed that different ports are only used for an initial connect. Once a connection using SCAN on any SCAN port has been established, port assignment is not maintained and routing of connections within the Oracle RAC cluster is performed using database services registered with one or more local listeners.

需要注意的是,不同的端口只用于初始连接。 一旦在任何SCAN端口上使用SCAN建立连接,就不会维护端口分配,并且使用向一个或多个本地侦听器注册的数据库服务来执行Oracle RAC集群中的连接路由。

This means that all SCAN ports are treated the same, so that a connection that comes in on any SCAN port can be directed to any registered local listener on any port within the same subnet.

这意味着所有SCAN端口都被视为相同,以便在任何SCAN端口上进入的连接可以被引导到同一子网内任何端口上的任何注册本地侦听器。

Note also that the multi-port assignment【分配】 differs per version. Oracle Grid Infrastructure 11.2.0.3 would not let you set up multiple ports on one SCAN anymore, while Oracle Grid Infrastructure 11.2.0.2 would have let you use this configuration.  Support for this configuration is resumed with Oracle Grid Infrastructure 11.2.0.3.6 and higher as well as Oracle Grid Infrastructure 12c.

还要注意,多端口分配因版本而异。 Oracle Grid Infrastructure 11.2.0.3不允许您在一个SCAN上设置多个端口,而Oracle Grid Infrastructure 11.2.0.2将允许您使用此配置。 Oracle Grid Infrastructure 11.2.0.3.6及更高版本以及Oracle Grid Infrastructure 12c恢复对此配置的支持。

Using SCAN in a MAA Environment not using GDS 在不使用GDS的MAA环境中使用SCAN

If you have implemented a Maximum Availability Architecture (MAA) environment without Global Data Services (GDS), a new capability available with Oracle Database 12c that extends intelligent【智能的】 load balancing and client failover concepts to globally distributed environments, in which you use Oracle RAC for both your primary and standby database (in both, your primary and standby site), which are synchronized using Oracle Data Guard, using SCAN provides a simplified TNSNAMES configuration that a client can use to connect to the database independently of whether the primary or standby database is the currently active (primary) database.   

如果您已实施没有全局数据服务(GDS)的最大可用性架构(MAA)环境,Oracle Database 12c提供了一项新功能,可将智能负载平衡和客户端故障转移概念扩展到全局分布式环境,其中使用Oracle RAC 您的主数据库和备用数据库(在主站点和备用站点)(使用Oracle Data Guard同步)使用SCAN提供了一个简化的TNSNAMES配置,客户端可以使用该配置连接到数据库,而不管主数据库还是备用数据库是当前活动(主)数据库。

In order to use this simplified configuration, Oracle Database 11g Release 2 introduces two new SQL*Net parameters that can be used on for connection strings of individual clients. The first parameter is CONNECT_TIMEOUT. It specifies the timeout duration (in seconds) for a client to establish an Oracle Net connection to an Oracle database.  This parameter overrides

SQLNET.OUTBOUT_CONNECT_TIMEOUT in the SQLNET.ORA. The second parameter is RETRY_COUNT and it specifies the number of times an ADDRESS_LIST is traversed before the connection attempt is terminated.  

为了使用此简化配置,Oracle Database 11g第2版引入了两个新的SQL * Net参数,可用于单个客户端的连接字符串。 第一个参数是CONNECT_TIMEOUT。 它指定客户端建立到Oracle数据库的Oracle Net连接的超时持续时间(以秒为单位)。 此参数覆盖

SQLNET.OUT中的SQLNET.OUTBOUT_CONNECT_TIMEOUT。 第二个参数是RETRY_COUNT,它指定在连接尝试终止之前ADDRESS_LIST被遍历的次数。

Using these two parameters, both, the SCAN on the primary site and the standby site, can be used in the client connection strings.  Even, if the randomly selected address points to the site that is not currently active, the timeout will allow the connection request to failover before the client has waited unreasonably long (the default timeout depending on the operating system can be as long as 10 minutes).  

 使用这两个参数,主站点和备用站点上的SCAN都可以在客户端连接字符串中使用。 即使,如果随机选择的地址指向当前不活动的站点,超时将允许连接请求在客户端不必要地等待之前进行故障转移(默认超时取决于操作系统可以长达10分钟) 。

sales.example.com =(DESCRIPTION= (CONNECT_TIMEOUT=10)(RETRY_COUNT=3)  

(ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON)

 (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-scan)(PORT=1521))  

 (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-scan)(PORT=1521)))

  (CONNECT_DATA=(SERVICE_NAME= salesservice.example.com)))

Example 12: TNSNAMES.ORA entry for MAA environment

 

 

Using SCAN in a MAA Environment using GDS

在使用GDS的MAA环境中使用SCAN

Global Data Services (GDS) is a new capability available with Oracle Database 12c that extends intelligent load balancing and client failover concepts【扩展】 to globally distributed environments【分布式环境 in which there are two or more failover targets that could be used to maintain availability. For MAA configurations using GDS, using SCAN listeners is avoided. For more information regarding the configuration of GDS and SCAN, please, consult the respective Oracle documentation.

全球数据服务(GDS)是Oracle Database 12c提供的一项新功能,可将智能负载平衡和客户端故障转移概念扩展到全球分布式环境,其中有两个或更多故障转移目标可用于维持可用性。 对于使用GDS的MAA配置,避免使用SCAN侦听器。 有关GDS和SCAN的配置的更多信息,请参阅相应的Oracle文档。

  

Using SCAN with Oracle Connection Manager

将SCAN与Oracle Connection Manager结合使用

If you use Oracle Connection Manager (CMAN) with your Oracle RAC Database, the REMOTE_LISTENER parameter for the Oracle RAC instances should include the CMAN server so that the CMAN server will receive load balancing related information and can therefore load balance connections across the available instances.  

如果对Oracle RAC数据库使用Oracle连接管理器(CMAN),则Oracle RAC实例的REMOTE_LISTENER参数应包括CMAN服务器,以便CMAN服务器将接收与负载平衡相关的信息,因此可以跨可用实例负载平衡连接

The easiest way to achieve this would be to add the CMAN-server as an entry to the REMOTE_LISTENER of the databases that clients want to connect to via CMAN as shown in figure 10.  Note also that you will have to remove the SCAN from the TNSNAMES connect descriptor of the clients and further configurations will be required for the CMAN server. See the CMAN documentation for more details.

实现这一点的最简单的方法是将CMAN服务器作为一个条目添加到客户机想要通过CMAN连接到的数据库的REMOTE_LISTENER中,如图10所示。还要注意,您必须从TNSNAMES中删除SCAN 连接描述符,并且CMAN服务器需要进一步的配置。 有关更多详细信息,请参阅CMAN文档。

SQL> show parameters listener

 

NAME                       TYPE        VALUE

-------------------------- ----------- ------------------------------ listener_networks          string

local_listener             string      (DESCRIPTION=(ADDRESS_LIST=                                          (ADDRESS=(PROTOCOL=TCP)

                                          (HOST=148.87.58.109)(PORT=1521)))) remote_listener            string      stscan3.oracle.com:1521,(DESCRIPTION=

                                          (ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)

                                           (HOST=CMANserver)(PORT=1521))))

Example 13: Server side TNSNAMES.ora example entry when using CMAN

 

 

Summary and Conclusion

摘要和结论

 

Single Client Access Name (SCAN) is a feature used in Oracle Real Application Clusters environments that provides a single name for clients to access any Oracle Database running in a cluster. SCAN was first introduced with Oracle Real Application Clusters (RAC) 11g Release 2 as part of the Oracle Grid Infrastructure suite of products and was further enhanced with Oracle RAC 12c.   

单一客户端访问名称(SCAN)是Oracle Real Application Clusters环境中使用的一种功能,它为客户端提供访问集群中运行的任何Oracle数据库的单一名称。 SCAN最初作为Oracle Grid Infrastructure产品套件的一部分引入了Oracle Real Application Clusters(RAC)11g第2版,并通过Oracle RAC 12c进一步增强。

In any version, having a single name to access the cluster to connect to a database in this cluster allows clients to use EZConnect and the simple JDBC thin URL to access any database running in the cluster, independently of the number of databases or servers running in the cluster and regardless on which server(s) in the cluster the requested database is actually active.  

在任何版本中,具有访问集群以连接到此集群中的数据库的单一名称允许客户端使用EZConnect和简单的JDBC瘦URL访问集群中运行的任何数据库,独立于运行的数据库或服务器的数量 集群以及所请求的数据库实际上处于活动状态的集群中的哪个服务器。

Support for multiple subnets in the cluster as well as IPv6 support in addition to a more secure way  of registering database instances with SCAN listeners floating in the cluster make the latest version of SCAN more flexible and effective in order to support DBaaS or private database cloud deployments【云部署】.

支持集群中的多个子网以及IPv6支持,以及更安全地注册具有浮动在集群中的SCAN侦听器的数据库实例的方法,使最新版本的SCAN更灵活和有效,以支持DBaaS或私有数据库云部署 。

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值