Sunday 2 August 2015

How Many Scan Listeners? Add SCAN listener-SCAN-ORACLE RAC 11GR2

          How Many Scan Listeners?   



SCAN is a new concept introduced by Oracle with release Oracle of 11GR2. Full form of SCAN is 
Single-Client Access Name. The Single-Client Access Name (SCAN) is the address used by clients connecting to the cluster.
The Scan is fully qualified host name located in the GNS subdomain registered to three IP addresses.
From 11gR2 onwards oracle has enhanced the availability of database from client’s perspective by introducing SCAN (Single Client Access Name). With SCAN, clients could use SCAN-NAME (resolved by 3 VIPs, for default configuration using GNS/DNS) instead of having list of all rac nodes in connect string. By default SCAN listeners (defined on SCAN VIPs) created as first point which co-ordinate with node listeners (defined on VIPs), so even if failure of node scan listener running on that node (if any) would be relocated to any surviving node while available SCAN listeners would be serving as normal.


Usually 3 SCANs can handle hundreds of new connections within few seconds. But if your environment needs more than 3 of them then you can add few more scan listeners. GNS based dynamic IP scheme still does not support change in number of SCAN listeners in your environment. But in DNS based static IP configuration you can add extra scan listeners.




              ADD SCAN LISTENER




Process of adding one extra scan listener in our DNS based static IP configuration.
It could be done in following simple steps without effecting the availability of cluster:
  1. Add additional unused IP from same subnet into DNS configuration for scan-name.
  2. Restart dns named service
  3. Update/modify scan in cluster
  4. Update/modify scan_listener in cluster
  5. Verify the changed configuration
  6. Start newly added scan
  7. Verification of service registration on newly added scan listener
 scan_name=>testscan11gr2p-scan is resolved into pair of 3 IPs (***.***.1.1/2/3)

[root@tnpdns ~]# nslookup testscan11gr2p-scan
Server: 1**.1**.1.43
Address: 1**.1**.1.43#53
Name: testscan11gr2p-scan.fiatz.klz
Address: 1**.1**.2.3
Name: testscan11gr2p-scan.fiatz.klz
Address: 1**.1**.2.1
Name: testscan11gr2p-scan.fiatz.klz
Address: 1**.1**.2.2

We have identified IP 1**.1**.1.4 from same subnet and added that against scan_name testscangr2p-scan:

Network Team will do this for us. Or you can configure your DNS your self.

To reflect the changes we need to do restart of named service:

[root@tnpdns named]# service named restart
Stopping named: . [ OK ]
Starting named: [ OK ]

Verify that scan name is getting resolved into 4 IPs:


[root@tnpdns named]# nslookup testscan11gr2p-scan
Server: 1**.1**.1.43
Address: 1**.1**.1.43#53
Name: testscan11gr2p-scan.fiatz.klz
Address: 1**.1**.2.2
Name: testscan11gr2p-scan.fiatz.klz
Address: 1**.1**.2.3
Name: testscan11gr2p-scan.fiatz.klz
Address: 1**.1**.2.4
Name: testscan11gr2p-scan.fiatz.klz
Address: 1**.1**.2.1

Change SCAN configuration :ges are getting reflected:
Check the current SCAN configuration:

[root@testscan11gr2p.fiatz.klz] srvctl config scan
SCAN name: testscan11gr2p-scan, Network: 1/1**.1**.2.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /testscan11gr2p-scan.fiatz.klz/1**.1**.2.1
SCAN VIP name: scan2, IP: /testscan11gr2p-scan.fiatz.klz/1**.1**.2.2
SCAN VIP name: scan3, IP: /testscan11gr2p-scan.fiatz.klz/1**.1**.2.3


Login to database cluster with root and execute following:


[root@testscan11gr2p.fiatz.klz] srvctl modify scan -n testscan11gr2p-scan


 Check the configuration again if changes are being reflected:


[root@testscan11gr2p.fiatz.klz] srvctl config scan

SCAN name: testscan11gr2p-scan, Network: 1/1**.1**.2.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /testscan11gr2p-scan.fiatz.klz/1**.1**.2.1
SCAN VIP name: scan2, IP: /testscan11gr2p-scan.fiatz.klz/1**.1**.2.2
SCAN VIP name: scan3, IP: /testscan11gr2p-scan.fiatz.klz/1**.1**.2.3
SCAN VIP name: scan4, IP: /testscan11gr2p-scan.fiatz.klz/1**.1**.2.4


Update the scan listener configuration:

Check current scan listener configuration:

[root@testscan11gr2p.fiatz.klz] 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

update the scan listener configuration:

[root@testscan11gr2p.fiatz.klz] srvctl modify scan_listener -u

Verify scan listener post updation of configuration:
[root@testscan11gr2p.fiatz.klz] 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
SCAN Listener LISTENER_SCAN4 exists. Port: TCP:1521

Start the listener_scan4:

[root@testscan11gr2p1.lgk.nmk] srvctl start scan_listener -i 4

Check the status of scan listener:

[root@testscan11gr2p1.lgk.nmk] srvctl status scan_listener

SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node testscan11gr2p2
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node testscan11gr2p1
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node testscan11gr2p1
SCAN Listener LISTENER_SCAN4 is enabled
SCAN listener LISTENER_SCAN4 is running on node testscan11gr2p2

Check the status of new scan listener if the services are getting registered:
lsnrctl status LISTENER_SCAN4

No comments:

Post a Comment