新聞中心
之前我們介紹過:Oracle數(shù)據(jù)庫RMAN恢復(fù)之?dāng)?shù)據(jù)文件的恢復(fù)詳解,本文我們介紹一下Oracle數(shù)據(jù)庫REMAN恢復(fù)之表空間和數(shù)據(jù)塊介質(zhì)的恢復(fù),接下來我們就開始介紹一下這部分內(nèi)容,首先我們先介紹一下恢復(fù)非系統(tǒng)表空間的示例。

創(chuàng)新互聯(lián)服務(wù)項目包括潘集網(wǎng)站建設(shè)、潘集網(wǎng)站制作、潘集網(wǎng)頁制作以及潘集網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,潘集網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到潘集省份的部分城市,未來相信會繼續(xù)擴大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!
示例一:表空間的數(shù)據(jù)文件被誤刪除
open狀態(tài)下刪除表空間對應(yīng)的所有數(shù)據(jù)文件。
在open狀態(tài)下使用alter tablespace ... offline for recover 脫機表空間。
使用restore tablespace ...轉(zhuǎn)儲表空間所有的數(shù)據(jù)文件。
使用recover tablespace ...應(yīng)用歸檔日志。
最后使用alter tablespace ... online使表空間聯(lián)機。
--open狀態(tài)下刪除表空間對應(yīng)的所有數(shù)據(jù)文件。
[oracle@localhost ~]$ rm /oracle/10g/oracle/product/10.2.0/oradatabak/users01.dbf;
--恢復(fù)表空間
- [oracle@localhost ~]$ rman target sys/oracle@oralife nocatalog
- RMAN> run {
- 2> sql 'alter tablespace users offline for recover';
- 3> restore tablespace users;
- 4> recover tablespace users;
- 5> sql 'alter tablespace users online';
- 6> }
示例二:表空間的數(shù)據(jù)文件所在磁盤出現(xiàn)故障
open狀態(tài)下刪除表空間對應(yīng)的所有數(shù)據(jù)文件。
在open狀態(tài)下使用alter tablespace ... offline for recover 脫機表空間。
執(zhí)行set newname為數(shù)據(jù)文件指定新的位置。
使用restore tablespace ...轉(zhuǎn)儲表空間所有的數(shù)據(jù)文件。
執(zhí)行switch datafile改變控制文件中數(shù)據(jù)文件位置和名稱。
使用recover tablespace ...應(yīng)用歸檔日志。
最后使用alter tablespace ... online使表空間聯(lián)機。
--open狀態(tài)下刪除表空間對應(yīng)的所有數(shù)據(jù)文件。
- [oracle@localhost ~]$ rm /oracle/10g/oracle/product/10.2.0/oradatabak/users01.dbf;
- SQL> select * from t_user;
- select * from t_user
- *
- ERROR at line 1:
- ORA-00376: file 4 cannot be read at this time
- ORA-01110: data file 4:
- '/oracle/10g/oracle/product/10.2.0/oradatabak/users01.dbf'
- SQL> select file#,error from v$recover_file;
- FILE# ERROR
- ---------- -----------------------------------------------------------------
- 4 FILE NOT FOUND
- --恢復(fù)表空間
- [oracle@localhost ~]$ rman target sys/oracle@oralife nocatalog
- run {
- sql 'alter tablespace users offline for recover';
- set newname for datafile 4 to '$ORACLE_BASE/product/10.2.0/oradata/oralife/user01.dbf';
- restore tablespace users;
- switch datafile all;
- recover tablespace users;
- sql 'alter tablespace users online';
- }
- --已恢復(fù)
- SQL> select * from t_user;
- TEXT
- --------------------
- java_
- SQL> select name from v$datafile where file# = 4;
- NAME
- --------------------------------------------------------------------------------
- /oracle/10g/oracle/product/10.2.0/oradata/oralife/user01.dbf
數(shù)據(jù)塊介質(zhì)恢復(fù)
如果數(shù)據(jù)文件部分?jǐn)?shù)據(jù)塊出現(xiàn)損壞,可以使用blockrecover 命令恢復(fù)損壞數(shù)據(jù)塊。
如:
- RMAN> blockrecover device type disk
- 2>datafile 5 block 2,7,88;
關(guān)于Oracle數(shù)據(jù)庫RMAN恢復(fù)之表空間和數(shù)據(jù)塊介質(zhì)的恢復(fù)方法就介紹到這里了,希望本次的介紹能夠?qū)δ兴鶐椭?/p>
本文標(biāo)題:Oracle數(shù)據(jù)庫RMAN恢復(fù)之表空間和數(shù)據(jù)塊介質(zhì)的恢復(fù)
本文地址:http://m.fisionsoft.com.cn/article/dhjeihg.html


咨詢
建站咨詢
