
ra2 studio - Fotolia
Simple steps to follow for an Oracle 12c upgrade
The time to upgrade your Oracle database to the 12c version is now, DBA Brian Peasland says. And it's easy to do via the command line in Oracle's Database Upgrade Assistant.
Database upgrades are never easy. They take planning and lots of testing to ensure the applications that use the...
Continue Reading This Article
Enjoy this article as well as all of our content, including E-Guides, news, tips and more.
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 11.2.0.4, 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 11.2.0.4 database to Oracle 12.1.0.2. 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, 11.1.0.7, 11.2.0.2 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:
export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2
export PATH=$ORACLE_HOME/bin:$PATH
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/11.2.0.4 -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 12.1.0.2 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
4% complete
20% complete
Performing RDBMS Upgrade
20% complete
Performing Post Upgrade
42% complete
44% complete
Configuring Database with Enterprise Manager
62% complete
64% complete
80% complete
Generating Summary
Database upgrade has been completed successfully, and the database is ready to use.
100% complete
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.