Thursday, October 1, 2020

SCAN Series PART :- 2

         HOW  SCAN VIP  & SCAN Listener are WORK together ???

 

Let see the SCAN-VIP information.

[grid@rac1 ~]$ srvctl config scan
SCAN name: mycluster-scan, Network: 1
Subnet IPv4: 192.168.56.0/255.255.255.0/enp0s3, static
Subnet IPv6:
SCAN 0 IPv4 VIP: 192.168.56.13
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
SCAN 1 IPv4 VIP: 192.168.56.15
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
SCAN 2 IPv4 VIP: 192.168.56.14
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
[grid@rac1 ~]$


[grid@rac1 ~]$ crsctl stat res -w "TYPE = ora.scan_vip.type"
NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac1

NAME=ora.scan2.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac2

NAME=ora.scan3.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac2

Here SCAN-VIP is up and running. 


Now lets try to stop  SCAN_VIP resources.

[grid@rac1 ~]$ srvctl stop scan
PRCR-1065 : Failed to stop resource ora.scan1.vip
CRS-2529: Unable to act on 'ora.scan1.vip' because that would require stopping or relocating 'ora.LISTENER_SCAN1.lsnr', but the force option was not specified
PRCR-1065 : Failed to stop resource ora.scan2.vip
CRS-2529: Unable to act on 'ora.scan2.vip' because that would require stopping or relocating 'ora.LISTENER_SCAN2.lsnr', but the force option was not specified
PRCR-1065 : Failed to stop resource ora.scan3.vip
CRS-2529: Unable to act on 'ora.scan3.vip' because that would require stopping or relocating 'ora.LISTENER_SCAN3.lsnr', but the force option was not specified

Not able to stop. 

Lets use force option .

[grid@rac1 ~]$ srvctl stop scan -f
[grid@rac1 ~]$ crsctl stat res -w "TYPE = ora.scan_vip.type"
NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
TARGET=OFFLINE====> offline 
STATE=OFFLINE====> offline 

NAME=ora.scan2.vip
TYPE=ora.scan_vip.type
TARGET=OFFLINE====> offline 
STATE=OFFLINE====> offline 

NAME=ora.scan3.vip
TYPE=ora.scan_vip.type
TARGET=OFFLINE    ====> offline 
STATE=OFFLINE ====> offline 


[grid@rac1 ~]$ ps -ef|grep -i scan
grid     21700 16262  0 09:37 pts/0    00:00:00 grep --color=auto -i scan


[grid@rac1 ~]$ crsctl stat res -w "TYPE = ora.scan_listener.type"
NAME=ora.LISTENER_SCAN1.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=OFFLINE    ====> offline 

NAME=ora.LISTENER_SCAN2.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=OFFLINE    ====> offline 

NAME=ora.LISTENER_SCAN3.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=OFFLINE    ====> offline 


Look the scan-vip & Scan-listener also getting down in pair in cluster. and its indicate its working in Pair.

Lets Do another try.

First down the SCAN LISTENER :======>

lets verify the status of SCAN Listeners and VIP Listeners

[grid@rac1 ~]$ srvctl start scan
[grid@rac1 ~]$ crsctl stat res -w "TYPE = ora.scan_vip.type"
NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac1

NAME=ora.scan2.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac2

NAME=ora.scan3.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac1

[grid@rac1 ~]$ crsctl stat res -w "TYPE = ora.scan_listener.type"
NAME=ora.LISTENER_SCAN1.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on rac1

NAME=ora.LISTENER_SCAN2.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on rac2

NAME=ora.LISTENER_SCAN3.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on rac1

[grid@rac1 ~]$ ps -ef|grep -i scan
grid     26330     1  0 09:49 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
grid     26403     1  0 09:49 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit
grid     26618 16262  0 09:50 pts/0    00:00:00 grep --color=auto -i scan
[grid@rac1 ~]$



Let down the SCAN Listeners:-

[grid@rac1 ~]$ crsctl stat res -w "TYPE = ora.scan_listener.type"
NAME=ora.LISTENER_SCAN1.lsnr
TYPE=ora.scan_listener.type
TARGET=OFFLINE
STATE=OFFLINE=====> its showing down

NAME=ora.LISTENER_SCAN2.lsnr
TYPE=ora.scan_listener.type
TARGET=OFFLINE
STATE=OFFLINE=====> its showing down

NAME=ora.LISTENER_SCAN3.lsnr
TYPE=ora.scan_listener.type
TARGET=OFFLINE
STATE=OFFLINE=====> its showing down

[grid@rac1 ~]$ ps -ef|grep -i scan
grid     27693 16262  0 09:51 pts/0    00:00:00 grep --color=auto -i scan
[grid@rac1 ~]$

But SCAN-VIP is up and running so SCAN-VIP resources  is parent process 
and SCAN-LISTENERS process is child process which depend upon SCAN_VIP process.

[grid@rac1 ~]$ crsctl stat res -w "TYPE = ora.scan_vip.type"
NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac1

NAME=ora.scan2.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac2

NAME=ora.scan3.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac1

[grid@rac1 ~]$


[grid@rac1 ~]$ srvctl start scan_listener
[grid@rac1 ~]$ crsctl stat res -w "TYPE = ora.scan_vip.type"
NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac1

NAME=ora.scan2.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac2

NAME=ora.scan3.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac1

[grid@rac1 ~]$ ps -ef|grep -i scan
grid     29759     1  0 09:56 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
grid     29846     1  0 09:56 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit


Now Let See how the SCAN-VIP resources and  SCAN_LISTENERS Resource  are move to another node in Cluster ??

On node1 : Two Scan Listeners are running 
[grid@rac1 ~]$ ps -ef|grep -i scan
grid     29759     1  0 09:56 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
grid     29846     1  0 09:56 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit
grid     31263 16262  0 10:01 pts/0    00:00:00 grep --color=auto -i scan
[grid@rac1 ~]$


On node2 : One Scan Listeners is running 
[oracle@rac2 ~]$ ps -ef|grep -i scan
grid     28111     1  0 00:59 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN2 -no_crs_notify -inherit
oracle   31379 30882  0 01:04 pts/0    00:00:00 grep --color=auto -i scan
[oracle@rac2 ~]$

Lets shut down the node 

grid     31263 16262  0 10:01 pts/0    00:00:00 grep --color=auto -i scan
[grid@rac1 ~]$ su - root
Password:
Last login: Wed Sep 30 08:05:05 IST 2020 on pts/0

[root@rac1 ~]#
[root@rac1 ~]#
[root@rac1 ~]# init 0

Now Check the SCAN_LISTENER Status on Node2

[grid@rac2 ~]$ ps -ef|grep -i scan
grid     28111     1  0 00:59 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN2 -no_crs_notify -inherit
grid     32266     1  0 01:07 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
grid     32280     1  0 01:07 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit
grid     32434 32294  0 01:07 pts/0    00:00:00 grep --color=auto -i scan
[grid@rac2 ~]$

here we can see three scan listeners are running ..... Good

Lets see scan-vip resources status :-

[grid@rac2 ~]$  crsctl stat res -w "TYPE = ora.scan_vip.type"
NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac2  =====on Node2

NAME=ora.scan2.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac2 ====on Node2

NAME=ora.scan3.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac2====on Node2

[grid@rac2 ~]$


[grid@rac2 ~]$ crsctl stat res -w "TYPE = ora.scan_listener.type"
NAME=ora.LISTENER_SCAN1.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on rac2

NAME=ora.LISTENER_SCAN2.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on rac2

NAME=ora.LISTENER_SCAN3.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on rac2

[grid@rac2 ~]$


 ****This indicate how the scan-vip and scan-listeners work together******

IF SCAN VIP & SCAN LISETNERS are DOWN still User can connect ????

Lets try :- 


[grid@rac1 ~]$ crsctl stat res -w "TYPE = ora.scan_listener.type"
NAME=ora.LISTENER_SCAN1.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=OFFLINE

NAME=ora.LISTENER_SCAN2.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=OFFLINE

NAME=ora.LISTENER_SCAN3.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=OFFLINE

[grid@rac1 ~]$ crsctl stat res -w "TYPE = ora.scan_vip.type"
NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.scan2.vip
TYPE=ora.scan_vip.type
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.scan3.vip
TYPE=ora.scan_vip.type
TARGET=OFFLINE
STATE=OFFLINE

[grid@rac1 ~]$


[oracle@rac1 admin]$ tnsping TEST.databasexpert.com

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 30-SEP-2020 03:39:14

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

Used parameter files:
/oracle/DEA/12102/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = mycluster-scan)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = TEST.databasexpert.com)))


^C ===========Taking Huge time so i have to cancel.

[oracle@rac1 admin]$ tnsping mycluster-scan

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 30-SEP-2020 03:39:34

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

Used parameter files:
/oracle/DEA/12102/network/admin/sqlnet.ora

Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.14)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.15)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.13)(PORT=1521)))
^C ======> Same again , i have to cancel
[oracle@rac1 admin]$



[oracle@rac1 admin]$ sqlplus scott/tiger@TEST.databasexpert.com

SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 30 03:42:29 2020

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:
ORA-12543: TNS:destination host unreachable  ======> Same issue 


Enter user-name:



So its Indicate the SCAN VIP & SCAN Listener plays very critical role for connection . if they down no connection will happened.


Oracle Grid also gave the different option to shut down the scan-listener.


Lets Check status of Scan_listeners.

 

[grid@rac2 ~]$ crsctl stat res -w "TYPE = ora.scan_vip.type"
NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac2

NAME=ora.scan2.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac2

NAME=ora.scan3.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on rac2

[grid@rac2 ~]$ ps -ef|grep -i scan
grid     10332  8593  0 01:30 pts/1    00:00:00 grep --color=auto -i scan
grid     28111     1  0 00:59 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN2 -no_crs_notify -inherit
grid     32266     1  0 01:07 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
grid     32280     1  0 01:07 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit



11gR2 Syntax

As grid user stop scan resources

[grid@rac2 admin]$ srvctl stop scan -i 1 -f

[grid@rac2 ~]$ srvctl stop scan -i 1 -f =======>
[grid@rac2 ~]$  ps -ef|grep -i scan
grid     10992  8593  0 01:32 pts/1    00:00:00 grep --color=auto -i scan
grid     28111     1  0 00:59 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN2 -no_crs_notify -inherit
grid     32280     1  0 01:07 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit
[grid@rac2 ~]$

LISTENER_SCAN1 is down successfully.


lets use 12CR1 & R2 Syntax:- 

As grid user stop scan resources

[grid@rac2 ~]$ srvctl stop scan -scannumber 2 -f   =======>
[grid@rac2 ~]$ ps -ef|grep -i scan
grid     11425  8593  0 01:33 pts/1    00:00:00 grep --color=auto -i scan
grid     32280     1  0 01:07 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit
[grid@rac2 ~]$


Now Lest start stop Scan Listener individually per node.

Lets check status of scan_listener:====>

[grid@rac2 ~]$ ps -ef|grep -i scan
grid     12500  8593  0 01:35 pts/1    00:00:00 grep --color=auto -i scan
grid     32280     1  0 01:07 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit
[grid@rac2 ~]$


11gR2 Syntax  ===> 

As grid user stop scan resources

[grid@rac2 ~]$ srvctl start scan -i 1


[grid@rac2 ~]$  ps -ef|grep -i scan
grid     12802     1  0 01:35 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
grid     12832  8593  0 01:36 pts/1    00:00:00 grep --color=auto -i scan
grid     32280     1  0 01:07 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit
[grid@rac2 ~]$



12CR1 &R2 syntax =====>

As grid user stop scan resources

[grid@rac2 ~]$ srvctl start scan -scannumber 2


[grid@rac2 ~]$  ps -ef|grep -i scan
grid     12802     1  0 01:35 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
grid     13272     1  0 01:37 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN2 -no_crs_notify -inherit
grid     13319  8593  0 01:37 pts/1    00:00:00 grep --color=auto -i scan
grid     32280     1  0 01:07 ?        00:00:00 /u002/app/oracle/product/12.1.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit
[grid@rac2 ~]$



           All Three Scan_Listener resources are up and running.



                                    *******EOD********

No comments:

Post a Comment