ORA-04021: timeout occurred while waiting to lock object error while executing the catbundle.sql script
During the patching process, we need to apply the patch sqls to the database. To apply the patches to the database, we execute
sqlplus / as sysdba
@catbundle.sql apply PSU
the above script hangs due to locked object and the error is written to the log ORA-04021: timeout occurred while waiting to lock object
This was due to the locked object dbms_advisor (in my case).
Restarting the database cleared the locks and the catbundle apply completed in few minutes.