Upgrade Oracle database from 11.2.0.4 to 12c (12.1.0.2) using the RMAN backup

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.

up_11204_12102_upgrade_table

2. Description of the environments:

This table describes the environments of the Oracle Database server source and destination:

up_11204_12102_OS_1

 

  • 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;

up_11204_12102_archive_log_list

 

 

 

 

 

 

Step 2: Verify the backup destination on the 11.2.0.4 Server:

up_11204_12102_show_parameter_recovery

 

 

 

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:

up_11204_12102_list_backup_summary

– List backup piece 6:

up_11204_12102_list_backup_6

– List backup piece 7 (contains the control file backup):

up_11204_12102_list_backup_7

– List backup piece 8:

up_11204_12102_list_backup_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/

up_11204_12102_scp_backup

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

up_11204_12102_scp_pfile

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:

up_11204_12102_cat_initorcl

 

 

 

 

 

 

 

 

 

Note: Create the absent directory:

up_11204_12102_mkdir

 

Step 2: Create the password file on the 12c Server. (On my case password=oracle)

up_11204_12102_orapw

 

 

Step 3: Startup the orcl 12c instance on the 12c Server.

up_11204_12102_startup_nomount

 

 

 

 

 

 

 

Step 4: Restore the Control file on the 12c Server.

up_11204_12102_restore_controlfile

 

Step 5: Startup mount

up_11204_12102_alter_database_mount

 

 

 

Step 6: Catalog the 11.2.0.4 backup within the controlfile:

up_11204_12102_catalog_start_with

 

 

 

 

 

 

 

 

 

 

 

Step 7: Restore database:

up_11204_12102_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:

up_11204_12102_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

 up_11204_12102_startup_upgrade

 

 

up_11204_12102_catupgrade

..

up_11204_12102_perl_2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

up_11204_12102_fin_upgrade

 

 

 

 

 

 

 

 

 

 

 

 

Step 11: Verify Upgrade:

up_11204_12102_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 :

up_11204_12102_utlrp

 

Step 13: Re-verification of oracle components after objects recompilation:

up_11204_12102_dba_registry_after_utlrp

 

Step 14: Configure the file /etc/oratab:

$ cat /etc/oratab

up_11204_12102_cat_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).

 

 

Bookmark the permalink.
Loading Facebook Comments ...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.