0% found this document useful (0 votes)
69 views5 pages

SCAN Configuration and Management Guide

Uploaded by

irum.waqas80
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views5 pages

SCAN Configuration and Management Guide

Uploaded by

irum.waqas80
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

How does SCAN work ?

SCAN is a GSD resource, which is managed by CRS. So, SCAN is pretty much aware of what's
going on in the cluster. Though Oracle documentation suggests that SCAN is a
recommendation, but its a kind of mandatory as Oracle 11gR2 OUI would not proceed without
it. SCAN is on top of VIPs, but you can directly connect to the local listener if you would like to
bypass SCAN in client’s tnsnames.ora. Clients use SCAN name in tnsnames.ora to make the DB
connection. SCAN Listener would forward the request to local listener that’s running on VIPs.

How to rename SCAN Port in Cluster?

As grid user, source the grid environment to make sure $GRID_HOME/bin is in PATH and

1. Modify SCAN listener port:

[oid1@rac1 ~]$ srvctl modify scan_listener -p 1522

2. Restart SCAN listener so the new port will be effective:

[oid1@rac1 ~]$ srvctl stop scan_listener


[oid1@rac1 ~]$ srvctl start scan_listener

3. Confirm the change:

[oid1@rac1 ~]$ srvctl config scan_listener

SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1522


SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1522
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1522

How to rename SCAN in Cluster?

After the installation of the Oracle 11g R2 cluster with SCAN, If you need to change the scan
name from scan.freeoraclehelp.com to newscan.freeoraclehelp.com, here is how.

1. Stop the SCAN: Source Grid home, srvctl stop scan_listener, and srvctl stop scan then.

[grid@rac1 ~]$ srvctl stop scan_listener


[grid@rac1 ~]$ srvctl stop scan

2. Configure the new SCAN in your DNS, or /etc/hosts, or GNS and make sure that lookups are
working for the new name.

[root@rac2 ~]# nslookup newscan.freeoraclehelp.com


Server: 192.168.1.20
Address: 192.168.1.20#53

Name: newscan.freeoraclehelp.com
Address: 192.168.1.32
Name: newscan.freeoraclehelp.com
Address: 192.168.1.33
Name: newscan.freeoraclehelp.com
Address: 192.168.1.34
[root@rac2 ~]#

3. Configure the Cluster to take the new VIPs


As root user on one of the cluster nodes (not needed on both the nodes):

[root@rac1 ~]# /oracle/product/11.2.0/11.2.0/grid/bin/srvctl modify scan -n


newscan.freeoraclehelp.com
[root@rac1 ~]#

As grid user on one of the cluster nodes (not needed on both the nodes):

[grid@rac1 ~]$ srvctl modify scan_listener -u


[grid@rac1 ~]$ srvctl start scan_listener
Verify that configuration is right and three SCAN listeners are started.

[grid@rac1 ~]$ srvctl config scan

SCAN name: newscan.freeoraclehelp.com, Network:


1/192.168.1.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /newscan.freeoraclehelp.com/192.168.1.34
SCAN VIP name: scan2, IP: /newscan.freeoraclehelp.com/192.168.1.33
SCAN VIP name: scan3, IP: /newscan.freeoraclehelp.com/192.168.1.32

[grid@rac1 ~]$ 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

CHANGING SCAN LISTENER NAME:

New scan listener cannot be added while there are scan listeners already configured.

srvctl config scan_listener


SCAN Listener LISTENER_SCAN1 exists. Port: TCP:9120/TCPS:1523

srvctl add scan_listener -l myscanlistener


PRCS-1028 : Single Client Access Name listeners already exist

To add a new scan listener remove the default scan listener first. When the new scan listener
name is specified it's give only with the prefix of the scan listener name. There's no need to
include the "SCAN", this will be added by the clusteware.

srvctl stop scan_listener

srvctl remove scan_listener


Remove scan listener? (y/[n]) y

srvctl add scan_listener -l myscanlistener -p TCP:9120/TCPS:1523

srvctl config scan_listener

SCAN Listener MYSCANLISTENER_SCAN1 exists. Port: TCP:9120/TCPS:1523

Listener.ora file won't be modified at this stage. Entries related to new scan listener name will be
added when the scan listener is started. The old scan listener entries will still be there on the
listener.ora and must be manually removed. Listener.ora files across all nodes will be updated
when the scan listener is started

srvctl start scan_listener

srvctl config scan_listener


SCAN Listener MYSCANLISTENER_SCAN1 exists. Port: TCP:9120/TCPS:1523

srvctl status scan_listener


SCAN Listener MYSCANLISTENER_SCAN1 is enabled
SCAN listener MYSCANLISTENER_SCAN1 is running on node rhel6m1
CHANGING LISTENER PORT
srvctl config listener

> srvctl modify listener -l LISTENER -p "TCP:1523"

Stop and restart listener


Change LOCAL_LISTENER Parameter in init file

Changing the listener name

1. To add the new listener name on the same port as the current default listener name -s option
must be used. This will skip the port check if not an error will be thrown.
srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rhel6m2,rhel6m1

srvctl add listener -l mylistener -p 9120 # without -s results in an error


PRCN-2061 : Failed to add listener ora.MYLISTENER.lsnr
PRCN-2065 : Port(s) 9120 are not available on the nodes given
PRCN-2067 : Port 9120 is not available across node(s) "rhel6m1-vip,rhel6m2-
vip"

srvctl add listener -l mylistener -s -p 9120

srvctl config listener


Name: MYLISTENER
Network: 1, Owner: grid
Home: <CRS home>
End points: TCP:9120
Before removing the default listener modify the asm configuration with the new listener. If not
asm configuration will continue to use the old listener name and will report PRCA-1032: ASM
Listener LISTENER Does Not Exist when srvctl config asm is run. It's important that this is done
before the default listener is dropped if not the default listener need to be added and then new
listener name is specified for the asm configuration. More on this is available on 1428284.1
srvctl modify asm -l MYLISTENER
srvctl config asm
ASM home: /opt/app/11.2.0/grid
ASM listener: MYLISTENER
2. Stop the default listener and remove it from the configuration.
srvctl stop listener -l listener
srvctl remove listener -l listener
3. The new listener name related entries are not added to the listener.ora file until the listener is
restarted and update will be done across all nodes of the cluster. Similar to scan listener the old
entries will still remain the listener.ora file and must be manually removed. At the same time also
edit the COST related listener entry.
cat /opt/app/11.2.0/grid/network/admin/listener.ora # before listener start
MYSCANLISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)
(KEY=MYSCANLISTENER_SCAN1)))) # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))
# line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = /opt/app/11.2.0/grid/network/admin/cost)
)
)

SECURE_REGISTER_LISTENER = (IPC,TCP)
SECURE_REGISTER_MYSCANLISTENER_SCAN1 = (IPC,TCPS)
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_MYSCANLISTENER_SCAN1=ON # line added
by Agent

srvctl start listener -l mylistener

cat /opt/app/11.2.0/grid/network/admin/listener.ora # after listener start


MYLISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)
(KEY=MYLISTENER)))) # line added by Agent
MYSCANLISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)
(KEY=MYSCANLISTENER_SCAN1)))) # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))
# line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent

IMP NOTE:

As with the services, listeners should be managed using the srvctl cluster
management utility. Starting from the 11GR2 version, the listener.ora file is
managed by the cluster itself. Therefore, try to avoid editing the
listener.ora file manually unless it is absolutely necessary.
For troubleshooting purposes, you still can use the lsnrctl status <name e.g.
LISTENER_SCAN1 or LISTENER > or lsnrctl status <name e.g. LISTENER_SCAN1 or
LISTENER > commands to make sure that the expected services are registered
under each listener

The idea is that you have two layers of listeners: scan listeners that do load
balancing, and node listeners that do spawn-and-bequeath. All listeners must
run from the clusterware homes. Your instances register with the scan
listeners with their remote_listener parameter, and with their node listener
with the local_listener parameter. You should never be specifying the node VIP
in your tnsnames file, always the scan listener virtual name. You should not
use an address list in the tnsnames file, just the one address for the scan
listener and rely on your DNS to load balance across them.

he ENABLE_GLOBAL_DYNAMIC_ENDPOINT_ parameter is set to allow the listener to


accept connections for pre-11.2 databases which did not register the dynamic
endpoint.

You might also like