av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

Oracle數(shù)據(jù)庫(kù)RMAN恢復(fù)之?dāng)?shù)據(jù)文件的恢復(fù)詳解

Oracle數(shù)據(jù)庫(kù)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ù)庫(kù)停用的時(shí)間,所以應(yīng)該在open狀態(tài)下恢復(fù)這些數(shù)據(jù)文件。

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

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

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

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

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

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

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

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

--數(shù)據(jù)庫(kù)關(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ù)文件所在磁盤(pán)出現(xiàn)損壞

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

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

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

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

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

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

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

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

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


文章標(biāo)題:Oracle數(shù)據(jù)庫(kù)RMAN恢復(fù)之?dāng)?shù)據(jù)文件的恢復(fù)詳解
文章路徑:http://uogjgqi.cn/article/dppijhp.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們?cè)谖⑿派?4小時(shí)期待你的聲音

解答本文疑問(wèn)/技術(shù)咨詢/運(yùn)營(yíng)咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流