FAILOVER Purpose:To enable or disable connect-time failover for multiple protocol addresses. When you set the parameter to on, yes, or true, Oracle Net, at connect time, fails over to a different address if the first protocol address fails. When you set the parameter to off, no, or false, Oracle Net tries one protocol address. 故障切换 目的:启用或禁用多个协议地址的连接时故障转移。 当您将参数设置为on,yes或true时,如果第一个协议地址失败,则Oracle Net在连接时将失败到另一个地址。 当您将参数设置为off,no或false时,Oracle Net会尝试一个协议地址。 这个参数应该默认是on,实验过,如下tns配置后,把节点1关机,节点1的公共ip NODE1 PUBLIC_IP就不存在了,使用sqlplus连接这个tns的名称时,还是可以连接上节点2 PUBLIC_NO_LOADBALANCE_FAILOVER = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =NODE1 PUBLIC_IP)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST =NODE2 PUBLIC_IP)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )
LOAD_BALANCE Purpose:To enable or disable client load balancing for multiple protocol addresses. When you set the parameter to on, yes, or true, Oracle Net progresses the list of addresses in a random sequence, balancing the load on the various listener or Oracle Connection Manager protocol addresses. When you set the parameter to off, no, or false, Oracle Net tries the first address in the address list. If the connection fails and the failover parameter is enabled, then Oracle Net tries the addresses sequentially until one succeeds. 负载均衡 目的:启用或禁用多个协议地址的客户端负载平衡。 当您将参数设置为on,yes或true时,Oracle Net会以随机顺序进行地址列表,平衡各种侦听器或Oracle Connection Manager协议地址的负载。 将参数设置为off,no或false时,Oracle Net会尝试地址列表中的第一个地址。 如果连接失败并启用了故障切换参数,则Oracle Net会依次尝试地址,直到成功。
About the SCAN Oracle Database 11g release 2 clients connect to the database using SCANs. The SCAN and its associated IP addresses provide a stable name for clients to use for connections, independent of the nodes that make up the cluster. SCAN addresses, virtual IP addresses, and public IP addresses must all be on the same subnet. The SCAN is a virtual IP name, similar to the names used for virtual IP addresses, such as node1-vip. However, unlike a virtual IP, the SCAN is associated with the entire cluster, rather than an individual node, and associated with multiple IP addresses, not just one address. The SCAN works by being able to resolve to multiple IP addresses in the cluster handling public client connections. When a client submits a request, the SCAN listener listening on a SCAN IP address and the SCAN port is made available to a client. Because all services on the cluster are registered with the SCAN listener, the SCAN listener replies with the address of the local listener on the least-loaded node where the service is currently being offered. Finally, the client establishes connection to the service through the listener on the node where service is offered. All of these actions take place transparently to the client without any explicit configuration required in the client. During installation listeners are created. They listen on the SCAN IP addresses provided on nodes for the SCAN IP addresses. Oracle Net Services routes application requests to the least loaded instance providing the service. Because the SCAN addresses resolve to the cluster, rather than to a node address in the cluster, nodes can be added to or removed from the cluster without affecting the SCAN address configuration. The SCAN should be configured so that it is resolvable either by using Grid Naming Service (GNS) within the cluster, or by using Domain Name Service (DNS) resolution. For high availability and scalability, Oracle recommends that you configure the SCAN name so that it resolves to three IP addresses. At a minimum, the SCAN must resolve to at least one address. If you specify a GNS domain, then the SCAN name defaults to clustername-scan.GNS_domain. Otherwise, it defaults to clustername-scan.current_domain. For example, if you start Oracle Grid Infrastructure installation from the server node1, the cluster name is mycluster, and the GNS domain is grid.example.com, then the SCAN Name is mycluster-scan.grid.example.com. Clients configured to use IP addresses for Oracle Database releases prior to Oracle Database 11g release 2 can continue to use their existing connection addresses; using SCANs is not required. When you upgrade to Oracle Clusterware 11g Release 2 (11.2), the SCAN becomes available, and you should use the SCAN for connections to Oracle Database 11g release 2 or later databases. When an earlier version of Oracle Database is upgraded, it registers with the SCAN listeners, and clients can start using the SCAN to connect to that database. The database registers with the SCAN listener through the remote listener parameter in the init.ora file. The REMOTE_LISTENER parameter must be set to SCAN:PORT. Do not set it to a TNSNAMES alias with a single address with the SCAN as HOST=SCAN. The SCAN is optional for most deployments. However, clients using Oracle Database 11g release 2 and later policy-managed databases using server pools should access the database using the SCAN. This is because policy-managed databases can run on different servers at different times, so connecting to a particular node virtual IP address for a policy-managed database is not possible. 关于SCAN Oracle数据库11g版本2客户端使用SCAN连接到数据库。 SCAN及其关联的IP地址为客户端提供了一个稳定的名称,用于连接,独立于构成集群的节点。 SCAN地址,虚拟IP地址和公共IP地址都必须在同一个子网上。 SCAN是一个虚拟IP名称,类似于虚拟IP地址的名称,如node1-vip。 然而,与虚拟IP不同,SCAN与整个集群相关联,而不是单个节点,并且与多个IP地址相关联,而不仅仅是一个地址。 SCAN通过能够解决群集中处理公共客户端连接的多个IP地址而起作用。 当客户端提交请求时,侦听SCAN IP地址和SCAN端口的SCAN侦听器可用于客户端。 因为群集上的所有服务都已向SCAN侦听器注册,所以SCAN侦听器将回复当前提供服务的最小负载节点上的本地侦听器的地址。 最后,客户端通过在提供服务的节点上的监听器建立与服务的连接。 所有这些操作都对客户端透明地进行,而客户端中不需要任何明确的配置。 在安装期间创建监听器。 他们监听节点上提供的SCAN IP。 Oracle Net Services将应用程序请求路由到提供服务的最小负载实例。 由于SCAN地址解析到集群,而不是群集中的节点地址,因此节点可以添加到集群中或从群集中删除,而不影响SCAN地址配置。 应该配置SCAN,以使其可以通过使用群集中的网格命名服务(GNS)或通过使用域名服务(DNS)解析来解析。 为了实现高可用性和可扩展性,Oracle建议您配置SCAN名称,以便它解析为三个IP地址。 至少,SCAN必须至少解决一个地址。 如果指定了GNS域,则SCAN名称默认为clustername-scan.GNS_domain。 否则,它默认为clustername-scan.current_domain。 例如,如果从服务器node1启动Oracle Grid Infrastructure安装,则集群名称为mycluster,并且GNS域为grid.example.com,则SCAN名称为mycluster-scan.grid.example.com。 配置为在Oracle Database 11g版本2之前使用Oracle数据库版本的IP地址的客户端可以继续使用其现有的连接地址; 不需要使用SCAN。 升级到Oracle Clusterware 11g第2版(11.2)时,SCAN变为可用,您应该使用SCAN连接到Oracle Database 11g第2版或更高版本的数据库。 当Oracle数据库的早期版本升级时,它会向SCAN监听器注册,客户端可以开始使用SCAN连接到该数据库。 数据库通过init.ora文件中的远程侦听器参数与SCAN侦听器注册。 REMOTE_LISTENER参数必须设置为SCAN:PORT。 不要将其设置为具有SCAN的单个地址的TNSNAMES别名作为HOST = SCAN。 对于大多数部署,SCAN是可选的。 但是,使用Oracle Database 11g版本2及更高版本的策略管理的数据库使用服务器池的客户端应使用SCAN访问数据库。 这是因为策略管理的数据库可以在不同的时间在不同的服务器上运行,因此连接到策略管理数据库的特定节点虚拟IP地址是不可能的。
Understanding SCAN Addresses and Client Service Connections Public network addresses are used to provide services to clients. If your clients are connecting to the Single Client Access Name (SCAN) addresses, then you may need to change public and virtual IP addresses as you add or remove nodes from the cluster, but you do not need to update clients with new cluster addresses. SCANs function like a cluster alias. However, SCANs are resolved on any node in the cluster, so unlike a VIP address for a node, clients connecting to the SCAN no longer require updated VIP addresses as nodes are added to or removed from the cluster. Because the SCAN addresses resolve to the cluster, rather than to a node address in the cluster, nodes can be added to or removed from the cluster without affecting the SCAN address configuration. The SCAN is a fully qualified name (host name+domain) that is configured to resolve to all the addresses allocated for the SCAN. The addresses resolve using Round Robin DNS either on the DNS server, or within the cluster in a GNS configuration. SCAN listeners can run on any node in the cluster. SCANs provide location independence for the databases, so that client configuration does not have to depend on which nodes run a particular database. Oracle Database 11g release 2 (11.2) and later instances only register with SCAN listeners as remote listeners. Upgraded databases register with SCAN listeners as remote listeners, and also continue to register with all node listeners. Because of the Oracle Clusterware installation requirement that you provide a SCAN name during installation, if you resolved at least one IP address using the server /etc/hosts file to bypass the installation requirement but you do not have the infrastructure required for SCAN, then, after the installation, you can ignore the SCAN and connect to the databases in the cluster using VIPs. Oracle does not support removing the SCAN address. 了解SCAN地址和客户端服务连接 公共网络地址用于向客户端提供服务。 如果您的客户端连接到单个客户端访问名称(SCAN)地址,则可能需要在从群集添加或删除节点时更改公共和虚拟IP地址,但不需要使用新的群集地址更新客户端。 SCANs功能像集群别名一样。 但是,在集群中的任何节点上都会解析SCAN,因此与节点的VIP地址不同,连接到SCAN的客户端不再需要更新的VIP地址,因为节点被添加到集群或从集群中删除。 由于SCAN地址解析到集群,而不是群集中的节点地址,因此节点可以添加到集群中或从群集中删除,而不影响SCAN地址配置。 SCAN是一个完全限定名称(主机名+域),配置为解析为SCAN分配的所有地址。 这些地址使用DNS或GNS解析。 SCAN侦听器可以在群集中的任何节点上运行。 SCAN为数据库提供位置独立性,因此客户机配置不必依赖于运行特定数据库的节点。 Oracle Database 11g第2版(11.2)和更高版本的实例只将SCAN侦听器注册为远程侦听器。 升级数据库将SCAN侦听器注册为远程监听器,并继续向所有节点侦听器注册。 由于Oracle Clusterware安装要求,您在安装期间提供SCAN名称,如果您使用服务器/etc/hosts文件解决了至少一个IP地址以绕过安装要求,但是没有SCAN需要的基础架构,那么,安装后,您可以忽略SCAN并使用VIP连接到群集中的数据库。Oracle不支持删除SCAN地址。
About the Virtual IP Address The virtual IP (VIP) address is registered in the GNS, or the DNS. Select an address for your VIP that meets the following requirements: The IP address and host name are currently unused (it can be registered in a DNS, but should not be accessible by a ping command) The VIP is on the same subnet as your public interface D.1.3.4 About the Grid Naming Service (GNS) Virtual IP Address The GNS virtual IP address is a static IP address configured in the DNS. The DNS delegates queries to the GNS virtual IP address, and the GNS daemon responds to incoming name resolution requests at that address. Within the subdomain, the GNS uses multicast Domain Name Service (mDNS), included with Oracle Clusterware, to enable the cluster to map host names and IP addresses dynamically as nodes are added and removed from the cluster, without requiring additional host configuration in the DNS. 关于虚拟IP地址 虚拟IP(VIP)地址注册在GNS或DNS中。 选择符合以下要求的VIP地址: IP地址和主机名当前未使用(可以在DNS中注册,但不能通过ping命令访问) VIP与您的PUBLIC IP接口在同一个子网上 D.1.3.4关于网格命名服务(GNS)虚拟IP地址 GNS虚拟IP地址是DNS中配置的静态IP地址。 DNS将对GNS虚拟IP地址的查询委托给GNS,并且GNS守护进程响应该地址处的传入名称解析请求。 在子域内,GNS使用Oracle Clusterware附带的多播域名服务(mDNS),使群集能够动态地映射主机名和IP地址,而不需要在群集中添加和删除节点,而不需要DNS中的其他主机配置。