模板编号:UEC/D-TSC-0014-1210Oracle数据文件的恢复文档密级:普通公开资料编码针对产品Oracle、NBU使用对象技术支持工程师版本通用编写部门技术服务中心资料版本V1.0拟制:葛承平日期:2012-11审核:日期:批准:日期:北京荣之联科技股份有限公司版权所有侵权必究安装实施及故障解决方案文档密级:普通公开1荣之联机密,未经许可不得扩散一、文档密级普通公开二、文档ID三、TASKID/CASEIDT016075/C014462四、文档名称NBU环境下的Oracle数据文件的恢复五、文档摘要Oracle数据文件恢复六、更新/编写日期2012-12-12七、涉及产品Oracle9i,Netbackup6.0八、涉及技术方面Oracle,Netbackup九、参考文档名称十、【问题简要描述】1.Oracle数据库出现了数据文件丢失2.Oracle数据库备份失败,数据文件出现了Block级错误。十一、【原始问题或故障信息】Rman备份到一半报错channelch00:startingpiece1at31-JUL-10releasedchannel:ch00releasedchannel:ch01RMAN-00571:===========================================================RMAN-00569:===============ERRORMESSAGESTACKFOLLOWS===============RMAN-00571:===========================================================RMAN-03009:failureofbackupcommandonch01channelat07/31/201022:55:00ORA-19566:exceededlimitof0corruptblocksforfile/u01/test159/testdata/ontx01.dbf当时alertlog:CreatingarchivedestinationLOG_ARCHIVE_DEST_1:'/u35102/testarchive/arch1_12867.arc'安装实施及故障解决方案文档密级:普通公开2荣之联机密,未经许可不得扩散ARC0:Completedarchivinglog2thread1sequence12867***Corruptblockrelativedba:0x280116de(file160,block71390)BadheaderfoundduringbackingupdatafileDatainbadblock-type:0format:0rdba:0x02000000lastchangescn:0x0000.00000000seq:0x1flg:0x05consistencyvalueintail:0x00000001checkvalueinblockheader:0x3fd9,computedblockchecksum:0x3eddspare1:0x0,spare2:0x0,spare3:0x0***Rereadofblocknum=71390,file=/u01/test159/testdata/ontx01.dbf.foundsamecorruptdataSatJul3123:07:092010CompletedcheckpointuptoRBA[0x3244.2.10],SCN:0x0001.e4b4f428SunAug100:58:402010BeginninglogswitchcheckpointuptoRBA[0x3245.2.10],SCN:0x0001.e4b6dc55Thread1advancedtologsequence12869十二、【问题分析及原因】由于存储出现了故障或者突然停机,导致Oracle数据块损坏。十三、【如何解决或临时解决或不能解决】方式一:恢复这个错误的块$dbvfile=/u01/test159/testdata/osmd01.dbfblocksize=8192|moreDBVERIFY:Release9.2.0.3.0-ProductiononWedAug411:04:192010Copyright(c)1982,2002,OracleCorporation.Allrightsreserved.DBVERIFY-Verificationstarting:FILE=/u01/test159/testdata/osmd01.dbfPage20238ismarkedcorrupt***Corruptblockrelativedba:0x0f404f0e(file61,block20238)Badheaderfoundduringdbv:Datainbadblock-type:0format:0rdba:0x02000000lastchangescn:0x0000.00000000seq:0x1flg:0x01consistencyvalueintail:0x00000001checkvalueinblockheader:0x0,blockchecksumdisabled安装实施及故障解决方案文档密级:普通公开3荣之联机密,未经许可不得扩散spare1:0x0,spare2:0x0,spare3:0x0***DBVERIFY-VerificationcompleteTotalPagesExamined:35200TotalPagesProcessed(Data):78TotalPagesFailing(Data):0TotalPagesProcessed(Index):22TotalPagesFailing(Index):0TotalPagesProcessed(Other):1097TotalPagesProcessed(Seg):0TotalPagesFailing(Seg):0TotalPagesEmpty:34002TotalPagesMarkedCorrupt:1TotalPagesInflux:0$四,恢复过程$rmantarget/RecoveryManager:Release9.2.0.3.0-ProductionCopyright(c)1995,2002,OracleCorporation.Allrightsreserved.connectedtotargetdatabase:TEST(DBID=4213936982)RMANRMANbackupvalidatedatafile'/u01/test159/testdata/osmd01.dbf';Startingbackupat04-AUG-10usingtargetdatabasecontrolfileinsteadofrecoverycatalogallocatedchannel:ORA_DISK_1channelORA_DISK_1:sid=136devtype=DISKchannelORA_DISK_1:startingfulldatafilebackupsetchannelORA_DISK_1:specifyingdatafile(s)inbackupsetinputdatafilefno=00061name=/u01/test159/testdata/osmd01.dbfchannelORA_DISK_1:backupsetcomplete,elapsedtime:00:00:14Finishedbackupat04-AUG-10SQLselect*fromV$DATABASE_BLOCK_CORRUPTION;FILE#BLOCK#BLOCKSCORRUPTION_CHANGE#CORRUPTIO---------------------------------------------------------612023810FRACTUREDRMANrun{2allocatechanneld1type'sbt_tape'parms=ENV=(NB_ORA_CLIENT=wferp1);3send'NB_ORA_SERV=wferp3,NB_ORA_CLIENT=wferp1';安装实施及故障解决方案文档密级:普通公开4荣之联机密,未经许可不得扩散4BLOCKRECOVERDATAFILE61BLOCK20238;5}releasedchannel:ORA_DISK_1allocatedchannel:d1channeld1:sid=136devtype=SBT_TAPEchanneld1:VERITASNetBackupforOracle-Release5.1(2004043015)sentcommandtochannel:d1Startingblockrecoverat04-AUG-10channeld1:restoringblock(s)channeld1:specifyingblock(s)torestorefrombackupsetrestoringblocksofdatafile00061channeld1:restoredblock(s)frombackuppiece1piecehandle=bk_3583_1_726040296tag=HOT_DB_BK_LEVEL0params=NULLchanneld1:blockrestorecompletestartingmediarecoverymediarecoverycompleteFinishedblockrecoverat04-AUG-10releasedchannel:d1RMANbackupvalidatedatafile'/u01/test159/testdata/osmd01.dbf';Startingbackupat04-AUG-10allocatedchannel:ORA_DISK_1channelORA_DISK_1:sid=136devtype=DISKchannelORA_DISK_1:startingfulldatafilebackupsetchannelORA_DISK_1:specifyingdatafile(s)inbackupsetinputdatafilefno=00061name=/u01/test159/testdata/osmd01.dbfchannelORA_DISK_1:backupsetcomplete,elapsedtime:00:00:07Finishedbackupat04-AUG-10SQLselect*fromV$DATABASE_BLOCK_CORRUPTION;方式二:删除此文件,重新恢复此数据文件一,数据库在运行时候,丢失了一个数据文件二,恢复这个数据文件$mv/u01/test159/testdata/ontx01.dbf/u01/test159/testdata/ontx01.dbf.bak$ls-l/u01/test159/testdata/ontx01.dbf/u01/test159/testdata/ontx01.dbf:NosuchfileordirectorySQLALTERDATABASEDATAFILE'/u01/test159/testdata/ontx01.dbf'offline;Databasealtered.安装实施及故障解决方案文档密级:普通公开5荣之联机密,未经许可不得扩散$rmantarget/RecoveryManager:Release9.2.0.3.0-ProductionCopyright(c)1995,2002,OracleCorporation.Allrightsreserved.connectedtotargetdatabase:TEST(DBID=421393