資料檔案丟失損壞的恢復--

還不算暈發表於2013-10-27

如資料檔案丟失,資料庫重啟時報錯,可以根據報錯的檔案號,先設定報錯的資料檔案為離線,然後開啟資料庫,

然後使用備份的資料檔案恢復至相應位置或者直接將資料檔案重新命名即指定到備份檔案。

此時執行介質恢復,然後將資料檔案聯機。

注:這種方法只能用於恢復非SYSTEM/SYSAUX/非當前UNDO表空間的資料檔案。


alter database datafile 9 offline;
alter database open;

 
select file#,status from v$datafile;
select tablespace_name,status,contents,extent_managementfrom dba_tablespaces;


alter tablespace bys_data rename datafile'e:\useroradata\bys_data.dbf' to 'e:\userbackup\bys_data.dbf';
recover datafile 9;
alter database datafile 9 online;


select file#,status from v$datafile;
selecttablespace_name,status,contents,extent_management from dba_tablespaces;

相關文章