跳过正文

Oracle 19.30 上卸载补丁 Patch 38632161 实战指南

Greatfinish
作者
Greatfinish
记录 Oracle、PostgreSQL、达梦、Linux、存储与生产环境故障处理经验。

适用版本:Oracle Database 19.30.0 → 19.3.0 环境:单实例 ,OS 为 Oracle Linux 7.9 补丁类型:RU (Release Update) 19.30.0.0.260120 工具:opatch / datapatch


一、前言
#

由于近期发布的Oracle Database 19c DATABASE RELEASE UPDATE 19.30.0.0.0补丁(Patch 38632161)存在bug,已经被官方下架了,打上该补丁的也不要担心,下面介绍两种方法解决这个问题:

  1. 19.30补丁卸载
  2. one-off 补丁进行修复

二、19.30补丁卸载
#

2.1 查询当前补丁情况
#

了解当前的补丁基线

数据库层面查询

set lines 200
col action_time format a25
col status format a12
select action_time, action, status, source_version, target_version from dba_registry_sqlpatch;

[oracle@prod_db ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 26 19:37:21 2026
Version 19.30.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.30.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB                            READ WRITE NO
SQL> set lines 200
SQL> col action_time format a25
SQL> col status format a12
SQL> select action_time, action, status, source_version, target_version from dba_registry_sqlpatch;

ACTION_TIME               ACTION          STATUS       SOURCE_VERSION  TARGET_VERSION
------------------------- --------------- ------------ --------------- ---------------
22-JAN-26 08.48.44.104406 APPLY           SUCCESS      19.1.0.0.0      19.3.0.0.0
 PM

22-JAN-26 10.28.24.990898 APPLY           SUCCESS      19.3.0.0.0      19.30.0.0.0
 PM


SQL>

Oracle 主目录补丁清单,注意下面这段已经应用的38632161补丁

Patch 38632161 : applied on Thu Jan 22 22:06:38 CST 2026
opatch lsinventory
opatch lspatches

[oracle@prod_db ~]$ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.49
Copyright (c) 2026, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/19.3.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.3.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.49
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2026-01-26_19-41-30PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2026-01-26_19-41-30PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: prod_db
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 19c                                                  19.0.0.0.0
There are 1 products installed in this Oracle Home.


Interim patches (2) :

Patch  38632161     : applied on Thu Jan 22 22:06:38 CST 2026
Unique Patch ID:  28443995
Patch description:  "Database Release Update : 19.30.0.0.260120 (38632161)"
   Created on 17 Jan 2026, 08:18:46 hrs UTC
   Bugs fixed:
     10121473, 10123661, 12608302, 1297945, 13087312, 13801211, 14570574
     14735102, 15878434, 15931756, 15959416, 16662822, 16664572, 16750494
     17275499, 17395507, 17428816, 17468475, 17562236, 17777718, 18534283
     18697534, 18943905, 19080742, 19138896, 19147630, 19226753, 19630878
     19697993, 19884953, 19958239, 20007421, 20044584, 20083476, 20289608
     20313356, 20319830, 20351180, 20479545, 20661314, 20721183, 20867658
     。。。省略
     38471934, 38476257, 38486044, 38486278, 38488013, 38507950, 38519816
     38525391, 38534801, 38542828, 38556579, 38573079, 38578258, 38585619
     38588567, 38590051, 38602559, 38615863, 38619898, 38624714, 38632348
     38637095, 38638752, 38657092, 38658095, 38658309, 38660638, 38676512
     38688895, 38702049, 38703128, 38750569, 38751199, 38760350, 38765450
     38782444, 38787400, 38789859, 38857925, 7391838, 8460502, 8476681
     9002767

Patch  29585399     : applied on Thu Apr 18 15:21:33 CST 2019
Unique Patch ID:  22840393
Patch description:  "OCW RELEASE UPDATE 19.3.0.0.0 (29585399)"
   Created on 9 Apr 2019, 19:12:47 hrs PST8PDT
   Bugs fixed:
     27222128, 27572040, 27604329, 27760043, 27877830, 28302580, 28470673
     28621543, 28642469, 28699321, 28710663, 28755846, 28772816, 28785321
     28800508, 28808652, 28815557, 28847541, 28847572, 28870496, 28871040
     28874416, 28877252, 28881191, 28881848, 28888083, 28911140, 28925250
     28925460, 28935956, 28940472, 28942694, 28951332, 28963036, 28968779
     28980448, 28995287, 29003207, 29003617, 29016294, 29018680, 29024876
     29026154, 29027933, 29047127, 29052850, 29058476, 29111631, 29112455
     29117337, 29123444, 29125708, 29125786, 29129476, 29131772, 29132456
     29139727, 29146157, 29147849, 29149170, 29152603, 29152752, 29154631
     29154636, 29154829, 29159216, 29159661, 29160462, 29161923, 29169540
     29169739, 29170717, 29173618, 29181568, 29182920, 29183298, 29186091
     29191827, 29201143, 29201695, 29209545, 29210577, 29210610, 29210624
     29210683, 29213641, 29219627, 29224294, 29225861, 29229839, 29235934
     29242906, 29243749, 29244495, 29244766, 29244968, 29248723, 29249583
     29251564, 29255616, 29260224, 29261695, 29271019, 29273360, 29282090
     29282666, 29285453, 29285621, 29290235, 29292232, 29293806, 29294753
     29299830, 29307090, 29307109, 29311336, 29329675, 29330791, 29339299
     29357821, 29360467, 29360775, 29367971, 29368725, 29379299, 29379381
     29380527, 29381000, 29382296, 29391301, 29393649, 29402110, 29411931
     29413360, 29457319, 29465047, 3



--------------------------------------------------------------------------------

OPatch succeeded.
[oracle@prod_db ~]$ opatch lspatches
38632161;Database Release Update : 19.30.0.0.260120 (38632161)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)

OPatch succeeded.
[oracle@prod_db ~]$

在应用此补丁之前,OPatch 版本要求:

OPatch version 12.2.0.1.48 or later

检查现有 OPatch 版本

cd $ORACLE_HOME/OPatch
./opatch version

[oracle@prod_db ~]$ cd $ORACLE_HOME/OPatch
[oracle@prod_db OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.49

OPatch succeeded.
[oracle@prod_db OPatch]$

✅️OPatch 现在符合补丁要求。

2.2 关闭数据库和监听
#

Oracle 要求在回退版本之前进行干净关机,停监听。

[oracle@prod_db ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 26 19:53:50 2026
Version 19.30.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.30.0.0.0

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.30.0.0.0
[oracle@prod_db OPatch]$ lsnrctl stop

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 26-JAN-2026 19:54:30

Copyright (c) 1991, 2025, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prod_db)(PORT=1521)))
The command completed successfully
[oracle@prod_db ~]$ 

2.3 卸载DB补丁 38632161
#

opatch rollback -id 38632161

[oracle@prod_db ~]$ opatch rollback -id 38632161
Oracle Interim Patch Installer version 12.2.0.1.49
Copyright (c) 2026, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/19.3.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.3.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.49
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2026-01-26_19-57-48PM_1.log


Patches will be rolled back in the following order:
   38632161
The following patch(es) will be rolled back: 38632161

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/19.3.0/dbhome_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y

Rolling back patch 38632161...

RollbackSession rolling back interim patch '38632161' from OH '/u01/app/oracle/product/19.3.0/dbhome_1'

Patching component oracle.rdbms.rsf, 19.0.0.0.0...

Patching component oracle.rdbms, 19.0.0.0.0...

Patching component oracle.rdbms.util, 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.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.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.xdk.parser.java, 19.0.0.0.0...

Patching component oracle.rdbms.lbac, 19.0.0.0.0...

Patching component oracle.ldap.ssl, 19.0.0.0.0...

Patching component oracle.network.aso, 19.0.0.0.0...

Patching component oracle.xdk, 19.0.0.0.0...

Patching component oracle.nlsrtl.rsf.core, 19.0.0.0.0...

Patching component oracle.odbc, 19.0.0.0.0...

Patching component oracle.rdbms.rat, 19.0.0.0.0...

Patching component oracle.rdbms.dv, 19.0.0.0.0...

Patching component oracle.oraolap.dbscripts, 19.0.0.0.0...

Patching component oracle.rdbms.hs_common, 19.0.0.0.0...

Patching component oracle.ldap.rsf.ic, 19.0.0.0.0...

Patching component oracle.oraolap, 19.0.0.0.0...

Patching component oracle.install.deinstalltool, 19.0.0.0.0...

Patching component oracle.mgw.common, 19.0.0.0.0...

Patching component oracle.rdbms.rman, 19.0.0.0.0...

Patching component oracle.xdk.server, 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.ctx.atg, 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.sqlj.sqljruntime, 19.0.0.0.0...

Patching component oracle.wwg.plsql, 19.0.0.0.0...

Patching component oracle.network.client, 19.0.0.0.0...

Patching component oracle.dbtoolslistener, 19.0.0.0.0...

Patching component oracle.rdbms.install.plugins, 19.0.0.0.0...

Patching component oracle.ctx.rsf, 19.0.0.0.0...

Patching component oracle.nlsrtl.rsf.lbuilder, 19.0.0.0.0...

Patching component oracle.rdbms.drdaas, 19.0.0.0.0...

Patching component oracle.sdo.locator, 19.0.0.0.0...

Patching component oracle.rdbms.locator, 19.0.0.0.0...

Patching component oracle.network.listener, 19.0.0.0.0...

Patching component oracle.ovm, 19.0.0.0.0...

Patching component oracle.javavm.server, 19.0.0.0.0...

Patching component oracle.xdk.xquery, 19.0.0.0.0...

Patching component oracle.precomp.common, 19.0.0.0.0...

Patching component oracle.precomp.lang, 19.0.0.0.0...

Patching component oracle.jdk, 1.8.0.201.0...
RollbackSession removing interim patch '38632161' from inventory
Inactive sub-set patch [29517242] has become active due to the rolling back of a super-set patch [38632161].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2026-01-26_19-57-48PM_1.log

OPatch succeeded.
[oracle@prod_db ~]$

2.4 启动数据库和监听
#

卸载补丁后就可以启动数据库和监听了

sqlplus / as sysdba
startup
alter pluggable database all open;
lsnrctl start

[oracle@prod_db ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 26 20:03:32 2026
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 2516582192 bytes
Fixed Size                  9137968 bytes
Variable Size             771751936 bytes
Database Buffers         1728053248 bytes
Redo Buffers                7639040 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open;

Pluggable database altered.

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@prod_db ~]$ lsnrctl start

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 26-JAN-2026 20:05:21

Copyright (c) 1991, 2019, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/19.3.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.3.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/prod_db/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prod_db)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prod_db)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                26-JAN-2026 20:05:21
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/prod_db/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prod_db)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@prod_db ~]$

2.5 使用 Datapatch 回滚补丁
#

现在执行 datapatch 工具,回滚与 19.30 二进制补丁对应的 SQL 脚本

datapatch -verbose

[oracle@prod_db ~]$ datapatch -verbose
SQL Patching tool version 19.3.0.0.0 Production on Mon Jan 26 20:10:35 2026
Copyright (c) 2012, 2019, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_10124_2026_01_26_20_10_35/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done

Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)

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.3.0.0.0 Release_Update 190410122720: Installed
  PDB CDB$ROOT:
    Applied 19.30.0.0.0 Release_Update 260116203150 successfully on 22-JAN-26 10.28.24.990898 PM
  PDB PDB:
    Applied 19.30.0.0.0 Release_Update 260116203150 successfully on 22-JAN-26 10.32.15.776106 PM
  PDB PDB$SEED:
    Applied 19.30.0.0.0 Release_Update 260116203150 successfully on 22-JAN-26 10.32.12.082646 PM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED PDB
    No interim patches need to be rolled back
    Patch 38632161 (Database Release Update : 19.30.0.0.260120 (38632161)):
      Rollback from 19.30.0.0.0 Release_Update 260116203150 to 19.3.0.0.0 Release_Update 190410122720
    No interim patches need to be applied

Installing patches...
Patch installation complete.  Total patches installed: 3

Validating logfiles...done
Patch 38632161 rollback (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/38632161/28443995/38632161_rollback_PRODCDB_CDBROOT_2026Jan26_20_11_05.log (no errors)
Patch 38632161 rollback (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/38632161/28443995/38632161_rollback_PRODCDB_PDBSEED_2026Jan26_20_15_02.log (no errors)
Patch 38632161 rollback (pdb PDB): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/38632161/28443995/38632161_rollback_PRODCDB_PDB_2026Jan26_20_15_02.log (no errors)
SQL Patching tool complete on Mon Jan 26 20:18:30 2026
[oracle@prod_db ~]$

2.6 验证补丁回退情况
#

数据库层面查询,编译失效对象

set lines 200
col action_time format a25
col status format a12
select action_time, action, status, source_version, target_version from dba_registry_sqlpatch;
@$ORACLE_HOME/rdbms/admin/utlrp.sql

[oracle@prod_db ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 26 20:22:49 2026
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> set lines 200
SQL> col action_time format a25
SQL> col status format a12
SQL> select action_time, action, status, source_version, target_version from dba_registry_sqlpatch;

ACTION_TIME               ACTION          STATUS       SOURCE_VERSION  TARGET_VERSION
------------------------- --------------- ------------ --------------- ---------------
22-JAN-26 08.48.44.104406 APPLY           SUCCESS      19.1.0.0.0      19.3.0.0.0
 PM

22-JAN-26 10.28.24.990898 APPLY           SUCCESS      19.3.0.0.0      19.30.0.0.0
 PM

26-JAN-26 08.14.39.384401 ROLLBACK        SUCCESS      19.30.0.0.0     19.3.0.0.0
 PM


SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

Session altered.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN              2026-01-26 20:28:05

DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END              2026-01-26 20:28:06

DOC> The following query reports the number of invalid objects.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
                  0

DOC> The following query reports the number of exceptions caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC> Note: Typical compilation errors (due to coding errors) are not
DOC>       logged into this table: they go into DBA_ERRORS instead.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
                          0


Function created.


PL/SQL procedure successfully completed.


Function dropped.


PL/SQL procedure successfully completed.

SQL>

我们可以发现数据库19.30的DBRU补丁已经回退。

Oracle 主目录补丁清单

opatch lsinventory
opatch lspatches

[oracle@prod_db ~]$ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.49
Copyright (c) 2026, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/19.3.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.3.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.49
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2026-01-26_20-25-44PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2026-01-26_20-25-44PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: prod_db
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 19c                                                  19.0.0.0.0
There are 1 products installed in this Oracle Home.


Interim patches (2) :

Patch  29585399     : applied on Thu Apr 18 15:21:33 CST 2019
Unique Patch ID:  22840393
Patch description:  "OCW RELEASE UPDATE 19.3.0.0.0 (29585399)"
   Created on 9 Apr 2019, 19:12:47 hrs PST8PDT
   Bugs fixed:
     27222128, 27572040, 27604329, 27760043, 27877830, 28302580, 28470673
     28621543, 28642469, 28699321, 28710663, 28755846, 28772816, 28785321
     28800508, 28808652, 28815557, 28847541, 28847572, 28870496, 28871040
     28874416, 28877252, 28881191, 28881848, 28888083, 28911140, 28925250
     。。。省略
     29282666, 29285453, 29285621, 29290235, 29292232, 29293806, 29294753
     29299830, 29307090, 29307109, 29311336, 29329675, 29330791, 29339299
     29357821, 29360467, 29360775, 29367971, 29368725, 29379299, 29379381
     29380527, 29381000, 29382296, 29391301, 29393649, 29402110, 29411931
     29413360, 29457319, 29465047, 3

Patch  29517242     : applied on Thu Apr 18 15:21:17 CST 2019
Unique Patch ID:  22862832
Patch description:  "Database Release Update : 19.3.0.0.190416 (29517242)"
   Created on 17 Apr 2019, 23:27:10 hrs PST8PDT
   Bugs fixed:
     14735102, 19697993, 20313356, 21965541, 25806201, 25883179, 25986062
     26476244, 26611353, 26872233, 27369515, 27423500, 27666312, 27710072
     27846298, 27957203, 28064977, 28072567, 28129791, 28181021, 28210681
     28279456, 28313275, 28350595, 28371123, 28379065, 28431445, 28463226
     。。。省略
     29431485, 29435652, 29438736, 29439522, 29450421, 29451386, 29452576
     29452953, 29457807, 29460252, 29462957, 29486181, 29507616, 29515240
     29521748, 29530812, 29531654, 29557336, 29558975, 29601461



--------------------------------------------------------------------------------

OPatch succeeded.
[oracle@prod_db ~]$ opatch lspatches
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
29517242;Database Release Update : 19.3.0.0.190416 (29517242)

OPatch succeeded.
[oracle@prod_db ~]$

我们可以发现清单中已经没有19.30的DBRU补丁,至此整个19.30的回滚补丁过程结束。


三、one-off 补丁进行修复
#

如果已经打了19.30的补丁又不想卸载补丁回退,可以参考三哥之前发的文章,这里我们来实操一下。

3.1 解压补丁38854064
#

[oracle@prod_db ~]$ cd 19.30-one-off/
[oracle@prod_db 19.30-one-off]$ pwd
/home/oracle/19.30-one-off
[oracle@prod_db 19.30-one-off]$ ll
total 480
-rw-r--r-- 1 oracle oinstall 488861 Jan 26 20:40 p38854064_1930000DBRU_Linux-x86-64.zip
[oracle@prod_db 19.30-one-off]$ unzip -q p38854064_1930000DBRU_Linux-x86-64.zip
[oracle@prod_db 19.30-one-off]$ 

3.2 关闭数据库和监听
#

[oracle@prod_db 19.30-one-off]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 26 20:46:25 2026
Version 19.30.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.30.0.0.0

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.30.0.0.0
[oracle@prod_db 19.30-one-off]$ lsnrctl stop

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 26-JAN-2026 20:47:04

Copyright (c) 1991, 2025, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prod_db)(PORT=1521)))
The command completed successfully
[oracle@prod_db 19.30-one-off]$

3.3 应用补丁38854064
#

[oracle@prod_db 19.30-one-off]$ cd 38854064/
[oracle@prod_db 38854064]$ opatch apply
Oracle Interim Patch Installer version 12.2.0.1.49
Copyright (c) 2026, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/19.3.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.3.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.49
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2026-01-26_20-48-32PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   38854064

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/19.3.0/dbhome_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '38854064' to OH '/u01/app/oracle/product/19.3.0/dbhome_1'

Patching component oracle.rdbms, 19.0.0.0.0...
Patch 38854064 successfully applied.
Log file location: /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2026-01-26_20-48-32PM_1.log

OPatch succeeded.
[oracle@prod_db 38854064]$

3.4 启动数据库和监听
#

[oracle@prod_db 38854064]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 26 20:50:33 2026
Version 19.30.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 2516580200 bytes
Fixed Size                  9181032 bytes
Variable Size             771751936 bytes
Database Buffers         1728053248 bytes
Redo Buffers                7593984 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open;

Pluggable database altered.

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.30.0.0.0
[oracle@prod_db 38854064]$ lsnrctl start

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 26-JAN-2026 20:51:04

Copyright (c) 1991, 2025, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/19.3.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.3.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/prod_db/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prod_db)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prod_db)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                26-JAN-2026 20:51:04
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/prod_db/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=prod_db)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@prod_db 38854064]$

3.5 使用 Datapatch 应用 SQL 补丁
#

Datapatch 连接到数据库,收集注册表信息,并应用 SQL 更改:

[oracle@prod_db 38854064]$ datapatch -verbose
SQL Patching tool version 19.30.0.0.0 Production on Mon Jan 26 20:57:14 2026
Copyright (c) 2012, 2026, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_5195_2026_01_26_20_57_14/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done

Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)

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.30.0.0.0 Release_Update 260116203150: Installed
  PDB CDB$ROOT:
    Applied 19.30.0.0.0 Release_Update 260116203150 successfully on 22-JAN-26 10.28.24.990898 PM
  PDB PDB:
    Applied 19.30.0.0.0 Release_Update 260116203150 successfully on 22-JAN-26 10.32.15.776106 PM
  PDB PDB$SEED:
    Applied 19.30.0.0.0 Release_Update 260116203150 successfully on 22-JAN-26 10.32.12.082646 PM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED PDB
    No interim patches need to be rolled back
    No release update patches need to be installed
    No interim patches need to be applied

SQL Patching tool complete on Mon Jan 26 20:57:27 2026
[oracle@prod_db 38854064]$

3.6 验证补丁应用情况
#

数据库查询补丁应用情况,编译失效对象

set lines 200
col action_time format a25
col status format a12
col action for a30
col comments for a80
select action_time, action, status, source_version, target_version from dba_registry_sqlpatch;
select action_time,action,comments from registry$history;
@$ORACLE_HOME/rdbms/admin/utlrp.sql

[oracle@prod_db 38854064]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 26 20:59:12 2026
Version 19.30.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.30.0.0.0

SQL> set lines 200
SQL> col action_time format a25
SQL> col status format a12
SQL> col action for a30
SQL> col comments for a80
SQL> select action_time, action, status, source_version, target_version from dba_registry_sqlpatch;

ACTION_TIME               ACTION                         STATUS       SOURCE_VERSION  TARGET_VERSION
------------------------- ------------------------------ ------------ --------------- ---------------
22-JAN-26 08.48.44.104406 APPLY                          SUCCESS      19.1.0.0.0      19.3.0.0.0
 PM

22-JAN-26 10.28.24.990898 APPLY                          SUCCESS      19.3.0.0.0      19.30.0.0.0
 PM


SQL> select action_time,action,comments from registry$history;

ACTION_TIME               ACTION                         COMMENTS
------------------------- ------------------------------ --------------------------------------------------------------------------------
                          BOOTSTRAP                      RDBMS_19.30.0.0.0DBRU_LINUX.X64_260116
22-JAN-26 08.48.40.853184 RU_APPLY                       Patch applied on 19.3.0.0.0: Release_Update - 190410122720
 PM

22-JAN-26 10.28.25.003754 RU_APPLY                       Patch applied from 19.3.0.0.0 to 19.30.0.0.0: Release_Update - 260116203150
 PM


SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

Session altered.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN              2026-01-26 21:08:01

DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END              2026-01-26 21:08:02

DOC> The following query reports the number of invalid objects.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
                  0

DOC> The following query reports the number of exceptions caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC> Note: Typical compilation errors (due to coding errors) are not
DOC>       logged into this table: they go into DBA_ERRORS instead.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
                          0


Function created.


PL/SQL procedure successfully completed.


Function dropped.


PL/SQL procedure successfully completed.

SQL>

Oracle 主目录补丁清单,注意38854064补丁已经应用

38854064;OCI DATA CORRUPTION SEEN IN MIDDLE OF DBRU PATCHING TO 19.29 AND LOST WRITE DETECTED IN THE STNABY
opatch lspatches

[oracle@prod_db 38854064]$ opatch lspatches
38854064;OCI  DATA CORRUPTION SEEN IN MIDDLE OF DBRU PATCHING TO 19.29 AND LOST WRITE DETECTED IN THE STNABY
38632161;Database Release Update : 19.30.0.0.260120 (38632161)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)

OPatch succeeded.
[oracle@prod_db 38854064]$

至此整个one-off 补丁修复过程结束