This activity is part of a GI upgrade from 12.1.0.2 to 19c, in which we need to apply latest PSU first, so here are the steps:

1:- Patches available here:

[oracle@persephone ~]$ ls -tlr /PATCHES/
total 6207668
drwxrwxrwx.  4 oracle oinstall         80 Oct 19 14:02 33248580
-rw-rw-r--.  1 oracle oinstall     423214 Oct 20 07:29 PatchSearch.xml
drwxr-x---. 15 oracle oinstall       4096 Jan  9 13:59 OPatch
-rwxrwx---.  1 oracle oinstall 6233337203 Feb  3 21:36 p33248580_121020_Linux-x86-64.zip
-rwxrwx---.  1 oracle oinstall  122883929 Apr  4 11:36 p6880880_122010_Linux-x86-64.zip
[oracle@persephone ~]$
	
GRID:
	/PATCHES/33248580/33248367/33128590 -- Database Patch Set Update 12.1.0.2.211019
	/PATCHES/33248580/33248367/32758932 -- OCW Patch Set Update 12.1.0.2.210720
	/PATCHES/33248580/33248367/33112931 -- ACFS Patch Set Update 12.1.0.2.210720
	/PATCHES/33248580/33248367/26983807 -- DBWLM Patch Set Update 12.1.0.2.180116

RDBMS:
	/PATCHES/33248580/33248367/33128590 -- Database Patch Set Update 12.1.0.2.211019
	/PATCHES/33248580/33248367/32758932 -- OCW Patch Set Update 12.1.0.2.210720 
	/PATCHES/33248580/33192628          -- OJVM

2:- (as ROOT) Update OPACH version to latest available. (p6880880_122010_Linux-x86-64.zip)

	[root@persephone ~]# mv /u01/app/oracle/product/12.1.0/grid/OPatch /u01/app/oracle/product/12.1.0/grid/OPatch_bck
	[root@persephone ~]# mv /u01/app/oracle/product/12.1.0/dbhome_1/OPatch /u01/app/oracle/product/12.1.0/dbhome_1/OPatch.bck
	[root@persephone ~]# cp -pR /PATCHES/OPatch /u01/app/oracle/product/12.1.0/grid
	[root@persephone ~]# cp -pR /PATCHES/OPatch /u01/app/oracle/product/12.1.0/dbhome_1
	[root@persephone ~]#
	
	[oracle@persephone ~]$ /u01/app/oracle/product/12.1.0/grid/OPatch/opatch version
	OPatch Version: 12.2.0.1.29
	OPatch succeeded.
	
	[oracle@persephone ~]$ /u01/app/oracle/product/12.1.0/dbhome_1/OPatch/opatch version
	OPatch Version: 12.2.0.1.29
	OPatch succeeded.
	[oracle@persephone ~]$

3:- (as ROOT) Run prepatch script. (RDBMS instances should be stopped first)

	[root@persephone ~]# . oraenv
	ORACLE_SID = [+ASM] ? +ASM
	The Oracle base remains unchanged with value /u01/app/oracle
	[root@persephone ~]#  $ORACLE_HOME/crs/install/roothas.sh -prepatch
	Using configuration parameter file: /u01/app/oracle/product/12.1.0/grid/crs/install/crsconfig_params
	2022/04/12 13:36:16 CLSRSC-347: Successfully unlock /u01/app/oracle/product/12.1.0/grid
	
	[root@persephone ~]#

4:- GI patching:

	[oracle@persephone ~]$ . oraenv
	ORACLE_SID = [oracle] ? +ASM
	The Oracle base has been set to /u01/app/oracle
	[oracle@persephone ~]$

	[oracle@persephone ~]$ $ORACLE_HOME/OPatch/opatch apply -oh $ORACLE_HOME -local /PATCHES/33248580/33248367/33128590
	...
	
	OPatch found the word "error" in the stderr of the make command.
	Please look at this stderr. You can re-run this make command.
	Stderr output:
	chmod: changing permissions of ‘/u01/app/oracle/product/12.1.0/grid/bin/extjobO’: Operation not permitted
	make: [iextjob] Error 1 (ignored)
	
	
	Composite patch 33128590 successfully applied.
	OPatch Session completed with warnings.
	Log file location: /u01/app/oracle/product/12.1.0/grid/cfgtoollogs/opatch/opatch2022-04-12_13-49-40PM_1.log
	
	OPatch completed with warnings.
	[oracle@persephone ~]$ 
	
	
	** as per "Applying Proactive Bundle / PSU Patch fails with Error: "chmod: changing permissions of `$ORACLE_HOME/bin/extjobO': Operation not permitted" (Doc ID 2265726.1)"
	this can be ignored
	
	
	[oracle@persephone ~]$ $ORACLE_HOME/OPatch/opatch apply -oh $ORACLE_HOME -local /PATCHES/33248580/33248367/32758932
	...
	Patching component oracle.has.db, 12.1.0.2.0...
	Patch 32758932 successfully applied.
	Log file location: /u01/app/oracle/product/12.1.0/grid/cfgtoollogs/opatch/opatch2022-04-12_14-01-02PM_1.log

	OPatch succeeded.
	[oracle@persephone ~]$ 
	
	
	
	[oracle@persephone ~]$ $ORACLE_HOME/OPatch/opatch apply -oh $ORACLE_HOME -local /PATCHES/33248580/33248367/33112931
	...
	Patching component oracle.usm, 12.1.0.2.0...
	Patch 33112931 successfully applied.
	Log file location: /u01/app/oracle/product/12.1.0/grid/cfgtoollogs/opatch/opatch2022-04-12_14-07-13PM_1.log
	
	OPatch succeeded.
	[oracle@persephone ~]$

	
	
	[oracle@persephone ~]$ $ORACLE_HOME/OPatch/opatch apply -oh $ORACLE_HOME -local /PATCHES/33248580/33248367/26983807
	..
	Patching component oracle.wlm.dbwlm, 12.1.0.2.0...
	Patch 26983807 successfully applied.
	Log file location: /u01/app/oracle/product/12.1.0/grid/cfgtoollogs/opatch/opatch2022-04-12_14-15-01PM_1.log
	
	OPatch succeeded.
	[oracle@persephone ~]$

5:- RDBMS patching:

	[oracle@persephone ~]$ . oraenv
	ORACLE_SID = [+ASM] ? dbtest
	The Oracle base remains unchanged with value /u01/app/oracle
	
	[oracle@persephone ~]$ /PATCHES/33248580/33248367/32758932/custom/scripts/prepatch.sh -dbhome $ORACLE_HOME
	/PATCHES/33248580/33248367/32758932/custom/scripts/prepatch.sh completed successfully.
	[oracle@persephone ~]$
	
	
	
	[oracle@persephone ~]$ $ORACLE_HOME/OPatch/opatch apply -oh $ORACLE_HOME -local /PATCHES/33248580/33248367/33128590
	...
	OPatch found the word "error" in the stderr of the make command.
	Please look at this stderr. You can re-run this make command.
	Stderr output:
	chmod: changing permissions of ‘/u01/app/oracle/product/12.1.0/dbhome_1/bin/extjobO’: Operation not permitted
	make: [iextjob] Error 1 (ignored)
	
	
	Composite patch 33128590 successfully applied.
	OPatch Session completed with warnings.
	Log file location: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2022-04-12_14-16-48PM_1.log
	
	OPatch completed with warnings.
	[oracle@persephone ~]$
	
			
	** as per "Applying Proactive Bundle / PSU Patch fails with Error: "chmod: changing permissions of `$ORACLE_HOME/bin/extjobO': Operation not permitted" (Doc ID 2265726.1)"
	this can be ignored
	
	
	
	
	[oracle@persephone ~]$ $ORACLE_HOME/OPatch/opatch apply -oh $ORACLE_HOME -local /PATCHES/33248580/33248367/32758932
	...
	Patching component oracle.has.db, 12.1.0.2.0...
	Patch 32758932 successfully applied.
	Log file location: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2022-04-12_14-28-16PM_1.log
	
	OPatch succeeded.
	[oracle@persephone ~]$

6:- OJVM patch (RDBMS home)

	[oracle@persephone ~]$ $ORACLE_HOME/OPatch/opatch apply -oh $ORACLE_HOME -local /PATCHES/33248580/33192628
	...
	Patching component oracle.dbjava.ic, 12.1.0.2.0...
	Patch 33192628 successfully applied.
	Log file location: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2022-04-12_14-29-51PM_1.log
	
	OPatch succeeded.
	[oracle@persephone ~]$ 

7:- Post patch script (RDBMS home)

	[oracle@persephone ~]$ /PATCHES/33248580/33248367/32758932/custom/scripts/postpatch.sh -dbhome $ORACLE_HOME
	....
	Reapplying file permissions on /u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnodes
	Reapplying file permissions on /u01/app/oracle/product/12.1.0/dbhome_1/bin/osdbagrp
	Reapplying file permissions on /u01/app/oracle/product/12.1.0/dbhome_1/bin/rawutl
	Reapplying file permissions on /u01/app/oracle/product/12.1.0/dbhome_1/srvm/admin/ractrans
	Reapplying file permissions on /u01/app/oracle/product/12.1.0/dbhome_1/srvm/admin/getcrshome
	Reapplying file permissions on /u01/app/oracle/product/12.1.0/dbhome_1/bin/crsdiag.pl
	Postpatch completed successfully
	[oracle@persephone ~]$

8:- (as ROOT) Run the post root script

	[root@persephone ~]# . oraenv
	ORACLE_SID = [root] ? +ASM
	The Oracle base has been set to /u01/app/oracle
	[root@persephone ~]#
	[root@persephone ~]# $ORACLE_HOME/rdbms/install/rootadd_rdbms.sh
	[root@persephone ~]# $ORACLE_HOME/crs/install/roothas.sh -postpatch
	Using configuration parameter file: /u01/app/oracle/product/12.1.0/grid/crs/install/crsconfig_params
	2022/04/12 14:35:01 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'
	
	CRS-4123: Oracle High Availability Services has been started.
	[root@persephone ~]#

9:- Run Datapatch for DB

	*Make sure pdb's are open
	
	INST HOST         INST_NAME  STATUS     DB_ROLE     OPEN_MODE       STARTUP_TIME
	---- ------------ ---------- ---------- ----------- --------------- --------------------
	*1   persephone   dbtest     OPEN       PRIMARY     READ WRITE      12-APR-2022 14:36:42
	
	
	SQL> show pdbs
		CON_ID CON_NAME      OPEN MODE  RESTRICTED
	---------- ------------- ---------- ----------
			2 PDB$SEED      READ ONLY  NO
			3 PDBTEST       READ WRITE NO
	
	
	[oracle@persephone ~]$  $ORACLE_HOME/OPatch/datapatch -verbose
	SQL Patching tool version 12.1.0.2.0 Production on Tue Apr 12 14:41:21 2022
	Copyright (c) 2012, 2016, Oracle.  All rights reserved.
	
	Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_4437_2022_04_12_14_41_21/sqlpatch_invocation.log
	
	Connecting to database...OK
	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 SQL patches:
	Patch 33192628 (Database PSU 12.1.0.2.211019,Oracle JavaVM Component (OCT2021)):
	Installed in the binary registry only
	Bundle series PSU:
	ID 211019 in the binary registry and not installed in any PDB
	
	Adding patches to installation queue and performing prereq checks...
	Installation queue:
	For the following PDBs: CDB$ROOT PDB$SEED PDBTEST
		Nothing to roll back
		The following patches will be applied:
		33192628 (Database PSU 12.1.0.2.211019,Oracle JavaVM Component (OCT2021))
		33128590 (DATABASE PATCH SET UPDATE 12.1.0.2.211019)
	
	Installing patches...
	
	Patch installation complete.  Total patches installed: 6
	
	Validating logfiles...
	Patch 33192628 apply (pdb CDB$ROOT): SUCCESS
	logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33192628/24427176/33192628_apply_DBTEST_CDBROOT_2022Apr12_14_43_21.log (no errors)
	Patch 33128590 apply (pdb CDB$ROOT): SUCCESS
	logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33128590/24457034/33128590_apply_DBTEST_CDBROOT_2022Apr12_14_51_25.log (no errors)
	Patch 33192628 apply (pdb PDB$SEED): SUCCESS
	logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33192628/24427176/33192628_apply_DBTEST_PDBSEED_2022Apr12_15_02_30.log (no errors)
	Patch 33128590 apply (pdb PDB$SEED): WITH ERRORS
	logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33128590/24457034/33128590_apply_DBTEST_PDBSEED_2022Apr12_15_05_55.log (errors)
		Error at line 85911: ORA-04068: existing state of packages has been discarded
		Error at line 85912: ORA-04061: existing state of package body "SYS.DBMS_REGISTRY_SYS" has been
		Error at line 85914: ORA-04065: not executed, altered or dropped package body
		Error at line 85916: ORA-06508: PL/SQL: could not find program unit being called:
	Patch 33192628 apply (pdb PDBTEST): SUCCESS
	logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33192628/24427176/33192628_apply_DBTEST_PDBTEST_2022Apr12_15_02_30.log (no errors)
	Patch 33128590 apply (pdb PDBTEST): WITH ERRORS
	logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33128590/24457034/33128590_apply_DBTEST_PDBTEST_2022Apr12_15_05_55.log (errors)
		Error at line 85911: ORA-04068: existing state of packages has been discarded
		Error at line 85912: ORA-04061: existing state of package body "SYS.DBMS_REGISTRY_SYS" has been
		Error at line 85914: ORA-04065: not executed, altered or dropped package body
		Error at line 85916: ORA-06508: PL/SQL: could not find program unit being called:
	
	Please refer to MOS Note 1609718.1 and/or the invocation log
	/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_4437_2022_04_12_14_41_21/sqlpatch_invocation.log
	for information on how to resolve the above errors.
	
	SQL Patching tool complete on Tue Apr 12 15:17:57 2022
	[oracle@persephone ~]$
	
	

10:- Datapatch fixes:

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  YES
         3 PDBTEST                        READ WRITE NO
		 
SQL> alter session set "_oracle_script"=true;
Session altered.
SQL> alter pluggable database PDB$SEED close immediate;
Pluggable database altered.
SQL>  alter pluggable database PDB$SEED open upgrade;
Pluggable database altered.
SQL> alter pluggable database PDBTEST close immediate;
Pluggable database altered.
SQL> alter pluggable database PDBTEST open upgrade;
Pluggable database altered.
SQL>




[oracle@persephone ~]$ $ORACLE_HOME/OPatch/datapatch -verbose -apply 33128590/24457034 -force  -pdbs 'PDB$SEED',PDBTEST
SQL Patching tool version 12.1.0.2.0 Production on Tue Apr 12 15:50:55 2022
Copyright (c) 2012, 2016, Oracle.  All rights reserved.

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

Connecting to database...OK
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)
Determining current state...done

Current state of SQL patches:
Patch 33192628 (Database PSU 12.1.0.2.211019,Oracle JavaVM Component (OCT2021)):
  Installed in PDB$SEED PDBTEST only
Bundle series PSU:
  ID 211019 in the binary registry and ID 211019 in PDB PDB$SEED, ID 211019 in PDB PDBTEST

Adding patches to installation queue and performing prereq checks...
Installation queue:
  For the following PDBs: PDB$SEED PDBTEST
    Nothing to roll back
    The following patches will be applied:
      33128590 (DATABASE PATCH SET UPDATE 12.1.0.2.211019)

Installing patches...

Patch installation complete.  Total patches installed: 1

Validating logfiles...
Patch 33128590 apply (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33128590/24457034/33128590_apply_DBTEST_PDBSEED_2022Apr12_15_50_59.log (no errors)
Patch 33128590 apply (pdb PDBTEST): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33128590/24457034/33128590_apply_DBTEST_PDBTEST_2022Apr12_15_50_59.log (no errors)
SQL Patching tool complete on Tue Apr 12 16:20:42 2022
[oracle@persephone ~]$

11:- Validate Datapatch:

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBTEST                        READ WRITE NO
SQL>



** No pending violations:

SQL> select name, cause, type, message, status, action from PDB_PLUG_IN_VIOLATIONS where type like 'ERROR%' and status like 'PENDING' ;
no rows selected
SQL>


SQL> alter session set container=PDBTEST;
Session altered.

SQL> select BUNDLE_SERIES,PATCH_UID,PATCH_ID,VERSION,ACTION,STATUS,ACTION_TIME ,DESCRIPTION from dba_registry_sqlpatch;

BUNDLE_SERIES    PATCH_UID   PATCH_ID VERSION      ACTION   STATUS          ACTION_TIME                DESCRIPTION
--------------- ---------- ---------- ------------ -------- --------------- -------------------------- --------------------------------------------------------------
                  24427176   33192628 12.1.0.2     APPLY    SUCCESS         12-APR-22 15.17.47.109928  Database PSU 12.1.0.2.211019,Oracle JavaVM Component (OCT2021)
PSU               24457034   33128590 12.1.0.2     APPLY    WITH ERRORS     12-APR-22 15.17.48.252646  DATABASE PATCH SET UPDATE 12.1.0.2.211019
PSU               24457034   33128590 12.1.0.2     APPLY    SUCCESS         12-APR-22 16.20.41.942448  DATABASE PATCH SET UPDATE 12.1.0.2.211019
SQL>

12:- Validate binaries:

GI:
	[oracle@persephone ~]$ /u01/app/oracle/product/12.1.0/grid/OPatch/opatch lspatches -oh  /u01/app/oracle/product/12.1.0/grid
	26983807;WLM Patch Set Update: 12.1.0.2.180116 (26983807)
	33112931;ACFS Interim patch for 33112931
	32758932;OCW PATCH SET UPDATE 12.1.0.2.210720 (32758932)
	33128590;Database Patch Set Update : 12.1.0.2.211019 (33128590)
	
	OPatch succeeded.
	[oracle@persephone ~]$ /u01/app/oracle/product/12.1.0/grid/OPatch/opatch lsinventory -detail -oh  /u01/app/oracle/product/12.1.0/grid| grep applied
	Patch  26983807     : applied on Tue Apr 12 14:15:18 BST 2022
	Patch  33112931     : applied on Tue Apr 12 14:11:35 BST 2022
	Patch  32758932     : applied on Tue Apr 12 14:04:14 BST 2022
	Patch  33128590     : applied on Tue Apr 12 13:56:56 BST 2022
	[oracle@persephone ~]$

RDBMS:
	[oracle@persephone ~]$  /u01/app/oracle/product/12.1.0/dbhome_1/OPatch/opatch lspatches -oh /u01/app/oracle/product/12.1.0/dbhome_1
	33192628;Database PSU 12.1.0.2.211019,Oracle JavaVM Component (OCT2021)
	32758932;OCW PATCH SET UPDATE 12.1.0.2.210720 (32758932)
	33128590;Database Patch Set Update : 12.1.0.2.211019 (33128590)
	
	OPatch succeeded.
	[oracle@persephone ~]$  /u01/app/oracle/product/12.1.0/dbhome_1/OPatch/opatch  lsinventory -detail -oh  /u01/app/oracle/product/12.1.0/dbhome_1  | grep applied
	Patch  33192628     : applied on Tue Apr 12 14:30:24 BST 2022
	Patch  32758932     : applied on Tue Apr 12 14:29:03 BST 2022
	Patch  33128590     : applied on Tue Apr 12 14:26:16 BST 2022
	[oracle@persephone ~]$

Last modified: 12 April 2022

Author

Comments

Write a Reply or Comment

Your email address will not be published.