RMAN Tablespace PointinTime Recovery TSPITR.docx
- 文档编号:28588922
- 上传时间:2023-07-19
- 格式:DOCX
- 页数:35
- 大小:33.60KB
RMAN Tablespace PointinTime Recovery TSPITR.docx
《RMAN Tablespace PointinTime Recovery TSPITR.docx》由会员分享,可在线阅读,更多相关《RMAN Tablespace PointinTime Recovery TSPITR.docx(35页珍藏版)》请在冰豆网上搜索。
RMANTablespacePointinTimeRecoveryTSPITR
RMANTablespacePoint-in-TimeRecovery(TSPITR)
RecoveryManager(RMAN)automatictablespacepoint-in-timerecovery(commonlyabbreviatedTSPITR)enablesyoutoquicklyrecoveroneormoretablespacesinanOracledatabasetoanearliertime,withoutaffectingthestateoftherestofthetablespacesandotherobjectsinthedatabase.
ThischapterexplainswhenyoucanandcannotuseTSPITR,whatRMANactuallydoestoyourdatabaseduringTSPITR,howtoprepareadatabaseforTSPITR,howtorunTSPITR,andoptionsforcontrollingtheTSPITRprocess.
Thischaptercontainsthefollowingsections:
∙UnderstandingRMANTSPITR
∙PlanningandPreparingforTSPITR
∙PerformingBasicRMANTSPITR
∙PerformingCustomizedRMANTSPITRwithanRMAN-ManagedAuxiliaryInstance
∙PerformingRMANTSPITRUsingYourOwnAuxiliaryInstance
∙TroubleshootingRMANTSPITR
UnderstandingRMANTSPITR
InordertouseTSPITReffectively,youneedtounderstandwhatproblemsitcansolveforyou,whatthemajorelementsusedinTSPITRare,whatRMANdoesduringTSPITR,andlimitationsonwhenandhowitcanbeapplied.
RMANTSPITRConcepts
Figure 10-1illustratesthecontextwithinwhichTSPITRtakesplace,andageneraloutlineoftheprocess.
Figure10-1TablespacePoint-in-TimeRecovery(TSPITR)Architecture
Textdescriptionoftheillustrationbradv032.gif
Thefigurecontainsthefollowingentities:
∙Thetargetinstance,containingthetablespacetoberecovered
∙TheRecoveryManagerclient
∙Thecontrolfileand(optional)recoverycatalog,usedfortheRMANrepositoryrecordsofbackupactivity
∙Archivedredologsandbackupsetsfromthetargetdatabase,whicharethesourceofthereconstructedtablespace.
∙Theauxiliaryinstance,anOracledatabaseinstanceusedintherecoveryprocesstoperformtheactualworkofrecovery.
TherearefourotherimportanttermsrelatedtoTSPITR,whichwillbeusedintherestofthisdiscussion:
∙Thetargettime,thepointintimeorSCNthatthetablespacewillbeleftatafterTSPITR
∙Therecoveryset,whichconsistsofthedatafilescontainingthetablespacestoberecovered;
∙Theauxiliaryset,whichincludesdatafilesrequiredforTSPITRoftherecoverysetwhicharenotthemselvespartoftherecoveryset.Theauxiliarysettypicallyincludes:
∙AcopyoftheSYSTEMtablespace
∙Datafilescontainingrollbackorundosegmentsfromthetargetinstance
∙Insomecases,atemporarytablespace,usedduringtheexportofdatabaseobjectsfromtheauxiliaryinstance
Theauxiliaryinstancehasotherfilesassociatedwithit,suchasacontrolfile,parameterfile,andonlinelogs,buttheyarenotpartoftheauxiliaryset.
Theauxiliarydestination,anoptionallocationondiskwhichcanbeusedtostoreanyoftheauxiliarysetdatafiles,controlfilesandonlinelogsoftheauxiliaryinstanceduringTSPITR.FilesstoredherecanbedeletedafterTSPITRiscomplete.
Allofthesetermswillbereferencedthroughouttheremainderofthischapter.
HowTSPITRWorksWithanRMAN-ManagedAuxiliaryInstance
ToperformTSPITRoftherecoverysetusingRMANandanautomatedauxiliaryinstance,youcarryoutthepreparationsforTSPITRdescribedin"PlanningandPreparingforTSPITR",andthenissuetheRECOVERTABLESPACEcommand,specifying,ataminimum,thetablespacesoftherecoverysetandthetargettimeforthepoint-in-timerecovery,and,ifdesired,anauxiliarydestinationaswell.
RMANthencarriesoutthefollowingsteps:
1.Ifthereisnoconnectiontoanauxiliaryinstance,RMANcreatestheauxiliaryinstance,startsitupandconnectstoit.
2.Takesthetablespacestoberecoveredofflineinthetargetdatabase
3.Restoresabackupcontrolfilefromapointintimebeforethetargettimetotheauxiliaryinstance
4.Restoresthedatafilesfromtherecoverysetandtheauxiliarysettotheauxiliaryinstance.Filesarerestoredeitherinlocationsyouspecifyforeachfile,ortheoriginallocationofthefile(forrecoverysetfiles)orintheauxiliarydestination(forauxiliarysetfiles,ifyouusedtheAUXILIARYDESTINATIONargumentofRECOVERTABLESPACE)
5.Recoverstherestoreddatafilesintheauxiliaryinstancetothespecifiedtime
6.OpenstheauxiliarydatabasewiththeRESETLOGSoption
7.Exportsthedictionarymetadataaboutobjectsintherecoveredtablespacestothetargetdatabase
8.Shutsdowntheauxiliaryinstance
9.IssuesSWITCHcommandsonthetargetinstance,sothatthetargetdatabasecontrolfilenowpointstothedatafilesintherecoverysetthatwerejustrecoveredattheauxiliaryinstance.
10.Importsthedictionarymetadatafromtheauxiliaryinstancetothetargetinstance,allowingtherecoveredobjectstobeaccessed.
11.Deletesallauxiliarysetfiles.
AtthatpointtheTSPITRprocessiscomplete.Therecoverysetdatafilesarereturnedtotheircontentsatthespecifiedpointintime,andbelongtothetargetdatabase.
DecidingWhentoUseTSPITR
Likeatableimport,RMANTSPITRenablesyoutorecoveraconsistentdataset;however,thedatasetrecoveredincludesanentiretablespaceratherthanoneobject.
RMANTSPITRismostusefulforsituationssuchasthese:
∙RecoveringdatalostafteranerroneousTRUNCATETABLEstatement;
∙Recoveringfromlogicalcorruptionofatable;
∙UndoingtheeffectsofanincorrectbatchjoborotherDMLstatementthathasaffectedonlyasubsetofthedatabase;
∙Recoveringalogicalschematoapointdifferentfromtherestofthephysicaldatabase,whenmultipleschemasexistinseparatetablespacesofonephysicaldatabase.
Notethat,aswithdatabasepoint-in-timerecovery(DBPITR),youcannotperformTSPITRifyoudonothaveyourarchivedredologs.FordatabasesrunninginNOARCHIVELOGmode,youcannotperformTSPITR.
LimitationsofTSPITR
ThereareanumberofsituationswhichyoucannotresolvebyusingTSPITR.
∙Youcannotrecoverdroppedtablespaces.
∙Youcannotrecoverarenamedtablespacetoapointintimebeforeitwasrenamed.IfyoutrytoperformaTSPITRtoanSCNearlierthantherenameoperation,RMANcannotfindthenewtablespacenameintherepositoryasofthatearlierSCN(becausethetablespacedidnothavethatnameatthatSCN).
Inthissituation,youmustrecovertheentiredatabasetoapointintimebeforethetablespacewasrenamed.Thetablespacewillbefoundunderthenameithadatthatearliertime.
∙Youcannotrecovertableswithouttheirassociatedconstraints,orconstraintswithouttheassociatedtables.
∙YoucannotuseTSPITRtorecoveranyofthefollowing:
oReplicatedmastertables
oPartialtables(forexample,ifyouperformRMANTSPITRonpartitionedtablesandspreadpartitionsacrossmultipletablespaces,thenyoumustrecoveralltablespaceswhichincludepartitionsofthetable.)
oTableswithVARRAYcolumns,nestedtables,orexternalfiles
oSnapshotlogsandsnapshottables
oTablespacescontainingundoorrollbacksegments
oTablespacesthatcontainobjectsownedbySYS,includingrollbacksegments
TSPITRhassomeotherlimitations:
∙IfadatafilewasaddedafterthepointtowhichRMANisrecovering,anemptydatafilebythesamenamewillbeincludedinthetablespaceafterRMANTSPITR.
∙TSPITRwillnotrecoverqueryoptimizerstatisticsforrecoveredobjects.YoumustgathernewstatisticsaftertheTSPITR.
∙AssumethatyourunTSPITRonatablespace,andthenbringthetablespaceonlineattimet.Backupsofthetablespacecreatedbeforetimetarenolongerusableforrecoverywithacurrentcontrolfile.YoucannotrunTSPITRagainonthistablespacetorecoverittoanytimelessthanorequaltotimet,norcanyouusethecurrentcontrolfiletorecoverthedatabasetoanytimelessthanorequaltot.Therefore,youmustbackupthetablespaceassoonasTSPITRiscomplete.
LimitationsofTSPITRWithoutaRecoveryCatalog
IfyoudonotusearecoverycatalogwhenperformingTSPITR,thennotethefollowingspecialrestrictions:
∙TheundosegmentsatthetimeoftheTSPITRmustbepartoftheauxiliaryset.BecauseRMANhasnohistoricalrecordoftheundointhecontrolfile,RMANassumesthatthecurrentrollbackorundosegmentswerethesamesegmentspresentatthetimetowhichrecoveryisperformed.Iftheundosegmentshavechangedsincethattime,thenTSPITRwillfail.
∙TSPITRtoatimethatistoooldmaynotsucceedifOraclehasreusedthecontrolfilerecordsforneededbackups.(Inplanningyourdatabase,settheCONTROL_FILE_RECORD_KEEP_TIMEinitializationparametertoavaluelargeenoughtoensurethatcontrolfilerecordsneededforTSPITRarekept.)
∙Whennotusingarecoverycatalog,thecurrentcontrolfilehasnorecordoftheolderincarnationoftherecoveredtablespace.Thus,recoverywithacurrentcontrolfilethatinvolvesthistablespacecannolongeruseabackuptakenpriortotimet.Youcan,however,performincompleterecoveryofthewholedatabasetoanytimelessthanorequaltot,ifyoucanrestoreabackupcontrolfilefrombeforetimet.
PlanningandPreparingforTSPITR
ThereareseveralstepstobecarriedoutinpreparingforTSPITR:
∙ChoosingtheRightTargetTimeforTSPITR
∙DeterminingtheRecoverySet:
AnalyzingDataRelationships
∙IdentifyingandPreservingObjectsThatWillBeLostAfterTSPITR
ChoosingtheRightTargetTimeforTSPITR
ItisextremelyimportantthatyouchoosetherighttargettimeorSCNforyourTSPITR.Asnotedalready,onceyoubringatablespaceonlineafterTSPITR,youcannotuseanybackupfromatimeearlierthanthemomentyoubroughtthetablespaceonline.Inpractice,thismeansthatyoucannotmakeasecondattemptatTSPITRifyouchoosethewrongtargettimethefirsttime,unlessyouare
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- RMAN Tablespace PointinTime Recovery TSPITR
![提示](https://static.bdocx.com/images/bang_tan.gif)