Oracle 10.2.0.5 64位RMAN如何遷移到11.2.0.3x64

來源:互聯網
上載者:User

本文是採用遷移的方式來實現資料庫10g到11g的遷移升級。

一、環境介紹

1. 來源資料庫環境

作業系統版本: OEL5.8 x64

資料庫版本  : 10.2.0.5 x64

資料庫sid名 : orcl

Oracle 10g 10.2.0.5(64bit)安裝目錄如下:

資料庫軟體:/u01/app/oracle/product/10.2.0/db_1

資料庫檔案:/u01/app/oracle/oradata/orcl

歸檔目錄:/u01/archivelog

RMAN目錄:/u01/rman_bak/data

2. 目標資料庫環境

作業系統版本: OEL5.8 x64

資料庫版本  : 11.2.0.3 x64

資料庫sid名 : orcl

Oracle 11g 11.2.0.3(64bit)安裝目錄如下(未建立資料庫)

資料庫軟體:/u01/app/oracle/product/11.2.0/db_1

資料庫檔案:/u01/app/oracle/oradata/orcl

歸檔目錄:/u01/archivelog

RMAN目錄:/u01/rman_bak/data

Oracle 11g 11.2.0.3(64bit)安裝檔案

p10404530_112030_Linux-x86-64_1of7.zip

p10404530_112030_Linux-x86-64_2of7.zip

3. 升級思路

1)Oracle 10.2.0.2 以後才可以升級到11g 11.2.0.3。

2)建立Oracle 11.2.0.3資料庫相關目錄。

3) 在Oracle 10.2.0.5x64資料庫上執行Oracle 11.2.0.3x64資料庫utlu112i.sql指令碼。

4)備份Oracle 10.2.0.5x64資料庫,並傳到11g資料庫伺服器上。

5)還原10g資料庫到11g庫上,並升級。

二、RMAN備份源10g資料庫

1. 在Oracle 10g庫上執行utlu112i.sql指令碼

道先需要將11g $ORACLE_HOME/rdbms/admin下的utlu112i.sql指令碼傳到10g的$ORACLE_HOME/rdbms/admin目錄下並執行。

並在10g上執行,這個指令碼可以檢查升級前的一些資訊,必須要執行,否則在恢複時會出現錯誤。

SQL> @?/rdbms/admin/utlu112i.sql

#執行過程中無錯誤

2. 備份來源資料庫

說明:記錄資料庫DBID(DBID=1349744318),恢複時有用。

[oracle@oradb ~]$ rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on 星期日 7月 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;

}

# 備份控制檔案與參數檔案

RMAN> backup current controlfile format '/u01/rman_bak/data/control20130728.bak';

RMAN> backup spfile format '/u01/rman_bak/data/spfile20130728.bak';

4. 將/u01/rman_bak/data目錄拷貝到11g資料庫伺服器上。

查看本欄目更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

三、11g資料庫恢複準備

1. 建立11g資料庫基本目錄

# 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. 建立規檔記錄檔

mkdir -p /u01/archivelog

3. 將rman備份資料庫恢複到/u01/rman_bak/data目錄下。

# 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

四、恢複資料庫

1. nomount啟動資料庫

說明:由於10g執行個體名與11g執行個體名與資料庫目錄一致,不需要手動建立參數檔案與控制檔案。

# su - oracle

$ echo 'db_name=orcl' > $ORACLE_HOME/dbs/initorcl.ora

$ rman target /

復原管理員: Release 11.2.0.3.0 - Production on 星期日 7月 28 18:52:43 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

已串連到目標資料庫 (未啟動)

RMAN> startup nomount;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.