Scan concept
Let's start with what is called Scan,scan (single client Access name), which was launched by Oracle from 11g R2, and the client can load-balance connections to the RAC database via the SCAN feature. Scan provides a domain name to access the RAC, the domain name can resolve 1 to 3 (note, up to 3) scan IP, we can resolve the implementation through DNS or GNS. Where DNS is familiar to everyone, here is not much to say. The GNS (Grid naming Service) is a new feature of Oracle 11g R2 that assigns VIP and scan IPs to nodes and scan via the DHCP service. Another advantage is that for new nodes that join the cluster, it automatically assigns VIP addresses, updates the cluster resources, and the client still connects to the new cluster node through the scan feature load balancer. The DNS and GNS configuration and resolution related content are described below.
In addition to DNS and GNS parsing methods, scan can also use the Hosts file to parse, but used to know that this method not only when installing RAC problems, late use is also problematic, such as scan domain name can only define a scan IP. So this approach is also deprecated by Oracle. However, many production still use this, that is, the 11g of the new features of the scan, but still use the VIP connection mode.
Public Ip&vip&scanip&private IP
Each node in the Oracle RAC has a virtual IP, referred to as a VIP, and a public IP in the same network segment. VIP is attached to the public gateway interface.
The public network card has two IP addresses: The public IP is fixed, and the VIP is floating.
The private private IP in the RAC is used for heartbeat synchronization, which can be ignored directly at the user level, and it does not belong to the same interface as the public IP.
In 11gr2, scan IP appears as a new IP, the scan IP is actually oracle between the client and the database, a new connection layer, when there is client access, connected to the scan IP LISTENER, and the scan IP When the LISTENER receives a connection request, it forwards the client's connection request to the VIP LISTENER on the corresponding instance based on the LBA algorithm, thus completing the whole client-server connection process. Simplify as follows:
Local listener, local instance, scan listener, client, can also understand scan as a virtual hostname, which corresponds to the entire RAC cluster. The client host simply accesses any node of the DB cluster through this scan name. Of course, the nodes that are accessed are random, and Oracle strongly recommends parsing the scan through the DNS server's round robin mode configuration to achieve load balancing (that is, rotating the IP address of the connection scan). This is somewhat similar to the principle of load balancing through VIP and listener loadbalance configurations. Client Tnsnames.ora Configuration
vip:19.16.8.166, 19.16.8.167
scanip:19.16.8.154
---VIP configuration
Gdsx_pro =(DESCRIPTION=(Address_list=(ADDRESS= (PROTOCOL = TCP) (HOST =19.16.8.166) (PORT =1521)) (ADDRESS= (PROTOCOL = TCP) (HOST =19.16.8.167) (PORT =1521)) (Load_balance=Yes)) (Connect_data=(SERVER=dedicated) (Service_Name=Gdwsbs)) )---scanip configuration
Gdsx_scan_pro=(DESCRIPTION=(ADDRESS= (PROTOCOL = TCP) (HOST =19.16.8.154) (PORT =1521)) (Connect_data= (SERVER =dedicated) (Service_Name= Gdwsbs)))
tnsping command
Tnsping 19.16.8.154:1521/gdwsbs
Oracle RAC VIP Scanip