配置和使用恢復(fù)管理器_第1頁
配置和使用恢復(fù)管理器_第2頁
配置和使用恢復(fù)管理器_第3頁
配置和使用恢復(fù)管理器_第4頁
配置和使用恢復(fù)管理器_第5頁
已閱讀5頁,還剩49頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

14.配置和使用恢復(fù)管理器BackupandRecovery:ReviewThemajorbackupandrecovery–relatedtopicscoveredintheDatabaseAdministrationICourseare:TypesoffailurethatcanhappenStatement,session,instance,media,andsoonHowtoconfigureARCHIVELOGmodeHowtoautomatebackupsHowtodoincrementalbackupsHowtoperformandtuneinstancerecoveryServer

sessionChannelServer

sessionEnterpriseManagerRecoveryManagerComponentsTarget

databaseRecovery

catalogdatabaseAuxiliary

databaseDiskFlashrecovery

areaChannelChannelMMLOptionsRecovery

Manager

(RMAN)RecoveryManagerComponents

(notesonlyslide)StepsforConfiguringRMAN1. Determinetherepositorylocation:controlfileorrecoverycatalog.2. Definedatabaseandenvironmentvariables.3. StartRMANandconnecttothetargetand,optionally,therecoverycatalogdatabases.4. Configurepersistentsettings.RMANRepositoryDataStorage:

ComparisonofOptionsControlfile:SimpleradministrationDefaultRecoverycatalog:ReplicatescontrolfiledataHasroomformoredataCanservicemanytargetsCanstoreRMANscriptsMetadataBackupsetlistImagecopylist...RMANRepositoryDataStorage:

ComparisonofOptions

(notesonlyslide)BackupDestinationsBackupscanbewrittento:DiskdirectoryMediaManagementLibrary(tapedevice)Typicallyusedfordisasterrecovery,whendiskbackupsarelostFlashrecoveryareaThisisadiskareasetasideforbackupandrecoveryandflashbackdatabasepurposes.Youdefinethelocationandthesize.FilesareautomaticallynamedbyusingOracleManagedFiles.Filesareautomaticallyretainedanddeletedasnecessary.MediaManagementRecovery

ManagerMedia

management

serversoftwareMedia

management

libraryServer

session

(channel)OracleSecure

Backupwithbuilt-inMMLOrUsingaFlashRecoveryAreawithRMANYoucanconfigureRMANtousetheflashrecoveryarea.DatabaseareaRMANbackupprocessFlashrecoveryareaDB_RECOVERY_FILE_DEST='/u01/oracle/fra'DB_RECOVERY_FILE_DEST_SIZE=2GUsingaFlashRecoveryAreawithRMAN

(notesonlyslide)MonitoringtheFlashRecoveryArea

withEMFlashRecoveryAreaSpaceUsageConfiguretheretentionpolicytotheminimumvalueappropriateforyourdatabase.Backupthearchivelogfilesregularlyanddeletethefilesuponcompletionofthebackup.UsetheRMANREPORTOBSOLETEandDELETEOBSOLETEcommandstoremovebackupsandfilecopiesthatarenotrequired.V$FLASH_RECOVERY_AREA_USAGEYoucanqueryV$FLASH_RECOVERY_AREA_USAGEtoviewtheflashrecoveryareadiskspaceusage.SQL>SELECTfile_type,2percent_space_usedASused,3percent_space_reclaimableASreclaimable,4number_of_filesASnumber5FROMv$flash_recovery_area_usage;FILE_TYPEUSEDRECLAIMABLEFILESV$FLASH_RECOVERY_AREA_USAGEOutputfromtheV$FLASH_RECOVERY_AREA_USAGEqueryFILE_TYPEUSEDRECLAIMABLEFILESCONTROLFILE000ONLINELOG000ARCHIVELOG69.130593BACKUPPIECE000IMAGECOPY000FLASHBACKLOG1.77037BackingUptheFlashRecoveryAreaRMAN>BACKUPRECOVERYFILES;BenefitsofUsingaFlashRecoveryAreaUsingtheflashrecoveryareaforrecovery-relatedfiles:SimplifiesthelocationofdatabasebackupsAutomaticallymanagesthediskspaceallocatedforrecoveryfilesDoesnotrequirechangestoexistingscriptsPutsdatabasebackups,archivelogs,andcontrolfilebackupsintheflashrecoveryareaSettingParametersThatAffectRMANDatabaseinitializationparametersCONTROL_FILE_RECORD_KEEP_TIMEDB_RECOVERY_FILE_DESTandDB_RECOVERY_FILE_DEST_SIZE,ifusingtheflashrecoveryareaEnvironmentvariablesNLS_DATE_FORMATNLS_LANGSettingParametersthatAffectRMAN(notesonlyslide)RMANUsageConsiderationsResources:Sharedmemory,moreprocessesPrivilegesgiventousers:Database:SYSDBAOperatingsystem:AccesstodevicesRemoteoperations:SetupthepasswordfileEnsurethatthepasswordfileisbackedupConnectionTypeswithRMANTargetdatabaseRecoverycatalogDBAuxiliarydatabaseRecoveryManagerStartingRMANStartingRMANlocallyStartingRMANremotelyUNIX:$ORACLE_SID=DB01;exportORACLE_SID$rmantarget/rmantargetsys/password@DB01WindowsNT:C:\>setORACLE_SID=DB01C:\>rmantarget/AdditionalRMANCommand-LineArgumentsWritingRMANoutputtoalogfileExecutingacommandfilewhenRMANisinvokedEstablishingdatabaseconnectionsonRMANstartup$rmanTARGETsys/oracleCMDFILE=$HOME/scripts/my_rman_script.rcv$rmanTARGETsys/oracleLOG=$HOME/oradata/u03/rman.logAPPEND$rmanTARGETSYS/sys_pwd@orclCATALOGrman/rman@rcatConfiguringRMANSettingsbyUsingEMControlFileAutobackupsRMAN>CONFIGURECONTROLFILEAUTOBACKUPON;Bestpractice:Oraclerecommendsthatyouenablecontrolfileautobackup.ControlFileAutobackups(notesonlypage)Aretentionpolicydescribeswhichbackupswillbekeptandforhowlong.Therearetwotypesofretentionpolicies:Recoverywindow:Establishesaperiodoftimewithinwhichpoint-in-timerecoverymustbepossibleRedundancy:EstablishesafixednumberofbackupsthatmustbekeptThesepoliciesaremutuallyexclusiveandcanbesetwiththeCONFIGUREcommand.RetentionPoliciesNowSeven-dayretentionFile1File2File2needstobebackedup:RetentionPolicies(notesonlypage)ManagingPersistentSettingsUsetheSHOWcommandtolistcurrentsettings:UsetheCLEARcommandtoresetanypersistentsettingtoitsdefaultvalue:RMAN>SHOWCONTROLFILEAUTOBACKUPFORMAT;RMAN>SHOWEXCLUDE;RMAN>SHOWALL;RMAN>CONFIGUREBACKUPOPTIMIZATIONCLEAR;RMAN>CONFIGUREMAXSETSIZECLEAR;RMAN>CONFIGUREDEFAULTDEVICETYPECLEAR;ChannelAllocationChannel(DISK)BACKUPRESTORERECOVERServersessionServersessionTargetdatabaseChannel(SBT)RMANAutomaticandManualChannelAllocationAnautomaticchannelisonethatispreconfiguredandusedforsubsequentcommands.Tochangethedefaultdevicetypeforautomaticchannelallocation,use:Amanuallyallocatedchannelisonethatoverridestheautomaticchannelsetting.Thischanneloverridestheautomaticchannelforthisrunblock:RMAN>CONFIGUREDEFAULTDEVICETYPETOsbt;RMAN>RUN{2>ALLOCATECHANNELc1DEVICETYPEdisk;3>BACKUPDATAFILE'/u01/oradata/user01.dbf';4>}ChannelControlOptionsConfigureparallelism:Specifythemaximumbackuppiecesize:Formatthenameofgeneratedbackupfiles:RMAN>CONFIGUREDEVICETYPEDISKPARALLELISM3;RMAN>CONFIGURECHANNELDEVICETYPEDISK2>MAXPIECESIZE2G;RMAN>RUN{2>ALLOCATECHANNELd1DEVICETYPEDISK3>FORMAT'/disk1/backups/%U';4>BACKUPDATABASEPLUSARCHIVELOG;}SummaryInthislesson,youshouldhavelearnedhowto:UseeitherthecontrolfileorarecoverycatalogfortheRMANrepositoryChangeRMANdefaultsettingswithCONFIGUREUsetheflashrecoveryareaforRMANoperationsMonitortheflashrecoveryareabyusingv$viewsandEnterpriseManagerImplementrecoverywindowandredundancyretentionpoliciesImplementmanualandautomaticchannelallocationIssuingRecoveryManagerCommandsInteractiveclientEntercommandsatRMANprompt.Usewhenperforminganalysis,orwhenrunningreportsorstoredscripts.BatchmodeUsewithautomatedjobs.SpecifyacommandfilewhenstartingRMAN.Specifythelogfilenametocapturesessionlog.PipeinterfaceSpecifythePIPEcommand-lineargument.UsetocommunicatedatabetweensessionsorbetweenRMANandanexternalapplication.IssuingRecoveryManagerCommands(notesonlyslide)TypesofRMANCommandsRMANcommandsareofthefollowingtypes:Stand-alonecommand:IsexecutedindividuallyattheRMANpromptCannotappearassubcommandswithinRUNJobcommand:MustbewithinthebracesofaRUNcommandIsexecutedasagroupSomecommandscanbeexecutedaseitherastand-aloneorajobcommand.JobCommands:ExampleJobcommandsappearinsideaRUNcommandblock:RMAN>RUN{2>BACKUPASBACKUPSET3>FORMAT'/u01/db01/backup/%d_%s_%p'4>DURATION10:00MINIMIZELOAD5>(DATABASE);6>SQL'altersystemarchivelogcurrent';7>}RMANCommands:OverviewTargetdatabaseREPORTLISTCatalogdatabaseEnterpriseManagerRESTORERECOVERFLASHBACKSPFILEBACKUPControl

fileArchivedlogfilesRMANCatalogmaintenanceCROSSCHECKDELETE……EXPIREDCHANGEStored

scriptsRMANCommandOverview(notesonlyslide)BACKUPCommandRMAN>BACKUPASBACKUPSET2>FORMAT'/BACKUP/df_%d_%s_%p.bus'3>TABLESPACEhr_data;BackupsetDatafile1Datafile2Datafile3Datafile1Datafile2Datafile3TablespaceHR_DATACommands>BACKUPBlockC.T.Inc.UpdateLISTREPORTDELETEBackupConstraintsThedatabasemustbemountedoropen.Youcannotbackuponlineredologs.Only“clean”backupsareusableinNOARCHIVELOGmode.Only“current”datafilebackupsareusableinARCHIVELOGmode.ParallelizationofBackupSetsForperformance,allocatemultiplechannelsandassignfilestospecificchannels.Datafile4Datafile1Datafile5ChannelMMLBackuppiece1Backup

piece2Datafile2Datafile3Datafile9ChannelMMLDatafile6Datafile7Datafile8BackupPiece3ChannelMMLCompressedBackupsRMAN>BACKUPAS2>COMPRESSEDBACKUPSET3>DATABASE;RMAN>CONFIGUREDEVICETYPE2>DISKPARALLELISM23>BACKUPTYPETO4>COMPRESSEDBACKUPSET;CompressedbackupfilesDatabasefilesImageCopyCopyofdatafile3CopyofarchivedlogDatafile3ArchivedlogfileDatafile3ArchivedlogfileRMAN>BACKUPASCOPY2>DATAFILE'/ORADATA/users_01_db01.dbf'3>FORMAT'/BACKUP/users01.dbf';RMAN>BACKUPASCOPY4>ARCHIVELOGLIKE'arch_1060.arc'5>FORMAT'arch_1060.bak';TagsforBackupsandImageCopiesAtagisalogicalnameassignedtoabackupsetorimagecopy.month_full_backupweek_full_backupDatafile3Datafile4BackupsetDatafiles1,3Datafiles2,4BackupsetBACKUPCommandOptionsCheckforphysicalblockcorruptions.Scanforlogicalcorruptionsandphysicalcorruptions.Setathresholdonthenumberofdetectedcorruptionsallowedbeforeaborting.Validatethetargetinputfilesbeforeperformingabackupoperation.Duplexthebackupset.Overwriteanexistingbackupsetorimagecopy.Passcontrolofthedatatransferbetweenstoragedevicesandthedatafilesondisktothemediamanagementlayer.Encryptthebackupfiles.BackingUpArchivedRedoLogsOnlineredologfileswitchisautomatic.Archivedlogfailoverisperformed.Youcanspecifyarangeofarchivedredologstobackup.Backupsetsofarchivedredologfilescannotcontainanyothertypeoffile.RMAN>BACKUP2>FORMAT'/disk1/backup/ar_%t_%s_%p'3>ARCHIVELOGFROMSEQUENCE=2344>DELETEINPUT;BackingUpArchivedRedoLogs(notesonlyslide)WholeDatabaseBackupRMAN>BACKUPDATABASEPLUSARCHIVELOG;ArchivedlogfilecopiesSPFILEControl

fileDatafilecopiesRMANBackupTypesAfullbackupcontainsalluseddatafileblocks.Alevel0incrementalbackupisequivalenttoafullbackupthathasbeenmarkedaslevel0.Acumulativelevel1incrementalbackupcontainsonlyblocksmodifiedsincethe

lastlevel0incrementalbackup.Adifferentiallevel1incrementalbackupcontainsonlyblocksmodifiedsincethelastincrementalbackup.DifferentialincrementalbackupCumulativeincrementalbackupFull,or"level0incrementalbackup"DifferentialVersusCumulativeAdifferentialincrementalbackupcontainsallblockschangedsincethelastincrementalbackup.Acumulativeincrementalbackupcontainsallblockschangedsincethelastlevel0incrementalbackup.LvlDaySunMonTueWedThuFriSatSunLevel0Level0111c11001cBlockChangeTrackingThebackupprocesscanbestreamlinedbyenablingblockchangetracking,which:RecordschangedblocksinachangetrackingfileIsusedautomaticallybyRMAN,ifenabledOptimizesincrementalbackupsbyavoidingfulldatafilescansduringbackupListofchangedblocksRedogenerationRedolog101100101011000011101001011010101110011Changetracking

fileSGACTWRCommandsBACKUP> BlockC.T.Inc.UpdateLISTREPORTDELETEEnablingBlockChangeTrackingSQL>ALTERDATABASEENABLE2>BLOCKCHANGETRACKING3>USINGFILE'/mydir/rman_change_track.f'4>REUSE;IncrementallyUpdating

BackupsIncrementalbackupfilesRecovereddatafileImagecopyofdatafileImagecopyofdatafileupdatedtoamorerecentstateRMAN>RECOVERCOPYOF2>DATAFILE{n|'file_name'}3>WITHTAG'incr_upd_df1';CommandsBACKUPBlockC.T.> Inc.UpdateLISTREPORTDELETELISTCommandListbackupsetsandcopiesofdatafiles:Listbackupsetsandcopiesofanydatafileforaspecifiedtablespace:Listbackupsetsandcopiescontainingarchivelogsforaspecifiedrange:RMAN>LISTBACKUPOFDATAFILE2>"/db01/ORADATA/u03/users01.dbf";RMAN>LISTBACKUPOFDATABASE;RMAN>LISTCOPYOFTABLESPACE"SYSTEM";RMAN>LISTCOPYOFDATABASEARCHIVELOG2>FROMTIME='SYSDATE-7';CommandsBACKUPBlockC.T.Inc.Update>LISTREPORTDELETEREPORTCommandProducesadetailedanalysisoftherepositoryProducesreportstoanswer:Whatarethedatafilesinthedatabase?Whichfilesneedabackup?Whichbackupscanbedeleted?Whichfilesareunrecoverable?CommandsBACKUPBlockC.T.Inc.UpdateLIST>REPORTDELETEREPORTNEEDBACKUPCommandListsalldatafilesthatrequireabackupAssumesthatthemostrecentbackupisusedduringarestoreProvidesfouroptions:IncrementalDaysRedundancyRecoverywindowUsesthecurrentretentionpolicyconfigurationifnooptionsarespecifiedREPORTNEEDBACKUP:ExamplesFilesthatneedmorethanthreeincrementalbackupsforrecovery:Filesthathavenotbeenbackedupforthreedays:Backupneedediftherearenottwoormorebackupsalready:Backupneededtorecovertothree

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論