您好,登錄后才能下訂單哦!
本篇文章給大家分享的是有關RAC怎么進行從帶庫到單實例的恢復,小編覺得挺實用的,因此分享給大家學習,希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
備份軟件:HP-DP
原庫:生產RAC 2節點,IP:192.168.160.2和192.168.160.3
目標庫:單實例庫,IP:192.168.160.129
0. 準備環境
配置好目標服務器的監聽,讓備份服務器可以鏈接到目標服務器。
1. 恢復控制文件
對于備份軟件恢復控制文件,是直接將其恢復到目標服務器的os上的,一般是在var目錄下。
登陸備份服務器,點開DP軟件,選擇RESTORE,找到原庫的備份。然后在SOURCE選擇"CONTROL FILE FROM DP MANAGED BACKUP",在OPTIONS中配置:Clinet=恢復的目標服務器,user name=oracle(目標服務器的oracle軟件的os用戶),User group=oinstall,Restore mode=Normal,Restore unitl=selected time,我這里選擇的是20131227 22:00點。在Settings中配置目標服務器的sys密碼和service_name。然后點擊restore即可。隨后去目標服務器(160.129)的/var/opt/omni/tmp/下找新產生的控制文件。
備注:Client這里要選擇在備份服務器中配置的192.168.160.129所對應的別名,這里的別名一般都是主機名。
2. 恢復spfile
現在已經有控制文件,其實參數文件,我們自己造一個就行,但如果想恢復的話,也是可以的。首先自己造一個參數文件,或者直接startup nomount force也行。隨后恢復控制文件,并啟動到mount,然后恢復spfile,具體如下:
SQL> startup nomount force
RMAN> restore controlfile from '/var/opt/omni/tmp/ctrl_ORCLDB.dbf';
RMAN> alter database mount;
RMAN> run {
allocate channel 'dev_0' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=mubiao_dbname,OB2BARLIST=mubiao_dbname)';
send device type 'sbt_tape' 'OB2BARHOSTNAME=yuanku_hostname';
restore spfile to '/home/orazkf/spfileORCL1.ora' from autobackup;
release channel 'dev_0';
}
released channel: ORA_DISK_1
allocated channel: dev_0
channel dev_0: SID=893 instance=ORCL1 device type=SBT_TAPE
channel dev_0: Data Protector A.06.20/PHSS_42081/DPSOL_00448/DPLNX_00154
sent command to channel: dev_0
Starting restore at 07-JAN-14
channel dev_0: looking for AUTOBACKUP on day: 20140107
channel dev_0: AUTOBACKUP found: c-3400117082-20140107-00
channel dev_0: restoring spfile from AUTOBACKUP c-3400117082-20140107-00
channel dev_0: SPFILE restore from AUTOBACKUP complete
Finished restore at 07-JAN-14
released channel: dev_0
現在可以用恢復的spfile和控制文件,將數據庫啟動到mount狀態。但需要注意的是,需要修改歸檔目錄,dump目錄等。
3. 恢復數據文件
對于rac到單實例的恢復,肯定是要做set newname的,因為rac的數據文件都存在在磁盤組里,而本來都是在fs中。
RMAN>run {
allocate channel 'dev_0' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=mubiao_dbname,OB2BARLIST=mubiao_dbname)';
send device type 'sbt_tape' 'OB2BARHOSTNAME=yuanku_hostname';
set newname for datafile 1 to '/pmsdb/oradata/ORCL1/data1/system.345.760169914';
set newname for datafile 2 to '/pmsdb/oradata/ORCL1/data1/sysaux.564.760187953';
set newname for datafile 3 to '/pmsdb/oradata/ORCL1/data1/undotbs1.124.760889985';
set newname for datafile 4 to '/pmsdb/oradata/ORCL1/data1/undotbs2.456.760990001';
set newname for datafile 5 to '/pmsdb/oradata/ORCL1/data1/users.167.760190409';
set newname for datafile 6 to '/pmsdb/oradata/ORCL1/data1/undotbs1.281.760310569';
set newname for datafile 7 to '/pmsdb/oradata/ORCL1/data1/undotbs2.282.760110751';
set newname for datafile 24 to '/pmsdb/oradata/ORCL1/data1/ORCLrddata101.dbf';
set newname for datafile 25 to '/pmsdb/oradata/ORCL1/data1/ORCLrddata102.dbf';
set newname for datafile 26 to '/pmsdb/oradata/ORCL1/data1/ORCLrddata103.dbf';
set newname for datafile 27 to '/pmsdb/oradata/ORCL1/data1/ORCLrddata104.dbf';
set newname for datafile 28 to '/pmsdb/oradata/ORCL1/data1/ORCLrddata105.dbf';
set newname for datafile 29 to '/pmsdb/oradata/ORCL1/data1/ORCLrddata106.dbf';
set newname for datafile 30 to '/pmsdb/oradata/ORCL1/data1/ORCLrddata107.dbf';
set newname for datafile 31 to '/pmsdb/oradata/ORCL1/data1/ORCLrddata108.dbf';
set newname for datafile 32 to '/pmsdb/oradata/ORCL1/data1/ORCLrdindex101.dbf';
set newname for datafile 33 to '/pmsdb/oradata/ORCL1/data1/ORCLrdindex102.dbf';
set newname for datafile 34 to '/pmsdb/oradata/ORCL1/data1/ORCLrdindex103.dbf';
set newname for datafile 35 to '/pmsdb/oradata/ORCL1/data1/ORCLrdindex104.dbf';
set newname for datafile 36 to '/pmsdb/oradata/ORCL1/data1/ORCLrdindex105.dbf';
set newname for datafile 37 to '/pmsdb/oradata/ORCL1/data1/ORCLrdindex106.dbf';
set newname for datafile 38 to '/pmsdb/oradata/ORCL1/data1/ORCLrdindex107.dbf';
set newname for datafile 39 to '/pmsdb/oradata/ORCL1/data1/ORCLrdindex108.dbf';
restore database;
switch datafile all;
release channel 'dev_0';
}
靜靜的等待很久,最后恢復成功。
4. 恢復歸檔文件
RMAN>run {
allocate channel 'dev_0' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=ORCL1,OB2BARLIST=ORCL1)';
send device type 'sbt_tape' 'OB2BARHOSTNAME=yuanku_hostname';
restore archivelog time between "to_date('2013-12-27 22:00:00','YYYY-MM-DD HH24:MI:SS')" and "to_date('2013-12-27 22:30:00','YYYY-MM-DD HH24:MI:SS')";
release channel 'dev_0';
}
由于我在此之前已經設置好新的歸檔目錄,所以待恢復歸檔完畢后,去我的歸檔目錄下查看,就會發現有幾個歸檔文件。
5 執行recover
RMAN>recover database;
6 執行open resetlogs
再此之前需要設置好閃回恢復區的大小,因為此時oracle可能會將新的onlinelog放在你的閃回恢復區中,所有要設置好大小正好,才可以啟動成功。
以上就是RAC怎么進行從帶庫到單實例的恢復,小編相信有部分知識點可能是我們日常工作會見到或用到的。希望你能通過這篇文章學到更多知識。更多詳情敬請關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。