This article is the migration of the way to achieve the database 10g to 11g migration upgrades.
First, the environment introduction
1. Source Database Environment
Operating system version: OEL5.8 x64
Database version: 10.2.0.5 x64
Database SID Name: ORCL
Oracle 10g 10.2.0.5 (64bit) installation directory is as follows:
Database software:/u01/app/oracle/product/10.2.0/db_1
Database files:/U01/APP/ORACLE/ORADATA/ORCL
Archive directory:/u01/archivelog
Rman Catalog:/u01/rman_bak/data
2. Target database environment
Operating system version: OEL5.8 x64
Database version: 11.2.0.3 x64
Database SID Name: ORCL
Oracle 11g 11.2.0.3 (64bit) installation directory is as follows (database not created)
Database software:/u01/app/oracle/product/11.2.0/db_1
Database files:/U01/APP/ORACLE/ORADATA/ORCL
Archive directory:/u01/archivelog
Rman Catalog:/u01/rman_bak/data
Oracle 11g 11.2.0.3 (64bit) installation files
P10404530_112030_linux-x86-64_1of7.zip
P10404530_112030_linux-x86-64_2of7.zip
3. Upgrade Ideas
1 Oracle 10.2.0.2 can be upgraded to 11g 11.2.0.3 later.
2 Create an Oracle 11.2.0.3 database-related directory.
3 Execute Oracle 11.2.0.3x64 database utlu112i.sql script on Oracle 10.2.0.5x64 database.
4 The Oracle 10.2.0.5x64 database is backed up and uploaded to the 11g database server.
5 Restore the 10g database to the 11g library, and upgrade.
Second, Rman backup source 10g database
1. Execute Utlu112i.sql script on Oracle 10g Library
First, you need to upload the Utlu112i.sql script under the 11g $ORACLE _home/rdbms/admin to the 10g $oracle_home/rdbms/admin directory and execute it.
and executed on 10g, this script can check some information before the upgrade, it must be executed, otherwise there will be an error in the recovery.
Sql> @?/rdbms/admin/utlu112i.sql
#执行过程中无错误
2. Backup source Database
Note: Log database DBID (dbid=1349744318), useful when recovering.
[ORACLE@ORADB ~]$ Rman Target/
Recovery manager:release 10.2.0.5.0-production on Sunday July 28 12:34:56 2013
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to target DATABASE:ORCL (dbid=1349744318)
Rman>
Run {
Allocate channel C1 device type disk;
Backup incremental Level 0 format '/u01/rman_bak/data/db_full_%u.bak ' tag ' 2013-07-28-full '
Database plus archivelog;
Release channel C1;
}
# Backup control files and parameter files
Rman> Backup current controlfile format '/u01/rman_bak/data/control20130728.bak ';
rman> backup spfile format '/u01/rman_bak/data/spfile20130728.bak ';
4. Copy the/u01/rman_bak/data directory to the 11g database server.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/
III. 11g Database Recovery Preparation
1. Create 11g Database Base directory
# su-oracle
Mkdir-p/u01/app/oracle/admin/orcl/{adump,dpdump,pfile,scripts}
Mkdir-p/U01/APP/ORACLE/ORADATA/ORCL
Mkdir-p/U01/APP/ORACLE/FLASH_RECOVERY_AREA/ORCL
2. Create a regulatory log file
Mkdir-p/u01/archivelog
3. Restore the Rman backup database to the/u01/rman_bak/data directory.
# su-oracle
$ cd/u01
[Root@rman data]# LL
-rw-r--r--1 root root 7110656 07-24 22:23 Control20130728.bak
-rw-r--r--1 root root 38029824 07-24 22:22 Db_full_01ofj0gt_1_1.bak
-rw-r--r--1 root root 545660928 07-24 22:22 Db_full_02ofj0h1_1_1.bak
-rw-r--r--1 root root 7168 07-24 22:22 Db_full_03ofj0hs_1_1.bak
-rw-r--r--1 root root 98304 07-24 22:23 Spfile20130728.bak
Iv. Recovery of databases
1. Nomount Start the database
Note: Because the 10g instance name and the 11g instance name are consistent with the database directory, you do not need to manually create the parameter files and control files.
# su-oracle
$ Echo ' DB_NAME=ORCL ' > $ORACLE _home/dbs/initorcl.ora
$ Rman Target/
Recovery manager: Release 11.2.0.3.0-production on Sunday July 28 18:52:43 2013
Copyright (c) 1982, Oracle and/or its affiliates. All rights reserved.
Connected to target database (not started)
rman> startup Nomount;