新聞中心
Oracle數(shù)據(jù)庫(kù)rman恢復(fù)之system表空間恢復(fù)是本文我們主要要介紹的內(nèi)容,system表空間存放著數(shù)據(jù)字典的信息。當(dāng)數(shù)據(jù)庫(kù)處于open狀態(tài),如果system表空間所對(duì)應(yīng)的數(shù)據(jù)文件出現(xiàn)介質(zhì)失敗,那么當(dāng)在其數(shù)據(jù)文件上執(zhí)行I/O操作時(shí),數(shù)據(jù)庫(kù)會(huì)自動(dòng)關(guān)閉;當(dāng)數(shù)據(jù)庫(kù)處于關(guān)閉狀態(tài)時(shí),如果system表空間所對(duì)應(yīng)的數(shù)據(jù)文件出現(xiàn)介質(zhì)失敗,數(shù)據(jù)庫(kù)將不能打開。恢復(fù)system表空間必須在mount狀態(tài)下進(jìn)行。

創(chuàng)新互聯(lián)公司是一家專業(yè)提供滁州企業(yè)網(wǎng)站建設(shè),專注與網(wǎng)站建設(shè)、成都做網(wǎng)站、HTML5、小程序制作等業(yè)務(wù)。10年已為滁州眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)絡(luò)公司優(yōu)惠進(jìn)行中。
示例一:system表空間的數(shù)據(jù)文件被誤刪除備份數(shù)據(jù)庫(kù)。
刪除system表空間對(duì)應(yīng)的數(shù)據(jù)文件。啟動(dòng)數(shù)據(jù)庫(kù)到mount狀態(tài)。使用restore datafile轉(zhuǎn)儲(chǔ)數(shù)據(jù)文件,并使用recover datafile命令應(yīng)用歸檔日志,***使用alter database open打開數(shù)據(jù)庫(kù)。
--備份數(shù)據(jù)庫(kù)(略)
--刪除system表空間對(duì)應(yīng)的數(shù)據(jù)文件
- RMAN> host rm $ORACLE_BASE/product/10.2.0/oradatabak/system01.dbf
- RMAN> startup
- connected to target database (not started)
- Oracle instance started
- database mounted
- RMAN-00571: ===========================================================
- RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
- RMAN-00571: ===========================================================
- RMAN-03002: failure of startup command at 08/22/2011 21:56:39
- ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
- ORA-01110: data file 1: '/oracle/10g/oracle/product/10.2.0/oradatabak/system01.dbf'
- SQL> select file#,error from v$recover_file;
- FILE# ERROR
- ---------- -----------------------------------------------------------------
- 1 FILE NOT FOUND
- SQL> select file#,name from v$datafile where file#=1;
- FILE# NAME
- ---------- ------------------------------------------------------------------------------------------------------------------------
- 1 /oracle/10g/oracle/product/10.2.0/oradatabak/system01.dbf
--啟動(dòng)數(shù)據(jù)庫(kù)到mount狀態(tài)并進(jìn)行恢復(fù)
- RMAN> run {
- 2> startup force mount;
- 3> restore datafile 1;
- 4> recover datafile 1;
- 5> sql 'alter database open';
- 6> }
示例二:system表空間數(shù)據(jù)文件所在磁盤出現(xiàn)故障
備份數(shù)據(jù)庫(kù)(略)刪除system表空間對(duì)應(yīng)的數(shù)據(jù)文件。啟動(dòng)數(shù)據(jù)庫(kù)到mount狀態(tài)。在restore database之前,執(zhí)行set newname為數(shù)據(jù)文件指定新的位置。在restore database之后,執(zhí)行switch datafile改變控制文件中數(shù)據(jù)文件位置和名稱。之后通過(guò)執(zhí)行recover database應(yīng)用歸檔日志。***執(zhí)行alter database open打開數(shù)據(jù)庫(kù)。
--備份數(shù)據(jù)庫(kù)(略)
--刪除system表空間對(duì)應(yīng)的數(shù)據(jù)文件
- RMAN> host 'rm /oracle/10g/oracle/product/10.2.0/oradatabak/system01.dbf'
- 2> ;
--啟動(dòng)數(shù)據(jù)庫(kù)到mount狀態(tài)并進(jìn)行恢復(fù)(為數(shù)據(jù)文件指定新位置,轉(zhuǎn)儲(chǔ)數(shù)據(jù)文件,恢復(fù)數(shù)據(jù)文件,打開數(shù)據(jù)庫(kù))
- RMAN> run {
- 2> startup force mount;
- 3> set newname for datafile 1 to '/oracle/10g/oracle/product/10.2.0/oradata/oralife/system01.dbf';
- 4> restore datafile 1;
- 5> switch datafile 1;
- 6> recover datafile 1;
- 7> sql 'alter database open';
- 8> }
關(guān)于Oracle數(shù)據(jù)庫(kù)rman恢復(fù)之system表空間恢復(fù)的相關(guān)知識(shí)就介紹到這里了,希望本次的介紹能夠?qū)δ兴斋@!
【編輯推薦】
- SSIS工程師為您揭秘SQL Server數(shù)據(jù)流
- SQL Server 2008 MDX學(xué)習(xí)筆記之理解元數(shù)組
- SQL Server數(shù)據(jù)庫(kù)DataRelation的應(yīng)用示例詳解
- SQL Server 2005/2008中的CTE應(yīng)用之遞歸查詢
- SQL Server 2008數(shù)據(jù)庫(kù)學(xué)習(xí)筆記之MDX查詢示例
網(wǎng)頁(yè)標(biāo)題:Oracle數(shù)據(jù)庫(kù)rman恢復(fù)之system表空間恢復(fù)詳解
文章地址:http://www.dlmjj.cn/article/ccopjhd.html


咨詢
建站咨詢
