Skip to content

Oracle 11g R2: catupgrd.sql running for hours

During the last weeks, I experienced an uncommon bug during upgrade of security sensible databases: The upgrade process was sticking for hours on the script c1101000.sql which tried to fill the column DBID with the database DBID of the tables AUD$ and/or FGA_LOG$ (auditing and fine grained auditing tables).

As expected this bug was already published on My Oracle Support Note 11.2.0.1 Catupgrd.sql Hangs While Running Procedure POPULATE_DBID_AUDIT [ID 1062993.1]. In simple words, when you have many rows in these audit tables, the catupgrd.sql may be stuck until all rows are processed.

The announced workaround:

  • exporting the AUD$ and/or FGA_LOG$ tables
  • cleaning up these two tables
  • finally launching catupgrd.sql
  • importing the data

But this solution can be bypassed by a much more “customer friendly” way as it does not require any delete/truncate operation on the audit logs!
My solution was to fill the column AUD$.DBID shortly before the catalog upgrade catupgrd.sql script. You have to use the following query:

DECLARE  
   cur_dbid NUMBER;
BEGIN  
   SELECT dbid INTO cur_dbid FROM v$database;
   UPDATE sys.aud$ SET dbid=cur_dbid WHERE dbid is NULL;  
   COMMIT;
END;
/

This short PL/SQL code was running about 10min (depending on the number of rows). Afterwards, the catupgrd.sql was running in an acceptable timeframe and the rows appended to the audit tables in the meantime were updated without any pain during the catalogue upgrade.

I hope this information will help some of you in the upgrade of your Oracle databases to Oracle 11gR2!

Jérôme

Let’s work together

Ready to operate at
the next level?

Tell us about your challenge. We’ll bring the depth, the expertise, and the Swiss precision.

Jérôme Witt

Jérôme Witt

Jérôme Witt leads the entire Oracle consulting team in Basel, having started his consulting career in 2008. He specializes in database and infrastructure management, Oracle high availability, backup and recovery, and performance tuning, alongside open-source technologies (Linux/Unix), Perl, Shell, and Windows PowerShell, with a recent focus on automation using Ansible. He holds Oracle 12c/11g Certified Professional, Oracle Certified Expert Tuning (OCE), and ITIL V3 Foundation certifications, and leads the Oracle DBA Essentials, Multitenant, and Ansible workshops. Prior to dbi services, he was a Consultant at Trivadis in Basel. His industry experience covers pharma, healthcare, banking and financial services, energy, and automotive.View Author posts

19 posts since January 2011

Leave a Comment

Your email address will not be published. Required fields are marked *