We are running datapatch on a Windows environment after a BP patching, but it was failing with:

C:\oracle\app\product\12.1.0\dbhome_1\OPatch>datapatch -verbose
SQL Patching tool version 12.1.0.2.0 Production on Thu Dec  1 23:13:00 2022
Copyright (c) 2012, 2021, Oracle.  All rights reserved.

Log file for this invocation: C:\oracle\app\cfgtoollogs\sqlpatch\sqlpatch_3564_2022_12_01_23_13_00\sqlpatch_invocation.log

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:
Bundle series PSU:
  ID 211019 in the binary registry and not installed in the SQL registry

Adding patches to installation queue and performing prereq checks...
Installation queue:
  Nothing to roll back
  The following patches will be applied:
    33174365 (WINDOWS DB BUNDLE PATCH 12.1.0.2.211019(64bit):33174365)

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

Validating logfiles...
Patch 33174365 apply: WITH ERRORS
  logfile: C:\oracle\app\cfgtoollogs\sqlpatch\33174365\24448047/33174365_apply_DBPROD_2022Dec01_23_13_24.log (errors)
    Error at line 36595: Warning: Package Body created with compilation errors.
    Error at line 36602: 10/5     PL/SQL: Statement ignored
    Error at line 36603: 10/49    PLS-00201: identifier 'SYS.UTL_RECOMP2' must be declared
    Error at line 36795: Warning: Package Body created with compilation errors.
    Error at line 36802: 0/0      PL/SQL: Compilation unit analysis terminated
    Error at line 36803: 1/14     PLS-00201: identifier 'UTL_RECOMP2' must be declared
    Error at line 36804: 1/14     PLS-00304: cannot compile body of 'UTL_RECOMP2' without its

Please refer to MOS Note 1609718.1 and/or the invocation log
C:\oracle\app\cfgtoollogs\sqlpatch\sqlpatch_3564_2022_12_01_23_13_00\sqlpatch_invocation.log
for information on how to resolve the above errors.

SQL Patching tool complete on Thu Dec  1 23:18:05 2022
C:\oracle\app\product\12.1.0\dbhome_1\OPatch>

For the fix, we applied solution suggested on: 12.1: datapatch -verbose Fails with Following Error”PLS-00201: identifier ‘UTL_FILE’ must be declared” (Doc ID 2265408.1):

Solution

1) Grant the missing privileges back to PUBLIC and recompile the invalid objects.

connect / as sysdba
grant execute on DBMS_RANDOM to PUBLIC;
grant execute on UTL_FILE to PUBLIC;
grant execute on UTL_HTTP to PUBLIC;
@?/rdbms/admin/utlrp.sql


2) Re-run Datapatch
Last modified: 1 December 2022

Author

Comments

Write a Reply or Comment

Your email address will not be published.