RMAN backup & Restoration for Database Upgrade


Steps for RMAN backup & Restoration for Database Upgrade. This document is only to verify Backup & Restoration activity.

How to check oracle version ?

[oracle@ ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 5 20:15:33 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL>

Here 11.2.0.1.0 shows Oracle version is 11.2.0.1 else if 11.2.0.2 is shown Oracle version is 11.2.0.2.


Backup Activity:

Below steps should be performed on Oracle 11.2.0.1 version Oracle Home.

1. $ export ORACLE_SID={instance_name}

2. $ rman "target / nocatalog"

3. RMAN> run {
  shutdown immediate;
startup mount;
backup database format '{Backup Path}/%d_before_upgrade_%U' tag=Before_upgrade;
backup current controlfile tag = Before_upgrade format '{Backup Path}/cf_%u';
shutdown immediate;
startup ;
    }

4. sq> shutdown immediate


Upgrade Activity:

Copy spfile, password  files from Oracle 11.2.0.1 to Oracle 11.2.0.2 home.

1. Go to ORACLE_HOME for Oracle 11.2.0.2 using.

   $ export ORACLE_HOME={Path_Oracle_home}

2. $ export ORACLE_SID={instance_name}

3. $ cd $ORACLE_HOME/bin

   $ ./sqlplus sys as sysdba

4. sql> startup upgrade

5. sql> $ORACLE_HOME/rdbms/admin/catupgrd.sql

   Note: This Upgrade process will take around 45 to 50 Minutes. When successfully done database will be down. Please start
   the database and check for its version. The database version must be 11.2.0.2 and shutdown the database.


Restore activity:

In case of failed upgradation, database needs to bring back to its lower version (Oracle 11.2.0.1). We need to do restoration of database.

1. Go to Oracle 11.2.0.1 version Oracle Home.

2. $ export ORACLE_SID={instance_name}

3. $ rman "target / nocatalog"

4. rman> startup nomount;

5. rman> run {
  restore controlfile from '{Backup Path}/{control_file_backup}' ;
alter database mount;
RESTORE DATABASE FROM TAG before_upgrade;
alter database open resetlogs;
  }

6. Check database is opened in Oracle 11.2.0.1 version.

No comments:

Post a Comment