利用RMAN跨平台遷移資料庫

來源:互聯網
上載者:User

1、資料檔案位元組排序
 Oracle平台一般使用兩種不同的位元組排序方案(尾數格式)。
 如果多個平台使用的位元組排序方案不同,則需要在RMAN中使用convert命令來將資料表空間轉換為目標平台上所需的格式。可以通過以下查詢確定尾數格式:
 select endian_format
from v$transportable_platform tp,v$database d
 where tp.platform_name=d.platform_name;
 2、使用RMAN轉換資料表空間尾數格式
 首先,建立儲存轉換檔副本的目錄,接下來將希望轉換的資料表空間設定為唯讀模式,然後,啟動RMAN並使用新的convert tablespace命令。
 rman target /
 convert tablespace users to platform='AIX-Based Systems(64-bit)' db_file_name_convert='c:\oracle\oradata\betatwo','c:\oracle\admin\transport_aix';
 也可以轉換目標網站上的資料檔案
 rman target /
 convert datafile='c:\oracle\oradata\betatwo\*' from platform='AIX-Based Systems(64-bit)'  db_file_name_convert='c:\oracle\oradata\betatwo','c:\oracle\admin\transport_aix';
 使用的平台名來自於v$transportable_platform視圖的platform_name列。
 3、跨平台移動資料庫
 Oracle Database 10g中的RMAN提供了全新的功能以協助在尾數位元組格式相同的平台之間移動資料庫。convert database命令結合DBMS_TDP包可以減少在平台之間移動資料庫的整體工作負載。操作過程如下:
 (1)以唯讀方式開啟資料庫
 startup mount;
 alter database open read only;
 (2)使用dbms_tdb.check_db進程來檢查資料庫狀態。該程式應該在開啟serveroutput命令時運行:
 set serveroutput on;
 declare
 db_ready boolean;
 begin
 db_ready:=dbms_tdb.check_db('Microsoft Windows IA (32-bit)',dbms_tdb.skip_readonly);
 end;
 /
 (3)使用dbms_tdb.check_external進程來標識外部對象:
 set serveroutput on;
 declare
 external boolean;
 begin
 external:=dbms_tdb.check_external;
 end;
 /
 (4)當資料庫可以傳送時,就可以使用RMAN的convert database命令。RMAN建立資料庫移動所需的指令碼,但不真正執行移動操作,而是建立移動所需的檔案:
 CONVERT DATABASE NEW DATABASE 'copydb' transport script 'c:\oracle\copydb\copyscripts' to platform 'Microsoft Windows IA (32-bit)';
 選擇性參數db_file_name_convert允許使用者為需要轉換的資料檔案定義目錄:
 CONVERT DATABASE NEW DATABASE 'copydb' transport script 'c:\oracle\copydb\copyscripts' to platform 'Microsoft Windows IA (32-bit)' db_file_name_convert 'c:\oracle\product\10.2.0\oradata\rob10r2','c:\oracle\newdbdest';

推薦閱讀:

RMAN 配置歸檔日誌刪除策略

Oracle基礎教程之通過RMAN複製資料庫

RMAN備份策略制定參考內容

RMAN備份學習筆記

OracleDatabase Backup加密 RMAN加密

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.