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中的其他主機配置。