Better At Oracle

A collection of tutorials, code and tools to help you get better using Oracle


17 July 2014

Upgrade an 11gr2 database to a newer patch set

Upgrading a database to a new patch set within the same major version is a pretty simple process. These days, Oracle don't supply a patchset for the database, you need to download the full Oracle binaries for the version you want to install.

The first step is to create a new Oracle home with the new patchset version. Then shutdown the database you want to upgrade.

Next, switch the Oracle home to the new Oracle home in /etc/oratab.

Then make sure your Oracle environment is correctly setup for the new home using the oraenv script.

Finally, bring the database up in upgrade mode and run the following scripts:

sqlplus / as sysdba
SQL> startup upgrade
SQL> spool upgradelog.log
SQL> @?/rdbms/admin/catupgrd.sql

The catupgrd script will probably run for 5 or 10 minutes. When it completes, check that there were no errors generated by the catupgrd script. According to the documentation, the script should go in cleanly on the first run without generating any errors. To check for this, search for lines that start with 'ORA-' in the upgradelog.log file.

Next run the following commands to complete the operation:

SQL> shutdown immediate
SQL> startup
SQL> @?/rdbms/admin/catuppst.sql
SQL> @?/rdbms/admin/utlrp.sql

To ensure the upgrade was successful , check everything is valid in DBA_REGISTRY:

select comp_name, status from dba_registry;

If there are invalid components in DBA_REGISTRY, it is probably time to start searching on Oracle support.

It goes without saying that you should do a complete DB backup before attempting the upgrade, just incase!

blog comments powered by Disqus