ra2 studio - Fotolia
Database upgrades are never easy. They take planning and lots of testing to ensure the applications that use the database don't break or suffer from poor performance afterward. That said, the act of upgrading an Oracle database is actually pretty simple.
I'll show you how easy it is through an example of an upgrade to Oracle Database 12c. If you haven't done an Oracle 12c upgrade yet, you should seriously consider one. Among other reasons to upgrade to 12c, it and the latest release of Oracle Database 11g are the only versions Oracle fully supports now -- and the latter is on extended support, which normally costs extra. Thus far, Oracle has waived the additional fee on Oracle 18.104.22.168, but the waiver is scheduled to expire at the end of May.
Before performing any database upgrade, it's important to read Oracle's Database Upgrade Guide for your target version. The documentation details your upgrade options and the steps involved in an upgrade. This article is not meant to be a means to skip reading that document.
In my example, I'll upgrade an Oracle 22.214.171.124 database to Oracle 126.96.36.199. I have both versions of the software installed on my database server, and I'm performing a direct upgrade. A direct Oracle 12c upgrade is possible if the current version is 10.2.0.5, 188.8.131.52, 184.108.40.206 or later. If you have a different version, multiple upgrades or the use of an alternate upgrade method may be required.
Normally, I use Oracle's Database Upgrade Assistant (DBUA) graphical utility to upgrade databases to 12c. The DBUA walks you through all of the available options via a series of screens and dialog boxes, and then automatically handles the upgrade for you.
In this case, though, I'll show you how to perform a simple database upgrade with one command. I'll still use the DBUA, but through the command line, not the GUI. Known as silent mode, this approach doesn't require any additional input during the Oracle 12c upgrade process.
First, I must set my environment variables to use the new software version:
I've run my database on Oracle Linux. If you use a different platform, you may have other environment variables to set, as well. Next, I'll call the DBUA in silent mode to kick off the upgrade:
dbua -silent -sid orcl -oracleHome /u01/app/oracle/product/220.127.116.11 -recompile_invalid_objects true
That's all there is to it. Now, I just sit back and watch the upgrade proceed. But first, let me describe the options I used on the command line.
- -silent: This tells the DBUA that I'm performing the upgrade via the command line.
- -sid: This tells the DBUA which database I'm upgrading. In my case, the database is named ORCL.
- -oracleHome: This tells the DBUA the ORACLE_HOME directory setting for the current database version. It will be upgraded to the 18.104.22.168 version pointed to by the ORACLE_HOME environment variable I set in my initial entry.
- -recompile_invalid_objects: I always have the DBUA run the script to recompile any objects in the database that may have become invalid during the upgrade process.
While it's executing the upgrade, the DBUA will send output similar to the following:
Log files for the upgrade operation are located at: /u01/app/oracle/cfgtoollogs/dbua/orcl/upgrade1
Performing Pre Upgrade
Performing RDBMS Upgrade
Performing Post Upgrade
Configuring Database with Enterprise Manager
Database upgrade has been completed successfully, and the database is ready to use.
Check the log file "/u01/app/oracle/cfgtoollogs/dbua/logs/silent.log_1479485639382" for upgrade details.
And it's done! The Oracle 12c upgrade is complete, and the process was very simple, with just one command that I can also use in a script to upgrade multiple databases, should I choose to do so. To avoid additional maintenance fees or limited support, start planning your Oracle database upgrades today.
Master the Oracle Database Upgrade Assistant
Learn how to migrate to Oracle 12c
The future of Oracle cloud databases