프린트 하기

내맘대로긍정이 알려주는

Oracle 23ai 신기능
무료 세미나 발표자료

다운로드 trending_flat

OS환경 : Oracle Linux 8.4, 8.5 (64bit)

 

DB 환경 : Oracle Database 19.12.0.0 RAC

 

방법 : 오라클 19c RAC OS 커널 패치시 작업 가이드

Oracle Linux 8.4을 8.5로 패치할 때 Oracle database 2노드 RAC 의 작업 절차를 설명함

os 패치 작업이라도 작업전 grid home, db home을 백업해놓는것을 추천함

1
2
3
4
5
6
7
8
9
10
11
GRID 엔진 백업
# cd $GRID_HOME/../
# ls
grid
# tar -cvf grid_home_20211020.tar grid/
 
DB 엔진 백업
$ cd $ORACLE_HOME/../
$ ls 
db_1
$ tar -cvf db_home_20211020.tar db_1/

 

 

기존 커널 버전 확인(모든 노드)

1
2
3
4
# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 8.4 (Ootpa)
# uname -a
Linux oel19db1 5.4.17-2102.201.3.el8uek.x86_64 #2 SMP Fri Apr 23 08:45:57 PDT 2021 x86_64 x86_64 x86_64 GNU/Linux

 

 

기존 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
# 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
ora.proxy_advm
               OFFLINE OFFLINE      oel19db1                 STABLE
               OFFLINE OFFLINE      oel19db2                 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       oel19db1                 STABLE
      2        ONLINE  ONLINE       oel19db2                 STABLE
ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       oel19db1                 STABLE
      2        ONLINE  ONLINE       oel19db2                 STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       oel19db1                 STABLE
ora.OCR_VOTE.dg(ora.asmgroup)
      1        ONLINE  ONLINE       oel19db1                 STABLE
      2        ONLINE  ONLINE       oel19db2                 STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       oel19db1                 Started,STABLE
      2        ONLINE  ONLINE       oel19db2                 Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       oel19db1                 STABLE
      2        ONLINE  ONLINE       oel19db2                 STABLE
ora.cvu
      1        ONLINE  ONLINE       oel19db1                 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=/oracle/ap
                                                             p/oracle/product/19c
                                                             ,STABLE
      2        ONLINE  ONLINE       oel19db2                 Open,HOME=/oracle/ap
                                                             p/oracle/product/19c
                                                             ,STABLE
ora.qosmserver
      1        ONLINE  ONLINE       oel19db1                 STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       oel19db1                 STABLE
--------------------------------------------------------------------------------

 

 

grid 종료(모든 노드)

1
2
3
4
5
6
7
8
9
10
11
# crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'oel19db1'
CRS-2673: Attempting to stop 'ora.crsd' on 'oel19db1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on server 'oel19db1'
CRS-2673: Attempting to stop 'ora.qosmserver' on 'oel19db1'
.
.
CRS-2677: Stop of 'ora.gipcd' on 'oel19db1' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'oel19db1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'oel19db1' has completed
CRS-4133: Oracle High Availability Services has been stopped.

 

 

root 유저로 grid unlock 처리(모든 노드)

1
2
3
4
5
6
7
8
# cd $GRID_HOME/crs/install
# pwd
/oracle/app/grid/19c/crs/install
# sh rootcrs.sh -unlock
Using configuration parameter file: /oracle/app/grid/19c/crs/install/crsconfig_params
The log of current session can be found at:
  /oracle/app/oracle/crsdata/oel19db1/crsconfig/crsunlock_oel19db1_2021-12-06_02-27-07PM.log
2021/12/06 14:27:08 CLSRSC-347: Successfully unlock /oracle/app/grid/19c

 

 

os 커널 패치(모든 노드)

1
2
3
4
5
6
7
8
9
10
11
12
# yum update -y
Last metadata expiration check: 0:11:46 ago on Mon 06 Dec 2021 02:16:06 PM KST.
Dependencies resolved.
=============================================================================================================================================================
 Package                                              Architecture    Version                                               Repository                  Size
=============================================================================================================================================================
Installing:
 kernel                                               x86_64          4.18.0-348.2.1.el8_5                                  ol8_baseos_latest          7.0 M
 kernel-core                                          x86_64          4.18.0-348.2.1.el8_5                                  ol8_baseos_latest           38 M
.
.
Complete!

 

 

패치 후 커널 버전 확인

1
2
3
4
# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.5 (Ootpa)
# uname -a
Linux oel19db1 5.4.17-2102.201.3.el8uek.x86_64 #2 SMP Fri Apr 23 09:05:57 PDT 2021 x86_64 x86_64 x86_64 GNU/Linux

정상적으로 커널 버전이 8.5로 패치됨

 

grid owner로 grid relink(모든 노드)

(나의 경우 grid 설치시 별도의 유저없이 oracle 유저로 설치했기 때문에 oracle 유저로 relink)

1
2
3
4
5
6
7
8
9
# su - oracle
$ export ORACLE_HOME=$GRID_HOME
$ echo $ORACLE_HOME
/oracle/app/grid/19c
$ cd $GRID_HOME/bin
$ pwd
/oracle/app/grid/19c/bin
$ ./relink all
writing relink log to: /oracle/app/grid/19c/install/relinkActions2021-12-06_02-39-28PM.log

 

*참고 root로 relink 를 수행하려고 하면 안된다고 나옴

1
2
3
# cd $GRID_HOME/bin
# ./relink all
The relink script cannot be run as root.

 

 

db owner로 db relink(모든 노드)

1
2
3
4
5
6
7
8
9
# su - oracle
$ export ORACLE_HOME=/oracle/app/oracle/product/19c
$ echo $ORACLE_HOME
/oracle/app/oracle/product/19c
$ cd $ORACLE_HOME/bin
$ pwd
/oracle/app/oracle/product/19c/bin
$ ./relink all
writing relink log to: /oracle/app/oracle/product/19c/install/relinkActions2021-12-06_02-41-52PM.log

 

 

root 유저로 아래 스크립트 실행(모든 노드)

1
2
3
4
5
6
7
8
9
10
# cd $GRID_HOME/rdbms/install
# pwd
/oracle/app/grid/19c/rdbms/install
# ./rootadd_rdbms.sh 
# cd $GRID_HOME/crs/install
# sh rootcrs.sh -lock
Using configuration parameter file: /oracle/app/grid/19c/crs/install/crsconfig_params
The log of current session can be found at:
  /oracle/app/oracle/crsdata/oel19db1/crsconfig/crslock_oel19db1_2021-12-06_02-48-13PM.log
2021/12/06 14:48:14 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'

 

*참고1 root 유저가 아닌 일반유저로 스크립트를 실행하면 안된다고 나옴

1
2
3
$ ./rootadd_rdbms.sh 
You must be logged in as user with UID as zero (e.g. root user) to run root.sh.
Log in as user with UID as zero (e.g. root user) and restart root.sh execution.

 

*참고2 19c 에서 rootcrs.sh -postpatch나 perl rootcrs.pl -patch 사용시 아래와 같은 에러가 발생함

sh rootcrs.sh -lock 명령을 사용해줘야함

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# cd $GRID_HOME/crs/install
# sh ./rootcrs.sh -postpatch
Using configuration parameter file: /oracle/app/grid/19c/crs/install/crsconfig_params
The log of current session can be found at:
  /oracle/app/oracle/crsdata/oel19db1/crsconfig/crs_postpatch_apply_inplace_oel19db1_2021-12-06_02-43-20PM.log
2021/12/06 14:43:21 CLSRSC-739: cannot run the postpatch operation because the prepatch operation did not complete successfully
Died at /oracle/app/grid/19c/crs/install/crspatch.pm line 2905.
The command '/oracle/app/grid/19c/perl/bin/perl -I/oracle/app/grid/19c/perl/lib -I/oracle/app/grid/19c/crs/install -I/oracle/app/grid/19c/xag 
/oracle/app/grid/19c/crs/install/rootcrs.pl -postpatch' execution failed
 
# perl rootcrs.pl -patch
Can't locate Net/Ping.pm in @INC (you may need to install the Net::Ping module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 
/usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . ./../../perl/lib) at crsutils.pm line 797.
BEGIN failed--compilation aborted at crsutils.pm line 797.
Compilation failed in require at crsconvert.pm line 67.
BEGIN failed--compilation aborted at crsconvert.pm line 67.
Compilation failed in require at rootcrs.pl line 197.
BEGIN failed--compilation aborted at rootcrs.pl line 197.

 

 

grid 기동(모든 노드)

1
2
# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

 

 

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
# 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
ora.proxy_advm
               OFFLINE OFFLINE      oel19db1                 STABLE
               OFFLINE OFFLINE      oel19db2                 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       oel19db1                 STABLE
      2        ONLINE  ONLINE       oel19db2                 STABLE
ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       oel19db1                 STABLE
      2        ONLINE  ONLINE       oel19db2                 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
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       oel19db1                 Started,STABLE
      2        ONLINE  ONLINE       oel19db2                 Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       oel19db1                 STABLE
      2        ONLINE  ONLINE       oel19db2                 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=/oracle/ap
                                                             p/oracle/product/19c
                                                             ,STABLE
      2        ONLINE  ONLINE       oel19db2                 Open,HOME=/oracle/ap
                                                             p/oracle/product/19c
                                                             ,STABLE
ora.qosmserver
      1        ONLINE  ONLINE       oel19db2                 STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       oel19db2                 STABLE
--------------------------------------------------------------------------------

모두 정상

 

 

참조 :

1467060.1, 1536057.1

https://positivemh.tistory.com/787

 

Oracle Linux 8.4 커널 패치 가이드

OS환경 : Oracle Linux 8.4, 8.5 (64bit) DB 환경 : Oracle Database 19.12.0.0 방법 : Oracle Linux 8.4 커널 패치 가이드 Oracle Linux 8.4을 8.5로 패치하는 방법을 설명함 현재 Oracle 19c 가 설치되어있..

positivemh.tistory.com