Tuning Backup and Recovery.docx

上传人:b****3 文档编号:26875693 上传时间:2023-06-23 格式:DOCX 页数:21 大小:27.94KB
下载 相关 举报
Tuning Backup and Recovery.docx_第1页
第1页 / 共21页
Tuning Backup and Recovery.docx_第2页
第2页 / 共21页
Tuning Backup and Recovery.docx_第3页
第3页 / 共21页
Tuning Backup and Recovery.docx_第4页
第4页 / 共21页
Tuning Backup and Recovery.docx_第5页
第5页 / 共21页
点击查看更多>>
下载资源
资源描述

Tuning Backup and Recovery.docx

《Tuning Backup and Recovery.docx》由会员分享,可在线阅读,更多相关《Tuning Backup and Recovery.docx(21页珍藏版)》请在冰豆网上搜索。

Tuning Backup and Recovery.docx

TuningBackupandRecovery

TuningBackupandRecovery

TuningRMANperformanceismostlyamatterofmaximizingthespeedwithwhichRMANcreatesyourbackupsandrestoresfrombackups,ondiskandespeciallyontape.Asecondaryconcernislimitingtheeffectofbackupactivitiesondatabasethroughput.

Youmayalsoneedtotuneperformanceofthedatabaseduringinstancerecovery.

Thischaptercoverstheconceptsneededforperformancetuning,andthefeaturesinRMANthatcanhelpyou.Thediscussionisdividedintothefollowingsections:

∙TuningRecoveryManager:

Overview

∙FeaturesandOptionsUsedtoTuneRMANPerformance

∙TuningRMANBackupPerformance:

Examples

∙InstanceRecoveryPerformanceTuning:

FAST_START_MTTR_TARGET

TuningRecoveryManager:

Overview

RMANbackupandrestoreoperationshavethefollowingdistinctcomponents:

∙Readingorwritinginputdata

∙Processingdatabyvalidatingblocksandcopyingthemfromtheinputtotheoutputbuffers

TheslowestoftheseoperationsinanyRMANtaskiscalledthebottleneck.RMANtuninginvolvesidentifyingthebottlenecksforagiventaskandusingRMANcommands,initializationparametersettings,oradjustmentstophysicalmediatoimproveperformanceonthebackup.

ThekeytotuningRMANisunderstandinghowitperformsI/O.RMAN'sbackupandrestorejobsusetwotypesofI/Obuffers:

DISKandtertiarystorage(usuallytape).Whenperformingabackup,RMANreadsinputfilesusingdiskbuffersandwritestheoutputbackupfilebyusingeitherdiskortapebuffers.Restoreoperationsusediskortapebuffersforinput,dependingonwherethebackupisstored,anddiskbuffersforoutput.

TotuneRMANeffectively,youmustthoroughlyunderstandconceptssuchassynchronousandasynchronousI/O,diskandtapebuffers,andchannelarchitecture.Whenyouunderstandtheseconcepts,thenyoucanlearnhowtousefixedviewstomonitorbottlenecks,andusethetechniquesdescribedin"TuningRMANBackupPerformance:

Examples"tosolveproblems.

ThereareanumberofconceptsthataffectRMANperformanceandthatcanthereforeinfluenceyourstrategyforbackupperformancetuning:

∙I/OBufferAllocation

∙AllocationofTapeBuffers

∙SynchronousandAsynchronousI/O

∙FactorsAffectingBackupSpeedtoTape

∙UsingtheRATEParametertoControlDiskBandwidthUsage

I/OBufferAllocation

RMANI/Ousestwodifferenttypesofbuffers:

diskandtape.Thesebuffersaretypicallydifferentsizes.Theyareallocateddifferently,dependinguponthedevicetypeandtherolethebufferplaysinanRMANoperation.

AllocationforDiskBuffers

TounderstandhowRMANallocatesbufferstoreaddatafilesduringbackups,youmustunderstandhowRMANmultiplexingworks.

RMANmultiplexingisRMAN'sabilitytoreadanumberoffilesinabackupsimultaneouslyfromdifferentsourcestoimprovereadingperformance,andthenwritethemtoasinglebackuppiece.Thelevelofmultiplexingisthenumberoffilesreadsimultaneously.

Multiplexingisdescribedatgreaterlengthin"MultiplexedBackupSets".Thelevelofmultiplexingisdeterminedbythealgorithmdescribedin"AlgorithmforMultiplexedBackups".Reviewthissectionbeforeproceeding.

WhenRMANbacksupfromdisk,itusesthedatafiledescribedinthefollowingtabletodeterminehowlargetomakethebuffers.

Table14-1DatafileReadBufferSizingAlgorithm

LevelofMultiplexing

ResultingBufferSize

Lessthanorequalto4

RMANallocatesbuffersofsize1MBsothatthetotalbuffersizeforalltheinputfilesis16MB.

Greaterthan4butlessthanorequalto8

RMANallocatesdiskbuffersofsize512KBsothatthetotalbuffersizeforallthefilesislessthan16MB.

Greaterthan8

RMANallocatesafixed4diskbuffersof128KBforeachfile,sothatthetotalsizeis512KBforeachfile.

Thenumberofbuffersallocateddependsonthefollowingrules:

∙Whentheouputofthebackupresidesondisk,4buffersareallocated,theirsizebeingoperatingsystemdependent.

∙Iftheoperationisarestore,andthebackupresidesondisk,4buffersareallocated,theirsizebeingoperatingsystemdependent.

∙Whenrestoringabackup,foreachactivedatafile4buffersof128Kareallocated.

∙Whenimagecopiesareproduced,only4buffersintotalareallocated,eachofanoperatingsystemdependentsize.

AllocationofTapeBuffers

Ifyoubackuptoorrestorefromansbtdevice,thenbydefaultthedatabaseallocatesfourbuffersforeachchannelforthetapewriters(orreadsifdoingarestore).Thesizeofthesebuffersisplatformdependent,butistypically256K.ThisvaluecanbechangedusingtheALLOCATEorSENDcommandusingthePARMSandtheBLKSIZEoption.

Tocalculatethetotalsizeofbuffersusedduringabackuporrestore,multiplythebuffersizeby2,andthenmultiplythisproductbythenumberofchannels.

Forexample,assumethatyouusetwotapechannelsandeachbufferis256K.Inthiscase,thetotalsizeofbuffersusedduringabackupisasfollows:

256KB/bufferx4buffers/channelx2channels=2MB

RMANallocatesthetapebuffersintheSGAifI/Oslavesarebeingused,orthePGAotherwise.

IfyouuseI/Oslaves,thensettheLARGE_POOL_SIZEinitializationparametertosetasideSGAmemorydedicatedtoholdingtheselargememoryallocations.ThispreventsRMANI/ObuffersfromcompetingwiththelibrarycacheforSGAmemory.IfI/OslavesfortapeI/OwererequestedbutthereisnotenoughspaceintheSGAforthem,slavesarenotused,andamessageappearsinthealertlog.

SynchronousandAsynchronousI/O

WhenRMANreadsorwritesdata,theI/Oiseithersynchronousorasynchronous.WhentheI/Oissynchronous,aserverprocesscanperformonlyonetaskatatime.Whenitisasynchronous,aserverprocesscanbeginanI/OandthenperformotherworkwhilewaitingfortheI/Otocomplete.ItcanalsobeginmultipleI/Ooperationsbeforewaitingforthefirsttocomplete.

SomeoperatingsystemssupportnativeasynchronousdiskI/O.Thedatabasetakesadvantageofthisfeatureifitisavailable.OnoperatingsystemsthatdonotsupportnativeasynchronousI/O,thedatabasecansimulateitwithspecialI/OslaveprocessesthatarededicatedtoperformingI/Oonbehalfofanotherprocess.YoucancontroldiskI/OslavesbysettingtheDBWR_IO_SLAVESparametertoanonzerovalue.ThedatabaseallocatesfourbackupdiskI/OslavesforanynonzerovalueofDBWR_IO_SLAVES.

Bycontrast,tapeI/Oisalwayssynchronous.FortapeI/O,eachchannelallocated(whethermanuallyorbasedonaCONFIGUREcommand)correspondstoaserverprocess,calledhereachannelprocess.

SynchronousI/O:

Example

Figure 14-1showssynchronousI/Oinabackuptotape.

Figure14-1SynchronousI/O

Textdescriptionoftheillustrationbradv015.gif

Thefollowingstepsoccur:

1.Thechannelprocesscomposesatapebuffer.

2.Thechannelprocessexecutesmediamanagercodethatprocessesthetapebufferandinternalizesitforfurtherprocessingandstoragebythemediamanager.

3.Themediamanagercodereturnsamessagetotheserverprocessstatingthatithascompletedwriting.

4.Thechannelprocesscaninitiateanewtask.

Figure 14-2showsasynchronousI/Oinatapebackup.AsynchronousI/Ototapeissimulatedbyusingtapeslaves.Inthiscase,eachallocatedchannelcorrespondstoaserverprocess,whichintheexplanationwhichfollowsisidentifiedasachannelprocess.Foreachchannelprocess,onetapeslaveisstarted(ormorethanone,inthecaseofmultiplecopies).

Figure14-2AsynchronousI/O

Textdescriptionoftheillustrationbradv012.gif

Thefollowingstepsoccur:

1.Achannelprocesswritesblockstoatapebuffer.

2.Thechannelprocesssendsamessagetothetapeslaveprocesstoprocessthetapebuffer.Thetapeslaveprocessexecutesmediamanagercodethatprocessesthetapebufferandinternalizesitsothatthemediamanagercanprocessit.

3.Whilethetapeslaveprocessiswriting,thechannelprocessisfreetoreaddatafromthedatafilesandpreparemoreoutputbuffers.

4.Oncethetapeslavechannelreturnsfromthemediamanagercode,itrequestsanewtapebuffer,whichusuallyisready.Thuswaitingtimeforthechannelprocessisreduced,andthebackupiscompletedfaster.

FactorsAffectingBackupSpeedtoTape

Thefollowingfactorsaffectthespeedofthebackuptotape:

∙NativeTransferRate

∙TapeCompression

∙TapeStreaming

∙PhysicalTapeBlockSize

NativeTransferRate

Thetapenativetransferrateisthespeedofwritingtoatapewithoutcompression.Thisspeedrepresentstheupperlimitofthebackuprate.Theupperlimitofyourbackupperformanceshouldbetheaggregatetransferrateofallofyourtapedrives.Ifyourbackupisalreadyperformingatthatrate,andifitisnotusinganexcessiveamountofCPU,thenRMANperformancetuningwillnothelp.

TapeCompression

Theleveloftapecompressionisveryimportantforbackupperformance.Ifthetapehasgoodcompression,thenthesustainedbackuprateisfaster.Forexample,ifthecompressionratiois2:

1andnativetransferrateofthetapedriveis6MB/s,thentheresultingbackupspeedis12MB/s.Inthiscase,RMANmustbeabletoreaddiskswithathroughputofmorethan12MB/sorthediskbecomesthebottleneckforthebackup.

Note:

YoushouldnotusebothtapecompressionprovidedbythemediamanagerandbinarybackupsetcompressionasprovidedbyRMAN.Ifthemediamanagercompressionisefficient,thenitisusuallythebetterchoice.UsingRMANcompressedbackupsetscanbeaneffectivealternativeifyouneedtoreducebandwidthusedtomoveuncompressedbackupsetsoveranetworktothemediamanager,andiftheCPUoverheadrequiredtocompressthedatainRMANisacceptable.

SeeOracle

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 人文社科 > 设计艺术

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1