RMAN Backups Concepts.docx
- 文档编号:8599957
- 上传时间:2023-02-01
- 格式:DOCX
- 页数:49
- 大小:50.62KB
RMAN Backups Concepts.docx
《RMAN Backups Concepts.docx》由会员分享,可在线阅读,更多相关《RMAN Backups Concepts.docx(49页珍藏版)》请在冰豆网上搜索。
RMANBackupsConcepts
RMANBackupsConcepts
ThischapterdescribesthebasicconceptsinvolvedinbackingupthedatabasewiththeRecoveryManager(RMAN)utility.
Thischaptercontainsthesetopics:
∙AboutRMANChannels
∙AboutRMANBackups
∙MultipleCopiesofRMANBackups
∙RMANBackupOptions:
Naming,Sizing,andSpeed
∙RMANBackupTypes
∙ControlFileandServerParameterFileAutobackups
∙BackupRetentionPolicies
∙BackupOptimization
∙RestartableBackups
∙ManagingBackupWindowsandPerformance:
BACKUP...DURATION
∙RMANBackupErrors
∙TestsandIntegrityChecksforBackups
AboutRMANChannels
AnRMANchannelrepresentsonestreamofdatatoadevicetype,andcorrespondstooneserversession.MostbackupandrecoverycommandsinRMANareexecutedbyserversessions.AsillustratedinFigure 2-1,eachchannelestablishesaconnectionfromtheRMANclienttoatargetorauxiliarydatabaseinstancebystartingaserversessionontheinstance.Theserversessionperformsthebackup,restore,andrecovery.
Figure2-1ChannelAllocation
Textdescriptionoftheillustrationbradv030.gif
YoucanusetheCONFIGURECHANNELcommandtoconfigurechannelsforusewithdiskortapeinallRMANsessionsusingautomaticchannelallocation,orallocatechannelsmanuallywithinaRUNblock.RMANcomespreconfiguredwithoneDISKchannelthatyoucanuseforbackupstodisk.
Whenyourunacommandthatrequiresachannelwithoutallocatingachannelexplicitly,thenRMANautomaticallyallocatesthechannelswiththeoptionsspecifiedintheCONFIGUREcommand.FortheBACKUPcommand,RMANallocatesonlyasingletypeofchannel,suchasDISK.FortheRESTOREcommandandmaintenancecommands(forexample,DELETE),RMANallocatesallnecessarychannelsforthedevicetypesrequiredtoexecutethecommand.
Tospecifythedevicetypetouseforanoperationexplicitly,usetheALLOCATECHANNELcommand,whichmustbeusedwithinaRUNblock,orALLOCATECHANNELFORMANTAINANCE,whichmustbeexecutedattheRMANprompt.
InaRealApplicationClustersconfiguration,therearespecialconsiderationsregardingchannelallocationandbackups.SeeOracleRealApplicationClustersAdministrator'sGuideformoredetails.
HowandwhentheALLOCATECHANNELorCONFIGURECHANNELcommandscausethemediamanagertoallocateresourcesisvendor-specific.Somemediamanagersallocateresourceswhenyouissuethecommand;othersdonotallocateresourcesuntilyouopenafileforreadingorwriting.
SeeAlso:
OracleDatabaseRecoveryManagerReferenceforALLOCATECHANNELsyntaxandOracleDatabaseRecoveryManagerReferenceonALLOCATECHANNELFORMAINTENANCE
AutomaticandManualChannelAllocation
Youcanusetheautomaticchannelallocationfeaturetoconfigureasetofpersistent,automaticchannelsforuseinallRMANsessions.YoucanusethemanualchannelallocationfeaturetospecifychannelsforcommandsusedwithinaRUNblock.
RMANallocatesautomaticchannelsaccordingtothesettingsinthesecommands:
∙CONFIGUREDEVICETYPE...PARALLELISM
∙CONFIGUREDEFAULTDEVICETYPE
∙CONFIGURECHANNEL
Forexample,youcanissuethefollowingcommandsattheRMANprompt:
#sinceyoudonotmanuallyallocatechannels,RMANusespreconfiguredchannels
BACKUPDATAFILE3;
RESTORETABLESPACEusers;
Whenyourunacommandthatrequireschannels,andnochannelshavebeenallocatedusingtheALLOCATEcommand,RMANautomaticallyallocateschannelsaccordingtovaluessetwiththeCONFIGUREcommandinthefollowingcases:
∙YouusecommandssuchasBACKUP,RESTORE,orDELETEoutsideofaRUNblock.
∙YouusecommandswithinaRUNblockbutdonotallocateanychannelswithintheRUNblock.
YoucanoverrideautomaticchannelallocationsettingsbymanuallyallocatingchannelswithinaRUNblock.Manualchannelsalwaysoverrideautomaticchannels.Forexample,youoverrideautomaticchannelallocationwhenyouissueacommandasfollows:
RUN
{
ALLOCATECHANNELc1DEVICETYPEsbt;
BACKUPDATABASEPLUSARCHIVELOG;
}
RMANoptimizesautomaticchannelallocationbyleavingautomaticchannelsallocatedsolongaseachnewcommandrequiresexactlythesamechannelconfigurationasthepreviouscommand.Forexample,RMANcanusethesamepreallocatedchannelsforthefollowingseriesofcommands:
BACKUPDATAFILE1;
BACKUPCURRENTCONTROLFILE;
BACKUPARCHIVELOGALL;
IfyouissueacommandsuchasALLOCATEorCONFIGURE,thenRMANautomaticallyreleasesthepreallocatedchannels.
SeeAlso:
"ConfiguringAutomaticChannels"tolearnhowtoconfigureautomaticchannels
AutomaticChannelDeviceConfigurationandParallelism
TheCONFIGUREDEVICETYPE...PARALLELISMcommandspecifiesthenumberofautomaticchannelstoallocateforaspecifieddevicetype.Forexample,ifyouconfigureparallelismto3foradevicetype,thenRMANallocatesthreechannelsforthedevicetypewhenusingautomaticchannels.
YoucanchangeaparallelismsettingbyissuinganotherCONFIGUREDEVICETYPE...PARALLELISMcommand.ThisexampleconfiguresPARALLELISM2andthenchangesitto3:
CONFIGUREDEVICETYPEDISKPARALLELISM2;
CONFIGUREDEVICETYPEDISKPARALLELISM3;
TheparallelismsettingdefinesthenumberofchannelsforadevicethatRMANallocatesinparallel.Itdoesnothavetocorrespondtotheactualnumberofchannelsconfiguredforthedevice.Forexample,youcanmanuallyconfigurefourdifferentsbtchannelsandsetPARALLELISMforsbtto2,1,or10.
YoucanviewthedefaultsettingforparallelismbyrunningtheSHOWDEVICETYPEcommand.Forexample:
RMAN>SHOWDEVICETYPE;
RMANconfigurationparametersare:
CONFIGUREDEVICETYPEDISKPARALLELISM1BACKUPTYPETOBACKUPSET;#default
AsalwayswhentheSHOWcommandisusedtoviewthevalueofaparameter,RMANincludesa"#default"commentattheendofthelineiftheRMANdefaultvaluehasnotbeenoverridden.
ThefollowingexampleconfiguresthedefaultdevicetosbtandthendisplaystheresultingconfigurationusingtheSHOWDEVICETYPEcommand:
RMAN>CONFIGUREDEFAULTDEVICETYPETOsbt;
newRMANconfigurationparameters:
CONFIGUREDEFAULTDEVICETYPETO'sbt';
newRMANconfigurationparametersaresuccessfullystored
RMAN>SHOWDEVICETYPE;
RMANconfigurationparametersare:
CONFIGUREDEVICETYPESBTPARALLELISM1;#default
CONFIGUREDEVICETYPEDISKPARALLELISM1BACKUPTYPETOBACKUPSET;#
default
SeeAlso:
"ConfiguringaGenericAutomaticChannelforaDeviceType"
AutomaticChannelDefaultDeviceTypes
RuntheCONFIGUREDEFAULTDEVICETYPEcommandtospecifyadefaultdevicetypeforautomaticchannels.Forexample,youmaymakebackupstotapemostofthetimeandonlyoccasionallymakeabackuptodisk.Inthiscase,configurechannelsfordiskandtapedevices,butmakesbtthedefaultdevicetype:
CONFIGUREDEVICETYPEDISKPARALLELISM1;#configuredevicedisk
CONFIGUREDEVICETYPEsbtPARALLELISM2;#configuredevicesbt
CONFIGUREDEFAULTDEVICETYPETOsbt;
Now,RMANwill,bydefault,usesbtchannelsforbackups.Forexample,ifyourunthefollowingcommand:
BACKUPTABLESPACEusers;
RMANonlyallocateschannelsoftypesbtduringthebackupbecausesbtisthedefaultdevice.
Youcanoverridethedefaultdeviceforbackupsbyspecifyingadifferentdeviceonthecommand.Forexample:
BACKUPDEVICETYPEsbtDATABASE;
IfthedefaultdevicetypeisDISK,thentheprecedingcommandoverridesthisdefaultandusesthesbtchannelconfiguration.Notethatthiscommandfailsunlessyouhaveconfiguredthesbtdeviceorconfiguredsbtchannels.
Whenrestoringfiles,RMANallocatesallautomaticchannelsaccordingtothesettingsconfiguredforeachdevicetype.Thedefaultdevicetypeconfigurationisirrelevant.Forexample,ifyouconfigurePARALLELISMto3forthedefaultsbtdeviceandPARALLELISMto2forDISK,thenRMANautomaticallyallocatesthreesbtchannelsandtwoDISKchannelsduringtherestore.
AutomaticChannelNamingConventions
RMANusesthefollowingconventionforchannelnaming:
ORA_devicetype_n,wheredevicetypereferstotheuser'sdevicetype(suchasDISKorsbt_tape)andnreferstothechannelnumber.
Note:
Thesbtandsbt_tapedevicetypesaresynonymous,butRMANoutputalwaysdisplayssbt_tapewhethertheinputissbtorsbt_tape.
Forexample,RMANnamesthefirstDISKchannelORA_DISK_1,thesecondORA_DISK_2,andsoforth.RMANnamesthefirstsbtchannelORA_SBT_TAPE_1,thesecondORA_SBT_TAPE_2,andsoforth.Whenyouparallelizechannels,RMANalwaysallocateschannelsinnumericalorder,startingwith1andendingwiththeparallelismsetting(CONFIGUREDEVICETYPE...PARALLELISMn),asinthisexample:
ORA_SBT_TAPE_1
ORA_SBT_TAPE_2
ORA_SBT_TAPE_3
Automaticchannelallocationalsoappliestomaintenancecommands.IfRMANallocatesanautomaticmaintenancechannel,thenitusesthesamenamingconventionasanyotherautomaticallyallocatedchannel.IfyoumanuallyallocateamaintenancechannelusingALLOCATECHANNELFORMAINTENANCE,thenRMANusesthefollowingconventionforchannelnaming:
ORA_MAINT_devicetype_n,wheredevicetypereferstotheuser'sdevicetype(forexample,DISKorsbt)andnreferstothechannelnumber.Forexample,RMANusesthesenamesfortwomanuallyallocateddiskchannels:
ORA_MAINT_DISK_1
ORA_MAINT_DISK_2
NotethatifyouruntheCONFIGUREDEVICETYPEcommandtoconfigureadevicetypeanddonotrunCONFIGURECHANNELforthisdevicetype,thenRMANallocatesallchannelswithoutotherchannelcontroloptions.Forexample,assumethatyouconfigurethesbtdeviceandrunabackupasfollows:
CONFIGUREDEVICETYPEsbtPARALLELISM1;
BACKUPDEVICETYPEsbtDATABASE;
Ineffect,RMANdoesthefollowing:
RUN
{
ALLOCATECHANNELORA_SBT_TAPE_1DEVICETYPEsbt;
BACKUPDATABASE;
}
Channelnam
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- RMAN Backups Concepts
![提示](https://static.bdocx.com/images/bang_tan.gif)