自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

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

數(shù)據(jù)庫 Oracle
本文我們主要介紹了Oracle數(shù)據(jù)庫RMAN恢復(fù)之?dāng)?shù)據(jù)文件的恢復(fù)的相關(guān)知識(shí),并通過示例來進(jìn)行說明,希望能夠?qū)δ兴鶐椭?/div>

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

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

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

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

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

打開數(shù)據(jù)庫,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ù)庫關(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ù)文件。

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

脫機(jī)丟失的數(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)機(jī)數(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.  
  3. SQL> select file#,error from v$recover_file;      
  4.  
  5. FILE# ERROR    
  6.  
  7. ---------- -----------------------------------------------------------------     
  8.  
  9. 5 FILE NOT FOUND    
  10.  
  11. SQL> select file#,name from v$datafile where file#=5;    
  12.  
  13. FILE# NAME    
  14.  
  15. ---------- --------------------------------------------------------------------------------     
  16.  
  17. 5 /oracle/10g/oracle/product/10.2.0/oradatabak/example01.dbf    
  18.  
  19. --恢復(fù)數(shù)據(jù)文件     
  20.  
  21. [oracle@localhost ~]$ rman target sys/oracle@oralife nocatalog    
  22.  
  23. RMAN> run {    
  24.  
  25. 2> startup force mount;    
  26.  
  27. 3> sql 'alter database datafile 5 offline';    
  28.  
  29. 4> sql 'alter database open';    
  30.  
  31. 5> set newname for datafile 5 to '$ORACLE_BASE/product/10.2.0/oradata/oralife/example01.dbf';    
  32.  
  33. 6> restore datafile 5;    
  34.  
  35. 7> switch datafile 5;    
  36.  
  37. 8> recover datafile 5;    
  38.  
  39. 9> sql 'alter database datafile 5 online';    
  40.  
  41. 10> }    
  42.  
  43. SQL> select file#,name from v$datafile where file#=5;    
  44.  
  45. FILE# NAME    
  46.  
  47. ---------- --------------------------------------------------------------------------------     
  48.  
  49. 5 /oracle/10g/oracle/product/10.2.0/oradata/oralife/example01.dbf    
  50.  
  51. SQL> select file#,error from v$recover_file;      
  52.  
  53. no rows selected  

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

【編輯推薦】

  1. Oracle數(shù)據(jù)庫PL/SQL快捷鍵設(shè)置詳解
  2. Oracle數(shù)據(jù)庫診斷工具RDA的安裝與使用詳解
  3. Oracle數(shù)據(jù)庫GLOBAL_NAMES參數(shù)的詳細(xì)研究
  4. Oracle數(shù)據(jù)庫歸檔模式的切換及其相關(guān)操作詳解
  5. Oracle 10g UNDO表空間過大導(dǎo)致磁盤空間不足的解決
責(zé)任編輯:趙鵬 來源: CSDN博客
相關(guān)推薦

2011-08-23 11:09:36

Oraclerman恢復(fù)system表空間恢復(fù)

2011-08-29 17:00:47

Oracle數(shù)據(jù)庫RM表空間數(shù)據(jù)塊介質(zhì)

2011-08-30 09:50:22

OracleRMAN不完全恢復(fù)基于SCN恢復(fù)

2011-08-30 09:35:10

OracleRMAN不完全恢復(fù)基于時(shí)間恢復(fù)

2011-05-17 11:33:43

oracle數(shù)據(jù)庫

2010-03-31 10:39:40

RMANOracle

2011-08-30 10:02:18

OracleRMAN不完全恢復(fù)基于日志序列號(hào)恢復(fù)

2011-04-11 13:46:17

Oracle數(shù)據(jù)庫備份

2019-06-12 08:57:43

Oracle數(shù)據(jù)庫恢復(fù)

2011-05-24 10:26:12

Oracle數(shù)據(jù)庫日志文件

2011-08-15 23:14:34

Oraclerman環(huán)境配置

2009-11-20 13:29:59

Oracle數(shù)據(jù)庫恢復(fù)

2011-05-26 09:36:07

Oracle數(shù)據(jù)庫Redo故障

2011-02-28 13:31:17

Oracle數(shù)據(jù)庫

2011-05-11 13:25:57

Oracle數(shù)據(jù)庫后備恢復(fù)

2011-04-02 11:02:54

SQL Server數(shù)文件恢復(fù)

2011-03-24 17:21:42

Oracle數(shù)據(jù)庫Redo故障

2011-08-03 18:42:21

Oracle數(shù)據(jù)庫重做日志

2009-03-17 16:00:47

Oracle數(shù)據(jù)庫備份

2011-05-20 09:35:24

Oracle數(shù)據(jù)庫恢復(fù)備份
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)