Recovery Manager Maintenance Tasks文档格式.docx
《Recovery Manager Maintenance Tasks文档格式.docx》由会员分享,可在线阅读,更多相关《Recovery Manager Maintenance Tasks文档格式.docx(22页珍藏版)》请在冰豆网上搜索。
SeeAlso:
OracleDatabaseBackupandRecoveryAdvancedUser'
sGuideformorein-depthinformationaboutmanagingtheRMANrepositorywhenusingarecoverycatalog
ManagingtheRMANRepositoryWithoutaRecoveryCatalog
TheauthoritativeRMANrepositoryisalwaysstoredinthedatabasecontrolfile.Therepositorycontentscanalsobestoredinarecoverycatalogdatabase,asanadjuncttotheinformationstoredinthecontrolfile.
WhileRMANisdesignedtoworkwithoutarecoverycatalog,ifyouchoosenottousearecoverycatalog,youmustperformsomeadditionaladministrativetasks.
OracleDatabaseAdministrator'
sGuideforaconceptualoverviewofthecontrolfileandmoredetailsaboutmanagingcontrolfiles.
BackingUpandRestoringtheControlFile
Ifyouarenotusingarecoverycatalog,thecontrolfileisthesolestoragefortheRMANrepository,soitisdoublyimportantthatyouprotectit.Maintainalternatecontrolfilesthroughmultiplexingoroperatingsystemmirroring,andbackupthecontrolfilefrequently.
ConfigureCONTROLFILEAUTOBACKUPtoONtoensureextraprotectionforyourcontrolfile.
Solongasacontrolfileautobackupisavailable,RMANcanrestoretheSPFILEandbackupcontrolfile,andmountthedatabase.Afterthecontrolfileismounted,youcanrestoretheremainderofthedatabase.
Notethat,ifyourestoreacontrolfilefromautobackup,anypersistentsettingsyousetwiththeCONFIGUREcommandwillreverttothevaluestheyhadatthetimeofthecontrolfileautobackup.YoushouldreviewthesettingswiththeSHOWALLafterrestoringthecontrolfile.
∙"
BackingUpControlFileswithRMAN"
tolearnaboutmanualandautomaticcontrolfilebackups
∙OracleDatabaseBackupandRecoveryAdvancedUser'
sGuidetolearnhowtorestoreadatabasewhenthecurrentcontrolfileandrecoverycatalogareunavailable
MonitoringtheOverwritingofControlFileRecords
Whenyoudonotusearecoverycatalog,thecontrolfileisthesolesourceofinformationaboutRMANbackups.Asyoumakebackups,Oraclerecordsthesebackupsinthecontrolfile.TopreventthecontrolfilefromgrowingwithoutboundtoholdRMANrepositorydata,recordscanbere-usediftheyareolderthanathreshholdyouspecify.
TheCONTROL_FILE_RECORD_KEEP_TIMEinitializationparameterdeterminestheminimumageindaysofarecordbeforeitcanbeoverwritten:
CONTROL_FILE_RECORD_KEEP_TIME=integer
Forexample,iftheparametervalueis14,thenanyrecordaged14daysandolderisacandidateforreuse.Informationinanoverwrittenrecordislost.Theoldestrecordavailableforre-usewillbeusedfirst.
WhenOracleneedstoaddnewRMANrepositoryrecordstothecontrolfile,butnorecordisolderthanthethreshhold,Oracleattemptstoexpandthesizeofthecontrolfile.Iftheunderlyingoperatingsystempreventstheexpansionofthecontrolfile(duetoadiskfullcondition,forinstance),Oracleoverwritestheoldestrecordinthecontrolfileandlogsthisactioninthealertlog.
ThedefaultvalueofCONTROL_FILE_RECORD_KEEP_TIMEis7days.Ifyouarenotusingarecoverycatalog,thensettheCONTROL_FILE_RECORD_KEEP_TIMEvaluetoslightlylongerthantheoldestfilethatyouneedtokeep.Forexample,ifyoubackupthedatabaseonceaweek,thenyouneedtokeepeverybackupatleastaweek.SetCONTROL_FILE_RECORD_KEEP_TIMEtoavaluesuchas10or14.
Caution:
Regardlessofwhetheryouusearecoverycatalog,neveruseRMANwhenCONTROL_FILE_RECORD_KEEP_TIMEissetto0.Ifyoudo,thenyoumaylosebackuprecords.
ManagingtheOverwritingofControlFileRecords:
Scenario
Assumethefollowingscenario:
∙Youdonotusearecoverycatalog.
∙CONTROL_FILE_RECORD_KEEP_TIMEissetto14.
∙Allrecordscurrentlyinthecontrolfilearebetween1and13daysold.
∙Thecontrolfileisatthemaximumsizepermittedbytheoperatingsystem.
Youmakeabackupofthedatabase.BecauseOraclecannotexpandthecontrolfilebeyondtheoperatingsystemfilesizelimit,itbeginsoverwritingrecordsinthecontrolfile,startingwiththoserecordsaged13days.Foreachrecordthatitoverwrites,itrecordsanentryinthealert.logsimilartotheoneshownhere:
kccwnc:
followingcontrolfilerecordwrittenover:
RECID#72Recno72Recordtimestamp
07/28/0022:
15:
21
Thread=1Seq#=3460
Backupsetkey:
stamp=372031415,count=17
Lowscn:
0x0000.3af33f36
07/27/0021:
00:
08
Nextscn:
0x0000.3af3871b
07/27/0023:
23:
54
Resetlogsscnandtime
scn:
0x0000.00000001
08/05/9910:
46:
44
Blockcount=102400Blocksize=512
Toguardagainstthistypeofscenario,usearecoverycatalog.Ifyoucannotusearecoverycatalog,thendothefollowingifpossible:
∙Storethecontrolfileinafilesystemratherthanrawdisk,sothatitcanexpandasneeded.
∙Monitorthealert.logtomakesurethatOracleisnotoverwritingcontrolfilerecords.
sGuideforaconceptualoverviewofcontrolfilerecordsandhowtheyarere-used
InteractionofFlashRecoveryAreaandCONTROL_FILE_RECORD_KEEP_TIME
Wheacontrolfilerecordcontaininginformationaboutafilecreatedintheflashrecoveryareaisabouttobereused(becausetherecordisolderthanCONTROL_FILE_RECORD_KEEP_TIME),ifthefileiseligiblefordeletionthenthedatabasewillattempttodeletethefilefromtheflashrecoveryarea.Otherwise,Oraclewillexpandthesizeofthecontrolfilesectioncontainingtherecordforthisfile,loggingtheexpansioninthealertlogwithamessagelikethisexample:
tringtoexpandcontrolfilesectionnnnnforOracleManagedFiles
wherennnnistherecordtypenumber.
IfOracleisunabletoexpandthecontrolfilesection,becausethecontrolfileisatthemaximumsizesupportedunderthehostoperatingsystem,youwillseethiswarninginthealertlog:
WARNING:
OracleManagedFilefilenameisunknowntocontrolfile.Thisisthe
resultoflimitationincontrolfilesizethatcouldnotkeepallrecoveryarea
files.
Thismeansthatthecontrolfilecannotholdallflashrecoveryareafilesneededtosatisfytheconfiguredretentionpolicy.
Thereareseveralwaystoavoidoralleviatethisproblem:
∙Useacontrolfileoflargerblocksize,preferablyonewith32Kblocksize.Toachievethis,youmustsettheSYSTEMtablespaceblocksizetobegreaterthanorequaltothecontrolfileblocksize,andyouneedtore-createthecontrolfileafterchangingDB_BLOCK_SIZE.
∙Makethefilesintheflashrecoveryareaeligiblefordeletion,bybackingthemuptotertiarystoragesuchastapewiththeRMANcommandBACKUPRECOVERYAREA,orbychangingtheretentionpolicytoashorterrecoverywindoworlowerdegreeofredundancy.
MaintainingtheRMANRepositoryintheControlFile
RMANprovidesseveralcommandsthatenableyoutocheckanddeleterecordsofbackupsaswellasphysicallyremovebackups.
CrosscheckingBackups
Toensurethatdataaboutbackupsintherecoverycatalogorcontrolfileissynchronizedwithcorrespondingdataondiskorinthemediamanagementcatalog,performacrosscheck.TheCROSSCHECKcommandoperatesonlyonfilesthatarerecordedintherecoverycatalogorthecontrolfile.
Thissectioncontainsthesetopics:
∙AboutRMANCrosschecks
∙CrosscheckingSpecificBackupSetsandCopies
∙CrosscheckingBackupsofSpecificDatabaseFiles
AboutRMANCrosschecks
CrosschecksupdateoutdatedRMANrepositoryinformationaboutbackupswhoserepositoryrecordsdonotmatchtheirphysicalstatus.Forexample,ifauserremovesarchivedlogsfromdiskwithanoperatingsystemcommand,therepositorystillindicatesthatthelogsareondisk,wheninfacttheyarenot.
Ifthebackupisondisk,thentheCROSSCHECKcommanddetermineswhethertheheaderofthefileisvalid.Ifthebackupisontape,thenthecommandsimplychecksthatthebackupexists.ThepossiblestatusvaluesforbackupsareAVAILABLE,UNAVAILABLE,andEXPIRED.Viewthestatusofbackupsinoneofthefollowinglocations:
∙TheLISTcommandoutput
∙V$BACKUP_FILES
∙VariousrecoverycatalogviewssuchasRC_DATAFILE_COPY,RC_ARCHIVED_LOG,andsoforth
Note:
TheCROSSCHECKcommanddoesnotdeleteoperatingsystemfilesorremoverepositoryrecords.YoumustusetheDELETEcommandfortheseoperations.
∙
DeletingBackups"
tolearnhowtodeletefilesandupdaterepositoryrecords
∙OracleDatabaseRecoveryManagerReferenceforCROSSCHECKcommandsyntaxandadescriptionoftherepositorystatusvalues
CrosscheckingSpecificBackupSetsandCopies
YoucanusetheLISTcommandtoreportyourbackupsandthenusetheCROSSCHECKcommandtocheckthatthesefilesstillexist.TheDELETEEXPIREDcommanddeletesrepositoryrecordsforbackupsthatfailthecrosscheck.
Tocrosscheckspecifiedbackups:
1.IdentifythedesiredbackupsthatyouwanttocheckbyissuingaLISTcommand.Forexample,issue:
2.LISTBACKUP;
#listsallbackupsets,proxycopies,andimagecopies
3.
4.Checkwhetherthespecifiedbackups.Forexample,enter:
5.CROSSCHECKBACKUP;
#checksbackupsets,proxycopies,andimagecopies
6.CROSSCHECKCOPYOFDATABASE;