프린트 하기 URL 복사

OS 환경 : Oracle Linux 9.6 (64bit)

 

DB 환경 : Oracle Database 19.31.0.0

 

방법 : 오라클 19c OPatch 이용 비활성 패치 제거

본문에서는 OPatch 12.2.0.1.37 버전 이후로 추가된 비활성 패치 제거 기능에 대해 테스트해봄
기본적으로 19c를 사용하고 있는경우 19.3부터 26년 4월 ru인 19.31까지 패치를 자주 적용한 경우 신규 패치를 또 적용하려할때 시간이 오래 소요됨
이는 패치전 기존 ru와 충돌이 있는지 검사하는 과정이 많기 때문임
더불어 $ORACLE_HOME/.patch_storage 경로에도 이전 버전으로 롤백하기 위한 파일들이 남아 있어 용량도 많이 차지함
OPatch 12.2.0.1.37 버전 이후에 있는 비활성 패치 제거 기능을 이용하면 $ORACLE_HOME에 ru가 많을 경우 바이너리 패칭 성능을 향상시키고 .patch_storage에서 비활성 패치가 차지하는 공간을 삭제해줌
비활성 패치 제거는 다운타임 없이 사용가능함

 

 

본문 테스트는 아래와 같이 진행함

테스트
1. 19.22 ru적용 및 db 구성
2. 19.23~19.28 ru 모두 적용(매번 datapatch 수행)
3. 엔진 및 DB 백업
4_1. 19.31 ru 적용(시간 측정)
4_2. 롤백
5_1. 엔진 백업본 압축해제
5_2. 비활성 패치 제거
5_3. 19.31 ru 적용(시간 측정)

 

 

테스트
본문에서는 db 설치 등 큰 부분만 작성하고 자세한 절차는 생략함, 아래 게시글 참고하여 구성하면됨
참고 : Oracle Linux 8.4에 Oracle 19c Silent 모드 설치 가이드 ( https://positivemh.tistory.com/1152 )

 

 

1. 19.22 ru적용 및 db 구성
엔진 압축 해제

1
2
3
$ mkdir -p $ORACLE_HOME
$ cd $ORACLE_HOME
$ unzip -q /app/oracle/media/LINUX.X64_193000_db_home.zip

 

 

opatch 업데이트

1
2
3
4
5
6
7
$ cd $ORACLE_HOME
$ mv OPatch OPatchold
$ unzip -q /app/oracle/media/p6880880_190000_Linux-x86-64.zip
$ opatch version
OPatch Version: 12.2.0.1.51
 
OPatch succeeded.

 

 

runInstaller 실행

1
2
3
$ cd $ORACLE_HOME
$ export CV_ASSUME_DISTID=OEL7.6
$ ./runInstaller -silent -applyRU /app/oracle/media/36031453/35940989 -responseFile /home/oracle/db_install.rsp

 

 

netca 수행

1
$ netca -silent -responseFile $ORACLE_HOME/assistants/netca/netca.rsp

 

 

리스너 종료

1
$ lsnrctl stop

 

 

dbca 수행

1
$ dbca -silent -createDatabase -responsefile /home/oracle/dbca.rsp

 

 

2. 19.23~19.28 ru 모두 적용(매번 datapatch 수행)
19.22~19.28 그리고 19.31 패치를 다운받아놓음
19.22는 엔진 설치시 이미 적용하였고 나머지 패치를 하나씩 진행함

 

 

현재 패치 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ opatch lspatches
35967489;OCW RELEASE UPDATE 19.22.0.0.0 (35967489)
35943157;Database Release Update : 19.22.0.0.240116 (35943157)
 
OPatch succeeded.
 
SQL>
set lines 200 pages 1000
col action_time for a20
col action for a10
col status for a10
col description for a60
col version for a10
select to_char(action_time, 'yyyy/mm/dd hh24:mi:ss') as action_time,
       action, status, description, patch_id
from dba_registry_sqlpatch
order by action_time;
 
ACTION_TIME          ACTION     STATUS     DESCRIPTION                                                    PATCH_ID
-------------------- ---------- ---------- ------------------------------------------------------------ ----------
2026/05/17 02:40:09  APPLY      SUCCESS    Database Release Update : 19.22.0.0.240116 (35943157)          35943157

19.22가 적용되어 있음

 

 

설치 직후

1
2
$ du -sh $ORACLE_HOME/.patch_storage
2.4G    ./.patch_storage/

2.4G 정도임

 

 

패치 파일 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ cd /app/oracle/media/
$ ls -al
total 32587196
drwxrwxr-x. 10 oracle dba            4096 May 16 22:03 .
drwxrwxr-x. 10 oracle dba             125 May 17 02:22 ..
drwxr-xr-x   4 oracle oinstall         57 Jan 16  2024 36031453
-rw-------.  1 oracle dba      3059705302 Oct 13  2025 LINUX.X64_193000_db_home.zip
-rw-r--r--   1 oracle dba      3297891114 May 16 20:59 p36031453_190000_Linux-x86-64_1922.zip
-rw-r--r--   1 oracle dba      3558403588 May 16 20:59 p36209493_190000_Linux-x86-64_1923.zip
-rw-r--r--   1 oracle dba      3592768748 May 16 21:00 p36522439_190000_Linux-x86-64_1924.zip
-rw-r--r--   1 oracle dba      3516796411 May 16 21:01 p36866740_190000_Linux-x86-64_1925.zip
-rw-r--r--   1 oracle dba      3658988450 May 16 21:01 p37262208_190000_Linux-x86-64_1926.zip
-rw-r--r--   1 oracle dba      4110578680 May 16 21:06 p37591516_190000_Linux-x86-64_1927.zip
-rw-r--r--.  1 oracle dba      4083374170 Oct 13  2025 p37952382_190000_Linux-x86-64_1928.zip
-rw-r--r--   1 oracle dba      4351062613 May 16 21:31 p39062956_190000_Linux-x86-64_1931.zip
-rw-r--r--   1 oracle dba       136478629 May 16 21:07 p6880880_190000_Linux-x86-64.zip
-rw-rw-r--   1 oracle oinstall    3219049 May  1 11:14 PatchSearch.xml

 

 

패치 파일 모두 압축 해제

1
2
$ for f in p3*.zip; do unzip -qo "$f"; done
$ ls -al

 

 

패치 자동화
매번 opatch apply 후 datapatch 수행

 

 

스크립트 작성

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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
$ vi test_patch.sh
#!/bin/bash
0. 오라클 환경변수 체크
if [ -z "$ORACLE_HOME" ]; then
    echo "ERROR: ORACLE_HOME 환경변수가 설정되지 않았습니다. .bash_profile을 로드한 후 실행하세요."
    exit 1
fi
 
1. 적용할 패치 경로들을 배열로 선언 (원하는 만큼 추가)
PATCH_DIRS=(
    #"/app/oracle/media/36031453/35940989/35943157" # 19.22 DBRU
    "/app/oracle/media/36209493/36233126/36233263" # 19.23 DBRU
    "/app/oracle/media/36522439/36582629/36582781" # 19.24 DBRU
    "/app/oracle/media/36866740/36916690/36912597" # 19.25 DBRU
    "/app/oracle/media/37262208/37257886/37260974" # 19.26 DBRU
    "/app/oracle/media/37591516/37641958/37642901" # 19.27 DBRU
    "/app/oracle/media/37952382/37957391/37960098" # 19.28 DBRU
    #"/app/oracle/media/39062956/39036936/39034528" # 19.31 DBRU
)
 
2. 배열을 순회하며 패치 작업 반복
for p_dir in "${PATCH_DIRS[@]}"; do
    echo "================================================="
    echo "▶ [START] 패치 작업 시작: $p_dir"
    echo "================================================="
 
    echo "[Step 1] Move to patch folder"
    cd "$p_dir" || { echo "ERROR: $p_dir 경로로 이동할 수 없습니다."; exit 1; }
 
    echo "[Step 1.5] Check Database Status (SMON)"
    # ora_smon 프로세스 개수 확인 (grep 명령어 자체는 제외)
    SMON_COUNT=$(ps -ef | grep ora_smon | grep -v grep | wc -l)
 
    if [ "$SMON_COUNT" -gt 0 ]; then
        echo "  -> WARNING: 실행 중인 DB 인스턴스(SMON)가 감지되었습니다. 패치를 위해 DB를 종료합니다."
        sqlplus -s / as sysdba << EOF
shutdown immediate
exit
EOF
        # 종료 후 프로세스가 확실히 내려갔는지 2차 검증
        sleep 2
        if [ "$(ps -ef | grep ora_smon | grep -v grep | wc -l)" -gt 0 ]; then
            echo "  -> ERROR: DB(smon)가 정상적으로 종료되지 않았습니다. 패치 작업을 중단합니다."
            exit 1
        fi
        echo "  -> DB 종료가 확인되었습니다."
    else
        echo "  -> OK: 실행 중인 DB 프로세스가 없습니다. 패치를 진행합니다."
    fi
 
    echo "[Step 2] OPatch apply"
    time opatch apply -silent || { echo "ERROR: OPatch 적용 중 오류가 발생했습니다. 로그를 확인하세요."; exit 1; }
 
    echo "[Step 3] Check lspatches"
    opatch lspatches
 
    echo "[Step 4] DB Startup"
    sqlplus -s / as sysdba << EOF
startup
exit
EOF
 
    echo "[Step 5] Datapatch"
    cd "$ORACLE_HOME/OPatch" || { echo "ERROR: OPatch 경로로 이동할 수 없습니다."; exit 1; }
    ./datapatch -verbose || { echo "WARNING: Datapatch 수행 중 오류가 발생했을 수 있습니다."; }
 
    echo "[Step 6] Check DB patch status"
    sqlplus -s / as sysdba << EOF
set lines 200 pages 1000
col action_time for a20
col action for a10
col status for a10
col description for a60
col version for a10
 
select to_char(action_time, 'yyyy/mm/dd hh24:mi:ss') as action_time,
       action, status, description, patch_id
from dba_registry_sqlpatch
order by action_time;
exit
EOF
 
    echo "[Step 7] DB Shutdown"
    sqlplus -s / as sysdba << EOF
shutdown immediate
exit
EOF
 
    echo "================================================="
    echo "▷ [END] 패치 작업 완료: $p_dir"
    echo "================================================="
    echo ""
du -sh $ORACLE_HOME/.patch_storage
    
done
 
echo "모든 패치 작업 완료."

 

 

권한 부여 및 nohup 수행

1
2
$ chmod +x test_patch.sh
$ nohup sh test_patch.sh &

몇시간뒤 모든 패치가 적용됨

 

 

19.28까지 패치 적용 후 패치 내역 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
SQL>
set lines 200 pages 1000
col action_time for a20
col action for a10
col status for a10
col description for a60
col version for a10
select to_char(action_time, 'yyyy/mm/dd hh24:mi:ss') as action_time,
       action, status, description, patch_id
from dba_registry_sqlpatch
order by action_time;
 
ACTION_TIME          ACTION     STATUS     DESCRIPTION                                                    PATCH_ID
-------------------- ---------- ---------- ------------------------------------------------------------ ----------
2026/05/17 02:40:09  APPLY      SUCCESS    Database Release Update : 19.22.0.0.240116 (35943157)          35943157
2026/05/17 03:18:32  APPLY      SUCCESS    Database Release Update : 19.23.0.0.240416 (36233263)          36233263
2026/05/17 03:36:42  APPLY      SUCCESS    Database Release Update : 19.24.0.0.240716 (36582781)          36582781
2026/05/17 03:51:46  APPLY      SUCCESS    Database Release Update : 19.25.0.0.241015 (36912597)          36912597
2026/05/17 04:08:39  APPLY      SUCCESS    Database Release Update : 19.26.0.0.250121 (37260974)          37260974
2026/05/17 04:26:14  APPLY      SUCCESS    Database Release Update : 19.27.0.0.250415 (37642901)          37642901
2026/05/17 04:44:57  APPLY      SUCCESS    Database Release Update : 19.28.0.0.250715 (37960098)          37960098
 
7 rows selected.

모든 패치가 잘적용됨

 

 

19.28까지 패치 적용 후 .patch_storage 경로 크기 확인

1
2
$ du -sh $ORACLE_HOME/.patch_storage
16G     /app/oracle/product/19c/.patch_storage

16gb 까지 증가함

 

 

매 패치마다 $ORACLE_HOME/.patch_storage에 백업 파일을 생성함

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ cd /app/oracle/product/19c/.patch_storage
$ du -sh ./*
248K    ./29517242_Apr_17_2019_23_27_10
76K     ./29585399_Apr_9_2019_19_12_47
2.3G    ./35943157_Jan_13_2024_05_42_55  <<-- 19.22
223M    ./35967489_Dec_27_2023_03_56_41  <<-- 19.22 OCW
2.1G    ./36233263_Apr_8_2024_17_16_56  <<-- 19.23
2.0G    ./36582781_Jul_13_2024_14_01_16  <<-- 19.24
2.3G    ./36912597_Oct_11_2024_06_47_24  <<-- 19.25
2.7G    ./37260974_Jan_20_2025_04_30_30  <<-- 19.26
2.1G    ./37642901_Apr_15_2025_08_17_25  <<-- 19.27
2.4G    ./37960098_Jul_15_2025_11_45_21  <<-- 19.28
268K    ./interim_inventory.txt
4.0K    ./LatestOPatchSession.properties
48K     ./NApply
288K    ./newdirs.txt
140K    ./record_inventory.txt

 

 

2gb가 넘는 이 폴더들을 열어보면 엔진영역의 백업 파일이 존재함

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ ls 35967489_Dec_27_2023_03_56_41/files
bin  crs  cv  has  install  inventory  jlib  lib  oui  racg  srvm
$ ls 36233263_Apr_8_2024_17_16_56/files
assistants  bin  ctx  deinstall  install  inventory  jdbc  jdk+  jlib  lib  md  network  nls  odbc  olap  opmn  owm  perl+  precomp  rdbms  sdk  sqlcl  ucp
$ ls 36582781_Jul_13_2024_14_01_16/files
assistants  bin  ctx  deinstall  install  inventory  jdbc  jdk+  jlib  lib  md  network  nls  odbc  olap  opmn  owm  perl+  precomp  rdbms  sqlcl  ucp
$ ls 36912597_Oct_11_2024_06_47_24/files
assistants  bin  ctx  deinstall  install  inventory  jdbc  jdk+  jlib  lib  md  network  nls  odbc  olap  opmn  owm  perl+  precomp  rdbms  sqlcl  ucp
$ ls 37260974_Jan_20_2025_04_30_30/files
assistants  bin  ctx  deinstall  install  inventory  jdbc  jdk+  jlib  lib  md  network  nls  odbc  olap  opmn  owm  perl+  precomp  rdbms  sqlcl  ucp
$ ls 37642901_Apr_15_2025_08_17_25/files
assistants  ctx        install    jdbc  jlib  lib  network  odbc  opmn  perl+    rdbms  ucp
bin         deinstall  inventory  jdk+  ldap  md   nls      olap  owm   precomp  sdk    xdk
$ ls 37960098_Jul_15_2025_11_45_21/files
assistants  crs  deinstall  inventory  jdk+  ldap  md       nls   olap  owm    plsql    QOpatch  sdk  xdk
bin         ctx  install    jdbc       jlib  lib   network  odbc  opmn  perl+  precomp  rdbms    ucp

 

 

3. 엔진 및 DB 백업
참고로 현재 db는 shutdown 상태임

 

 

엔진 백업

1
2
3
4
5
6
7
8
9
10
# cd $ORACLE_HOME/..
$ pwd
/app/oracle/product
$ ls
19c
# tar cfp ./db_home_bak.tar ./19c
$ ls -lh
total 28G
drwxr-xr-x 74 oracle oinstall 4.0K May 17 04:39 19c
-rw-r--r--  1 oracle oinstall  28G May 25 11:37 db_home_bak.tar

백업이 완료됨

 

 

DB 백업

1
2
3
4
5
6
7
8
9
10
11
12
13
$ cd /app/oracle/oradata/ORA19FS/
$ mkdir -p ../ORA19FSBAK
$ cp -av ./* ../ORA19FSBAK/
'./control01.ctl' -> '../ORA19FSBAK/control01.ctl'
'./control02.ctl' -> '../ORA19FSBAK/control02.ctl'
'./redo01.log' -> '../ORA19FSBAK/redo01.log'
'./redo02.log' -> '../ORA19FSBAK/redo02.log'
'./redo03.log' -> '../ORA19FSBAK/redo03.log'
'./sysaux01.dbf' -> '../ORA19FSBAK/sysaux01.dbf'
'./system01.dbf' -> '../ORA19FSBAK/system01.dbf'
'./temp01.dbf' -> '../ORA19FSBAK/temp01.dbf'
'./undotbs01.dbf' -> '../ORA19FSBAK/undotbs01.dbf'
'./users01.dbf' -> '../ORA19FSBAK/users01.dbf'

백업이 완료됨

 

 

4_1. 19.31 ru 적용(시간 측정)
19.31 패치 적용

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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
$ cd /app/oracle/media/39062956/39036936/39034528
$ time opatch apply -silent
Oracle Interim Patch Installer version 12.2.0.1.51
Copyright (c) 2026, Oracle Corporation.  All rights reserved.
 
 
Oracle Home       : /app/oracle/product/19c
Central Inventory : /app/oraInventory
   from           : /app/oracle/product/19c/oraInst.loc
OPatch version    : 12.2.0.1.51
OUI version       : 12.2.0.7.0
Log file location : /app/oracle/product/19c/cfgtoollogs/opatch/opatch2026-05-25_11-55-05AM_1.log
 
Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   39034528
 
Do you want to proceed? [y|n]
Y (auto-answered by -silent)
User Responded with: Y
All checks passed.
 
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/app/oracle/product/19c')
 
 
Is the local system ready for patching? [y|n]
Y (auto-answered by -silent)
User Responded with: Y
Backing up files...
Applying interim patch '39034528' to OH '/app/oracle/product/19c'
ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.assistants.asm, 19.0.0.0.0 ] , [ oracle.datamining, 19.0.0.0.0 ] , [ oracle.java.sqlj.sqljruntime, 19.0.0.0.0 ] , [ oracle.crypto.rsf, 19.0.0.0.0 ] , [ oracle.oraolap.mgmt, 19.0.0.0.0 ] , [ oracle.pg4appc, 19.0.0.0.0 ] , [ oracle.pg4mq, 19.0.0.0.0 ] , [ oracle.precomp.companion, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.sdo.companion, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.rdbms.tg4ifmx, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 19.0.0.0.0 ] , [ oracle.ldap.ztk, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.ons.cclient, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 19.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ] , [ oracle.jdk, 1.8.0.391.11 ]  not present in the Oracle Home or a higher version is found.
 
Patching component oracle.rdbms.util, 19.0.0.0.0...
 
Patching component oracle.rdbms.rsf, 19.0.0.0.0...
 
Patching component oracle.rdbms, 19.0.0.0.0...
 
Patching component oracle.assistants.acf, 19.0.0.0.0...
 
Patching component oracle.assistants.deconfig, 19.0.0.0.0...
 
Patching component oracle.assistants.server, 19.0.0.0.0...
 
Patching component oracle.blaslapack, 19.0.0.0.0...
 
Patching component oracle.buildtools.rsf, 19.0.0.0.0...
 
Patching component oracle.wwg.plsql, 19.0.0.0.0...
 
Patching component oracle.ctx, 19.0.0.0.0...
 
Patching component oracle.dbdev, 19.0.0.0.0...
 
Patching component oracle.dbjava.ic, 19.0.0.0.0...
 
Patching component oracle.dbjava.jdbc, 19.0.0.0.0...
 
Patching component oracle.dbjava.ucp, 19.0.0.0.0...
 
Patching component oracle.duma, 19.0.0.0.0...
 
Patching component oracle.javavm.client, 19.0.0.0.0...
 
Patching component oracle.ldap.client, 19.0.0.0.0...
 
Patching component oracle.ldap.owm, 19.0.0.0.0...
 
Patching component oracle.ldap.rsf, 19.0.0.0.0...
 
Patching component oracle.ldap.security.osdt, 19.0.0.0.0...
 
Patching component oracle.marvel, 19.0.0.0.0...
 
Patching component oracle.network.rsf, 19.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf, 19.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf.core, 19.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf.ic, 19.0.0.0.0...
 
Patching component oracle.odbc.ic, 19.0.0.0.0...
 
Patching component oracle.ons, 19.0.0.0.0...
 
Patching component oracle.ons.ic, 19.0.0.0.0...
 
Patching component oracle.oracore.rsf, 19.0.0.0.0...
 
Patching component oracle.perlint, 5.28.1.0.0...
 
Patching component oracle.precomp.common.core, 19.0.0.0.0...
 
Patching component oracle.precomp.rsf, 19.0.0.0.0...
 
Patching component oracle.rdbms.crs, 19.0.0.0.0...
 
Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...
 
Patching component oracle.rdbms.deconfig, 19.0.0.0.0...
 
Patching component oracle.rdbms.install.common, 19.0.0.0.0...
 
Patching component oracle.rdbms.oci, 19.0.0.0.0...
 
Patching component oracle.rdbms.rsf.ic, 19.0.0.0.0...
 
Patching component oracle.rdbms.scheduler, 19.0.0.0.0...
 
Patching component oracle.rhp.db, 19.0.0.0.0...
 
Patching component oracle.rsf, 19.0.0.0.0...
 
Patching component oracle.sdo, 19.0.0.0.0...
 
Patching component oracle.sdo.locator.jrf, 19.0.0.0.0...
 
Patching component oracle.sqlj.sqljruntime, 19.0.0.0.0...
 
Patching component oracle.sqlplus, 19.0.0.0.0...
 
Patching component oracle.sqlplus.ic, 19.0.0.0.0...
 
Patching component oracle.tfa.db, 19.0.0.0.0...
 
Patching component oracle.wwg.plsql, 19.0.0.0.0...
 
Patching component oracle.xdk.rsf, 19.0.0.0.0...
 
Patching component oracle.rdbms.hs_common, 19.0.0.0.0...
 
Patching component oracle.javavm.server, 19.0.0.0.0...
 
Patching component oracle.rdbms.install.plugins, 19.0.0.0.0...
 
Patching component oracle.rdbms.locator, 19.0.0.0.0...
 
Patching component oracle.oraolap.api, 19.0.0.0.0...
 
Patching component oracle.rdbms.hsodbc, 19.0.0.0.0...
 
Patching component oracle.network.client, 19.0.0.0.0...
 
Patching component oracle.rdbms.drdaas, 19.0.0.0.0...
 
Patching component oracle.rdbms.dm, 19.0.0.0.0...
 
Patching component oracle.rdbms.rman, 19.0.0.0.0...
 
Patching component oracle.rdbms.rat, 19.0.0.0.0...
 
Patching component oracle.ovm, 19.0.0.0.0...
 
Patching component oracle.odbc, 19.0.0.0.0...
 
Patching component oracle.xdk.server, 19.0.0.0.0...
 
Patching component oracle.oraolap.dbscripts, 19.0.0.0.0...
 
Patching component oracle.xdk.xquery, 19.0.0.0.0...
 
Patching component oracle.network.listener, 19.0.0.0.0...
 
Patching component oracle.dbtoolslistener, 19.0.0.0.0...
 
Patching component oracle.ldap.rsf.ic, 19.0.0.0.0...
 
Patching component oracle.xdk.parser.java, 19.0.0.0.0...
 
Patching component oracle.sdo.locator, 19.0.0.0.0...
 
Patching component oracle.ctx.rsf, 19.0.0.0.0...
 
Patching component oracle.ldap.ssl, 19.0.0.0.0...
 
Patching component oracle.oraolap, 19.0.0.0.0...
 
Patching component oracle.mgw.common, 19.0.0.0.0...
 
Patching component oracle.install.deinstalltool, 19.0.0.0.0...
 
Patching component oracle.rdbms.dv, 19.0.0.0.0...
 
Patching component oracle.xdk, 19.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf.lbuilder, 19.0.0.0.0...
 
Patching component oracle.ctx.atg, 19.0.0.0.0...
 
Patching component oracle.network.aso, 19.0.0.0.0...
 
Patching component oracle.rdbms.lbac, 19.0.0.0.0...
 
Patching component oracle.precomp.lang, 19.0.0.0.0...
 
Patching component oracle.precomp.common, 19.0.0.0.0...
 
Patching component oracle.jdk, 1.8.0.201.0...
Patch 39034528 successfully applied.
Sub-set patch [37960098] has become inactive due to the application of a super-set patch [39034528].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /app/oracle/product/19c/cfgtoollogs/opatch/opatch2026-05-25_11-55-05AM_1.log
 
OPatch succeeded.
 
real    15m22.869s
user    9m42.937s
sys     1m44.956s

약 15분 소요됨

 

 

DB 기동

1
SQL> startup

 

 

datapatch 수행

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
$ time datapatch -verbose
SQL Patching tool version 19.31.0.0.0 Production on Mon May 25 12:15:19 2026
Copyright (c) 2012, 2026, Oracle.  All rights reserved.
 
Log file for this invocation: /app/oracle/cfgtoollogs/sqlpatch/sqlpatch_23246_2026_05_25_12_15_19/sqlpatch_invocation.log
 
Connecting to database...OK
Gathering database info...done
Bootstrapping registry and package to current versions...done
Determining current state...done
 
Current state of interim SQL patches:
  No interim patches found
 
Current state of release update SQL patches:
  Binary registry:
    19.31.0.0.0 Release_Update 260426152757: Installed
  SQL registry:
    Applied 19.28.0.0.0 Release_Update 250705030417 successfully on 17-MAY-26 04.44.57.694569 AM
 
Adding patches to installation queue and performing prereq checks...done
Installation queue:
  No interim patches need to be rolled back
  Patch 39034528 (Database Release Update : 19.31.0.0.260421 (39034528)):
    Apply from 19.28.0.0.0 Release_Update 250705030417 to 19.31.0.0.0 Release_Update 260426152757
  No interim patches need to be applied
 
Installing patches...
Patch installation complete.  Total patches installed: 1
 
Validating logfiles...done
Patch 39034528 apply: SUCCESS
  logfile: /app/oracle/cfgtoollogs/sqlpatch/39034528/28700584/39034528_apply_ORA19FS_2026May25_12_17_55.log (no errors)
SQL Patching tool complete on Mon May 25 12:19:19 2026
 
real    4m0.746s
user    0m34.862s
sys     0m3.917s

datapatch는 4분 소요됨

 

 

패치 적용 후 패치 내역 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
SQL>
set lines 200 pages 1000
col action_time for a20
col action for a10
col status for a10
col description for a60
col version for a10
select to_char(action_time, 'yyyy/mm/dd hh24:mi:ss') as action_time,
       action, status, description, patch_id
from dba_registry_sqlpatch
order by action_time;
 
ACTION_TIME          ACTION     STATUS     DESCRIPTION                                                    PATCH_ID
-------------------- ---------- ---------- ------------------------------------------------------------ ----------
2026/05/17 02:40:09  APPLY      SUCCESS    Database Release Update : 19.22.0.0.240116 (35943157)          35943157
2026/05/17 03:18:32  APPLY      SUCCESS    Database Release Update : 19.23.0.0.240416 (36233263)          36233263
2026/05/17 03:36:42  APPLY      SUCCESS    Database Release Update : 19.24.0.0.240716 (36582781)          36582781
2026/05/17 03:51:46  APPLY      SUCCESS    Database Release Update : 19.25.0.0.241015 (36912597)          36912597
2026/05/17 04:08:39  APPLY      SUCCESS    Database Release Update : 19.26.0.0.250121 (37260974)          37260974
2026/05/17 04:26:14  APPLY      SUCCESS    Database Release Update : 19.27.0.0.250415 (37642901)          37642901
2026/05/17 04:44:57  APPLY      SUCCESS    Database Release Update : 19.28.0.0.250715 (37960098)          37960098
2026/05/25 12:19:00  APPLY      SUCCESS    Database Release Update : 19.31.0.0.260421 (39034528)          39034528 <<-- !!
 
8 rows selected.

19.31이 잘 적용됨

 

 

db 종료

1
SQL> shutdown immediate

 

 

5_1. 엔진 백업본 압축해제 및 DB 백업본 복구
비활성 패치 제거 후 패치를 다시 수행하기 위해 백업본을 다시 복구 시킴
엔진 복구

1
2
3
4
5
$ cd $ORACLE_HOME/..
$ mv 19c/ 19cold
$ tar xfp db_home_bak.tar
$ ls
19c  19cold  db_home_bak.tar

복구가 완료됨

 

 

DB 백업본 복구

1
2
3
$ cd /app/oracle/oradata/
$ mv ORA19FS ORA19FSold
$ mv ORA19FSBAK/ ORA19FS

복구가 완료됨

 

 

5_2. 비활성 패치 제거
가장 최근 비활성 패치 하나만 ​​유지하고 모든 비활성 패치 제거

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
$ $ORACLE_HOME/OPatch/opatch util deleteinactivepatches
Oracle Interim Patch Installer version 12.2.0.1.51
Copyright (c) 2026, Oracle Corporation.  All rights reserved.
 
 
Oracle Home       : /app/oracle/product/19c
Central Inventory : /app/oraInventory
   from           : /app/oracle/product/19c/oraInst.loc
OPatch version    : 12.2.0.1.51
OUI version       : 12.2.0.7.0
Log file location : /app/oracle/product/19c/cfgtoollogs/opatch/opatch2026-05-25_12-27-45PM_1.log
 
Invoking utility "deleteinactivepatches"
Inactive Patches Cleanup option provided
Delete Inactive Patches .......
 
***** There are 7 inactive RU patches in chain 1
 
***** 6 inactive patches will be deleted
-To be deleted inactive RU/BP 29517242:Database Release Update : 19.3.0.0.190416 (29517242), installed on: Thu Apr 18 16:21:17 KST 2019, with no overlays
-To be deleted inactive RU/BP 35943157:Database Release Update : 19.22.0.0.240116 (35943157), installed on: Sun May 17 02:08:41 KST 2026, with no overlays
-To be deleted inactive RU/BP 36233263:Database Release Update : 19.23.0.0.240416 (36233263), installed on: Sun May 17 03:11:05 KST 2026, with no overlays
-To be deleted inactive RU/BP 36582781:Database Release Update : 19.24.0.0.240716 (36582781), installed on: Sun May 17 03:28:27 KST 2026, with no overlays
-To be deleted inactive RU/BP 36912597:Database Release Update : 19.25.0.0.241015 (36912597), installed on: Sun May 17 03:43:16 KST 2026, with no overlays
-To be deleted inactive RU/BP 37260974:Database Release Update : 19.26.0.0.250121 (37260974), installed on: Sun May 17 03:59:45 KST 2026, with no overlays
-To be retained inactive RU/BP 37642901:Database Release Update : 19.27.0.0.250415 (37642901), installed on: Sun May 17 04:16:11 KST 2026, with no overlays
-Active RU/BP 37960098:Database Release Update : 19.28.0.0.250715 (37960098), installed on: Sun May 17 04:34:56 KST 2026, with no overlays
 
Do you want to proceed? [y|n]
y  <<-- y 입력
User Responded with: Y
Deleted RU/BP patch: 29517242
Deleted RU/BP patch: 35943157
Deleted RU/BP patch: 36233263
Deleted RU/BP patch: 36582781
Deleted RU/BP patch: 36912597
Deleted RU/BP patch: 37260974
 
OPatch succeeded.

19.3~19.28 패치가 존재했고 이중 19.28은 현재 버전, 19.27은 직전 패치임
19.3(29517242)~19.26(37260974)까지 비활성 패치가 제거됨
제거는 약 7분 소요됨(12시 27분에 시작해서 12시 34분에 완료됨)

 

 

.patch_storage의 패치파일 확인

1
2
3
4
5
6
7
8
9
10
11
12
$ cd /app/oracle/product/19c/.patch_storage
$ du -sh ./*
76K     ./29585399_Apr_9_2019_19_12_47
223M    ./35967489_Dec_27_2023_03_56_41  <<-- 19.22 OCW
2.1G    ./37642901_Apr_15_2025_08_17_25  <<-- 19.27
2.4G    ./37960098_Jul_15_2025_11_45_21  <<-- 19.28
64M     ./backup_delete_inactive
268K    ./interim_inventory.txt
4.0K    ./LatestOPatchSession.properties
48K     ./NApply
288K    ./newdirs.txt
140K    ./record_inventory.txt

19.27, 19.28을 제외하곤 모두 폴더채로 지워짐

 

 

5_3. 19.31 ru 적용(시간 측정)
19.31 패치 적용

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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
$ cd /app/oracle/media/39062956/39036936/39034528
$ time opatch apply -silent
Oracle Interim Patch Installer version 12.2.0.1.51
Copyright (c) 2026, Oracle Corporation.  All rights reserved.
 
 
Oracle Home       : /app/oracle/product/19c
Central Inventory : /app/oraInventory
   from           : /app/oracle/product/19c/oraInst.loc
OPatch version    : 12.2.0.1.51
OUI version       : 12.2.0.7.0
Log file location : /app/oracle/product/19c/cfgtoollogs/opatch/opatch2026-05-25_12-41-16PM_1.log
 
Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   39034528
 
Do you want to proceed? [y|n]
Y (auto-answered by -silent)
User Responded with: Y
All checks passed.
 
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/app/oracle/product/19c')
 
 
Is the local system ready for patching? [y|n]
Y (auto-answered by -silent)
User Responded with: Y
Backing up files...
Applying interim patch '39034528' to OH '/app/oracle/product/19c'
ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.assistants.asm, 19.0.0.0.0 ] , [ oracle.datamining, 19.0.0.0.0 ] , [ oracle.java.sqlj.sqljruntime, 19.0.0.0.0 ] , [ oracle.crypto.rsf, 19.0.0.0.0 ] , [ oracle.oraolap.mgmt, 19.0.0.0.0 ] , [ oracle.pg4appc, 19.0.0.0.0 ] , [ oracle.pg4mq, 19.0.0.0.0 ] , [ oracle.precomp.companion, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.sdo.companion, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.rdbms.tg4ifmx, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 19.0.0.0.0 ] , [ oracle.ldap.ztk, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.ons.cclient, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 19.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ] , [ oracle.jdk, 1.8.0.391.11 ]  not present in the Oracle Home or a higher version is found.
 
Patching component oracle.rdbms.util, 19.0.0.0.0...
 
Patching component oracle.rdbms.rsf, 19.0.0.0.0...
 
Patching component oracle.rdbms, 19.0.0.0.0...
 
Patching component oracle.assistants.acf, 19.0.0.0.0...
 
Patching component oracle.assistants.deconfig, 19.0.0.0.0...
 
Patching component oracle.assistants.server, 19.0.0.0.0...
 
Patching component oracle.blaslapack, 19.0.0.0.0...
 
Patching component oracle.buildtools.rsf, 19.0.0.0.0...
 
Patching component oracle.wwg.plsql, 19.0.0.0.0...
 
Patching component oracle.ctx, 19.0.0.0.0...
 
Patching component oracle.dbdev, 19.0.0.0.0...
 
Patching component oracle.dbjava.ic, 19.0.0.0.0...
 
Patching component oracle.dbjava.jdbc, 19.0.0.0.0...
 
Patching component oracle.dbjava.ucp, 19.0.0.0.0...
 
Patching component oracle.duma, 19.0.0.0.0...
 
Patching component oracle.javavm.client, 19.0.0.0.0...
 
Patching component oracle.ldap.client, 19.0.0.0.0...
 
Patching component oracle.ldap.owm, 19.0.0.0.0...
 
Patching component oracle.ldap.rsf, 19.0.0.0.0...
 
Patching component oracle.ldap.security.osdt, 19.0.0.0.0...
 
Patching component oracle.marvel, 19.0.0.0.0...
 
Patching component oracle.network.rsf, 19.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf, 19.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf.core, 19.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf.ic, 19.0.0.0.0...
 
Patching component oracle.odbc.ic, 19.0.0.0.0...
 
Patching component oracle.ons, 19.0.0.0.0...
 
Patching component oracle.ons.ic, 19.0.0.0.0...
 
Patching component oracle.oracore.rsf, 19.0.0.0.0...
 
Patching component oracle.perlint, 5.28.1.0.0...
 
Patching component oracle.precomp.common.core, 19.0.0.0.0...
 
Patching component oracle.precomp.rsf, 19.0.0.0.0...
 
Patching component oracle.rdbms.crs, 19.0.0.0.0...
 
Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...
 
Patching component oracle.rdbms.deconfig, 19.0.0.0.0...
 
Patching component oracle.rdbms.install.common, 19.0.0.0.0...
 
Patching component oracle.rdbms.oci, 19.0.0.0.0...
 
Patching component oracle.rdbms.rsf.ic, 19.0.0.0.0...
 
Patching component oracle.rdbms.scheduler, 19.0.0.0.0...
 
Patching component oracle.rhp.db, 19.0.0.0.0...
 
Patching component oracle.rsf, 19.0.0.0.0...
 
Patching component oracle.sdo, 19.0.0.0.0...
 
Patching component oracle.sdo.locator.jrf, 19.0.0.0.0...
 
Patching component oracle.sqlj.sqljruntime, 19.0.0.0.0...
 
Patching component oracle.sqlplus, 19.0.0.0.0...
 
Patching component oracle.sqlplus.ic, 19.0.0.0.0...
 
Patching component oracle.tfa.db, 19.0.0.0.0...
 
Patching component oracle.wwg.plsql, 19.0.0.0.0...
 
Patching component oracle.xdk.rsf, 19.0.0.0.0...
 
Patching component oracle.rdbms.hs_common, 19.0.0.0.0...
 
Patching component oracle.javavm.server, 19.0.0.0.0...
 
Patching component oracle.rdbms.install.plugins, 19.0.0.0.0...
 
Patching component oracle.rdbms.locator, 19.0.0.0.0...
 
Patching component oracle.oraolap.api, 19.0.0.0.0...
 
Patching component oracle.rdbms.hsodbc, 19.0.0.0.0...
 
Patching component oracle.network.client, 19.0.0.0.0...
 
Patching component oracle.rdbms.drdaas, 19.0.0.0.0...
 
Patching component oracle.rdbms.dm, 19.0.0.0.0...
 
Patching component oracle.rdbms.rman, 19.0.0.0.0...
 
Patching component oracle.rdbms.rat, 19.0.0.0.0...
 
Patching component oracle.ovm, 19.0.0.0.0...
 
Patching component oracle.odbc, 19.0.0.0.0...
 
Patching component oracle.xdk.server, 19.0.0.0.0...
 
Patching component oracle.oraolap.dbscripts, 19.0.0.0.0...
 
Patching component oracle.xdk.xquery, 19.0.0.0.0...
 
Patching component oracle.network.listener, 19.0.0.0.0...
 
Patching component oracle.dbtoolslistener, 19.0.0.0.0...
 
Patching component oracle.ldap.rsf.ic, 19.0.0.0.0...
 
Patching component oracle.xdk.parser.java, 19.0.0.0.0...
 
Patching component oracle.sdo.locator, 19.0.0.0.0...
 
Patching component oracle.ctx.rsf, 19.0.0.0.0...
 
Patching component oracle.ldap.ssl, 19.0.0.0.0...
 
Patching component oracle.oraolap, 19.0.0.0.0...
 
Patching component oracle.mgw.common, 19.0.0.0.0...
 
Patching component oracle.install.deinstalltool, 19.0.0.0.0...
 
Patching component oracle.rdbms.dv, 19.0.0.0.0...
 
Patching component oracle.xdk, 19.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf.lbuilder, 19.0.0.0.0...
 
Patching component oracle.ctx.atg, 19.0.0.0.0...
 
Patching component oracle.network.aso, 19.0.0.0.0...
 
Patching component oracle.rdbms.lbac, 19.0.0.0.0...
 
Patching component oracle.precomp.lang, 19.0.0.0.0...
 
Patching component oracle.precomp.common, 19.0.0.0.0...
 
Patching component oracle.jdk, 1.8.0.201.0...
Patch 39034528 successfully applied.
Sub-set patch [37960098] has become inactive due to the application of a super-set patch [39034528].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /app/oracle/product/19c/cfgtoollogs/opatch/opatch2026-05-25_12-41-16PM_1.log
 
OPatch succeeded.
 
real    10m2.842s
user    5m24.434s
sys     1m40.542s

약 10분 소요됨, 기존에 비해 5분 단축됨

 

 

DB 기동

1
SQL> startup

 

 

datapatch 수행

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
$ time datapatch -verbose
SQL Patching tool version 19.31.0.0.0 Production on Mon May 25 12:52:57 2026
Copyright (c) 2012, 2026, Oracle.  All rights reserved.
 
Log file for this invocation: /app/oracle/cfgtoollogs/sqlpatch/sqlpatch_44717_2026_05_25_12_52_57/sqlpatch_invocation.log
 
Connecting to database...OK
Gathering database info...done
Bootstrapping registry and package to current versions...done
Determining current state...done
 
Current state of interim SQL patches:
  No interim patches found
 
Current state of release update SQL patches:
  Binary registry:
    19.31.0.0.0 Release_Update 260426152757: Installed
  SQL registry:
    Applied 19.28.0.0.0 Release_Update 250705030417 successfully on 17-MAY-26 04.44.57.694569 AM
 
Adding patches to installation queue and performing prereq checks...done
Installation queue:
  No interim patches need to be rolled back
  Patch 39034528 (Database Release Update : 19.31.0.0.260421 (39034528)):
    Apply from 19.28.0.0.0 Release_Update 250705030417 to 19.31.0.0.0 Release_Update 260426152757
  No interim patches need to be applied
 
Installing patches...
Patch installation complete.  Total patches installed: 1
 
Validating logfiles...done
Patch 39034528 apply: SUCCESS
  logfile: /app/oracle/cfgtoollogs/sqlpatch/39034528/28700584/39034528_apply_ORA19FS_2026May25_12_54_51.log (no errors)
SQL Patching tool complete on Mon May 25 12:56:10 2026
 
real    3m14.306s
user    0m33.001s
sys     0m3.828s

datapatch는 3분 14초 소요됨(기존에 비해 46초 단축됨)

 

 

패치 적용 후 패치 내역 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
SQL>
set lines 200 pages 1000
col action_time for a20
col action for a10
col status for a10
col description for a60
col version for a10
select to_char(action_time, 'yyyy/mm/dd hh24:mi:ss') as action_time,
       action, status, description, patch_id
from dba_registry_sqlpatch
order by action_time;
 
ACTION_TIME          ACTION     STATUS     DESCRIPTION                                                    PATCH_ID
-------------------- ---------- ---------- ------------------------------------------------------------ ----------
2026/05/17 02:40:09  APPLY      SUCCESS    Database Release Update : 19.22.0.0.240116 (35943157)          35943157
2026/05/17 03:18:32  APPLY      SUCCESS    Database Release Update : 19.23.0.0.240416 (36233263)          36233263
2026/05/17 03:36:42  APPLY      SUCCESS    Database Release Update : 19.24.0.0.240716 (36582781)          36582781
2026/05/17 03:51:46  APPLY      SUCCESS    Database Release Update : 19.25.0.0.241015 (36912597)          36912597
2026/05/17 04:08:39  APPLY      SUCCESS    Database Release Update : 19.26.0.0.250121 (37260974)          37260974
2026/05/17 04:26:14  APPLY      SUCCESS    Database Release Update : 19.27.0.0.250415 (37642901)          37642901
2026/05/17 04:44:57  APPLY      SUCCESS    Database Release Update : 19.28.0.0.250715 (37960098)          37960098
2026/05/25 12:55:52  APPLY      SUCCESS    Database Release Update : 19.31.0.0.260421 (39034528)          39034528
 
8 rows selected.

19.31이 잘 적용됨

 

 

참고1. help 명령

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
$ $ORACLE_HOME/OPatch/opatch util deleteinactivepatches -help
Oracle Interim Patch Installer version 12.2.0.1.51
Copyright (c) 2026, Oracle Corporation.  All rights reserved.
 
 
DESCRIPTION
    This operation helps to clean up inactive patches stored
    under ORACLE_HOME/inventory & ORACLE_HOME/.patch_storage
 
    By default OPatch util deleteinactivepatches retains only
    1 latest inactive patch(RU\CPU\BP)
    Note: If user needs to retain more than 1 inactive patch,
    then update the value of RETAIN_INACTIVE_PATCHES in
    ORACLE_HOME/OPatch/config/opatch.properties
 
SYNTAX
opatch util deleteinactivepatches [-report] [-silent] [-oh]
 
OPTIONS
 
[-report]
      Prints the list of inactive patches without performing any delete actions from ORACLE_HOME
 
[-silent]
      This suppresses any user-interaction.
 
[-oh]
      The oracle home to work on. This takes precedence over the environment variable ORACLE_HOME.
 
Example:
 
To delete all inactive patches and retain only 1 latest inactive patch based on user confrimation
        opatch util deleteinactivepatches
 
To delete all inactive patches and retain only 1 latest inactive patch without user confirmation
        opatch util deleteinactivepatches -silent
 
To delete all inactive patches and retain 2 latest inactive patches in ORACLE_HOME
    update RETAIN_INACTIVE_PATCHES=2 in ORACLE_HOME/OPatch/config/opatch.properties
    opatch util deleteinactivepatches
 
 
OPatch succeeded.

 

 

참고2. 가장 최근 비활성화된 패치를 n개 유지하고 싶은 경우(예시 2개) opatch.properties의 RETAIN_INACTIVE_PATCHES 옵션을 2로 수정한 뒤 위 명령을 수행하면됨

1
2
3
4
5
6
$ vi $ORACLE_HOME/OPatch/config/opatch.properties
OPATCH_HEAP_MEMORY=3072
PS_OBFUSCATION=true
RETAIN_INACTIVE_PATCHES=2  <<-- !!
SKIP_FUSER_WARNINGS=false
DELETE_INACTIVE_PATCHES_BY_DEFAULT=true

 

 

결론 :
OPatch 12.2.0.1.37 버전부터 추가된 deleteinactivepatches 유틸리티를 사용하여 $ORACLE_HOME/.patch_storage 내에 쌓여있던 오래된 비활성 RU 패치들을 안전하고 효과적으로 정리할 수 있음
본문 테스트 결과 비활성 패치를 제거함으로써 .patch_storage 디렉터리 용량이 16GB에서 약 4.7GB 수준으로 대폭 감소하는 공간 확보 효과를 확인함
인벤토리 검사 항목이 줄어들어 다음 차기 패치(19.31 RU) 적용 시 opatch apply 시간이 15분 22초에서 10분 2초로 약 5분 단축되었고 datapatch 수행 시간도 감소함
테스트 환경 특성상 단축 시간이 극적이지는 않으나 RU 패치가 더 많이 누적된 실제 운영 환경에서는 패치 다운타임 개선 효과가 훨씬 더 클 것으로 예상됨
기본적으로 가장 최근의 비활성 패치 1개만 남기고 삭제되지만 롤백 안정성을 위해 이전 버전을 더 유지하고 싶다면 opatch.properties 파일의 RETAIN_INACTIVE_PATCHES 파라미터를 통해 유지 개수를 직접 제어할 수 있음
운영 환경에서 RU 패치를 분기별로 꾸준히 적용해 온 시스템이라면 다운타임 없이 온라인으로 수행 가능한 이 기능을 사용하여 효과적으로 디스크 공간을 확보하고 잠재적인 패치 성능 저하 문제를 해결할 수 있을듯 함

 

 

참조 : 

OPatch 12.2.0.1.37+ Introduces a New Feature to Delete Inactive Patches in the ORACLE_HOME/.patch_storage Directory(KB104015)
How to archive/unarchive patch directory under $ORACLE_HOME/.patch_storage ?(KB122762)
Opatch Apply And Rollback Getting Slower After Oneoff Or RU Patch Numbers Increased(KB626057)

오라클 19c DB RU(Release Update) 패치중 세션 종료 테스트 ( https://positivemh.tistory.com/1382 )
https://mikedietrichde.com/2023/05/16/cleaning-up-older-patch-artifacts-improving-opatch-performance/
https://mikedietrichde.com/2022/05/10/binary-patching-is-slow-because-of-the-inventory/
https://mikedietrichde.com/2022/01/21/can-i-cleanup-the-previous-patch-bundles-with-opatch/
https://anjo.pt/keyword-oracle/2023/08/13/new-opatch-util-deleteinactivepatches-tool-for-reducing-the-oracle_home-size/
https://docs.oracle.com/en/middleware/idm/identity-governance/12.2.1.4/bpspb/removing-inactive-patches.html
https://docs.oracle.com/en/enterprise-manager/cloud-control/enterprise-manager-cloud-control/13.4/optch/opatch-syntax-and-commands.html#GUID-B4E408A8-C217-4BE1-B193-15F58D5B5355