標籤:linux oracle rman 資料庫恢複
1.建立資料庫目錄
2.從原來主機複製pfile檔案,並更改oracle_sid
vi .bash_profilesource .bash_profile
3.啟動資料到nomount狀態
$ sqlplus / as sysdbaSQL> startup nomount pfile=‘pfile檔案絕對位置‘;ORACLE instance started.SQL> exit
4.查看備份controlfile列表
$ /usr/openv/netbackup/bin/bplist -S 備份伺服器 -C 備份用戶端 -t 4 -s 09/10/2000 -e 09/11/2000 -R -l /該命令中-s參數後面接開始日期,-e參數接結束日期,表示擷取該時間段內的控制檔案清單
5.恢複controlfile檔案
$ rman target /RMAN>run{allocate channel a0 type ‘sbt_tape‘;allocate channel a1 type ‘sbt_tape‘;send ‘nb_ora_serv=備份伺服器 , nb_ora_client=備份用戶端‘;restore controlfile from ‘ cntrl_xxx_x_xxxxxxxxx‘; #控制檔案名稱由上一步驟中得到release channel a0;release channel a1;}RMAN> exit
注意:在這裡報錯
RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03009: failure of allocate command on a0 channel at 06/14/2011 11:45:03ORA-19554: error allocating device, device type: SBT_TAPE, device name: ORA-27211: Failed to load Media Management Libraryrace檔案發現沒有libobk.so所致,拷貝libobk.so至oracle安裝目錄下的lib/下面cp /usr/openv/netbackup/bin/libobk.so64.1 /opt/oracle/product/9.2/lib/libobk.so或者做一個軟連結ln -s /usr/openv/netbackup/bin/libobk.so64 /opt/oracle/product/9.2/lib/libobk.so
6.啟動資料庫到mount狀態
$ sqlplus / as sysdbaSQL> alter database mount;Database altered.SQL> exit
7.恢複資料庫
$ rman target /run{allocate channel a0 type ‘sbt_tape‘;allocate channel a1 type ‘sbt_tape‘;allocate channel a2 type ‘sbt_tape‘;allocate channel a3 type ‘sbt_tape‘;send ‘nb_ora_serv=備份伺服器 , nb_ora_client=備份用戶端‘;restore database;recover database;release channel a0;release channel a1;release channel a2;release channel a3;}
8.Reset log 開啟資料庫
$ sqlplus / as sysdbaSQL> alter database open resetlogs;
本文出自 “hello world” 部落格,請務必保留此出處http://nxyboy.blog.51cto.com/10511646/1940710
rman結合netbackup重新導向恢複oracle資料庫