日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Oracle數(shù)據(jù)庫RMAN恢復(fù)之?dāng)?shù)據(jù)文件的恢復(fù)詳解

Oracle數(shù)據(jù)庫REAN恢復(fù)數(shù)據(jù)文件的恢復(fù)是本文我們主要要介紹的內(nèi)容,我們知道,除了system表空間的數(shù)據(jù)文件(mount)之外,其它數(shù)據(jù)文件可以在open(mount也可以)狀態(tài)下恢復(fù)。open狀態(tài)下恢復(fù)數(shù)據(jù)文件可以減少數(shù)據(jù)庫停用的時間,所以應(yīng)該在open狀態(tài)下恢復(fù)這些數(shù)據(jù)文件。

示例一:數(shù)據(jù)文件被誤刪除

數(shù)據(jù)庫關(guān)閉狀態(tài)下刪除非系統(tǒng)表空間數(shù)據(jù)文件。

啟動數(shù)據(jù)庫到mount狀態(tài)。

脫機丟失的數(shù)據(jù)文件,alter database datafile n offline。

打開數(shù)據(jù)庫,alter database open。

轉(zhuǎn)儲數(shù)據(jù)文件,restore datafile n。

使用recover datafile n 應(yīng)用歸檔日志。

聯(lián)機數(shù)據(jù)文件,alter database datafile n online。

--數(shù)據(jù)庫關(guān)閉狀態(tài)下刪除非系統(tǒng)表空間數(shù)據(jù)文件。

 
 
 
  1. [oracle@localhost ~]$  rm $ORACLE_BASE/product/10.2.0/oradatabak/example01.dbf;  
  2. SQL> select file#,error from v$recover_file;    
  3. FILE# ERROR  
  4. ---------- -----------------------------------------------------------------   
  5. 5 FILE NOT FOUND  
  6. SQL> select file#,name from v$datafile where file#=5;  
  7. FILE# NAME  
  8. ---------- --------------------------------------------------------------------------------   
  9. 5 /oracle/10g/oracle/product/10.2.0/oradatabak/example01.dbf  
  10. --恢復(fù)數(shù)據(jù)文件   
  11. RMAN> run {  
  12. startup force mount;  
  13. sql 'alter database datafile 5 offline';  
  14. sql 'alter database open';  
  15. restore datafile 5;  
  16. recover datafile 5;  
  17. sql 'alter database datafile 5 online';  
  18. 8> }  

示例二:數(shù)據(jù)文件所在磁盤出現(xiàn)損壞

數(shù)據(jù)庫關(guān)閉狀態(tài)下刪除非系統(tǒng)表空間數(shù)據(jù)文件。

啟動數(shù)據(jù)庫到mount狀態(tài)。

脫機丟失的數(shù)據(jù)文件,alter database datafile n offline。

打開數(shù)據(jù)庫,alter database open。

在restore database之前,執(zhí)行set newname為數(shù)據(jù)文件指定新的位置。

在restore database之后,執(zhí)行switch datafile改變控制文件中數(shù)據(jù)文件位置和名稱。

之后通過執(zhí)行recover database應(yīng)用歸檔日志。

聯(lián)機數(shù)據(jù)文件,alter database datafile n online。

--數(shù)據(jù)庫關(guān)閉狀態(tài)下刪除非系統(tǒng)表空間數(shù)據(jù)文件。

 
 
 
  1. [oracle@localhost ~]$  rm $ORACLE_BASE/product/10.2.0/oradatabak/example01.dbf;  
  2. SQL> select file#,error from v$recover_file;    
  3. FILE# ERROR  
  4. ---------- -----------------------------------------------------------------   
  5. 5 FILE NOT FOUND  
  6. SQL> select file#,name from v$datafile where file#=5;  
  7. FILE# NAME  
  8. ---------- --------------------------------------------------------------------------------   
  9. 5 /oracle/10g/oracle/product/10.2.0/oradatabak/example01.dbf  
  10. --恢復(fù)數(shù)據(jù)文件   
  11. [oracle@localhost ~]$ rman target sys/oracle@oralife nocatalog  
  12. RMAN> run {  
  13. 2> startup force mount;  
  14. 3> sql 'alter database datafile 5 offline';  
  15. 4> sql 'alter database open';  
  16. 5> set newname for datafile 5 to '$ORACLE_BASE/product/10.2.0/oradata/oralife/example01.dbf';  
  17. 6> restore datafile 5;  
  18. 7> switch datafile 5;  
  19. 8> recover datafile 5;  
  20. 9> sql 'alter database datafile 5 online';  
  21. 10> }  
  22. SQL> select file#,name from v$datafile where file#=5;  
  23. FILE# NAME  
  24. ---------- --------------------------------------------------------------------------------   
  25. 5 /oracle/10g/oracle/product/10.2.0/oradata/oralife/example01.dbf  
  26. SQL> select file#,error from v$recover_file;    
  27. no rows selected 

關(guān)于Oracle數(shù)據(jù)庫RMAN恢復(fù)之?dāng)?shù)據(jù)文件的恢復(fù)的相關(guān)知識就介紹到這里了,希望本次的介紹能夠?qū)δ兴斋@!


當(dāng)前名稱:Oracle數(shù)據(jù)庫RMAN恢復(fù)之?dāng)?shù)據(jù)文件的恢復(fù)詳解
網(wǎng)址分享:http://www.dlmjj.cn/article/dppijhp.html