When you configure ADG or use the HA for cluster management applications of Oracle (such as OGG), we may want to use a different network to avoid the impact of ADG transmission logs on the primary production network.
Starting with 11.2, we can use CRS to manage multiple network resources (the default is NETWORK1 only), but scan can only be active on one of multiple networks (the default is NETWORK1, which can be assigned to different networks).
Then, we typically configure a NETWORK2 network specifically for ADG transfer logs, but when configuring a connection string, only VIPs are used (because scan is usually used for NETWORK1 on the main production).
.
Starting with 12.1, we can configure multiple scan on multiple networks, such as configuring SCAN2 on the NETWORK2 when we configure ADG.
The specific configuration is as follows:
– Check the IP address of the NIC interface:
[Root@rac1 ~]# Ifconfig | Egrep ' eth0 '-A 1 | grep ' inet ' | Cut-d:-f2 | Cut-d '-f1
192.168.56.61
192.168.56.63
[Root@rac1 ~]# Ifconfig | Egrep ' eth2 '-A 1 | grep ' inet ' | Cut-d:-f2 | Cut-d '-f1
192.168.209.61
[Root@rac1 ~]#
[Root@rac2 ~]# Ifconfig | Egrep ' eth0 '-A 1 | grep ' inet ' | Cut-d:-f2 | Cut-d '-f1
192.168.56.62
192.168.56.64
192.168.56.65
[Root@rac2 ~]# Ifconfig | Egrep ' eth2 '-A 1 | grep ' inet ' | Cut-d:-f2 | Cut-d '-f1
192.168.209.62
[Root@rac2 ~]#
– Add a new public network
[Grid@rac1 ~]$ oifcfg getif
Eth0 192.168.56.0 Global Public
eth1 192.168.60.0 Global Cluster_interconnect
[Grid@rac1 ~]$
[Grid@rac1 ~]$ oifcfg Setif-global eth2/192.168.209.0:public
[Grid@rac1 ~]$ oifcfg getif
Eth0 192.168.56.0 Global Public
eth1 192.168.60.0 Global Cluster_interconnect
Eth2 192.168.209.0 Global Public
[Grid@rac1 ~]$
– Check the network definition, by default there is only one network definition: NETWORK1
[grid@rac1 ~]$ srvctl Config Network
Network 1 exists
Subnet Ipv4:192.168.56.0/255.255.255.0/eth0, static
Subnet IPV6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
[Grid@rac1 ~]$
– Add a new network cluster resource (a network cluster resource)
[Root@rac1 ~]# ipcalc-bnm 192.168.209.61 255.255.255.0
netmask=255.255.255.0
broadcast=192.168.209.255
network=192.168.209.0
[Root@rac1 ~]#
[Root@rac1 ~]# srvctl add network-netnum 2-subnet 192.168.209.0/255.255.255.0/eth2
[Root@rac1 ~]#
[root@rac1 ~]# srvctl Config Network
Network 1 exists
Subnet Ipv4:192.168.56.0/255.255.255.0/eth0, static
Subnet IPV6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
Network 2 exists
Subnet Ipv4:192.168.209.0/255.255.255.0/eth2, static
Subnet IPV6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
[Root@rac1 ~]#
Two networks (including newly added networks) are already configured in the cluster's network resources, and if you use the Crsctl status Res-t view, you can see:
[Root@rac1 ~]# crsctl status res-t |grep-a 2 network
Ora.net1.network
Online Online Rac1 Stable
Online Online RAC2 Stable
Ora.net2.network
OFFLINE OFFLINE Rac1 Stable
OFFLINE OFFLINE Rac2 Stable
[Root@rac1 ~]#
– Add VIP
[Root@rac1 ~]# srvctl add Vip-node rac1-netnum 2-address
[Root@rac1 ~]# srvctl add Vip-node rac2-netnum 2-address
[root@rac1 ~]# srvctl config vip-n rac1
VIP exists:network number 1, hosting node Rac1
VIP NAME:RAC1-VIP
VIP IPv4 address:192.168.56.63
VIP IPV6 Address:
The VIP is enabled.
The VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
VIP exists:network number 2, hosting node Rac1
VIP NAME:RAC1-ADG-VIP
VIP IPv4 address:192.168.209.63
VIP IPV6 Address:
The VIP is enabled.
The VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
[root@rac1 ~]# srvctl config vip-n rac2
VIP exists:network number 1, hosting node Rac2
VIP NAME:RAC2-VIP
VIP IPv4 address:192.168.56.64
VIP IPV6 Address:
The VIP is enabled.
The VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
VIP exists:network number 2, hosting node Rac2
VIP NAME:RAC2-ADG-VIP
VIP IPv4 address:192.168.209.64
VIP IPV6 Address:
The VIP is enabled.
The VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
[Root@rac1 ~]# crsctl status res-t |grep-a 2 network
Ora.net1.network
Online Online Rac1 Stable
Online Online RAC2 Stable
Ora.net2.network
OFFLINE OFFLINE Rac1 Stable
Online Online RAC2 Stable
[Root@rac1 ~]# crsctl status res-t |grep-a 2 VIP
Ora.rac1.vip
1 Online online Rac1 stable
Ora.rac1_2.vip
1 OFFLINE OFFLINE Stable
Ora.rac2.vip
1 Online Online Rac2 stable
Ora.rac2_2.vip
1 OFFLINE OFFLINE Stable
Ora.scan1.vip
1 Online Online Rac2 stable
--------------------------------------------------------------------------------
[Root@rac1 ~]#
-Start VIP, view VIP Resources
[Root@rac1 ~]# Su-grid
[Grid@rac1 ~]$ srvctl start Vip-vip rac1-adg-vip
[Grid@rac1 ~]$ srvctl start Vip-vip rac2-adg-vip
[Grid@rac1 ~]$ srvctl status Vip-n Rac1
VIP RAC1-VIP is enabled
VIP Rac1-vip is running on NODE:RAC1
VIP RAC1-ADG-VIP is enabled
VIP Rac1-adg-vip is running on NODE:RAC1
[Grid@rac1 ~]$ srvctl status Vip-n rac2
VIP RAC2-VIP is enabled
VIP Rac2-vip is running on NODE:RAC2
VIP RAC2-ADG-VIP is enabled
VIP Rac2-adg-vip is running on NODE:RAC2
[Grid@rac1 ~]$
[Grid@rac1 ~]$ crsctl status res-t |grep-a 2 network
Ora.net1.network
Online Online Rac1 Stable
Online Online RAC2 Stable
Ora.net2.network
Online Online Rac1 Stable
Online Online RAC2 Stable
[Grid@rac1 ~]$ crsctl status res-t |grep-a 2 VIP
Ora.rac1.vip
1 Online online Rac1 stable
Ora.rac1_2.vip
1 Online online Rac1 stable
Ora.rac2.vip
1 Online Online Rac2 stable
Ora.rac2_2.vip
1 Online Online Rac2 stable
Ora.scan1.vip
1 Online Online Rac2 stable
--------------------------------------------------------------------------------
[Grid@rac1 ~]$
– Check to see if the newly created VIP is running:
[Grid@rac1 ~]$/sbin/ifconfig eth2:1
Eth2:1 Link encap:ethernet hwaddr 08:00:27:17:79:3c
inet addr:192.168.209.63 bcast:192.168.209.255 mask:255.255.255.0
Up broadcast RUNNING multicast mtu:1500 metric:1
[Grid@rac1 ~]$
[Root@rac2 ~]#/sbin/ifconfig eth2:1
Eth2:1 Link encap:ethernet hwaddr 08:00:27:74:c7:94
inet addr:192.168.209.64 bcast:192.168.209.255 mask:255.255.255.0
Up broadcast RUNNING multicast mtu:1500 metric:1
[Root@rac2 ~]#
– Add a listener on Network 2:
[Grid@rac1 ~]$ srvctl add listener-listener listener_adg-netnum 2-endpoints "tcp:1522"
[Grid@rac1 ~]$ crsctl status res-t |grep-a 2 LISTENER
Ora. Listener.lsnr
Online Online Rac1 Stable
Online Online RAC2 Stable
Ora. Listener_adg.lsnr
OFFLINE OFFLINE Rac1 Stable
OFFLINE OFFLINE Rac2 Stable
--
Ora. Listener_scan1.lsnr
1 Online Online Rac2 stable
Ora. Mgmtlsnr
[Grid@rac1 ~]$
Configure scan on the NETWORK2:
[Root@rac1 ~]# srvctl add scan-scanname racadg-scan-netnum 2
[root@rac1 ~]# srvctl config scan-netnum 2
SCAN Name:racadg-scan, Network:2
Subnet Ipv4:192.168.209.0/255.255.255.0/eth2, static
Subnet IPV6:
SCAN 0 IPv4 vip:192.168.209.65
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
[Root@rac1 ~]# srvctl Status Scan-netnum 2
SCAN VIP Scan1_net2 is enabled
SCAN VIP Scan1_net2 is not running
[Root@rac1 ~]# crsctl status res-t |grep-a 2 LISTENER
Ora. Listener.lsnr
Online Online Rac1 Stable
Online Online RAC2 Stable
Ora. Listener_adg.lsnr
OFFLINE OFFLINE Rac1 Stable
OFFLINE OFFLINE Rac2 Stable
--
Ora. Listener_scan1.lsnr
1 Online Online Rac2 stable
Ora. Mgmtlsnr
[Root@rac1 ~]# crsctl status res-t |grep-a 1 SCAN
Ora. Listener_scan1.lsnr
1 Online Online Rac2 stable
[Root@rac1 ~]#
-Start listening on the NETWORK2
[Grid@rac1 ~]$ srvctl start Listener-listener LISTENER_ADG
[Grid@rac1 ~]$ srvctl status Listener-listener LISTENER_ADG
Listener LISTENER_ADG is enabled
Listener LISTENER_ADG is running on node (s): RAC1,RAC2
[Grid@rac1 ~]$ srvctl status Listener-listener Listener
Listener Listener is enabled
Listener Listener is running on node (s): RAC1,RAC2
[Grid@rac1 ~]$
[Grid@rac1 ~]$ crsctl status res-t |grep-a 2 LISTENER
Ora. Listener.lsnr
Online Online Rac1 Stable
Online Online RAC2 Stable
Ora. Listener_adg.lsnr
Online Online Rac1 Stable
Online Online RAC2 Stable
--
Ora. Listener_scan1.lsnr
1 Online Online Rac2 stable
Ora. Mgmtlsnr
[Grid@rac1 ~]$ crsctl status res-t |grep-a 2 SCAN
Ora. Listener_scan1.lsnr
1 Online Online Rac2 stable
Ora. Mgmtlsnr
[Grid@rac1 ~]$
– Start the scan on the NETWORK2
[Root@rac1 ~]# srvctl start Scan-netnum 2
[root@rac1 ~]# srvctl config scan-netnum 2
SCAN Name:racadg-scan, Network:2
Subnet Ipv4:192.168.209.0/255.255.255.0/eth2, static
Subnet IPV6:
SCAN 0 IPv4 vip:192.168.209.65
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes:
SCAN VIP is individually disabled on nodes:
[Root@rac1 ~]# srvctl Status Scan-netnum 2
SCAN VIP Scan1_net2 is enabled
SCAN VIP Scan1_net2 is running on node Rac1
[Root@rac1 ~]# crsctl status res-t |grep-a 2 LISTENER
Ora. Listener.lsnr
Online Online Rac1 Stable
Online Online RAC2 Stable
Ora. Listener_adg.lsnr
Online Online Rac1 Stable
Online Online RAC2 Stable
--
Ora. Listener_scan1.lsnr
1 Online Online Rac2 stable
Ora. Mgmtlsnr
[Root@rac1 ~]# crsctl status res-t |grep-a 2 SCAN
Ora. Listener_scan1.lsnr
1 Online Online Rac2 stable
Ora. Mgmtlsnr
[Root@rac1 ~]#
– Add Scan LISTENER on the NETWORK2
[Grid@rac1 ~]$ srvctl add scan_listener-netnum 2-listener racadg-scanlsnr-endpoints "tcp:1522"
[Grid@rac1 ~]$ srvctl start Scan_listener-netnum 2
[Grid@rac1 ~]$ srvctl Status Scan_listener-netnum 2
SCAN Listener Racadg-scanlsnr_scan1_net2 is enabled
SCAN Listener Racadg-scanlsnr_scan1_net2 is running on node Rac1
[grid@rac1 ~]$ srvctl config scan_listener-netnum 2
SCAN Listener Racadg-scanlsnr_scan1_net2 exists. port:tcp:1522
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@rac1 ~]$ crsctl status res-t |grep-a 2 LISTENER
Ora. Listener.lsnr
Online Online Rac1 Stable
Online Online RAC2 Stable
Ora. Listener_adg.lsnr
Online Online Rac1 Stable
Online Online RAC2 Stable
--
Ora. Listener_scan1.lsnr
1 Online Online Rac2 stable
Ora. Mgmtlsnr
[Grid@rac1 ~]$ crsctl status res-t |grep-a 2 SCAN
Ora. Listener_scan1.lsnr
1 Online Online Rac2 stable
Ora. Mgmtlsnr
--
Ora. Racadg-scanlsnr_scan1_net2.lsnr
1 Online online Rac1 stable
Ora.cvu
[Grid@rac1 ~]$
– Check the Listening status
[Grid@rac1 ~]$ netstat-an |grep 1521|grep LISTEN
TCP 0 0 169.254.242.79:1521 0.0.0.0:* LISTEN
TCP 0 0 192.168.60.61:1521 0.0.0.0:* LISTEN-----rac1-priv
TCP 0 0 192.168.56.63:1521 0.0.0.0:* LISTEN-----RAC1-VIP
TCP 0 0 192.168.56.61:1521 0.0.0.0:* LISTEN-----Rac1
[Grid@rac1 ~]$ netstat-an |grep 1522|grep LISTEN
TCP 0 0 192.168.209.65:1522 0.0.0.0:* LISTEN-----Rac-scan
TCP 0 0 192.168.209.63:1522 0.0.0.0:* LISTEN-----RAC1-ADG-VIP
[Grid@rac1 ~]$ lsnrctl status LISTENER
Lsnrctl for linux:version 12.1.0.2.0-production on 16-feb-2016 21:41:54
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (description= address= (PROTOCOL=IPC) (Key=listener))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version Tnslsnr for Linux:version 12.1.0.2.0-production
Start Date 16-feb-2016 17:59:39
Uptime 0 Days 3 hr. sec
Trace level off
Security On:local OS Authentication
SNMP off
Listener Parameter File/u01/app/12.1.0.2/grid/network/admin/listener.ora
Listener Log File/u01/app/grid/diag/tnslsnr/rac1/listener/alert/log.xml
Listening Endpoints Summary ...
(Description= (address= (PROTOCOL=IPC) (Key=listener))
(Description= (address= (protocol=tcp) (host=192.168.56.61) (port=1521))-----Rac1
(Description= (address= (protocol=tcp) (host=192.168.56.63) (port=1521))-----RAC1-VIP
(Description= (address= (PROTOCOL=TCPS) (HOST=RAC1) (port=5500)) (Security= (my_wallet_directory=/u01/app/oracle/ Product/12.1.0.2/dbhome_1/admin/lunar/xdb_wallet)) (presentation=http) (Session=raw))
Services Summary ...
Service "+asm" has 1 instance (s).
Instance "+asm1", Status READY, has 1 handler (s) for the This service ...
Service "Lunar" has 1 instance (s).
Instance "Lunar1", Status READY, has 1 handler (s) for the This service ...
Service "Lunarxdb" has 1 instance (s).
Instance "Lunar1", Status READY, has 1 handler (s) for the This service ...
The command completed successfully
[Grid@rac1 ~]$
[Grid@rac1 ~]$ lsnrctl status LISTENER_ADG
Lsnrctl for linux:version 12.1.0.2.0-production on 16-feb-2016 21:41:59
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (description= address= (PROTOCOL=IPC) (KEY=LISTENER_ADG))
STATUS of the LISTENER
------------------------
Alias LISTENER_ADG
Version Tnslsnr for Linux:version 12.1.0.2.0-production
Start Date 16-feb-2016 21:13:48
Uptime 0 days 0 hr. Min. sec
Trace level off
Security On:local OS Authentication
SNMP off
Listener Parameter File/u01/app/12.1.0.2/grid/network/admin/listener.ora
Listener Log File/u01/app/grid/diag/tnslsnr/rac1/listener_adg/alert/log.xml
Listening Endpoints Summary ...
(Description= (address= (PROTOCOL=IPC) (KEY=LISTENER_ADG))
(Description= (address= (protocol=tcp) (host=192.168.209.63) (port=1522))
The listener supports no services
The command completed successfully
[Grid@rac1 ~]$
Configuring Oracle Database instances to support multiple networks:
Lunarrac1_local_net1 = (DESCRIPTION = (address = (PROTOCOL = TCP) (HOST = RAC1-VIP) (PORT = 1521))
Lunarrac1_local_net2 = (DESCRIPTION = (address = (PROTOCOL = TCP) (HOST = RAC1-ADG-VIP) (PORT = 1522))
Lunarrac2_local_net1 = (DESCRIPTION = (address = (PROTOCOL = TCP) (HOST = RAC2-VIP) (PORT = 1521))
Lunarrac2_local_net2 = (DESCRIPTION = (address = (PROTOCOL = TCP) (HOST = RAC2-ADG-VIP) (PORT = 1522))
Lunarrac_remote_net1 = (Description_list = (DESCRIPTION = (address = (PROTOCOL = TCP) (HOST = Rac-scan) (PORT = 1521)))
Lunarrac_remote_net2 = (Description_list = (DESCRIPTION = (address = (PROTOCOL = TCP) (HOST = Racadg-scan) (PORT = 1522)))
[ORACLE@RAC1 admin]$ SS
Sql*plus:release 12.1.0.2.0 Production on Thu Feb 18 21:58:50 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
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
Sys@lunar1>
Sys@lunar1>alter system set listener_networks= ' (NAME=NETWORK1) (Local_listener=lunarrac1_local_net1) (REMOTE_ LISTENER=LUNARRAC_REMOTE_NET1)) ', ' (NAME=NETWORK2) (Local_listener=lunarrac1_local_net2) (REMOTE_LISTENER= Lunarrac_remote_net2)) ' sid= ' lunar1 ';
System altered.
elapsed:00:00:00.36
Sys@lunar1>alter system set listener_networks= ' (NAME=NETWORK1) (Local_listener=lunarrac2_local_net1) (REMOTE_ LISTENER=LUNARRAC_REMOTE_NET1)) ', ' (NAME=NETWORK2) (Local_listener=lunarrac2_local_net2) (REMOTE_LISTENER= Lunarrac_remote_net2)) ' sid= ' lunar2 ';
System altered.
elapsed:00:00:00.19
Sys@lunar1>alter system set local_listener= ' (Description= (address_list= address= (protocol=tcp) (HOST=RAC1-VIP) ( port=1521))), ' sid= ' lunar1 ';
System altered.
elapsed:00:00:00.03
Sys@lunar1>alter system set local_listener= ' (Description= (address_list= address= (protocol=tcp) (HOST=RAC2-VIP) ( port=1521))), ' sid= ' lunar2 ';
System altered.
elapsed:00:00:00.80
Sys@lunar1>
Configuring Client Connection Strings
-Check whether the database can log on:
[Oracle@lunarrac ~]$ SS
Sql*plus:release 12.1.0.2.0 Production on Fri Feb 19 08:57:30 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
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
Sys@lunar1>conn Sys/oracle@//lunarrac-scan:1521/lunar as Sysdba
Connected.
Sys@//lunarrac-scan:1521/lunar>conn Sys/oracle@//lunaradg-scan:1522/lunar as Sysdba
Connected.
Sys@//lunaradg-scan:1522/lunar>conn System/oracle@//lunarrac-scan:1521/lunar
Connected.
System@//lunarrac-scan:1521/lunar>conn System/oracle@//lunaradg-scan:1522/lunar
Connected.
System@//lunaradg-scan:1522/lunar>conn Sys/oracle@lunarrac.vip as Sysdba
Connected.
Sys@lunarrac.vip>conn Sys/oracle@lunarrac.scanip as Sysdba
Connected.
Sys@lunarrac.scanip>conn Sys/oracle@lunaradg.vip as Sysdba
Connected.
Sys@lunaradg.vip>conn Sys/oracle@lunaradg.scanip as Sysdba
Connected.
Sys@lunaradg.scanip>conn SYS/ORACLE@RAC1ADG as Sysdba
Connected.
Sys@rac1adg>conn SYS/ORACLE@RAC2ADG as Sysdba
Connected.
Sys@rac2adg>conn Sys/oracle@racadg.vip as Sysdba
Connected.
Sys@racadg.vip>conn Sys/oracle@racadg.scanip as Sysdba
Connected.
Sys@racadg.scanip>conn Sys/oracle@rac1 as Sysdba
Connected.
Sys@rac1>conn Sys/oracle@rac2 as Sysdba
Connected.
Sys@rac2>conn Sys/oracle@racdb.vip as Sysdba
Connected.
Sys@racdb.vip>conn Sys/oracle@racdb.scanip as Sysdba
Connected.
Sys@racdb.scanip>
This is all done.