Applies To:: Purpose Scope Details References

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Document 2022820.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state...

Copyright (c) 2020, Oracle. All rights reserved. Oracle Confidential.

Upgrade to 12c using RMAN Duplicate with Noopen clause and Backup Location (Doc ID 2022820.1)

In this Document

Purpose
Scope
Details
References

APPLIES TO:

Oracle Database Cloud Schema Service - Version N/A and later


Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Information in this document applies to any platform.

PURPOSE

Method for Duplicating a 12c database using RMAN Backup created by a lower release (i.e 10gR2, 11gR1, 11gR2)

SCOPE

In 12c, the RMAN duplicate command has new "NOOPEN" option which clones the database but does not open the auxiliary. This feature
can be used to duplicate a database to higher version.

Note: This note provides the example for upgrading the database using "RMAN DUPLICATE using BACKUP LOCATION with NOOPEN
clause" and applicable ONLY for said method

Note: This note covers the RMAN duplicate with noopen clause procedure. If you choose to upgrade the database after the RMAN
procedure completes, please insure the Pre Upgrade Checks are completed PRIOR to starting the upgrade.

DETAILS

When cloning (duplicating) a database to a higher version, traditionally (prior to 12c), you must use restore/recover of an RMAN backup.
This is because the database in the destination must be opened with UPGRADE option. Therefore, the RMAN duplicate could not be used
because RMAN automatically opens the auxiliary database with resetlogs. This would fail with error 'ORA-39700: database must be opened
with UPGRADE option'.

In RMAN 12c, a new option is available "NOOPEN" requesting RMAN to complete the duplicate activity but NOT open the auxiliary database.
This would allow for the 'open upgrade' option to be manually executed when going between versions.

"NOOPEN": It specifies that the duplicate database must not be opened after duplicate is completed.

Steps to duplicate a database to 12c:

1) Execute Preupgrade script (preupgrd.sql) at 11g database. This script will validate 11g database for upgrade and provide
recommendations. This script is available in the 12c $ORACLE_HOME/rdbms/admin directory. Note, both preupgrd.sql and utluppkg.sql
(called by preupgrd.sql) must be copied from 12c.

Note: This method performs duplicate using backup. The database backup should be taken after performing pre-upgrade steps of target
database version.
Suppose we are going to upgrade to 12.2, then database should be taken after performing pre-upgrade tasks of 12.2 version.

1 de 4 22/04/2020 10:04
Document 2022820.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state...

Note: Database upgrade compatible matrix will be applicable for this upgrade.

To upgrade to 12.1 the minimum required version in each release are

Release Minimum require version

10g 10.2.0.5.0

11gR1 11.1.0.7.0

11gR2 11.2.0.2.0

12cR1 12.1.0.1.0

To upgrade to 12.2 the minimum required version in each release are

Release Minimum require version


11gR2 11.2.0.3 / 11.2.0.4
12c 12.1.0.1 / 12.1.0.2

2) Once Preupgrade checks are complete, take complete backup of 11g database

RMAN> connect target / catalog <catalog_schema>/<password>@<catalog database>


RMAN> backup database format '/<PATH>/db_%U' plus archivelog format '/<PATH>/arch_%U';
RMAN> backup current controlfile format '/<source_backup PATH>/cf_%U';

This will generate a set of backupsets in source_backup directory.

3) Move these backup and pfile to 12c host:

Using OS command like scp , we can copy the backup pieces to Destination server
Example: scp -p <backup-piece> user@<host>:/<dest_backup PATH>/

4) Create password file for 12c database. We can choose new name for 12c database using duplicate method

$ORACLE_HOME/bin/orapwd file=orapw<sid> password=<password>

5) Edit copied pfile and make necessary changes. Set necessary values like:

db_name =
controfile_name =
db_file_name_convert and log_file_name_convert ( if source and destination locations are different )

6) startup the Auxiliary instance in NOMOUNT

SQL> connect / as sysdba


SQL> startup nomount

7) From RMAN connect this instance as AUXILIARY

Example:

2 de 4 22/04/2020 10:04
Document 2022820.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state...

$ export ORACLE_SID=<oracle sid value>


RMAN> connect auxiliary /

8) Using RMAN 12c, execute the duplicate command. In this example, '/u01/backup' denotes RMAN backup location on destination. Note,
“NOOPEN” option is specified.

RMAN> DUPLICATE DATABASE TO <new DB > NOOPEN BACKUP LOCATION '/<dest_backup PATH>/' ;

Once it completes exit from Rman.

RMAN> exit

9) Once RMAN completes, the auxiliary database remains in MOUNT mode. Within sqlplus, you can open the database with UPGRADE
option:

SQL> alter database open resetlogs upgrade;

Ensure the tempfiles have got created.

Select * from v$tempfile ;

Check the files exist physically on disk.

10)Execute Manual upgrade scripts.

In 12c manual upgrade can be done parallel using perl utility catctl.pl

$ cd $ORACLE_HOME/rdbms/admin
$ $ORACLE_HOME/perl/bin/perl catctl.pl –n 4 –l /<PATH> catupgrd.sql

n – number of parallel process to execute catupgrd.sql


l – log location for catupgrd.sql. Based on number of process log files gets created (catupgrd<n-1>.log to catupgrd0.log)

11) Execute post upgrade scripts (please refer Document reference given for 12.1 and 12.2 accordingly)

$ORACLE_HOME/perl/bin/perl catctl.pl –n 4 –l /<PATH> catuppst.sql

References:

For 12.1

Complete Checklist for Manual Upgrades to Oracle Database 12c Release 1 (12.1) (Doc ID 1503653.1)
http://docs.oracle.com/database/121/RCMRF/rcmsynta020.htm#RCMRF126

For 12.2 please refer


Complete Checklist for Manual Upgrades to Non-CDB Oracle Database 12c Release 2 (12.2) Document 2173141.1

12) Check the database component status to confirm upgrade completion

Connect as SYS user to the database

3 de 4 22/04/2020 10:04
Document 2022820.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state...

col comp_id format a10


col comp_name format a30
col version format a10
col status format a8
select substr(comp_id,1,15) comp_id,substr(comp_name,1,30) comp_name,substr(version,1,10) version,status from
dba_registry

NOTE: If using this method to upgrade an existing database, be aware that once the auxiliary database is created and opened, no
further recovery is allowed from the source.

REFERENCES

NOTE:1503653.1 - Complete Checklist for Manual Upgrades to Oracle Database 12c Release 1 (12.1)
http://docs.oracle.com/database/121/RCMRF/rcmsynta020.htm#RCMRF126
NOTE:551141.1 - Database Server Upgrade/Downgrade Compatibility Matrix
NOTE:419550.1 - Different Upgrade Methods For Upgrading Your Database
Didn't find what you are looking for?

4 de 4 22/04/2020 10:04

You might also like