tuning rman performance

31
Home (https://docs.oracle.com/) / Database (https://docs.oracle.com/en/database/) / Oracle Database Online Documentation 11g Release 1 (11.1) (../../index.htm) / Database Administration (../../nav/portal_4.htm) Database Backup and Recovery User's Guide () () 21 () Tuning RMAN Performance This chapter contains the following sections: Purpose of RMAN Performance Tuning Basic Concepts of RMAN Performance Tuning Using V$ Views to Diagnose RMAN Performance Problems Tuning RMAN Backup Performance () () Purpose of RMAN Performance Tuning (//docs.oracle.com/en/) Welcome DAVID

Upload: bruced0812

Post on 09-Nov-2015

42 views

Category:

Documents


2 download

DESCRIPTION

Tuning Oracle RMAN performance

TRANSCRIPT

  • Home(https://docs.oracle.com/)/Database(https://docs.oracle.com/en/database/)/OracleDatabaseOnlineDocumentation11gRelease1(11.1)(../../index.htm)/DatabaseAdministration(../../nav/portal_4.htm)

    DatabaseBackupandRecoveryUser'sGuide

    ()

    ()

    21()TuningRMANPerformanceThischaptercontainsthefollowingsections:

    PurposeofRMANPerformanceTuning

    BasicConceptsofRMANPerformanceTuning

    UsingV$ViewstoDiagnoseRMANPerformanceProblems

    TuningRMANBackupPerformance

    ()

    ()PurposeofRMANPerformanceTuning

    (//docs.oracle.com/en/) WelcomeDAVID

  • AnRMANbackuporrestorejobcanbedividedintoseparatephasesorcomponents.TheslowestofthesephasesinanyRMANjobiscalledthebottleneck.ThepurposeofRMANtuningistoidentifythebottlenecksforagivenjobanduseRMANcommands,initializationparameters,oradjustmentstophysicalmediatoimproveperformance.

    ()

    ()BasicConceptsofRMANPerformanceTuningTuningRMANperformancerequiresadetailedunderstandingofhowRMANcreatesabackup.Asexplainedin"RMANChannels"(rcmarchi.htm#i1012864),theworkofabackupisperformedbyoneormorechannels.Achannel(glossary.htm#i432240)representsastreamofbytestoastoragedevice.

    Forthepurposesofillustration,youcanthinkofthebytestreamaspassingfromtheinputbuffersinmemorythroughtheCPUtotheoutputbuffers,andfromtheretothestoragedevice.Todirectabackuptotwotapedevices,youallocatetwotapechannelssothateachbytestreamgoestoadifferentdevice.

    Theworkofeachchannel,whetheroftypediskorSBT,issubdividedintothefollowingdistinctphases:

    ReadPhase

    AchannelreadsblocksfromdiskintoinputI/Obuffers.

    CopyPhase

    Achannelcopiesblocksfrominputbufferstooutputbuffersandperformsadditionalprocessingontheblocks.

    WritePhase

    Achannelwritestheblocksfromoutputbufferstostoragemedia.Thewritephasecantakeeitherofthefollowingmutuallyexclusiveforms,dependingonthetypeofbackupmedia:

    WritePhaseforSBT

  • 2. WritePhaseforDisk

    Figure211depictstwochannelsbackingupdatastoredonthreedisks.Eachchannelreadsthedataintotheinputbuffers,processesthedatawhilecopyingitfromtheinputtotheoutputbuffers,andthewritesthedatafromtheoutputbufferstodisk.

    ()Figure211PhasesofaMultichannelBackuptoDisk

    Descriptionof"Figure211PhasesofaMultichannelBackuptoDisk"(img_text/bradv042.htm)

    Figure212alsodepictstwochannelsbackingupdatastoredonthreedisks,butoneofthedisksismountedremotelyoverthenetwork.Eachchannelreadsthedataintotheinputbuffers,processesthedatawhilecopyingitfromtheinputtotheoutputbuffers,andthewritesthedatafromtheoutputbuffersto

  • tape.Channel1writesthedatatoalocallyattachedtapedrive,whereaschannel2sendsthedataoverthenetworktoaremotemediaserver.

    ()Figure212PhasesofaMultichannelBackuptoTape

    Descriptionof"Figure212PhasesofaMultichannelBackuptoTape"(img_text/bradv041.htm)

    Whenrestoringdata,achannelperformsthesestepsinreverseorderandreversesthereadingandwritingoperations.ThefollowingsectionsexplainRMANtuningconceptsintermsofabackup.

    ()

  • ()ReadPhaseThissectionexplainsfactorsthataffectperformancewhenanRMANchannelisreadingdatafromdisk:

    AllocationofInputDiskBuffers

    SynchronousandAsynchronousDiskI/O

    DiskI/OSlaves

    RATEChannelParameter

    ()

    ()AllocationofInputDiskBuffersDuringabackup,anRMANchannelreadstheblocksfromtheinputfilesintoI/Odiskbuffers.ThedatabasefilesonthedisksubsystemcanbemanagedbyeitherAutomaticStorageManagement(ASM)(glossary.htm#CHDBDJIJ)oranalternativevolumemanagerorfilesystem.TheconsiderationsforbackuptuningchangedependingonwhetheryoumanagedatabasefileswithASM.

    Theallocationoftheinputbuffersdependsonhowthefilesaremultiplexed.()()Backupmultiplexing(glossary.htm#i999499)isRMAN'sabilitytoreadanumberoffilesinabackupsimultaneouslyfromdifferentsourcesandthenwritethemtoasinglebackuppiece.Thelevelofmultiplexing(glossary.htm#CHDFBDDG),whichisthenumberofinputfilessimultaneouslyreadandthenwrittenintothesamebackuppiece(glossary.htm#i432114),isdeterminedbythealgorithmdescribedin"MultiplexedBackupSets"(rcmcncpt.htm#i1015964).Reviewthissectionbeforeproceeding.

    WhenanRMANchannelbacksupfilesfromdisk,itusestherulesdescribedinthefollowingtabletodeterminehowlargetomaketheinputdiskbuffers.

    ()()Table211DatafileReadBufferSizingAlgorithm

    LevelofMultiplexing InputDiskBufferSize

  • Lessthanorequalto4

    TheRMANchannelallocates16buffersofsize1MBsothatthetotalbuffersizeforalltheinputfilesis16MB.

    Greaterthan4butlessthanorequalto8

    TheRMANchannelallocatesavariablenumberofdiskbuffersofsize512KBsothatthetotalbuffersizeforalltheinputfilesislessthan16MB.

    Greaterthan8 TheRMANchannelallocates4diskbuffersof128KBforeachfile,sothatthetotalbuffersizeforeachinputfileis512KB.

    IntheexampleshowninFigure213,onechannelisbackingupfourdatafiles.MAXOPENFILES issetto4andFILESPERSET issetto4.Thus,thelevelofmultiplexingis4.So,thetotalsizeofthebuffersforeachdatafileis4MB.Thecombinedsizeofallthebuffersis16MB.

    ()Figure213DiskBufferAllocation

  • Descriptionof"Figure213DiskBufferAllocation"(img_text/bradv011.htm)

    IfachannelisbackingupfilesstoredinASM,thenthenumberofinputdiskbuffersequalsthenumberofphysicaldisksintheASMdiskgroup.Forexample,ifadatafileisstoredinanASMdiskgroupthatcontains16physicaldisks,thenthechannelallocates16inputbuffersforthedatafilebackup.

    Ifachannelisrestoringabackupfromdisk,then4buffersareallocated.Thesizeofthebuffersisdependentontheoperatingsystem.

    ()

    ()()SynchronousandAsynchronousDiskI/OWhenachannelreadsfromorwritestodisk,theI/OiseithersynchronousI/O(glossary.htm#CHDDCBGC)orasynchronousI/O(glossary.htm#CHDIIJAC).WhenthediskI/Oissynchronous,aserverprocesscanperformonlyonetaskatatime.WhenthediskI/Oisasynchronous,aserverprocesscanbeginanI/OandthenperformotherworkwhilewaitingfortheI/Otocomplete.RMANcanalsobeginmultipleI/Ooperationsbeforewaitingforthefirsttocomplete.

  • WhenreadingfromanASMdiskgroup(glossary.htm#CHDHIIBA),youshoulduseasynchronousdiskI/Oifpossible.Also,ifachannelreadsfromarawdevice(glossary.htm#CHDHBJAG)managedwithavolumemanager,thenasynchronousdiskI/Oalsoworkswell.SomeoperatingsystemssupportnativeasynchronousdiskI/O.Thedatabasetakesadvantageofthisfeatureifitisavailable.

    ()

    ()()DiskI/OSlavesOnoperatingsystemsthatdonotsupportnativeasynchronousI/O,thedatabasecansimulateitwithspecialI/Oslaveprocesses.TheseprocessesarededicatedtoperformingI/Oonbehalfofanotherprocess.

    YoucancontroldiskI/OslavesbysettingtheDBWR_IO_SLAVES initializationparameter,whichisnotdynamic.TheparameterspecifiesthenumberofI/Oserverprocessesusedbythedatabasewriterprocess(DBWR).Bydefault,thevalueis0andI/Oserverprocessesarenotused.IfasynchronousI/Oisdisabled,thenRMANallocatesfourbackupdiskI/OslavesforanynonzerovalueofDBWR_IO_SLAVES .

    WhenattemptingtogetsharedbuffersforI/Oslaves,thedatabasedoesthefollowing:

    IfLARGE_POOL_SIZE isset,andiftheDBWR_IO_SLAVES parameterissettoanonzerovalue,thenthedatabaseattemptstogetmemoryfromthelargepool.Ifthisvalueisnotlargeenough,thenanerrorisrecordedinthealertlog,thedatabasedoesnottrytogetbuffersfromthesharedpool,andasynchronousI/Oisnotused.

    IfLARGE_POOL_SIZE isnotsetorissettozero,thenthedatabaseattemptstogetmemoryfromthesharedpool.

    Ifthedatabasecannotgetenoughmemory,thenitobtainsI/ObuffermemoryfromthePGAandwritesamessagetothealert .log fileindicatingthatsynchronousI/Oisusedforthisbackup.

    Thememoryfromthelargepoolisusedformanyfeatures,includingthesharedserver,parallelquery,andRMANI/Oslavebuffers.ConfiguringthelargepoolpreventsRMANfromcompetingwithothersubsystemsforthesamememory.

  • Requestsforcontiguousmemoryallocationsfromthesharedpoolareusuallysmall(under5KB)insize.However,itispossiblethatarequestforalargecontiguousmemoryallocationcaneitherfailorrequiresignificantmemoryhousekeepingtoreleasetherequiredamountofcontiguousmemory.Althoughthesharedpoolmaybeunabletosatisfythismemoryrequest,thelargepoolisabletodoso.Thelargepooldoesnothavealeastrecentlyused(LRU)listthedatabasedoesnotattempttoagememoryoutofthelargepool.

    ()

    ()RATEChannelParameterIntheALLOCATE orCONFIGURECHANNEL commands,theRATE parameterspecifiesthebytes/secondthatarereadonachannel.YoucanusethisparametertosetanupperlimitforbytesreadsothatRMANdoesnotconsumeexcessivediskbandwidthanddegradeonlineperformance.Essentially,RATE servesasabackupthrottle.Forexample,ifyousetRATE1500K ,andifeachdiskdrivedelivers3MB/second,thenthechannelleavessomediskbandwidthavailabletotheonlinesystem.

    ()

    ()CopyPhaseInthisphase,achannelcopiesblocksfromtheinputtotheoutputbuffersandperformsadditionalprocessing.Forexample,ifachannelreadsdatafromdiskandbacksuptotape,thenthechannelcopiesthedatafromthediskbufferstotheoutputtapebuffers.

    Thecopyphaseinvolvesthefollowingtypesofprocessing:

    Validation

    Compression

    Encryption

    Whenperformingvalidation(glossary.htm#i433696)oftheblocks,RMANchecksthemforcorruption.ValidationisexplainedinChapter15,"ValidatingDatabaseFilesandBackups"(rcmvalid.htm#CHDBFAIF).Typically,thisprocessingisnotCPUintensive.

  • Whenperformingbinarycompression(glossary.htm#CHDEEEDG),RMANappliesacompressionalgorithmtothedatainbackupsets.BinarycompressioncanbeCPUintensive.YoucanchoosewhichcompressionalgorithmthatRMANusesforbackups.Bydefault,RMANusesBZIP2 ,whichhasaverygoodcompressionratio.ZLIB compression,whichrequiresaCOMPATIBLE settingof11.0.0orhigher,isveryfastbuthasalowercompressionratiothanotheralgorithms.Binarycompressionisexplainedin"MakingCompressedBackups"(rcmbckba.htm#i1034440).

    Whenperformingbackupencryption(glossary.htm#CHDJDIEJ),RMANencryptsbackupsetsbyusingoneofthealgorithmslisted()inV$RMAN_ENCRYPTION_ALGORITHMS .RMANoffersthreemodesofencryption:transparent,passwordprotected,anddualmode.Backupencryptionisexplainedin"EncryptingRMANBackups"(rcmbckad.htm#CEGEJABH).BackupencryptioncanbeCPUintensive.

    ()

    ()WritePhaseforSBTWhenbackinguptoSBT,RMANgivesthemediamanager(glossary.htm#i432922)astreamofbytesandassociatesauniquenamewiththisstream.Alldetailsofhowandwherethatstreamisstoredarehandledentirelybythemediamanager.Thus,abackuptotapeinvolvestheinteractionofbothRMANandthemediamanager.

    ()

    ()RMANComponentofWritePhaseforSBTTheRMANspecificfactorsaffectingtheSBTwritephaseareanalogoustothefactorsaffectingdiskreads.Inbothcases,thebufferallocation,slaveprocesses,andsynchronousorasynchronousI/Oaffectperformance.

    ()

    ()()AllocationofTapeBuffers

    IfyoubackuptoorrestorefromanSBT(glossary.htm#CHDCCBFI)device,thenbydefaultthedatabaseallocatesfourbuffersforeachchannelforthetapewriters(orreadsifrestoringdata).ThesizeofthetapeI/Obuffersisplatformdependent.YoucanchangethisvaluewiththePARMS andBLKSIZE parametersoftheALLOCATECHANNEL orCONFIGURECHANNEL command.

    ()Figure214AllocationofTapeBuffers

  • Descriptionof"Figure214AllocationofTapeBuffers"(img_text/bradv013.htm)

    ()

    ()TapeI/OSlaves

    RMANallocatesthetapebuffersintheSGAorthePGA,dependingonwhetherI/Oslavesareused.IfyousettheinitializationparameterBACKUP_TAPE_IO_SLAVES=true ,thenRMANallocatestapebuffersfromtheSGA.Tapedevicescanonlybeaccessedbyoneprocessatatime,soRMANstartsasmanyslavesasnecessaryforthenumberoftapedevices.IftheLARGE_POOL_SIZE initializationparameterisalsoset,thenRMANallocatesbuffersfromthelargepool.IfyousetBACKUP_TAPE_IO_SLAVES=false ,thenRMANallocatesthebuffersfromthePGA.

    IfyouuseI/Oslaves,thensettheLARGE_POOL_SIZE initializationparametertodedicateSGAmemorytoholdingtheselargememoryallocations.ThisparameterpreventsRMANI/ObuffersfromcompetingwiththelibrarycacheforSGAmemory.IfI/OslavesfortapeI/OwererequestedbutthereisnotenoughspaceintheSGAforthem,slavesarenotused,andamessageappearsinthealertlog.

    NotethatBACKUP_TAPE_IO_SLAVES specifieswhetherRMANusesslaveprocesses,notthenumberofslaveprocesses.Tapedevicescanonlybeaccessedbyoneprocessatatime,andRMANusesthenumberofslavesnecessaryforthenumberoftapedevices.

    ()

    ()()SynchronousandAsynchronousI/O

    WhenanSBTchannelreadsorwritesdatatotape,theI/Oisalwayssynchronous.FortapeI/O,eachchannelallocated(whethermanuallyorautomatically)correspondstoaserverprocess,calledhereachannelprocess.

  • ThefollowingfigureshowssynchronousI/Oinabackuptotape.

    ()Figure215SynchronousTapeI/O

    Descriptionof"Figure215SynchronousTapeI/O"(img_text/bradv015.htm)

    Thefollowingstepsoccur:

    Thechannelprocesscomposesatapebuffer.

    Thechannelprocessexecutesmediamanagercodethatprocessesthetapebufferandinternalizesitforfurtherprocessingandstoragebythemediamanager.

    Themediamanagercodereturnsamessagetotheserverprocessstatingthatithascompletedwriting.

    Thechannelprocesscaninitiateanewtask.

    ThefollowingfigureshowsasynchronousI/Oinatapebackup.AsynchronousI/Ototapeissimulatedbyusingtapeslaves.Inthiscase,eachallocatedchannelcorrespondstoaserverprocess,whichintheexplanationwhichfollowsisidentifiedasachannelprocess.Foreachchannelprocess,onetapeslaveisstarted(ormorethanone,inthecaseofmultiplecopies).

    ()Figure216AsynchronousTapeI/O

  • Descriptionof"Figure216AsynchronousTapeI/O"(img_text/bradv012.htm)

    Thefollowingstepsoccur:

    Achannelprocesswritesblockstoatapebuffer.

    Thechannelprocesssendsamessagetothetapeslaveprocesstoprocessthetapebuffer.Thetapeslaveprocessexecutesmediamanagercodethatprocessesthetapebufferandinternalizesitsothatthemediamanagercanprocessit.

    Whilethetapeslaveprocessiswriting,thechannelprocessisfreetoreaddatafromthedatafilesandpreparemoreoutputbuffers.

    Afterthetapeslavechannelreturnsfromthemediamanagercode,itrequestsanewtapebuffer,whichusuallyisready.Thuswaitingtimeforthechannelprocessisreduced,andthebackupiscompletedfaster.

    ()

    ()MediaManagerComponentofWritePhaseforSBTThefollowingfactorsaffectthespeedofthebackuptotape:

  • NetworkThroughput

    NativeTransferRate

    TapeCompression

    TapeStreaming

    PhysicalTapeBlockSize

    ()

    ()NetworkThroughput

    Ifthetapedeviceisremote,thenthemediamanagerneedstotransferdataoverthenetwork.Forexample,anadministrativedomaininOracleSecureBackupcancontainmultiplenetworkedclienthosts,mediaservers,andtapedevices.Ifthedatabaseisononehost,buttheoutputtapedriveisattachedtoadifferenthost,thenOracleSecureBackupmanagesthedatatransferoverthenetwork.Thenetworkthroughputistheupperlimitforbackupperformance.

    ()

    ()NativeTransferRate

    Thetapenativetransferrate(glossary.htm#CHDDDBEG)isthespeedofwritingtoatapewithoutcompression.Thisspeedrepresentstheupperlimitofthebackuprate.Theupperlimitofyourbackupperformanceshouldbetheaggregatetransferrateofallofyourtapedrives.Ifyourbackupisalreadyperformingatthatrate,andifitisnotusinganexcessiveamountofCPU,thenRMANperformancetuningwillnothelp.

    ()

    ()TapeCompression

    Theleveloftapecompressionisveryimportantforbackupperformance.Ifthetapehasgoodcompression,thenthesustainedbackuprateisfaster.Forexample,ifthecompressionratiois2:1andnativetransferrateofthetapedriveis6MB/s,thentheresultingbackupspeedis12MB/s.Inthiscase,RMANmustbeabletoreaddiskswithathroughputofmorethan12MB/sorthediskbecomesthebottleneckforthebackup.

  • Note:YoushouldnotusebothtapecompressionprovidedbythemediamanagerandbinarycompressionprovidedbyRMAN.Ifthemediamanagercompressionisefficient,thenitisusuallythebetterchoice.UsingRMANcompressedbackupsetscanbeaneffectivealternativetoreducebandwidthusedtomoveuncompressedbackupsetsoveranetworktothemediamanager,iftheCPUoverheadrequiredtocompressthedatainRMANisacceptable.

    ()

    ()TapeStreaming

    Tapestreamingduringwriteoperationshasamajorimpactontapebackupperformance.Almostalltapedrivescurrentlyonthemarketarefixedspeed,streamingtapedrives.Becausesuchdrivescanonlywritedataatonespeed,whentheyrunoutofdatatowritetotape,thetapemustslowdownandstop.Typically,whenthedrive'sbufferempties,thetapeismovingsoquicklythatitactuallyovershootstocontinuewriting,thedrivemustrewindthetapetolocatethepointwhereitstoppedwriting.

    ()

    ()PhysicalTapeBlockSize

    Thephysicaltapeblocksizecanaffectbackupperformance.Theblocksizeistheamountofdatawrittenbymediamanagementsoftwaretoatapeinonewriteoperation.Ingeneral,thelargerthetapeblocksize,thefasterthebackup.NotethatphysicaltapeblocksizeisnotcontrolledbyRMANortheOracledatabaseserver,butbymediamanagementsoftware.Seeyourmediamanagementsoftware'sdocumentationfordetails.

    ()

    ()WritePhaseforDiskTheprincipalfactoraffectingthewritephasefordiskisthebuffersize.Whentheoutputofthebackupresidesondisk,eachchannelallocates4outputbuffersof1MBeach.Thediskchannelwritestheblockstothedisksubsystem.Notethatthereadphasewhenrestoringfilesisjustlikethewritephasewhenbackingupfiles,excepttheblocksmoveintheoppositedirection.

  • IfRMANreadsfromadiskasynchronously,thenitwritestothediskasynchronously.Whenwritingtodisk,youcanmakeuseofdiskI/Oslavesjustaswhenreading.

    IfRMANisbackingupfilestoadiskbasedoutputdestinationstripedovermultipledisks,thenyoucanallocatemultiplechannels.Thenumberofchannelsislimitedonlytothenumberofdisksoverwhichthedestinationisstriped.ASMisoneexampleadestinationstripedovermultipledisks.

    ()

    ()UsingV$ViewstoDiagnoseRMANPerformanceProblemsTypically,youbeginthetuningprocessbyusingV$ viewstodeterminewhereRMANbackupandrestoreoperationsareencounteringproblems.

    ()

    ()MonitoringRMANJobProgresswithV$SESSION_LONGOPS()()You()canmonitortheprogressofbackupsandrestorejobsbyqueryingtheviewV$SESSION_LONGOPS .RMANusestwotypesofrows()inV$SESSION_LONGOPS :detailandaggregaterows.

    Detailrowsdescribethefilesbeingprocessedbyonejobstep,whileaggregaterowsdescribethefilesprocessedbyalljobstepsinanRMANcommand.Ajobstepisthecreationorrestoreofonebackupsetordatafilecopy.Detailrowsareupdatedwitheverybufferthatisreadorwrittenduringthebackupstep,sotheirgranularityofupdateissmall.Aggregaterowsareupdatedwheneachjobstepcompletes,sotheirgranularityofupdateislarge.

    Table212describesthecolumnsinV$SESSION_LONGOPS thataremostrelevantforRMAN.Typically,youwillviewthedetailrowsratherthantheaggregaterowstodeterminetheprogressofeachbackupset.

    ()()Table212ColumnsofV$SESSION_LONGOPSRelevantforRMAN

  • Column DescriptionforDetailRows

    SID TheserversessionIDcorrespondingtoanRMANchannel.

    SERIAL# Theserversessionserialnumber.Thisvaluechangeseachtimeaserversessionisreused.

    OPNAME Atextdescriptionoftherow.ExamplesofdetailsrowsincludeRMAN: datafile copy ,RMAN: full datafile backup ,andRMAN: full datafile restore .

    Note:RMAN: aggregate input andRMAN: aggregate output aretheonlyaggregaterows.

    CONTEXT Forbackupoutputrows,thisvalueis2 .Forallotherrowsexceptproxycopy(whichdoesnotupdatethiscolumn),thevalueis1 .

    SOFAR Themeaningofthiscolumndependsonthetypeofoperationdescribedbythisrow:

    Forimagecopies,thenumberofblocksthathavebeenread.

    Forbackupinputrows,thenumberofblocksthathavebeenreadfromthefilesbeingbackedup.

    Forbackupoutputrows,thenumberofblocksthathavebeenwrittentothebackuppiece.

    Forrestores,thenumberofblocksthathavebeenprocessedtothefilesthatarebeingrestoredinthisonejobstep.

    Forproxycopies,thenumberoffilesthathavebeencopied.

  • TOTALWORK Themeaningofthiscolumndependsonthetypeofoperationdescribedbythisrow:

    Forimagecopies,thetotalnumberofblocksinthefile.

    Forbackupinputrows,thetotalnumberofblockstobereadfromallfilesprocessedinthisjobstep.

    Forbackupoutputrows,thevalueis0 becauseRMANdoesnotknowhowmanyblocksthatitwillwriteintoanybackuppiece.

    Forrestores,thetotalnumberofblocksinallfilesrestoredinthisjobstep.

    Forproxycopies,thetotalnumberoffilestobecopiedinthisjobstep.

    Eachserversessionperformingabackuporrestorejobreportsitsprogresscomparedtothetotalworkrequiredforajobstep.Forexample,ifyourestorethedatabasewithtwochannels,andeachchannelhastwobackupsetstorestore(atotaloffoursets),theneachserversessionreportsitsprogressthroughasinglebackupset.Whenasetiscompletelyrestored,RMANbeginsreportingprogressonthenextsettorestore.

    ()TomonitorRMANjobprogress:

    BeforestartingtheRMANjob,createascriptfile(called,forthisexample,longops )containingthefollowingSQLstatement:

  • SELECTSID,SERIAL#,CONTEXT,SOFAR,TOTALWORK,

    ROUND(SOFAR/TOTALWORK*100,2)"%_COMPLETE"

    FROMV$SESSION_LONGOPS

    WHEREOPNAMELIKE'RMAN%'

    ANDOPNAMENOTLIKE'%aggregate%'

    ANDTOTALWORK!=0

    ANDSOFARTOTALWORK

    StartRMANandconnecttothetargetdatabaseandrecoverycatalog(ifused).

    StartanRMANjob.Forexample,enter:

    RMAN>RESTOREDATABASE

    WhiletheRMANjobisrunning,startSQL*Plusandconnecttothetargetdatabase,andexecutethelongops scripttochecktheprogressoftheRMANjob.IfyourepeatthequerywhiletheRMANjobprogresses,thenyouseeoutputsuchasthefollowing:

  • SQL>@longops

    SIDSERIAL#CONTEXTSOFARTOTALWORK%_COMPLETE

    8191103773661728.34

    SQL>@longops

    SIDSERIAL#CONTEXTSOFARTOTALWORK%COMPLETE

    8191215133661758.75

    SQL>@longops

    SIDSERIAL#CONTEXTSOFARTOTALWORK%COMPLETE

    8191296413661780.95

    SQL>@longops

    SIDSERIAL#CONTEXTSOFARTOTALWORK%COMPLETE

    8191358493661797.9

    SQL>@longops

    norowsselected

    Ifyourunthelongops scriptatintervalsoftwominutesormoreandthe%_COMPLETE columndoesnotincrease,thenRMANisencounteringaproblem.Referto"MonitoringRMANInteractionwiththeMediaManager"(rcmtroub.htm#i1008347)toobtainmoreinformation.

    Ifyoufrequentlymonitortheexecutionoflongrunningtasks,thenyoucouldcreateashellscriptorbatchfileunderyourhostoperatingsystemthatrunsSQL*Plustoexecutethisqueryrepeatedly.

    ()

    ()IdentifyingBottleneckswithV$BACKUP_SYNC_IOandV$BACKUP_ASYNC_IO

  • Youcanuse()theV$BACKUP_SYNC_IO ()andV$BACKUP_ASYNC_IO viewstodeterminethesourceofbackuporrestorebottlenecksandtoseedetailedprogressofbackupjobs.

    V$BACKUP_SYNC_IO containsrowswhentheI/Oissynchronoustotheprocess(orthreadonsomeplatforms)performingthebackup.V$BACKUP_ASYNC_IO containsrowswhentheI/Oisasynchronous.AsynchronousI/OisobtainedeitherwithI/Oprocessesorbecauseitissupportedbytheunderlyingoperatingsystem.

    Theresultsofabackuporrestorejobremaininmemoryuntilthedatabaseinstanceshutsdown.Thus,youcanquerytheviewsafterthejobcompletes.

    ()TodeterminewhetherthetapeisstreamingwhentheI/Oissynchronous:

    StartSQL*Plusandconnecttothetargetdatabase.

    QuerytheEFFECTIVE_BYTES_PER_SECOND columnintheV$BACKUP_SYNC_IO orV$BACKUP_ASYNC_IO view.

    IfEFFECTIVE_BYTES_PER_SECOND islessthantherawcapacityofthehardware,thenthetapeisnotstreaming.IfEFFECTIVE_BYTES_PER_SECOND isgreaterthantherawcapacityofthehardware,thetapemayormaynotbestreaming.CompressionmaycausetheEFFECTIVE_BYTES_PER_SECOND tobegreaterthanthespeedofrealI/O.

    SeeAlso:OracleDatabaseReference(../../server.111/b28320/toc.htm)formoreinformationabouttheseviews

    ()

    ()IdentifyingBottleneckswithSynchronousI/O

  • TableofContents(toc.htm)OracleDatabaseBackupandRecoveryUser'sGuide(toc.htm)

    Preface(preface.htm#sthref2)What'sNewinBackupandRecovery?(wnbradv.htm#BRADV021)IntroductiontoBackupandRecovery(rcmintro.htm#BRADV8001)GettingStartedwithRMAN(rcmquick.htm#BRADV89346)RecoveryManagerArchitecture(rcmarchi.htm#BRADV001)StartingandInteractingwiththeRMANClient(rcmcnctg.htm#BRADV005)ConfiguringtheRMANEnvironment(rcmconfb.htm#BRADV8002)ConfiguringtheRMANEnvironment:AdvancedTopics(rcmconfa.htm#BRADV006)

    RMANBackupConcepts(rcmcncpt.htm#BRADV002)BackingUptheDatabase(rcmbckba.htm#BRADV8003)

    WithsynchronousI/O,itisdifficulttoidentifyspecificbottlenecksbecauseallsynchronousI/Oisabottlenecktotheprocess.TheonlywaytotunesynchronousI/Oistocomparetherate(inbytes/second)withthedevice'smaximumthroughputrate.Iftherateislowerthantheratethatthedevicespecifies,thenconsidertuningthisaspectofthebackupandrestoreprocess.

    ()TodeterminetherateofsynchronousI/O:

    StartSQL*Plusandconnecttothetargetdatabase.

    QuerytheDISCRETE_BYTES_PER_SECOND columnintheV$BACKUP_SYNC_IO viewtodisplaytheI/Orate.

    IfyouseedatainV$BACKUP_SYNC_IO ,thentheproblemisthatyouhavenotenabledasynchronousI/OoryouarenotusingdiskI/Oslaves.

    ()

    ()IdentifyingBottleneckswithAsynchronousI/O()()LongwaitsarethenumberoftimesthebackuporrestoreprocesstoldtheoperatingsystemtowaituntilanI/Owascomplete.()()ShortwaitsarethenumberoftimesthebackuporrestoreprocessmadeanoperatingsystemcalltopollforI/Ocompletioninanonblockingmode.ReadyindicatesthenumberoftimeswhenI/Owasalreadyreadyforuse,sotherewasnoneedtomakeanoperatingsystemcalltopollforI/Ocompletion.

    ()TodeterminetherateofasynchronousI/O:

    StartSQL*Plusandconnecttothetargetdatabase.

    QuerytheLONG_WAITS andIO_COUNT columnsintheV$BACKUP_SYNC_IO viewtodisplaytheI/Orate.

    ThesimplestwaytoidentifythebottleneckistofindthedatafilethathasthelargestratioforLONG_WAITS dividedbyIO_COUNT .Forexample,youcanusethefollowingquery:

  • BackingUptheDatabase(rcmbckba.htm#BRADV8003)BackingUptheDatabase:AdvancedTopics(rcmbckad.htm#BRADV007)ReportingonRMANOperations(rcmreprt.htm#BRADV8004)MaintainingRMANBackupsandRepositoryRecords(rcmmaint.htm#BRADV8007)

    ManagingaRecoveryCatalog(rcmcatdb.htm#BRADV8015)RMANDataRepairConcepts(rcmrvcon.htm#BRADV89703)DiagnosingandRepairingFailureswithDataRecoveryAdvisor(rcmrepai.htm#BRADV246)

    ValidatingDatabaseFilesandBackups(rcmvalid.htm#BRADV90063)PerformingFlashbackandDatabasePointinTimeRecovery(rcmflash.htm#BRADV80055)

    PerformingCompleteDatabaseRecovery(rcmcomre.htm#BRADV8005)PerformingBlockMediaRecovery(rcmblock.htm#BRADV89781)PerformingRMANRecovery:AdvancedScenarios(rcmadvre.htm#BRADV008)PerformingRMANTablespacePointinTimeRecovery(TSPITR)(rcmtspit.htm#BRADV009)

    TuningRMANPerformance(rcmtunin.htm#BRADV011)TroubleshootingRMANOperations(rcmtroub.htm#BRADV012)DuplicatingaDatabase(rcmdupdb.htm#BRADV010)CreatingTransportableTablespaceSets(rcmttbsb.htm#BRADV05141)TransportingDataAcrossPlatforms(rcmxplat.htm#BRADV89976)PerformingASMDataMigration(rcmasmmi.htm#BRADV12000)MakingUserManagedDatabaseBackups(osbackup.htm#BRADV016)PerformingUserManagedDatabaseFlashbackandRecovery(osrecvry.htm#BRADV017)

    PerformingUserManagedRecovery:AdvancedScenarios(osadvsce.htm#BRADV018)

    Glossary(glossary.htm#i433934)

    CategoriesHome(../../index.htm)BookList(../../nav/portal_booklist.htm)

    Download

    SELECTLONG_WAITS/IO_COUNT,FILENAME

    FROMV$BACKUP_ASYNC_IO

    WHERELONG_WAITS/IO_COUNT>0

    ORDERBYLONG_WAITS/IO_COUNTDESC

    Note:IfyouhavesynchronousI/Obutyouhaveset BACKUP_DISK_IO_SLAVES ,thentheI/Owillbedisplayedin V$BACKUP_ASYNC_IO .

    SeeAlso:OracleDatabaseReference(../../server.111/b28320/dynviews_part.htm#REFRN003)fordescriptionsoftheV$BACKUP_SYNC_IO and V$BACKUP_ASYNC_IO views

    ()

    ()TuningRMANBackupPerformance()Manyfactorscanaffectbackupperformance.Often,findingthesolutiontoaslowbackupisaprocessoftrialanderror.Toobtainthebestperformanceforabackup,followthestepsinthissectioninsequentialorder.

    Thissectioncontainsthefollowingsteps:

    Step1:RemovetheRATEParameterfromChannelSettings

    Step2:IfYouUseSynchronousDiskI/O,SetDBWR_IO_SLAVES

    Step3:IfYouFailtoAllocateSharedMemory,SetLARGE_POOL_SIZE

  • Step4:TunetheRead,Write,andCopyPhases

    ()

    ()Step1:RemovetheRATEParameterfromChannelSettingsAsexplainedin"RATEChannelParameter",theRATE parameteronachannelisintendedtoreduce,ratherthanincrease,backupthroughputsothatmorediskbandwidthisavailableforotherdatabaseoperations.Ifthebackupisnotstreamingtotape,thenmakesurethattheRATE parameterisnotset.

    ()ToremovetheRATEparameter:

    Examineyourbackupscript.

    Dooneofthefollowing:

    IfthebackupisinaRUN command,thenremovetheRATE parameter,ifitisspecified,fromtheALLOCATE command.Skiptheremainingsteps.

    2. IfthebackupisnotinaRUN command,thenstartRMAN,connecttothetargetdatabase,andproceedtothenextstep.

    ExecutetheSHOWALL commandtoshowthecurrentlyconfiguredsettings.

    RemovetheRATE parameter,ifitisset,fromtheCONFIGURECHANNEL command.

  • ()

    ()Step2:IfYouUseSynchronousDiskI/O,SetDBWR_IO_SLAVESAsexplainedin"SynchronousandAsynchronousDiskI/O",someoperatingsystemssupportnativeasynchronousI/O.IfandonlyifyourdiskdoesnotsupportasynchronousI/O,thensetDBWR_IO_SLAVES .AnynonzerovalueforDBWR_IO_SLAVES causesafixednumberofdiskI/Oslavestobeusedforbackupandrestore,whichsimulatesasynchronousI/O.

    ()ToenablediskI/Oslaves:

    StartSQL*Plusandconnecttothetargetdatabase.

    Shutdownthedatabase.

    SetDBWR_IO_SLAVES initializationparametertoanonzerovalue.

    BysettingDBWR_IO_SLAVES ,thedatabasewriterprocesseswilluseslaves.Thus,youmayneedtoincreasethevalueofthePROCESSES initializationparameter.

    Restartthedatabase.

    RestarttheRMANbackup.

    ()

    ()Step3:IfYouFailtoAllocateSharedMemory,SetLARGE_POOL_SIZESettheLARGE_POOL_SIZE initializationparameterifthedatabasereportsanerrorinthealertlogstatingthatitdoesnothaveenoughmemoryandthatitwillnotstartI/Oslaves.Themessageshouldresemblethefollowing:

  • ksfqxcre:failuretoallocatesharedmemorymeanssyncI/Owillbeusedwhenever

    asyncI/Otofilenotsupportednatively

    ThelargepoolisusedforRMANandforotherpurposes,soitstotalsizeshouldaccommodatealluses.ThisisespeciallytrueifDBWR_IO_SLAVES hasbeensetandtheDBWRprocessneedsbuffers.

    ()Tosetthelargepoolsize:

    StartSQL*Plusandconnecttothetargetdatabase.

    Optionally,()queryV$SGASTAT.POOL todeterminewhichpool(sharedpoolorlargepool)thememoryforanobjectresides.

    Setthe ()()LARGE_POOL_SIZE initializationparameterinthetargetdatabase.

    YoucanexecuteanALTERSYSTEMSET statementtosettheparameterdynamically.TheformulaforsettingLARGE_POOL_SIZE isasfollows:

    LARGE_POOL_SIZE=number_of_allocated_channels*

    (16MB+(4*size_of_tape_buffer))

    RestarttheRMANbackup.

    SeeAlso:OracleDatabaseConcepts(../../server.111/b28318/toc.htm)formoreinformationaboutthelargepool,andOracleDatabaseReference(../../server.111/b28320/toc.htm)forcompleteinformationaboutinitializationparameters

    ()

    ()Step4:TunetheRead,Write,andCopyPhases

  • Thereareseveraltasksyoucanperformtoidentifyandremedybottlenecksthataffectbackupperformance.

    ()

    ()UsingBackupValidationToDistinguishBetweenReadandWriteBottlenecksOnereliablewaytodeterminewhethertheoutputdeviceorinputdiskI/OisthebottleneckinagivenbackupjobistocomparethetimerequiredtorunbackuptaskswiththetimerequiredtorunBACKUPVALIDATE ofthesametasks.BACKUPVALIDATE ofabackupperformsthesamediskreadsasarealbackupbutperformsnoI/Otoanoutputdevice.

    ()Tocomparebackupandvalidationtimes:

    MakesureyourNLSenvironmentdateformatvariableissettoshowthetime.Forexample,settheNLSvariablesasfollows:

    setenvNLS_LANGAMERICAN_AMERICA.WE8DEC

    setenvNLS_DATE_FORMAT"MM/DD/YYYYHH24:MI:SS"

    EdityourbackupscripttousetheBACKUPVALIDATE commandinsteadoftheBACKUP command.

    Runthebackupscript.

    ExaminetheRMANoutputandcalculatethedifferencebetweenthetimesdisplayedintheStartingbackupat andFinishedbackupat messages.

    EditthebackupscripttousetheBACKUP commandinsteadoftheBACKUPVALIDATE command.

    Runthebackupscript.

    ExaminetheRMANoutputandcalculatethedifferencebetweenthetimesdisplayedintheStartingbackupat andFinishedbackupat messages.

    Comparethebackuptimesforthevalidationandrealbackup.

  • IfthetimefortheBACKUPVALIDATE totapeisaboutthesameasthetimeforarealbackuptotape,thenreadingfromdiskisthelikelybottleneck.See"TuningtheReadPhase".

    IfthetimefortheBACKUPVALIDATE totapeissignificantlylessthanthetimeforarealbackuptotape,thenwritingtotheoutputdeviceisthelikelybottleneck.See"TuningtheCopyandWritePhases".

    ()

    ()TuningtheReadPhaseRMANmaynotbeabletosenddatablockstotheoutputdevicefastenoughtokeepitoccupied.Forexample,duringanincrementalbackup(glossary.htm#i432786),RMANonlybacksupblockschangedsinceapreviousdatafilebackupaspartofthesamestrategy.Ifyoudonotturnonblockchangetracking(glossary.htm#CHDIFJHF),thenRMANmustscanwholedatafilesforchangedblocks,andfilloutputbuffersasitfindssuchblocks.Iffewblockschanged,andifRMANismakinganSBTbackup,thenRMANmaynotfilloutputbuffersfastenoughtokeepthetapedrivestreaming.

    Youcanimprovebackupperformancebyadjustingthelevelofmultiplexing(glossary.htm#CHDFBDDG),whichisnumberofinputfilessimultaneouslyreadandthenwrittenintothesameRMANbackuppiece.ThelevelofmultiplexingistheminimumoftheMAXOPENFILES settingonthechannelandthenumberofinputfilesplacedineachbackupset.Thefollowingtablemakesrecommendationsforadjustingthelevelofmultiplexing.

    ()()Table213AdjustingtheLevelofMultiplexing

    ASM StripedDisk Recommendation

    No Yes Increasethelevelofmultiplexing.Determinewhichistheminimum,MAXOPENFILES orthenumberoffilesineachbackupset,andthenincreasethisvalue.

  • Inthisway,youincreasetherateatwhichRMANfillstapebuffers,whichmakesitmorelikelythatbuffersaresenttothemediamanagerfastenoughtomaintainstreaming.

    No No IncreasetheMAXOPENFILESsettingonthechannel.

    Yes n/a SettheMAXOPENFILESparameteronthechannelto1or2.

    SeeAlso:

    "MultiplexedBackupSets"(rcmcncpt.htm#i1015964)tolearnhowtheMAXOPENFILES andFILESPERSET settingsaffectthelevelofmultiplexing

    "IncrementalBackups"(rcmcncpt.htm#i1007616)foraconceptualoverview

    ()

    ()TuningtheCopyandWritePhasesIfthereadphaseisperformingwell,thenthecopyorwritephasesareprobablythebottleneck.Inparticular,ifRMANissendingdatablockstothetapedrivefastenoughtosupportstreaming,butthetapeisnotstreaming,thentheSBTwritephaseisthebottleneck.Trytoimproveperformanceasfollows:

  • Ifthebackupisafullbackup(glossary.htm#i432658),thenconsiderusingincrementalbackups.

    Incrementallevel1backupswriteonlythechangedblocksfromdatafilestotape,sothatanybottleneckonwritingtotapehaslessimpactonyouroverallbackupstrategy.Inparticular,iftapedrivesarenotlocallyattachedtothenodeofthedatabasebeingbackedup,thenincrementalbackupscanbefaster.See"MakingandUpdatingIncrementalBackups"(rcmbckba.htm#i1034163).

    IfthebackupusestheBZIP2 compressionalgorithm,whichisthedefault,thenchangethecompressionalgorithmfromBZIP2 toZLIB .

    ZLIB islessCPUintensivethanBZIP2 .See"ConfiguringtheBackupCompressionAlgorithm"(rcmconfa.htm#CHDEHCEB).

    IfthedatabasehostusesmultipleCPUs,andifthebackupusesbinarycompression,thenincreasethenumberofchannels.

    Ifthebackupisencrypted,thenchangetheencryptionalgorithmtoAES128 .

    TheAES128 algorithmistheleastCPUintensive.See"ConfiguringtheBackupEncryptionAlgorithm"(rcmconfa.htm#CHDFAHHJ).

    IfRMANisbackinguptotape,thentrythefollowingadjustments:

    AdjustthesizeofthetapeI/Obuffers.

    UsethePARMS andBLKSIZE parametersoftheALLOCATECHANNEL orCONFIGURECHANNELcommandtosetthesize.ThesizeofthetapeI/Obuffersisplatformdependent.TheBLKSIZE settingoverridesthedefault.

    Adjustsettingsinthemediamanagementsoftware.

    Anumberofmediamanagersettings,includingthetapeblocksize,mayaffectbackupperformance.

  • IfRMANisbackingupfilestoASM,thenincreasethenumberofchannels.

    Forexample,ifRMANisbackingupthedatabasetoasinglediskgroupwith16physicaldisks,thenallocateorconfigureatleast4diskchannels,uptoamaximumof16.

    AboutOracle(http://www.oracle.com/corporate/index.html) ContactUs(http://www.oracle.com/us/corporate/contact/index.html) LegalNotices(http://www.oracle.com/us/legal/index.html) TermsofUse

    (http://www.oracle.com/us/legal/terms/index.html) YourPrivacyRights(http://www.oracle.com/us/legal/privacy/index.html)Copyright2015,Oracleand/oritsaffiliates.Allrightsreserved.