資源描述:
《rman備份,備份后破壞數(shù)據(jù)文件,再利用備份的庫(kù)還原數(shù)據(jù)文件》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在學(xué)術(shù)論文-天天文庫(kù)。
1、rman備份,備份后破壞數(shù)據(jù)文件,再利用備份的庫(kù)還原數(shù)據(jù)文件rman備份,備份后破壞數(shù)據(jù)文件,再利用備份的庫(kù)還原數(shù)據(jù)文件。用rman備份,備份后破壞數(shù)據(jù)文件,再利用備份的庫(kù)還原數(shù)據(jù)文件。測(cè)試如下:1.進(jìn)入rman,關(guān)閉數(shù)據(jù)庫(kù),啟動(dòng)加載狀態(tài)C:DocumentsandSettingspengwzh>rmantarget/2.執(zhí)行備份腳本run{configurechanneldevicetypediskFORMAT='c:ora_bak%U'maxpiecesize=2G;sql'altersystemarchivelog
2、current';allocatechanneldisk1typedisk;backupfullascompressedbackupsetformat='c:ora_bak%d_t%t_s%s_%U.bak'tag'fullbak'(database);releasechanneldisk1;allocatechanneldisk2typedisk;BACKUPascompressedbackupsetFORMAT'c:ora_bakal_%d_t%t_s%s_%U.arcbak'ARCHIVELOGALLdelet
3、einput;releasechanneldisk2;allocatechanneldisk3typedisk;backupcurrentcontrolfileformat='c:ora_bakctl_%d_t%t_s%s_%U.ctlbak';releasechanneldisk3;sql'altersystemarchivelogcurrent';}3.--用test用戶進(jìn)入sqlplusC:DocumentsandSettingspengwzh>sqlplustest/testSQL*Plus:Release10.
4、2.0.1.0-Productionon星期五4月314:29:522009Copyright(c)1982,2005,Oracle.Allrightsreserved.連接到:OracleDatabase10gEnterpriseEditionRelease10.2.0.1.0-ProductionWiththePartitioning,OLAPandDataMiningoptions--創(chuàng)建表及插入數(shù)據(jù)SQL>createtabletmp(avarchar(2));表已創(chuàng)建。SQL>insertintotmpvalues
5、('1');已創(chuàng)建1行。SQL>insertintotmpvalues('2');已創(chuàng)建1行。SQL>commit;提交完成。SQL>select*fromtmp;A--12--連接sysdba用戶,關(guān)閉數(shù)據(jù)庫(kù),刪除數(shù)據(jù)文件5SQL>conn/assysdba;已連接。SQL>shutdownimmediate;數(shù)據(jù)庫(kù)已經(jīng)關(guān)閉。已經(jīng)卸載數(shù)據(jù)庫(kù)。ORACLE例程已經(jīng)關(guān)閉。SQL>hostdelD:oracleproduct10.2.0oradataorcltest01.ora;--啟動(dòng)數(shù)據(jù)庫(kù),啟動(dòng)失敗,退出sqlplus操作如
6、下:SQL>startup;ORACLE例程已經(jīng)啟動(dòng)。TotalSystemGlobalArea289406976bytesFixedSize1248576bytesVariableSize125829824bytesDatabaseBuffers155189248bytesRedoBuffers7139328bytes數(shù)據(jù)庫(kù)裝載完畢。ORA-01157:無(wú)法標(biāo)識(shí)/鎖定數(shù)據(jù)文件5-請(qǐng)參閱DBWR跟蹤文件ORA-01110:數(shù)據(jù)文件5:'D:ORACLEPRODUCT10.2.0ORADATAORCLTEST01.ORA'SQ
7、L>exit;--進(jìn)入rman命令提示符,利用rman備份的數(shù)據(jù)庫(kù)來(lái)恢復(fù)刪除的數(shù)據(jù)文件5C:DocumentsandSettingspengwzh>rmantarget/恢復(fù)管理器:Release10.2.0.1.0-Productionon星期五4月314:34:522009Copyright(c)1982,2005,Oracle.Allrightsreserved.已連接到目標(biāo)數(shù)據(jù)庫(kù):ORCL(DBID=1210922825,未打開(kāi))RMAN>shutdownimmediate;使用目標(biāo)數(shù)據(jù)庫(kù)控制文件替代恢復(fù)目錄數(shù)據(jù)庫(kù)已
8、卸載Oracle實(shí)例已關(guān)閉RMAN>startupmount;已連接到目標(biāo)數(shù)據(jù)庫(kù)(未啟動(dòng))Oracle實(shí)例已啟動(dòng)數(shù)據(jù)庫(kù)已裝載系統(tǒng)全局區(qū)域總計(jì)289406976字節(jié)FixedSize1248576字節(jié)VariableSize125829824字節(jié)DatabaseBuffers15518924