This article explains how to upgrade Oracle database from the version 11gR2 (11.2.0.4) to the version 12c (12.01.0.2) using the RMAN Full backup.
Table of Contents:
– Introduction
– Description of the environments
– Steps of Oracle Database 11.2.0.4 Backup
– Steps of Oracle Database 12c Restore
– Dealing with INVALID status of Oracle Database components
1. Introduction:
Recovery Manager (RMAN) is an Oracle Database client that performs backup and recovery tasks on your databases and automates administration of your backup strategies. It greatly simplifies backing up, restoring, and recovering database files. For more information.
Note: To upgrade Oracle database to 12c from previous version, there are some specification about the source Oracle database version.
2. Description of the environments:
This table describes the environments of the Oracle Database server source and destination:
- Configuration of the file /etc/hosts on both Linux Server:
172.16.1.140 dbserv11204.localdomain dbserv11204 172.16.1.120 dbserv12c.localdomain dbserv12c
- Creation of needed directory on 12c Linux Server:
# mkdir /orabin12c /oradata /orafra # chown oracle:oinstall /orabin12c /oradata /orafra # chmod 775 /orabin12c /oradata /orafra
3. Steps of Oracle Database 11g 11.2.0.4 backup:
Note: This article describes the backup steps on the production server and also the restore steps on the 12c Server, and doesn’t describe the steps how to install the Oracle database 11g or 12c which they has been described on the previous articles.
Step 1: Verify that the archive log is enabled on the Linux database 11g.
SQL> archive log list;
Step 2: Verify the backup destination on the 11.2.0.4 Server:
Step 3: Backup 11.2.0.4 database:
RMAN> backup database plus archivelog;
Step 4: Verify the backup on the 11g Server:
– List Backup summary:
– List backup piece 6:
– List backup piece 7 (contains the control file backup):
– List backup piece 8:
Step 5: Copy the backup pieces from Server 11.2.0.4 to Server 12c:
$ scp -r /orafra/ORCL/backupset/2015_08_27/ dbserv12c:/orafra/
Step 6: Create and copy the pfile from source 11g to destination 12c:
Create a PFILE for the 12c database. Since we are restoring the database with the same filesystem and locations as the original, we don’t need to convert the file names. In this case, the PFILE is called “initorcl.ora” and is placed in the “$ORACLE_HOME/dbs” directory on the 12c server.
- Create a pfile
SQL> create pfile='/tmp/initorcl.ora' from spfile;
- Copy the pfile on the remote server
$ scp /tmp/initorcl.ora dbserv12c:/orabin12c/product/12.1.0/dbhome_1/dbs
4. Steps of Oracle Database 12c Restore:
Note: After the installation of the Oracle 12c Binary, and the creation of the Listener using the netca tool, it is time to modify the pfile and the creation of the password file:
Step 1: Modify and Set UP the pfile parameters:
Note: Create the absent directory:
Step 2: Create the password file on the 12c Server. (On my case password=oracle)
Step 3: Startup the orcl 12c instance on the 12c Server.
Step 4: Restore the Control file on the 12c Server.
Step 5: Startup mount
Step 6: Catalog the 11.2.0.4 backup within the controlfile:
Step 7: Restore database:
Step 8: Recover database (The last archive log sequence has the number 44):
RMAN > run { set until sequence = 45; recover database; }
Step 9: Alter database open:
Step 10: Upgrade database:
Note: In the previous version of 11g, we use the sql script catupgrd.sql to upgrade the Oracle components, but the catupgrd.sql is being deprecated in the 12.1 release of the Oracle Database. Customers are encouraged to use catctl.pl as the replacement for catupgrd.sql when upgrading the database dictionary.
$ cd $ORACLE_HOME/rdbms/admin $ORACLE_HOME/perl/bin/perl catctl.pl -n 4 catupgrd.sql
..
Step 11: Verify Upgrade:
Note: There are some Oracle components have the status OPTION OFF, UPGRADED, INVALID, LOADING, and then we should recompile the Oracle database objects.
Step 12: Recompile the Invalid objects after upgrade using the script utlrp.sql :
Step 13: Re-verification of oracle components after objects recompilation:
Step 14: Configure the file /etc/oratab:
$ cat /etc/oratab
5. Dealing with INVALID status of Oracle Database components:
Dealing with INVALID status of Oracle database components after upgrade to 12c (12.1.0.2)
Conclusion:
This article explains how to upgrade Oracle database 11g (11.2.0.4) to Oracle Database 12c (12.1.0.2).