Recently we
faced one issue while applying DB PSU Apr 2025 patch on oracle database 19c.
The error
was like below.
$ ./datapatch -verbose /u01/oracle/cfgtoollogs/sqlpatch/37642901/27123174/37642901_apply_NONPROD_2025May17_03_54_30.log
(errors)
-> Error at line 27817: script rdbms/admin/owmcvws.plb - ORA-04088: error during execution of
trigger 'WMSYS.NO_VM_DDL' - ORA-00604: error occurred at
recursive SQL level 2 - ORA-04061: existing state of has been invalidated - ORA-04061: existing state of package
body "WMSYS.LT_CTX_PKG" has been - invalidated - ORA-04065: not executed, altered or
dropped package body "WMSYS.LT_CTX_PKG" - ORA-06508: PL/SQL: could not find
program unit being called: "WMSYS.LT_CTX_PKG" - ORA-06512: at
"WMSYS.LTADM", line 9800 - ORA-04061: existing state of package
body "WMSYS.LT_CTX_PKG" has been - invalidated - ORA-04065: not executed, altered or
dropped package body "WMSYS.LT_CTX_PKG" - ORA-06508: PL/SQL: could not find
program unit being called: "WMSYS.LT_CTX_PKG" - ORA-06512: at
"WMSYS.LTADM", line 9532 - ORA-06512: at
"WMSYS.OWM_DYNSQL_ACCESS", line 549 - ORA-06512: at line 17 - ORA-06512: at line 7 - ORA-06512: at line 7
-> Error at line 28420: script rdbms/admin/owmcvws.plb - ORA-04088: error during execution of
trigger 'WMSYS.NO_VM_DDL' - ORA-00604: error occurred at
recursive SQL level 1 - ORA-04068: existing state of packages
has been discarded - ORA-04061: existing state of package
body "WMSYS.LTUTIL" has been invalidated - ORA-04065: not executed, altered or
dropped package body "WMSYS.LTUTIL" - ORA-06508: PL/SQL: could not find
program unit being called: "WMSYS.LTUTIL" - ORA-06512: at
"WMSYS.LTADM", line 9437 - ORA-06512: at
"WMSYS.OWM_DYNSQL_ACCESS", line 544 - ORA-06512: at line 15 Please refer to MOS Note 1609718.1
and/or the invocation log /u01/oracle/cfgtoollogs/sqlpatch/sqlpatch_30994_2025_05_17_03_52_45/sqlpatch_invocation.log for information on how to resolve
the above errors. SQL Patching tool complete on Sat
May 17 03:55:35 2025 |
Solution:-
To resolve
the issue we did following
Step 1: Disable WMSYS Triggers
Run this as SYS:
SQL> BEGIN
EXECUTE IMMEDIATE 'ALTER TRIGGER WMSYS.NO_VM_DDL DISABLE';
EXECUTE IMMEDIATE 'ALTER TRIGGER WMSYS.REFRESH_ON_ALTER DISABLE';
EXECUTE IMMEDIATE 'ALTER TRIGGER WMSYS.ADD_OBJ_TRIGGER DISABLE'; EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(SQLERRM); END; / |
Step 2: Recompile WMSYS Schema
SQL> BEGIN
DBMS_UTILITY.compile_schema(schema => 'WMSYS', compile_all =>
TRUE); END; / |
Step 3: Rerun datapatch
cd $ORACLE_HOME/OPatch ./datapatch -verbose |
This time we
didn’t face the error as mentioned above. So disable the triggers mentioned
above fixed the issue.
Step 4: Re-enable the Triggers
SQL>BEGIN
EXECUTE IMMEDIATE 'ALTER TRIGGER WMSYS.NO_VM_DDL ENABLE';
EXECUTE IMMEDIATE 'ALTER TRIGGER WMSYS.REFRESH_ON_ALTER ENABLE';
EXECUTE IMMEDIATE 'ALTER TRIGGER WMSYS.ADD_OBJ_TRIGGER ENABLE'; EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(SQLERRM); END; / |
Now when we checked dba_registry_sqlpatch we could see the patch application was successful.
No comments:
Post a Comment