Oracle – RAC – Créer une deuxième VIP SCAN sur un RAC

Dans certains cas, il peut être nécessaire de gérer deux VIP SCAN sur un cluster Oracle RAC 12cR1.

La création de la deuxième VIP SCAN se fait de la manière qui suit.

Configuration initiale du cluster (une SCAN)

Noeud 1

ifconfig                            
eth2      Link encap:Ethernet  HWaddr 08:00:27:09:9C:56
inet addr:192.168.20.11  Bcast:192.168.20.255  Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe09:9c56/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:39204 errors:0 dropped:0 overruns:0 frame:0
TX packets:77206 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:14794613 (14.1 MiB)  TX bytes:126633109 (120.7 MiB)
eth2:1    Link encap:Ethernet  HWaddr 08:00:27:09:9C:56
inet addr:192.168.20.111  Bcast:192.168.20.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth2:3    Link encap:Ethernet  HWaddr 08:00:27:09:9C:56
inet addr:192.168.20.110  Bcast:192.168.20.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth3      Link encap:Ethernet  HWaddr 08:00:27:64:2F:A9
inet addr:192.168.30.11  Bcast:192.168.30.255  Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe64:2fa9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:2030899 errors:0 dropped:0 overruns:0 frame:0
TX packets:1754528 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1511998424 (1.4 GiB)  TX bytes:1084570287 (1.0 GiB)
eth3:1    Link encap:Ethernet  HWaddr 08:00:27:64:2F:A9
inet addr:169.254.77.49  Bcast:169.254.255.255  Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

 

eth2:1 correspond à l’adresse VIP du noeud de cluster 1

eth2:2 correspond à l’adresse VIP SCAN du cluster

eth3:1 correspond à l’adresse SCAN broadcast du cluster sur le noeud de cluster 1

Noeud 2

ifconfig                                                 
eth2      Link encap:Ethernet  HWaddr 08:00:27:D6:A0:27
inet addr:192.168.20.12  Bcast:192.168.20.255  Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fed6:a027/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:82613 errors:0 dropped:0 overruns:0 frame:0
TX packets:33663 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:83655903 (79.7 MiB)  TX bytes:19787515 (18.8 MiB)
eth2:1    Link encap:Ethernet  HWaddr 08:00:27:D6:A0:27
inet addr:192.168.20.112  Bcast:192.168.20.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth3      Link encap:Ethernet  HWaddr 08:00:27:89:9A:77
inet addr:192.168.30.12  Bcast:192.168.30.255  Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe89:9a77/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:1756109 errors:0 dropped:0 overruns:0 frame:0
TX packets:2024779 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1083418768 (1.0 GiB)  TX bytes:1703830236 (1.5 GiB)
eth3:1    Link encap:Ethernet  HWaddr 08:00:27:89:9A:77
inet addr:169.254.127.150  Bcast:169.254.255.255  Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

 

eth2:1 correspond à l’adresse VIP du noeud de cluster 2

eth3:1 correspond à l’adresse SCAN broadcast du cluster sur le noeud de cluster 2

Fichier /etc/hosts de chaque noeud

192.168.20.11   ora12cr1rac1    ora12cr1rac1.nice
192.168.20.12   ora12cr1rac2    ora12cr1rac2.nice
192.168.20.111  ora12cr1rac1-vip        ora12cr1rac1-vip.nice
192.168.20.112  ora12cr1rac2-vip        ora12cr1rac2-vip.nice
192.168.20.110  ora12ccls-scan
192.168.30.11   ora12cr1cf1
192.168.30.12   ora12cr1cf2
192.168.30.110  ora12cclsvlan2-scan
192.168.30.111  ora12cr1vlan2rac1-vip   ora12cr1vlan2rac1-vip.nice
192.168.30.112  ora12cr1vlan2rac2-vip   ora12cr1vlan2rac2-vip.nice

Création du deuxième réseau SCAN

su - root
export ORACLE_HOME=/oracle/grid
export PATH=$ORACLE_HOME/bin:$PATH
srvctl add network -netnum 2 -subnet 192.168.30.0/255.255.255.0
srvctl add vip -node ora12cr1rac1 -netnum 2 -address ora12cr1vlan2rac1-vip/255.255.255.0
srvctl add vip -node ora12cr1rac2 -netnum 2 -address ora12cr1vlan2rac2-vip/255.255.255.0
srvctl add scan -scanname ora12cclsvlan2-scan -netnum 2
srvctl start vip -node ora12cr1rac1 -netnum 2
srvctl start vip -node ora12cr1rac2 -netnum 2

Afin de valider le bon fonctionnement de la nouvelle configuration, rebooter les noeuds du cluster

Etat du réseau après création du deuxième réseau SCAN

Noeud 1

ifconfig
eth3      Link encap:Ethernet  HWaddr 08:00:27:64:2F:A9
inet addr:192.168.30.11  Bcast:192.168.30.255  Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe64:2fa9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:321774 errors:0 dropped:0 overruns:0 frame:0
TX packets:262946 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:250577987 (238.9 MiB)  TX bytes:155204365 (148.0 MiB)
eth3:1    Link encap:Ethernet  HWaddr 08:00:27:64:2F:A9
inet addr:169.254.77.49  Bcast:169.254.255.255  Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth3:3    Link encap:Ethernet  HWaddr 08:00:27:64:2F:A9
inet addr:192.168.30.111  Bcast:192.168.30.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth3:4    Link encap:Ethernet  HWaddr 08:00:27:64:2F:A9
inet addr:192.168.30.110  Bcast:192.168.30.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

En rouge-gras l’ajout de la nouvelle VIP et de la nouvelle SCAN.

Noeud 2

ifconfig
eth2      Link encap:Ethernet  HWaddr 08:00:27:D6:A0:27
inet addr:192.168.20.12  Bcast:192.168.20.255  Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fed6:a027/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:7162 errors:0 dropped:0 overruns:0 frame:0
TX packets:6552 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1399489 (1.3 MiB)  TX bytes:3855506 (3.6 MiB)
eth2:1    Link encap:Ethernet  HWaddr 08:00:27:D6:A0:27
inet addr:192.168.20.112  Bcast:192.168.20.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth2:2    Link encap:Ethernet  HWaddr 08:00:27:D6:A0:27
inet addr:192.168.20.110  Bcast:192.168.20.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth3      Link encap:Ethernet  HWaddr 08:00:27:89:9A:77
inet addr:192.168.30.12  Bcast:192.168.30.255  Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe89:9a77/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:275025 errors:0 dropped:0 overruns:0 frame:0
TX packets:334746 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:163448505 (155.8 MiB)  TX bytes:296578261 (282.8 MiB)
eth3:1    Link encap:Ethernet  HWaddr 08:00:27:89:9A:77
inet addr:169.254.127.150  Bcast:169.254.255.255  Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth3:2    Link encap:Ethernet  HWaddr 08:00:27:89:9A:77
inet addr:192.168.30.112  Bcast:192.168.30.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

En rouge-gras, ajout de la nouvelle VIP

Statut des VIP déclarées sur le cluster RAC

srvctl status vip -node ora12cr1rac1
VIP ora12cr1rac1-vip is enabled
VIP ora12cr1rac1-vip is running on node: ora12cr1rac1
VIP ora12cr1vlan2rac1-vip is enabled
VIP ora12cr1vlan2rac1-vip is running on node: ora12cr1rac1
srvctl status vip -node ora12cr1rac2
VIP ora12cr1rac2-vip is enabled
VIP ora12cr1rac2-vip is running on node: ora12cr1rac2
VIP ora12cr1vlan2rac2-vip is enabled
VIP ora12cr1vlan2rac2-vip is running on node: ora12cr1rac2

Ajout du listener sur la nouvelle SCAN

srvctl add scan_listener -netnum 2
srvctl start scan_listener -netnum 2
srvctl status scan_listener -netnum 1
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node ora12cr1rac1
srvctl status scan_listener -netnum 2
SCAN Listener LISTENER_SCAN1_NET2 is enabled
SCAN listener LISTENER_SCAN1_NET2 is running on node ora12cr1rac2

Test des listeners SCAN

[grid@ora12cr1rac1 grid]$ lsnrctl status listener_scan1
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 18-JAN-2017 22:40:34
Copyright (c) 1991, 2014, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                17-JAN-2017 18:56:06
Uptime                    1 days 3 hr. 44 min. 27 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/grid/network/admin/listener.ora
Listener Log File         /oracle/base/diag/tnslsnr/ora12cr1rac1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.20.110)(PORT=1521)))
Services Summary...
Service "ACHRAC" has 1 instance(s).
Instance "ACHRAC_1", status READY, has 1 handler(s) for this service...
Service "ACHRACXDB" has 1 instance(s).
Instance "ACHRAC_1", status READY, has 1 handler(s) for this service...
Service "_mgmtdb" has 1 instance(s).
Instance "-MGMTDB", status BLOCKED, has 1 handler(s) for this service...
Service "pdbachrac1" has 1 instance(s).
Instance "ACHRAC_1", status READY, has 1 handler(s) for this service...
Service "pdbachrac2" has 1 instance(s).
Instance "ACHRAC_1", status READY, has 1 handler(s) for this service...
Service "pdbachrac3" has 1 instance(s).
Instance "ACHRAC_1", status READY, has 1 handler(s) for this service...
The command completed successfully

Le listener_scan nouveau n’écoute pour le moment aucun service :

[grid@ora12cr1rac2 ~]$ lsnrctl status listener_scan1_net2
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 18-JAN-2017 22:44:00
Copyright (c) 1991, 2014, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1_NET2)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1_NET2
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                18-JAN-2017 22:37:15
Uptime                    0 days 0 hr. 6 min. 44 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/grid/network/admin/listener.ora
Listener Log File         /oracle/base/diag/tnslsnr/ora12cr1rac2/listener_scan1_net2/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1_NET2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.30.110)(PORT=1521)))
The listener supports no services
The command completed successfully

Création d’une nouvelle base de données RAC

A l’aide de dbca nous créons une nouvelle base de données nommée VIP2RAC. Sans rien modifier des scripts de création de VIP2RAC, dbca fait pointer par défaut les instances sur le premier SCAN listener.

Modification du pointage SCAN des instances de VIP2RAC (nouvelle BDD)

[oracle@ora12cr1rac1 database]$ export ORACLE_SID=VIP2RAC_2
[oracle@ora12cr1rac1 database]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.2.0 Production on Thu Jan 19 07:46:12 2017
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> show parameter listener
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
listener_networks                    string
local_listener                       string       (ADDRESS=(PROTOCOL=TCP)(HOST=
192.168.20.111)(PORT=1521))
remote_listener                      string       ora12ccls-scan:1521
SQL> alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.30.111)(PORT=1521))' scope=both;
System altered.
SQL> alter system register;
System altered.
SQL> alter system set remote_listener='ora12cclsvlan2-scan:1521' scope=both;
System altered.
SQL> alter system register;
System altered.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options

Vérification de l’état des SCAN listeners

[grid@ora12cr1rac2 ~]$ lsnrctl status listener_scan1
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 18-JAN-2017 07:51:41
Copyright (c) 1991, 2014, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                18-JAN-2017 07:21:14
Uptime                    0 days 0 hr. 30 min. 27 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/grid/network/admin/listener.ora
Listener Log File         /oracle/base/diag/tnslsnr/ora12cr1rac2/listener_scan1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.20.110)(PORT=1521)))
Services Summary...
Service "-MGMTDBXDB" has 1 instance(s).
Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "ACHRAC" has 2 instance(s).
Instance "ACHRAC_1", status READY, has 1 handler(s) for this service...
Instance "ACHRAC_2", status READY, has 1 handler(s) for this service...
Service "ACHRACXDB" has 2 instance(s).
Instance "ACHRAC_1", status READY, has 1 handler(s) for this service...
Instance "ACHRAC_2", status READY, has 1 handler(s) for this service...
Service "_mgmtdb" has 1 instance(s).
Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "ora12ccls" has 1 instance(s).
Instance "-MGMTDB", status READY, has 1 handler(s) for this service...
Service "pdbachrac1" has 2 instance(s).
Instance "ACHRAC_1", status READY, has 1 handler(s) for this service...
Instance "ACHRAC_2", status READY, has 1 handler(s) for this service...
Service "pdbachrac2" has 2 instance(s).
Instance "ACHRAC_1", status READY, has 1 handler(s) for this service...
Instance "ACHRAC_2", status READY, has 1 handler(s) for this service...
Service "pdbachrac3" has 2 instance(s).
Instance "ACHRAC_1", status READY, has 1 handler(s) for this service...
Instance "ACHRAC_2", status READY, has 1 handler(s) for this service...
The command completed successfully
 
[grid@ora12cr1rac1 ~]$ lsnrctl status listener_scan1_net2
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 18-JAN-2017 07:51:37
Copyright (c) 1991, 2014, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1_NET2)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1_NET2
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                18-JAN-2017 07:19:41
Uptime                    0 days 0 hr. 31 min. 56 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/grid/network/admin/listener.ora
Listener Log File         /oracle/base/diag/tnslsnr/ora12cr1rac1/listener_scan1_net2/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1_NET2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.30.110)(PORT=1521)))
Services Summary...
Service "VIP2RAC" has 2 instance(s).
Instance "VIP2RAC_1", status READY, has 1 handler(s) for this service...
Instance "VIP2RAC_2", status READY, has 1 handler(s) for this service...
Service "VIP2RACXDB" has 2 instance(s).
Instance "VIP2RAC_1", status READY, has 1 handler(s) for this service...
Instance "VIP2RAC_2", status READY, has 1 handler(s) for this service...
Service "pdbvip2rac" has 2 instance(s).
Instance "VIP2RAC_1", status READY, has 1 handler(s) for this service...
Instance "VIP2RAC_2", status READY, has 1 handler(s) for this service...
The command completed successfully

Vérification des SCAN listeners et des SCAN au niveau du Grid Control

[grid@ora12cr1rac1 ~]$ srvctl config scan_listener -netnum 1
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
Registration invited nodes:
Registration invited subnets:
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:
[grid@ora12cr1rac1 ~]$ srvctl config scan_listener -netnum 2
SCAN Listener LISTENER_SCAN1_NET2 exists. Port: TCP:1521
Registration invited nodes:
Registration invited subnets:
SCAN Listener is enabled.
SCAN Listener is individually enabled on nodes:
SCAN Listener is individually disabled on nodes:
[grid@ora12cr1rac1 ~]$ srvctl status scan_listener -netnum 1
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node ora12cr1rac2
[grid@ora12cr1rac1 ~]$ srvctl status scan_listener -netnum 2
SCAN Listener LISTENER_SCAN1_NET2 is enabled
SCAN listener LISTENER_SCAN1_NET2 is running on node ora12cr1rac1
[grid@ora12cr1rac1 ~]$ srvctl config scan -netnum 1
SCAN name: ora12ccls-scan, Network: 1
Subnet IPv4: 192.168.20.0/255.255.255.0/eth2, static
Subnet IPv6:
SCAN 0 IPv4 VIP: 192.168.20.110
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
[grid@ora12cr1rac1 ~]$ srvctl config scan -netnum 2
SCAN name: ora12cclsvlan2-scan, Network: 2
Subnet IPv4: 192.168.30.0/255.255.255.0/, static
Subnet IPv6:
SCAN 0 IPv4 VIP: 192.168.30.110
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
[grid@ora12cr1rac1 ~]$ srvctl status scan -netnum 1
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node ora12cr1rac2
[grid@ora12cr1rac1 ~]$ srvctl status scan -netnum 2
SCAN VIP scan1_net2 is enabled
SCAN VIP scan1_net2 is running on node ora12cr1rac1
 

A ce point, la configuration de la deuxième SCAN est réalisée et les instances de la nouvelle base de données RAC pointent bien sur la SCAN numéro 2

(Comments are closed)