내맘대로긍정이 알려주는
Oracle 23ai 신기능
무료 세미나 발표자료
OS환경 : Oracle Linux 7.6 (64bit)
DB 환경 : Oracle Database 19.6.0.0
방법 : 오라클 19c RAC IP 변경 방법(IP Change)
오라클 19c 2node RAC 환경에서 Public IP, Virtual IP, Scan IP, Private IP 를 변경하는 테스트
기존 IP 리스트
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
##Public
192.168.137.10 oel19db1
192.168.137.20 oel19db2
##Private
10.10.10.10 oel19db1-priv
10.10.10.20 oel19db2-priv
##Virtual
192.168.137.100 oel19db1-vip
192.168.137.200 oel19db2-vip
##SCAN
192.168.137.150 oel19db-scan
|
Public, Virtual, Scan IP를 192.168.137.n 대역에서 192.168.200.n 대역으로 변경할 예정
Private IP를 10.10.10.n 대역에서 10.10.200.n 대역으로 변경할 예정
*(IP 제일 끝자리만 변경하는 경우 /etc/hosts 및 OS IP만 변경해주면됨)
작업 전 참고사항
* $GRID_HOME 이란 grid 의 HOME 경로임
* oifcfg 명령은 한쪽 노드에서만 실행해도 됨(한쪽에서 명령어 실행하면 양쪽다 적용됨)
* /etc/hosts 수정은 양쪽 노드에서 다 해주어야함
* #은 root 유저, $는 oracle(grid)유저를 나타냄
목차
0. 사전작업
1. Public IP 변경
2. Virtual IP 변경
3. Scan IP 변경
4. Private IP 변경
절차를 간단하게 설명하면
1번, 2번 노드 Grid의 Public IP 대역 변경 후
Virtual IP 정보 확인 후
OS 에서 실제 IP(IP, /etc/hosts)를 변경 후
각 노드의 Virtual IP 를 변경한 뒤
각 노드의 Scan IP를 변경함
이후 Private IP를 변경 함
0. 사전 작업
OS에 등록되어있는 네트워크 정보 확인(netstat)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
1번 노드
# netstat -ni
Kernel Interface table
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
ens32 1500 1292 0 0 0 1156 0 0 0 BMRU
ens32:1 1500 - no statistics available - BMRU
ens35 1500 105208 0 0 0 95408 0 0 0 BMRU
ens35:1 1500 - no statistics available - BMRU
lo 65536 11652 0 0 0 11652 0 0 0 LRU
2번 노드
# netstat -ni
Kernel Interface table
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
ens32 1500 1265 0 0 0 778 0 0 0 BMRU
ens32:1 1500 - no statistics available - BMRU
ens32:2 1500 - no statistics available - BMRU
ens35 1500 94241 0 0 0 105448 0 0 0 BMRU
ens35:1 1500 - no statistics available - BMRU
lo 65536 110178 0 0 0 110178 0 0 0 LRU
|
OS에 등록되어있는 네트워크 정보 확인(ifconfig)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
1번 노드
# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.137.10 netmask 255.255.255.0 broadcast 192.168.137.255
inet6 fe80::20c:29ff:fed3:6d16 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:d3:6d:16 txqueuelen 1000 (Ethernet)
RX packets 1358 bytes 144259 (140.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1199 bytes 497717 (486.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens32:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.137.100 netmask 255.255.255.0 broadcast 192.168.137.255
ether 00:0c:29:d3:6d:16 txqueuelen 1000 (Ethernet)
ens35: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.10.10 netmask 255.255.255.0 broadcast 10.10.10.255
inet6 fe80::20c:29ff:fed3:6d20 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:d3:6d:20 txqueuelen 1000 (Ethernet)
RX packets 108619 bytes 106960757 (102.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 100307 bytes 104267128 (99.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens35:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.29.124 netmask 255.255.224.0 broadcast 169.254.31.255
ether 00:0c:29:d3:6d:20 txqueuelen 1000 (Ethernet)
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 12430 bytes 5315593 (5.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12430 bytes 5315593 (5.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2번 노드
# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.137.20 netmask 255.255.255.0 broadcast 192.168.137.255
inet6 fe80::250:56ff:fe3d:54c6 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:3d:54:c6 txqueuelen 1000 (Ethernet)
RX packets 1300 bytes 176208 (172.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 808 bytes 121505 (118.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens32:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.137.150 netmask 255.255.255.0 broadcast 192.168.137.255
ether 00:50:56:3d:54:c6 txqueuelen 1000 (Ethernet)
ens32:2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.137.200 netmask 255.255.255.0 broadcast 192.168.137.255
ether 00:50:56:3d:54:c6 txqueuelen 1000 (Ethernet)
ens35: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.10.20 netmask 255.255.255.0 broadcast 10.10.10.255
inet6 fe80::250:56ff:fe39:a3bc prefixlen 64 scopeid 0x20<link>
ether 00:50:56:39:a3:bc txqueuelen 1000 (Ethernet)
RX packets 101993 bytes 104825909 (99.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 110394 bytes 107777990 (102.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens35:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.2.149 netmask 255.255.224.0 broadcast 169.254.31.255
ether 00:50:56:39:a3:bc txqueuelen 1000 (Ethernet)
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 111778 bytes 370243441 (353.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 111778 bytes 370243441 (353.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
각각 ens와 ip가 아래와 같음
Public IP ens32 : 192.168.137.10, 192.168.137.20
Virtual IP ens32:1 : 192.168.37.100, 192.168.37.200
Private IP ens35 : 10.10.10.10, 10.10.10.20
(169 대역과 lo는 무시)
1. Public IP 변경
Public 변경시 GRID 는 내리지 않고 작업함
(OS 에서 IP 변경으로 노드 재부팅이 필요한 경우가 아니면 GRID를 재기동 할 필요가 없음, 롤링 방식으로 수행할 수 있음)
Public IP 변경 절차는 1번 노드에서만 적용하면 2번 노드도 같이 적용됨
기존 네트워크 정보 확인
1
2
3
|
# $GRID_HOME/bin/oifcfg getif
ens32 192.168.137.0 global public
ens35 10.10.10.0 global cluster_interconnect,asm
|
기존 Public IP 정보 삭제 및 확인
예시와 같이 입력
1
2
3
|
# $GRID_HOME/bin/oifcfg delif -global ens32
# $GRID_HOME/bin/oifcfg getif
ens35 10.10.10.0 global cluster_interconnect,asm
|
Public IP 정보가 정상적으로 삭제됨
새로운 Public IP 정보 입력 및 확인
예시와 같이 입력
1
2
3
4
|
# $GRID_HOME/bin/oifcfg setif -global ens32/192.168.200.0:public
# $GRID_HOME/bin/oifcfg getif
ens35 10.10.10.0 global cluster_interconnect,asm
ens32 192.168.200.0 global public
|
Public IP 정보가 정상적으로 변경됨
2. Virtual IP 변경
OS IP, 네트워크 변경 후 OS 재기동 또는 grid 재기동을 하는 경우 vip가 올라오지 않음
이 경우 아래 단계를 건너뛰고 아래에 있는 "Virtual IP 변경" 작업을 시작하면됨
기존 네트워크 정보 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 192.168.137.0/255.255.255.0/ens32, static
Subnet IPv6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
VIP exists: network number 1, hosting node oel19db1
VIP Name: oel19db1-vip
VIP IPv4 Address: 192.168.137.100
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
VIP exists: network number 1, hosting node oel19db2
VIP Name: oel19db2-vip
VIP IPv4 Address: 192.168.137.200
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
|
vip 1번, 2번 모두가 192.168.137 대역임
VIP 상태 확인
1
2
3
4
5
6
7
8
|
# crsctl stat res -t | grep -A1 vip
ora.oel19db1.vip
1 ONLINE ONLINE oel19db1 STABLE
ora.oel19db2.vip
1 ONLINE ONLINE oel19db2 STABLE
--
ora.scan1.vip
1 ONLINE ONLINE oel19db2 STABLE
|
모두 정상 ONLINE 상태
VIP 리소스 중지(db, vip)
1
2
3
4
5
6
7
8
9
|
예시
$ srvctl stop instance -d <db_name> -n <node_name> (선택사항)
$ srvctl stop vip -n <node_name> -f
사용
$ srvctl stop instance -d ORADB -n oel19db1
$ srvctl stop instance -d ORADB -n oel19db2
$ srvctl stop vip -n oel19db1 -f
$ srvctl stop vip -n oel19db2 -f
|
리소스 중지 되었는지 확인
1
2
3
4
5
6
7
8
|
$ crsctl stat res -t | grep -A1 vip
ora.oel19db1.vip
1 OFFLINE OFFLINE STABLE
ora.oel19db2.vip
1 OFFLINE OFFLINE STABLE
--
ora.scan1.vip
1 ONLINE ONLINE oel19db2 STABLE
|
1번, 2번 vip가 정상적으로 OFFLINE 됨
나의 경우 가상머신(1번 노드, 2번 노드) 의 NAT 대역 자체를 변경 해줘야 해서 grid 및 OS 종료가 필요함
grid 및 OS를 종료하지 않고 OS의 IP, 네트워크를 변경한 상태라면 아래 단계를 건너뛰고 아래에 있는 "Virtual IP 변경" 작업을 시작하면됨
grid 종료
1
2
3
4
5
|
1번 노드
# crsctl stop crs
2번 노드
# crsctl stop crs
|
OS 에서 네트워크, IP 변경
/etc/hosts 백업(1번 노드, 2번 노드 모두)
1
2
|
# cp -av /etc/hosts /etc/hostsbak
/etc/hosts -> /etc/hostsbak
|
/etc/hosts 파일 수정(1번 노드, 2번 노드 모두)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
##Public
192.168.200.10 oel19db1
192.168.200.20 oel19db2
##Private
10.10.10.10 oel19db1-priv
10.10.10.20 oel19db2-priv
##Virtual
192.168.200.100 oel19db1-vip
192.168.200.200 oel19db2-vip
##SCAN
192.168.200.150 oel19db-scan
|
Public, Virtual, Scan IP 만 192.138.200.n 으로 변경
OS의 IP 변경
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
1번 노드
# vi /etc/sysconfig/network-scripts/ifcfg-ens32
(생략)
기존 IPADDR=192.168.137.10
변경 IPADDR=192.168.200.10
PREFIX=24
기존 GATEWAY=192.168.137.2
변경 GATEWAY=192.168.200.2
DNS1=168.126.63.1
IPV6_PRIVACY=no
2번 노드
# vi /etc/sysconfig/network-scripts/ifcfg-ens32
(생략)
기존 IPADDR=192.168.137.20
변경 IPADDR=192.168.200.20
PREFIX=24
기존 GATEWAY=192.168.137.2
변경 GATEWAY=192.168.200.2
DNS1=168.126.63.1
IPV6_PRIVACY=no
|
OS 종료
1
2
3
4
5
|
1번 노드
# init 0
2번 노드
# init 0
|
VM NAT 대역 변경
vmware Edit - Vritual Network Editor... 선택
NAT 선택 후 NAT Settings.. 선택
Gateway IP 변경(192.168.137.2 에서 192.168.200.2 으로 변경)
Subnet IP 변경(192.168.137.0 에서 192.168.200.0 으로 변경)
OS 기동
변경된 IP로 노드 접속 후 IP 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
1번 노드
# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.200.10 netmask 255.255.255.0 broadcast 192.168.200.255
inet6 fe80::20c:29ff:fed3:6d16 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:d3:6d:16 txqueuelen 1000 (Ethernet)
RX packets 360 bytes 46650 (45.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 304 bytes 60519 (59.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens35: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.10.10 netmask 255.255.255.0 broadcast 10.10.10.255
inet6 fe80::20c:29ff:fed3:6d20 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:d3:6d:20 txqueuelen 1000 (Ethernet)
RX packets 14692 bytes 14375736 (13.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 18134 bytes 15391585 (14.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
(169 대역과 lo는 생략함)
2번 노드
# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.200.20 netmask 255.255.255.0 broadcast 192.168.200.255
inet6 fe80::250:56ff:fe3d:54c6 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:3d:54:c6 txqueuelen 1000 (Ethernet)
RX packets 1333 bytes 198214 (193.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1467 bytes 206192 (201.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens35: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.10.20 netmask 255.255.255.0 broadcast 10.10.10.255
inet6 fe80::250:56ff:fe39:a3bc prefixlen 64 scopeid 0x20<link>
ether 00:50:56:39:a3:bc txqueuelen 1000 (Ethernet)
RX packets 18484 bytes 15320983 (14.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15075 bytes 16068968 (15.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
(169 대역과 lo는 생략함)
|
정상적으로 OS IP가 변경됨
Virtual IP 변경(root유저)
예시와 같이 입력
1
2
3
4
5
|
1번 노드
# srvctl modify nodeapps -n oel19db1 -A oel19db1-vip/255.255.255.0/ens32
2번 노드
# srvctl modify nodeapps -n oel19db2 -A oel19db2-vip/255.255.255.0/ens32
|
위 명령 입력시 수동으로 vip 리소스를 start 시키지 않아도 자동으로 ONLINE 상태가 되었음
자동으로 ONLINE 되지 않는 경우도 수동 기동
1
2
3
4
5
6
|
예시
$ srvctl start vip -n <node_name>
사용
$ srvctl start vip -n oel19db1
$ srvctl start vip -n oel19db2
|
Virtual IP 변경 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 192.168.200.0/255.255.255.0/ens32, static
Subnet IPv6:
Ping Targets:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
VIP exists: network number 1, hosting node oel19db1
VIP Name: oel19db1-vip
VIP IPv4 Address: 192.168.200.100
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
VIP exists: network number 1, hosting node oel19db2
VIP Name: oel19db2-vip
VIP IPv4 Address: 192.168.200.200
VIP IPv6 Address:
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:
|
정상적으로 변경됨
Virtual IP 상태 확인
1
2
3
4
5
6
7
8
|
$ crsctl stat res -t | grep -A1 vip
ora.oel19db1.vip
1 ONLINE ONLINE oel19db1 STABLE
ora.oel19db2.vip
1 ONLINE ONLINE oel19db2 STABLE
--
ora.scan1.vip
1 ONLINE ONLINE oel19db2 STABLE
|
정상적으로 ONLINE 상태로 확인됨
3. Scan IP 변경
기존 네트워크 정보 확인
1
2
3
4
5
6
|
$ $GRID_HOME/bin/srvctl config scan
SCAN name: oel19db-scan, Network: 1
Subnet IPv4: 192.168.200.0/255.255.255.0/ens32, static
Subnet IPv6:
SCAN 1 IPv4 VIP: 192.168.137.150
SCAN VIP is enabled.
|
현재 192.168.137 대역임
기존 Scan 리소스 확인
1
2
3
4
5
6
|
$ crsctl stat res -t | grep -E -A1 "SCAN|scan"
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE oel19db2 STABLE
--
ora.scan1.vip
1 ONLINE ONLINE oel19db2 STABLE
|
기존 Scan 리소스 중지 및 확인
1
2
3
4
5
6
7
8
|
$ $GRID_HOME/bin/srvctl stop scan_listener
$ $GRID_HOME/bin/srvctl stop scan
$ crsctl stat res -t | grep -E -A1 "SCAN|scan"
ora.LISTENER_SCAN1.lsnr
1 OFFLINE OFFLINE STABLE
--
ora.scan1.vip
1 OFFLINE OFFLINE STABLE
|
정상적으로 중지됨
Scan IP 변경 및 확인
($GRID_HOME/bin/srvctl modify scan_listener -u 명령은 scan vip 수가 변경 되었을때 입력하면됨(업데이트명령))
1
2
3
4
5
6
7
8
|
# $GRID_HOME/bin/srvctl modify scan -n oel19db-scan
# $GRID_HOME/bin/srvctl modify scan_listener -u
# $GRID_HOME/bin/srvctl config scan
SCAN name: oel19db-scan, Network: 1
Subnet IPv4: 192.168.200.0/255.255.255.0/ens32, static
Subnet IPv6:
SCAN 1 IPv4 VIP: 192.168.200.150
SCAN VIP is enabled.
|
192.168.200 대역으로 변경됨
Scan 리소스 시작 및 확인
1
2
3
4
5
6
7
8
|
$ $GRID_HOME/bin/srvctl start scan
$ $GRID_HOME/bin/srvctl start scan_listener
$ crsctl stat res -t | grep -E -A1 "SCAN|scan"
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE oel19db2 STABLE
--
ora.scan1.vip
1 ONLINE ONLINE oel19db2 STABLE
|
정상적으로 기동됨
4. Private IP 변경
gpnp 프로파일 백업($GRID_HOME/gpnp/{hostname}/profiles/peer)
1
2
3
4
5
6
7
8
9
10
|
# cd $GRID_HOME/gpnp/oel19db1/profiles/peer
# cp -p profile.xml profile.xmlbak
# ls -al
total 16
drwxr-x--- 2 oracle dba 90 Jul 28 04:04 .
drwxr-x--- 3 oracle dba 18 Mar 4 2020 ..
-rw-r--r-- 1 oracle dba 1863 Jul 27 23:27 profile.old
-rw-r--r-- 1 oracle dba 1873 Mar 4 2020 profile_orig.xml
-rw-r--r-- 1 oracle dba 1936 Jul 27 23:29 profile.xml
-rw-r--r-- 1 oracle dba 1936 Jul 27 23:29 profile.xmlbak
|
* grid 11.2 부터 Private IP는 OCR 뿐만 아니라 gpnp 프로필에도 저장됨
Private 네트워크를 사용할 수 없거나 정의가 잘못된 경우 CRSD 프로세스가 시작되지 않고 이후에 OCR을 변경할 수 없음
따라서 Private 네트워크 구성을 수정할 때 주의가 필요함
올바른 순서로 변경을 수행하는 것이 중요하고 gpnp 프로필의 수동 변경은 지원되지 않음 (gpnptool을 이용해야함)
기존 네트워크 정보 확인
1
2
3
|
$ $GRID_HOME/bin/oifcfg getif
ens35 10.10.10.0 global cluster_interconnect,asm
ens32 192.168.200.0 global public
|
새로운 Private IP 정보 입력 및 확인
예시와 같이 입력
1
2
3
4
5
|
$ $GRID_HOME/bin/oifcfg setif -global ens35/10.10.200.0:cluster_interconnect,asm
$ $GRID_HOME/bin/oifcfg getif
ens35 10.10.10.0 global cluster_interconnect,asm
ens32 192.168.200.0 global public
ens35 10.10.200.0 global cluster_interconnect,asm
|
ASM LISTENER도 있으므로 ASM LISTENER 정보도 변경해야함
(ASM LISTENER은 Private IP를 사용함)
1
2
3
4
5
|
# ps -ef|grep tns
root 21 2 0 02:29 ? 00:00:00 [netns]
oracle 11080 1 0 02:35 ? 00:00:00 /ORA19/app/grid/19.3.0/bin/tnslsnr ASMNET1LSNR_ASM -no_crs_notify -inherit
oracle 14066 1 0 02:41 ? 00:00:00 /ORA19/app/grid/19.3.0/bin/tnslsnr LISTENER -no_crs_notify -inherit
root 30091 9101 0 04:02 pts/0 00:00:00 grep --color=auto tns
|
ASM LISTENER 이름이 ASMNET1LSNR_ASM임
기존 ASM LISTENER 정보 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
$ TNS_ADMIN=$GRID_HOME/network/admin
$ lsnrctl status ASMNET1LSNR_ASM
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 28-JUL-2021 04:14:17
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET1LSNR_ASM)))
STATUS of the LISTENER
------------------------
Alias ASMNET1LSNR_ASM
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 28-JUL-2021 02:35:38
Uptime 0 days 1 hr. 38 min. 39 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /ORA19/app/grid/19.3.0/network/admin/listener.ora
Listener Log File /ORA19/app/oracle/diag/tnslsnr/oel19db1/asmnet1lsnr_asm/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=ASMNET1LSNR_ASM)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.10.10)(PORT=1525)))
Services Summary...
Service "+ASM" has 2 instance(s).
Instance "+ASM1", status READY, has 2 handler(s) for this service...
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 2 instance(s).
Instance "+ASM1", status READY, has 2 handler(s) for this service...
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "+ASM_OCR_VOTE" has 2 instance(s).
Instance "+ASM1", status READY, has 2 handler(s) for this service...
Instance "+ASM2", status READY, has 1 handler(s) for this service...
The command completed successfully
|
새로운 ASM LISTENER 추가
1
2
3
4
5
|
예시
$ srvctl add listener -asmlistener -l {new ASM LISTENER NAME} -subnet {new subnet}
사용
$ srvctl add listener -asmlistener -l ASMNEWLSNR_ASM -subnet 10.10.200.0
|
ASM LISTENER 정보 확인
1
2
3
4
5
6
7
|
$ srvctl config asm
ASM home: <CRS home>
Password file: +OCR_VOTE/orapwASM
Backup of Password file: +OCR_VOTE/orapwASM_backup
ASM listener: LISTENER
ASM instance count: 3
Cluster ASM listener: ASMNET1LSNR_ASM,ASMNEWLSNR_ASM
|
기존 ASM LISTENER(ASMNET1LSNR_ASM)와 새로 추가한 ASM LISTENER(ASMNEWLSNR_ASM) 이 존재함
기존 ASM LISTENER 삭제 및 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
$ srvctl update listener -listener ASMNET1LSNR_ASM -asm -remove -force
$ srvctl config listener -asmlistener
Name: ASMNEWLSNR_ASM
Type: ASM Listener
Owner: oracle
Subnet: 10.10.200.0
Home: <CRS home>
End points: TCP:1526
Listener is enabled.
Listener is individually enabled on nodes:
Listener is individually disabled on nodes:
$ srvctl config asm
ASM home: <CRS home>
Password file: +OCR_VOTE/orapwASM
Backup of Password file: +OCR_VOTE/orapwASM_backup
ASM listener: LISTENER
ASM instance count: 3
Cluster ASM listener: ASMNEWLSNR_ASM
|
새로 추가한 ASM LISTENER(ASMNEWLSNR_ASM) 만 남음
삭제와 동시에 해당 리스너도 내려감
grid 종료(1번 노드, 2번 노드 모두)
1
|
# crsctl stop crs
|
OS에서 Private IP 정보 변경
/etc/hosts 파일 수정(1번 노드, 2번 노드 모두)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
##Public
192.168.200.10 oel19db1
192.168.200.20 oel19db2
##Private
10.10.200.10 oel19db1-priv
10.10.200.20 oel19db2-priv
##Virtual
192.168.200.100 oel19db1-vip
192.168.200.200 oel19db2-vip
##SCAN
192.168.200.150 oel19db-scan
|
Private IP 10.10.200.n 으로 변경
OS의 IP 변경
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1번 노드
# vi /etc/sysconfig/network-scripts/ifcfg-ens35
(생략)
기존 IPADDR=10.10.10.10
변경 IPADDR=10.10.200.10
(생략)
NAME=ens35
2번 노드
# vi /etc/sysconfig/network-scripts/ifcfg-ens35
(생략)
기존 IPADDR=10.10.10.20
변경 IPADDR=10.10.200.20
(생략)
|
network restart 후 ip 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
1번 노드
# systemctl restart network.service
# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.200.10 netmask 255.255.255.0 broadcast 192.168.200.255
inet6 fe80::20c:29ff:fed3:6d16 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:d3:6d:16 txqueuelen 1000 (Ethernet)
RX packets 12850 bytes 4264157 (4.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11002 bytes 2830953 (2.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens35: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.200.10 netmask 255.255.255.0 broadcast 10.10.200.255
inet6 fe80::20c:29ff:fed3:6d20 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:d3:6d:20 txqueuelen 1000 (Ethernet)
RX packets 262231 bytes 212006693 (202.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 452873 bytes 504885774 (481.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2번 노드
# systemctl restart network.service
# ifconfig
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.200.20 netmask 255.255.255.0 broadcast 192.168.200.255
inet6 fe80::250:56ff:fe3d:54c6 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:3d:54:c6 txqueuelen 1000 (Ethernet)
RX packets 11864 bytes 4396803 (4.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9542 bytes 2414978 (2.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens35: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.200.20 netmask 255.255.255.0 broadcast 10.10.200.255
inet6 fe80::250:56ff:fe39:a3bc prefixlen 64 scopeid 0x20<link>
ether 00:50:56:39:a3:bc txqueuelen 1000 (Ethernet)
RX packets 453371 bytes 497024399 (473.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 262240 bytes 213624630 (203.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
정상적으로 Private IP가 10.10.200.n 대역으로 변경됨
grid 기동(1번 노드, 2번 노드 모두)
1
|
# crsctl start crs
|
기존 Private IP 정보 삭제 및 확인
예시와 같이 입력
1
2
3
4
5
6
7
8
9
10
|
$ $GRID_HOME/bin/oifcfg getif
ens35 10.10.10.0 global cluster_interconnect,asm
ens32 192.168.200.0 global public
ens35 10.10.200.0 global cluster_interconnect,asm
$ $GRID_HOME/bin/oifcfg delif -global ens35/10.10.10.0
$ $GRID_HOME/bin/oifcfg getif
ens32 192.168.200.0 global public
ens35 10.10.200.0 global cluster_interconnect,asm
|
정상적으로 10.10.10.0 대역이 삭제됨
asmnetwork 의 정보 변경
기존 정보 확인
1
2
3
4
5
6
7
|
# srvctl config asmnetwork
ASM network 1 exists
Subnet IPv4: 10.10.10.0//
Subnet IPv6:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
|
기존 정보 삭제 후 확인
1
2
3
|
# srvctl remove asmnetwork -netnum 1
# srvctl config asmnetwork
PRCN-2045 : No network exists
|
신규 정보 삽입 후 확인
1
2
3
4
5
6
7
8
9
|
# srvctl add asmnetwork -netnum 1 -subnet 10.10.200.0
# srvctl config asmnetwork
ASM network 1 exists
Subnet IPv4: 10.10.200.0//
Subnet IPv6:
Network is enabled
Network is individually enabled on nodes:
Network is individually disabled on nodes:
# srvctl start asmnetwork
|
db 기동 후 grid 전체 상태 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# srvctl start database -db ORADB
# crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE oel19db1 STABLE
ONLINE ONLINE oel19db2 STABLE
ora.chad
ONLINE ONLINE oel19db1 STABLE
ONLINE ONLINE oel19db2 STABLE
ora.net1.network
ONLINE ONLINE oel19db1 STABLE
ONLINE ONLINE oel19db2 STABLE
ora.ons
ONLINE ONLINE oel19db1 STABLE
ONLINE ONLINE oel19db2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNEWLSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE oel19db1 STABLE
2 ONLINE ONLINE oel19db2 STABLE
3 ONLINE OFFLINE STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE oel19db1 STABLE
2 ONLINE ONLINE oel19db2 STABLE
3 OFFLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE oel19db2 STABLE
ora.OCR_VOTE.dg(ora.asmgroup)
1 ONLINE ONLINE oel19db1 STABLE
2 ONLINE ONLINE oel19db2 STABLE
3 OFFLINE OFFLINE STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE oel19db1 Started,STABLE
2 ONLINE ONLINE oel19db2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE oel19db1 STABLE
2 ONLINE ONLINE oel19db2 STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE oel19db2 STABLE
ora.oel19db1.vip
1 ONLINE ONLINE oel19db1 STABLE
ora.oel19db2.vip
1 ONLINE ONLINE oel19db2 STABLE
ora.oradb.db
1 ONLINE ONLINE oel19db1 Open,HOME=/ORA19/app
/oracle/product/19.3
.0/db_1,STABLE
2 ONLINE ONLINE oel19db2 Open,HOME=/ORA19/app
/oracle/product/19.3
.0/db_1,STABLE
ora.qosmserver
1 ONLINE ONLINE oel19db2 STABLE
ora.scan1.vip
1 ONLINE ONLINE oel19db2 STABLE
--------------------------------------------------------------------------------
|
서비스 모두 정상
리스너 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
$ TNS_ADMIN=$GRID_HOME/network/admin
일반 리스너
$ lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 28-JUL-2021 06:38:56
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 28-JUL-2021 06:27:16
Uptime 0 days 0 hr. 11 min. 40 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /ORA19/app/grid/19.3.0/network/admin/listener.ora
Listener Log File /ORA19/app/oracle/diag/tnslsnr/oel19db1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.200.10)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.200.100)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_OCR_VOTE" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "ORADB" has 1 instance(s).
Instance "ORADB1", status READY, has 1 handler(s) for this service...
Service "ORADBXDB" has 1 instance(s).
Instance "ORADB1", status READY, has 1 handler(s) for this service...
The command completed successfully
ASM 리스너
$ lsnrctl status ASMNEWLSNR_ASM
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 28-JUL-2021 06:40:31
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNEWLSNR_ASM)))
STATUS of the LISTENER
------------------------
Alias ASMNEWLSNR_ASM
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 28-JUL-2021 06:27:18
Uptime 0 days 0 hr. 13 min. 13 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /ORA19/app/grid/19.3.0/network/admin/listener.ora
Listener Log File /ORA19/app/oracle/diag/tnslsnr/oel19db1/asmnewlsnr_asm/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=ASMNEWLSNR_ASM)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.10.200.10)(PORT=1526)))
Services Summary...
Service "+ASM" has 2 instance(s).
Instance "+ASM1", status READY, has 2 handler(s) for this service...
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 2 instance(s).
Instance "+ASM1", status READY, has 2 handler(s) for this service...
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "+ASM_OCR_VOTE" has 2 instance(s).
Instance "+ASM1", status READY, has 2 handler(s) for this service...
Instance "+ASM2", status READY, has 1 handler(s) for this service...
The command completed successfully
|
IP가 모두 정상적으로 변경됨
참조 :
https://positivemh.tistory.com/322
How to Modify Private Network Information in Oracle Clusterware (Doc ID 283684.1)
How to Modify SCAN Setting or SCAN Listener Port after Installation [ID 972500.1]
How to Update the IP Address of the SCAN VIP Resources (ora.scan{n}.vip) (Doc ID 952903.1)
How to Modify Public Network Information including VIP in Oracle Clusterware (Doc ID 276434.1)
오라클 클러스터웨어에서 VIP를 포함한 공용 네트워크 정보를 수정하는 방법 (Doc ID 1572572.1)
'ORACLE > Rac' 카테고리의 다른 글
오라클 19c RAC 리스너 포트 변경 방법 (0) | 2021.08.14 |
---|---|
오라클 19c RAC network interface 변경 후 grid 기동불가 시 해결방법 (0) | 2021.08.04 |
오라클 19c RAC에서 ASM 리소스 제거 방법 (0) | 2021.05.10 |
Oracle 10g RAC 운영시 rcp, rsh, rlogin 이 필요한지 여부 (0) | 2020.07.16 |
오라클 11g R2 RAC cssd 프로세스 중지 시 노드 재기동 (5) | 2020.07.06 |