Apply the latest DB RU Patch_19.19 (35042068) on Oracle Database 19C
Posted by Mir Sayeed Hassan on July 19th, 2023
Apply the latest DB RU Patch_19.19 (35042068) on Oracle Database 19C
Check the status of Database
SQL> select instance_name, version, open_mode from v$database, v$instance; INSTANCE_NAME VERSION OPEN_MODE ---------------- ----------------- -------------------- oemswdb 19.0.0.0.0 READ WRITE
Verify the lastest OPatch applied on it., If not use the below link to apply
[oracle@OEM-DB-SW ~]$ cd /u01/app/oracle/product/19c/db_1/OPatch [oracle@OEM-DB-SW OPatch]$ ./opatch version OPatch Version: 12.2.0.1.37 OPatch succeeded.
link: https://mirsayeedhassan.com/apply-the-latest-opatch-12-2-0-1-37-for-oracle-database-19c/
Download the Patch from below link
https://support.oracle.com/epmos/faces/PatchSearchResults?_adf.ctrl-state=ym4c1dobw_120&_afrLoop=189225645173189
Create a directory & place the downloaded Patch into it.
[oracle@OEM-DB-SW ~]$ cd /u01/source/Patch_19.19/ [oracle@OEM-DB-SW Patch_19.19]$ ls p35042068_190000_Linux-x86-64.zip
Unzip the DB Patch
[oracle@OEM-DB-SW Patch_19.19]$ unzip p35042068_190000_Linux-x86-64.zip
Verify the Patch Conflict.
[oracle@OEM-DB-SW Patch_19.19]$ ls 35042068 p35042068_190000_Linux-x86-64.zip PatchSearch.xml
[oracle@OEM-DB-SW ~]$ cd /u01/source/Patch_19.19/35042068/
[oracle@OEM-DB-SW 35042068]$ ls custom etc files README.html README.txt
[oracle@OEM-DB-SW 35042068]$ /u01/app/oracle/product/19c/db_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./ Oracle Interim Patch Installer version 12.2.0.1.37 Copyright (c) 2023, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/oracle/product/19c/db_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/19c/db_1/oraInst.loc OPatch version : 12.2.0.1.37 OUI version : 12.2.0.7.0 Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2023-07-19_14-46-18PM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded.
Shutdown database & listener
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down.
[oracle@OEM-DB-SW ~]$ lsnrctl stop LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 19-JUL-2023 15:48:25 Copyright (c) 1991, 2022, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) The command completed successfully
Start Apply the Patch
[oracle@OEM-DB-SW ~]$ cd /u01/source/Patch_19.19/35042068/ [oracle@OEM-DB-SW 35042068]$ /u01/app/oracle/product/19c/db_1/OPatch/opatch apply Oracle Interim Patch Installer version 12.2.0.1.37 Copyright (c) 2023, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/19c/db_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/19c/db_1/oraInst.loc OPatch version : 12.2.0.1.37 OUI version : 12.2.0.7.0 Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2023-07-19_14-49-33PM_1.log Verifying environment and performing prerequisite checks... OPatch continues with these patches: 35042068 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/19c/db_1') Is the local system ready for patching? [y|n] y User Responded with: Y Backing up files... Applying interim patch '35042068' to OH '/u01/app/oracle/product/19c/db_1' ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.ons.cclient, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 19.0.0.0.0 ] , [ oracle.sdo.companion, 19.0.0.0.0 ] , [ oracle.rdbms.tg4ifmx, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ] not present in the Oracle Home or a higher version is found. Patching component oracle.rsf, 19.0.0.0.0... Patching component oracle.nlsrtl.rsf.core, 19.0.0.0.0... Patching component oracle.slax.rsf, 19.0.0.0.0... Patching component oracle.ordim.jai, 19.0.0.0.0... Patching component oracle.bali.jewt, 11.1.1.6.0... Patching component oracle.bali.ewt, 11.1.1.6.0... Patching component oracle.help.ohj, 11.1.1.7.0... Patching component oracle.rdbms.locator, 19.0.0.0.0... Patching component oracle.perlint.expat, 2.0.1.0.4... 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.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.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.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.sdo, 19.0.0.0.0... Patching component oracle.sdo.locator.jrf, 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.wwg.plsql, 19.0.0.0.0... Patching component oracle.xdk.xquery, 19.0.0.0.0... Patching component oracle.javavm.server, 19.0.0.0.0... Patching component oracle.xdk.parser.java, 19.0.0.0.0... Patching component oracle.odbc, 19.0.0.0.0... Patching component oracle.ctx.rsf, 19.0.0.0.0... Patching component oracle.oraolap, 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.ctx.atg, 19.0.0.0.0... Patching component oracle.rdbms.install.common, 19.0.0.0.0... Patching component oracle.oraolap.dbscripts, 19.0.0.0.0... Patching component oracle.ldap.rsf.ic, 19.0.0.0.0... Patching component oracle.install.deinstalltool, 19.0.0.0.0... Patching component oracle.ldap.client, 19.0.0.0.0... Patching component oracle.rdbms.rman, 19.0.0.0.0... Patching component oracle.ovm, 19.0.0.0.0... Patching component oracle.rdbms.drdaas, 19.0.0.0.0... Patching component oracle.rdbms.hs_common, 19.0.0.0.0... Patching component oracle.oraolap.api, 19.0.0.0.0... Patching component oracle.network.listener, 19.0.0.0.0... Patching component oracle.rdbms.dv, 19.0.0.0.0... Patching component oracle.sdo.locator, 19.0.0.0.0... Patching component oracle.nlsrtl.rsf, 19.0.0.0.0... Patching component oracle.xdk.rsf, 19.0.0.0.0... Patching component oracle.xdk, 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.ldap.ssl, 19.0.0.0.0... Patching component oracle.rdbms.lbac, 19.0.0.0.0... Patching component oracle.mgw.common, 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 35042068 successfully applied. Sub-set patch [34419443] has become inactive due to the application of a super-set patch [35042068]. Please refer to Doc ID 2161861.1 for any possible further required actions. Log file location: /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2023-07-19_14-49-33PM_1.log OPatch succeeded.
Verify the patch applied
[oracle@OEM-DB-SW OPatch]$ ./opatch lspatches 35042068;Database Release Update : 19.19.0.0.230418 (35042068) 29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399) OPatch succeeded.
OR
[oracle@OEM-DB-SW OPatch]$ ./opatch lsinventory Oracle Interim Patch Installer version 12.2.0.1.37 Copyright (c) 2023, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/19c/db_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/19c/db_1/oraInst.loc OPatch version : 12.2.0.1.37 OUI version : 12.2.0.7.0 Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2023-07-19_14-55-42PM_1.log Lsinventory Output file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/lsinv/lsinventory2023-07-19_14-55-42PM.txt -------------------------------------------------------------------------------- Local Machine Information:: Hostname: OEM-DB-SW 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 35042068 : applied on Wed Jul 19 14:51:49 IRST 2023 Unique Patch ID: 25183678 Patch description: "Database Release Update : 19.19.0.0.230418 (35042068)" Created on 6 Apr 2023, 15:25:04 hrs UTC Bugs fixed: 10123661, 1297945, 14570574, 14735102, 15931756, 15959416, 16662822 16664572, 16750494, 17275499, 17395507, 17428816, 17468475, 17562236 --------- --------- OPatch succeeded.
Check the list of DB Patches are applied init it.
[oracle@OEM-DB-SW OPatch]$ ./opatch lsinv | grep applied Patch 35042068 : applied on Wed Jul 19 14:51:49 IRST 2023 Patch 29585399 : applied on Thu Apr 18 11:51:33 IRDT 2019
Bring back the Oracle Database & Listener, Verify the POST UPDATE THE PATCH
SQL> startup ORACLE instance started. Total System Global Area 2.0670E+10 bytes Fixed Size 13902168 bytes Variable Size 2818572288 bytes Database Buffers 1.7784E+10 bytes Redo Buffers 53202944 bytes Database mounted. Database opened.
SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ---------------------------------------- 2 PDB$SEED READ ONLY NO 3 PDB_OEM MOUNTED
Open the Pluggable Databases
SQL> alter pluggable database pdb_oem open; Pluggable database altered.
start the listener
[oracle@OEM-DB-SW ~]$ lsnrctl start LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 19-JUL-2023 16:02:20 Copyright (c) 1991, 2023, Oracle. All rights reserved. Starting /u01/app/oracle/product/19c/db_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 19.0.0.0.0 - Production System parameter file is /u01/app/oracle/product/19c/db_1/network/admin/listener.ora Log messages written to /u01/app/oracle/diag/tnslsnr/OEM-DB-SW/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=OEM-DB-SW)(PORT=1521))) Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 19-JUL-2023 16:02:20 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/19c/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/OEM-DB-SW/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=OEM-DB-SW)(PORT=1521))) The listener supports no services The command completed successfully
SQL> alter system register; System altered.
SQL> alter session set container=pdb_oem; Session altered.
SQL> alter system register; System altered.
Verify PDB
SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------------------------------------------------- 2 PDB$SEED READ ONLY NO 3 PDB_OEM READ WRITE NO
Verify by Query level.
SQL> set linesize 300 SQL> select CON_ID, TO_CHAR(action_time, 'YYYY-MM-DD') AS action_time, PATCH_ID, PATCH_TYPE, ACTION, DESCRIPTION, SOURCE_VERSION, TARGET_VERSION from CDB_REGISTRY_SQLPATCH order by CON_ID, action_time, patch_id; CON_ID ACTION_TIM PATCH_ID PATCH_TYPE ACTION DESCRIPTION SOURCE_VERSION TARGET_VERSION ---------- ---------- ---------- ---------- --------------- ---------------------------------------------------------------------------------------------------- --------------- --------------- 1 2022-11-26 29517242 RU APPLY Database Release Update : 19.3.0.0.190416 (29517242) 19.1.0.0.0 19.3.0.0.0 1 2022-12-06 34419443 RU APPLY Database Release Update : 19.17.0.0.221018 (34419443) 19.3.0.0.0 19.17.0.0.0 3 2022-11-26 29517242 RU APPLY Database Release Update : 19.3.0.0.190416 (29517242) 19.1.0.0.0 19.3.0.0.0 3 2022-12-06 34419443 RU APPLY Database Release Update : 19.17.0.0.221018 (34419443) 19.3.0.0.0 19.17.0.0.0
Therefore the DB Patch are applied in Container., Need to apply for All PDB Database as fallow.
[oracle@OEM-DB-SW ~]$ cd $ORACLE_HOME/OPatch
[oracle@OEM-DB-SW OPatch]$ ./datapatch -verbose SQL Patching tool version 19.19.0.0.0 Production on Wed Jul 19 15:59:44 2023 Copyright (c) 2012, 2023, Oracle. All rights reserved. Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_18409_2023_07_19_15_59_44/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.19.0.0.0 Release_Update 230322020406: Installed PDB CDB$ROOT: Applied 19.17.0.0.0 Release_Update 220924224051 successfully on 06-DEC-22 04.06.54.429983 PM PDB PDB$SEED: Applied 19.17.0.0.0 Release_Update 220924224051 successfully on 06-DEC-22 04.07.01.141426 PM PDB PDB_OEM: Applied 19.17.0.0.0 Release_Update 220924224051 successfully on 06-DEC-22 04.07.01.141426 PM Adding patches to installation queue and performing prereq checks...done Installation queue: For the following PDBs: CDB$ROOT PDB$SEED PDB_OEM No interim patches need to be rolled back Patch 35042068 (Database Release Update : 19.19.0.0.230418 (35042068)): Apply from 19.17.0.0.0 Release_Update 220924224051 to 19.19.0.0.0 Release_Update 230322020406 No interim patches need to be applied Installing patches... Patch installation complete. Total patches installed: 3 Validating logfiles...done Patch 35042068 apply (pdb CDB$ROOT): SUCCESS logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/35042068/25183678/35042068_apply_OEMSWDB_CDBROOT_2023Jul19_16_00_28.log (no errors) Patch 35042068 apply (pdb PDB$SEED): SUCCESS logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/35042068/25183678/35042068_apply_OEMSWDB_PDBSEED_2023Jul19_16_02_13.log (no errors) Patch 35042068 apply (pdb PDB_OEM): SUCCESS logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/35042068/25183678/35042068_apply_OEMSWDB_PDB_OEM_2023Jul19_16_02_13.log (no errors) SQL Patching tool complete on Wed Jul 19 16:03:50 2023
Hence applied for all PDB DB’s & veified.
SQL> alter session set container=pdb_oem; Session altered.
SQL> select CON_ID, TO_CHAR(action_time, 'YYYY-MM-DD') AS action_time, PATCH_ID, PATCH_TYPE, ACTION, DESCRIPTION, SOURCE_VERSION, TARGET_VERSION from CDB_REGISTRY_SQLPATCH order by CON_ID, action_time, patch_id; CON_ID ACTION_TIM PATCH_ID PATCH_TYPE ACTION DESCRIPTION SOURCE_VERSION TARGET_VERSION ---------- ---------- ---------- ---------- --------------- ---------------------------------------------------------------------------------------------------- --------------- --------------- 3 2022-11-26 29517242 RU APPLY Database Release Update : 19.3.0.0.190416 (29517242) 19.1.0.0.0 19.3.0.0.0 3 2022-12-06 34419443 RU APPLY Database Release Update : 19.17.0.0.221018 (34419443) 19.3.0.0.0 19.17.0.0.0 3 2023-07-19 35042068 RU APPLY Database Release Update : 19.19.0.0.230418 (35042068) 19.17.0.0.0 19.19.0.0.0
Check the INVALID Object in PDB Database
SQL> select count(*) from all_objects where status='INVALID' group by owner; COUNT(*) ---------- 96 2 44 1 4 63 6 rows selected.
Run the below script to validate all the INVALID Objects in Database
SQL> @?/rdbms/admin/utlrp.sql; Session altered. TIMESTAMP ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ COMP_TIMESTAMP UTLRP_BGN 2023-07-19 16:06:10 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 2023-07-19 16:06:18 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.
Re-Verify Invalid Objects.
SQL> select count(*) from all_objects where status='INVALID' group by owner; no rows selected