【RMAN】RAC資料恢複至單機環境
RAC資料恢複至單機環境
一、概括
隨著越來越多的RAC環境,將RAC資料移轉至單機環境下的需求也隨之增加,怎樣才能更有效遷移呢,方法有許多邏輯遷移(exp/expdp)、RMAN、DG、goldengate等,我們可根據自身環境及需求選擇相應的遷移方式,下面簡單介紹一下使用RMAN將RAC資料移轉至單機環境中的步驟。
二、 類比環境:整套RAC環境無故宕機,暫無法恢複,我們將之前備份的資料進行恢複
將最近一次全備份檔案上傳至目標環境,並查看檔案資訊
[Oracle@oradb1 backup]$ pwd
/oracle/backup
[oracle@oradb1 backup]$ ls -lrt
總計 264312
-rw-r----- 1 oracle oinstall 132608 02-17 13:24 arch_0lp0ro84
-rw-r----- 1 oracle oinstall 19456 02-17 13:24 arch_0ip0ro4u
-rw-r----- 1 oracle oinstall 1114112 02-17 13:24 full_0kp0ro7v_1_1
-rw-r----- 1 oracle oinstall 269107200 02-17 13:24 full_0jp0ro50_1_
通過上述我們可以看到,歸檔檔案有兩個,由於是測試環境,資料量及備份資訊較簡單,資料檔案也是兩個,由此得知檔案full_0kp0ro7v_1_1存放參數檔案和控制檔案。
設定環境變數
[oracle@oradb1 ~]$ vi ~/.bash_profile
修改參數為:export ORACLE_SID=racdb1
恢複spfile檔案
[oracle@oradb1 backup]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Feb 17 11:37:45 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup force nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/oracle/db_1/dbs/initracdb1.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 1068937216 bytes
Fixed Size 2260088 bytes
Variable Size 281019272 bytes
Database Buffers 780140544 bytes
Redo Buffers 5517312 bytes
RMAN> restore spfile from '/oracle/backup/full_0kp0ro7v_1_1';
Starting restore at 17-FEB-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /oracle/backup/full_0kp0ro7v_1_1
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 17-FEB-14
RMAN> restore spfile from '/oracle/backup/full_0kp0ro7v_1_1';
Starting restore at 17-FEB-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /oracle/backup/full_0kp0ro7v_1_1
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 17-FEB-14
登入到資料庫,產生pfile檔案,並編輯,刪除與叢集即節點2相關參數,修改控制檔案及其他目錄路徑,並根據需求建立相應目錄(如閃回區、oracle基礎目錄)
--------------------------------------------------------------------------------
RMAN 配置歸檔日誌刪除策略
Oracle基礎教程之通過RMAN複製資料庫
RMAN備份策略制定參考內容
RMAN備份學習筆記
OracleDatabase Backup加密 RMAN加密
Linux-6-64下安裝Oracle 12C筆記
在CentOS 6.4下安裝Oracle 11gR2(x64)
Oracle 11gR2 在VMWare虛擬機器中安裝步驟
Debian 下 安裝 Oracle 11g XE R2
--------------------------------------------------------------------------------
idle> create pfile from spfile;
File created.
建立spfile,並重啟執行個體
idle> create spfile from pfile;
File created.
idle> show parameter pfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string
idle> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string
idle> shutdown abort
ORACLE instance shut down.
idle> startup nomount
ORACLE instance started.
Total System Global Area 534462464 bytes
Fixed Size 2254952 bytes
Variable Size 213911448 bytes
Database Buffers 314572800 bytes
Redo Buffers 3723264 bytes
idle> show parameter pfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /oracle/db_1/dbs/spfileracdb1.
Ora
恢複控制檔案,並啟動資料庫到mount模式
[oracle@oradb1 oracle]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Feb 17 12:45:58 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: RACDB (not mounted)
RMAN> restore controlfile from '/oracle/backup/full_0bp0rlcu_1_1';
Starting restore at 17-FEB-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
output file name=/oracle/oradata/racdb/current.273.839446247
output file name=/oracle/oradata/racdb/current.274.839446249
Finished restore at 17-FEB-14
RMAN> sql 'alter database mount';
sql statement: alter database mount
released channel: ORA_DISK_1
更多詳情見請繼續閱讀下一頁的精彩內容: