Duplicating a Database with Recovery Manager.docx

上传人:b****5 文档编号:8837075 上传时间:2023-05-15 格式:DOCX 页数:28 大小:25.57KB
下载 相关 举报
Duplicating a Database with Recovery Manager.docx_第1页
第1页 / 共28页
Duplicating a Database with Recovery Manager.docx_第2页
第2页 / 共28页
Duplicating a Database with Recovery Manager.docx_第3页
第3页 / 共28页
Duplicating a Database with Recovery Manager.docx_第4页
第4页 / 共28页
Duplicating a Database with Recovery Manager.docx_第5页
第5页 / 共28页
Duplicating a Database with Recovery Manager.docx_第6页
第6页 / 共28页
Duplicating a Database with Recovery Manager.docx_第7页
第7页 / 共28页
Duplicating a Database with Recovery Manager.docx_第8页
第8页 / 共28页
Duplicating a Database with Recovery Manager.docx_第9页
第9页 / 共28页
Duplicating a Database with Recovery Manager.docx_第10页
第10页 / 共28页
Duplicating a Database with Recovery Manager.docx_第11页
第11页 / 共28页
Duplicating a Database with Recovery Manager.docx_第12页
第12页 / 共28页
Duplicating a Database with Recovery Manager.docx_第13页
第13页 / 共28页
Duplicating a Database with Recovery Manager.docx_第14页
第14页 / 共28页
Duplicating a Database with Recovery Manager.docx_第15页
第15页 / 共28页
Duplicating a Database with Recovery Manager.docx_第16页
第16页 / 共28页
Duplicating a Database with Recovery Manager.docx_第17页
第17页 / 共28页
Duplicating a Database with Recovery Manager.docx_第18页
第18页 / 共28页
Duplicating a Database with Recovery Manager.docx_第19页
第19页 / 共28页
Duplicating a Database with Recovery Manager.docx_第20页
第20页 / 共28页
亲,该文档总共28页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

Duplicating a Database with Recovery Manager.docx

《Duplicating a Database with Recovery Manager.docx》由会员分享,可在线阅读,更多相关《Duplicating a Database with Recovery Manager.docx(28页珍藏版)》请在冰点文库上搜索。

Duplicating a Database with Recovery Manager.docx

DuplicatingaDatabasewithRecoveryManager

DuplicatingaDatabasewithRecoveryManager

ThischapterdescribeshowtousetheDUPLICATEcommandtocreateaduplicatedatabasefortestingpurposes.Thischaptercontainsthesetopics:

∙CreatingaDuplicateDatabase:

Overview

∙GeneratingFilesfortheDuplicateDatabase

∙PreparingtheAuxiliaryInstanceforDuplication:

BasicSteps

∙CreatingaDuplicateDatabaseonaLocalorRemoteHost

∙DatabaseDuplicationExamples

SeeAlso:

OracleDataGuardConceptsandAdministrationtolearnhowtocreateastandbydatabasewiththeDUPLICATEcommand

CreatingaDuplicateDatabase:

Overview

YoucanusetheRMANDUPLICATEcommandtocreateaduplicatedatabasefromtargetdatabasebackupswhilestillretainingtheoriginaltargetdatabase.Theduplicatedatabasecanbeidenticaltotheoriginaldatabaseorcontainonlyasubsetoftheoriginaltablespaces.

Aduplicatedatabaseisacopyofatargetdatabasethatyoucanrunindependentlyforavarietyofpurposes.Forexample,youcanuseitto:

∙Testbackupandrecoveryprocedures

∙Exportdatasuchasatablethatwasinadvertentlydroppedfromtheproductiondatabase,andthenimportitbackintotheproductiondatabase

Forexample,youcanduplicatetheproductiondatabaseonhost1tohost2,andthenusetheduplicatedatabaseonhost2topracticerestoreandrecoveryscenarioswhiletheproductiondatabaseonhost1continuesasusual.

Aduplicatedatabaseisdistinctfromastandbydatabase,althoughbothtypesofdatabasesarecreatedwiththeDUPLICATEcommand.Astandbydatabaseisacopyoftheprimarydatabasethatyoucanupdatecontinuallyorperiodicallywitharchivedlogsfromtheprimarydatabase.Iftheprimarydatabaseisdamagedordestroyed,thenyoucanperformfailovertothestandbydatabaseandeffectivelytransformitintothenewprimarydatabase.Aduplicatedatabase,ontheotherhand,cannotbeusedinthisway:

itisnotintendedforfailoverscenariosanddoesnotsupportthevariousstandbyrecoveryandfailoveroptions.

SeeAlso:

OracleDataGuardConceptsandAdministrationtolearnhowtocreateastandbydatabasewiththeDUPLICATEcommand

HowRecoveryManagerDuplicatesaDatabase

Topreparefordatabaseduplication,youmustfirstcreateanauxiliaryinstanceasdescribedin"PreparingtheAuxiliaryInstanceforDuplication:

BasicSteps".Fortheduplicationtowork,youmustconnectRMANtoboththetarget(primary)databaseandanauxiliaryinstancestartedinNOMOUNTmode.

Youmusthaveatleastoneauxiliarychannelallocatedontheauxiliaryinstance.Theprincipalworkoftheduplicationisperformedbytheauxiliarychannel,whichstartsaserversessionontheduplicatehost.Thischannelthenrestoresthenecessarybackupsoftheprimarydatabase,usesthemtocreatetheduplicatedatabase,andinitiatesrecovery.

SolongasRMANisabletoconnecttotheprimaryandauxiliaryinstances,theRMANclientcanrunonanymachine.However,allbackupsandarchivedlogsusedforcreatingandrecoveringtheduplicatedatabasemustbeaccessiblebytheserversessionontheduplicatehost.Iftheduplicatehostisnotthesameastheprimaryhost,thenyoumustmakebackupsondiskontheprimaryhostavailabletotheduplicatehostwiththesamefullpathnameasintheprimarydatabase.Whenusingdiskbackups,youcanaccomplishthisgoalinanyofthefollowingways:

∙Manuallytransferthebackupsfromtheprimaryhosttotheremotehosttoanidenticalpath.

∙Manuallytransferthebackupsfromtheprimaryhosttotheremotehosttoanewpath,andthenruntheCATALOGcommandtoaddthesecopiestotheRMANrepository.

∙UseNFSorshareddisksandmakesurethatthesamepathisaccessibleintheremotehost.

Whenusingtapebackups,youmustmakethetapescontainingthebackupsaccessibletotheremotenode,eitherbyphysicallymovingthetapetotheremotehostorbymeansofanetworktapeserver.

Aspartoftheduplicatingoperation,RMANautomatesthefollowingsteps:

∙Createsacontrolfilefortheduplicatedatabase

∙Restoresthetargetdatafilestotheduplicatedatabaseandperformsincompleterecoverybyusingallavailableincrementalbackupsandarchivedlogs

∙Shutsdownandstartstheauxiliaryinstance(referto"Task4:

StarttheAuxiliaryInstance"forissuesrelatingtoclient-sideversusserver-sideinitializationparameterfiles)

∙OpenstheduplicatedatabasewiththeRESETLOGSoptionafterincompleterecoverytocreatetheonlineredologs(exceptwhenrunningDUPLICATE...FORSTANDBY,inwhichcaseRMANdoesnotopenthedatabase)

∙Generatesanew,uniqueDBIDfortheduplicatedatabase(exceptwhenyoucreateastandbydatabasewithDUPLICATE...FORSTANDBY,inwhichcaseRMANdoesnotcreateauniqueDBID)

Duringduplication,RMANmustperformincompleterecoverybecausetheonlineredologsinthetargetarenotbackedupandcannotbeappliedtotheduplicatedatabase.ThefarthestthatRMANcangoinrecoveryoftheduplicatedatabaseisthemostrecentredologarchivedbythetargetdatabase.

SeeAlso:

OracleDataGuardConceptsandAdministrationtolearnhowtocreateastandbydatabasewithRMAN

DatabaseDuplicationOptions

Whenduplicatingadatabase,youhavethefollowingoptions:

∙YoucanruntheDUPLICATEcommandwithorwithoutarecoverycatalog

∙Youcanskipread-onlytablespaceswiththeSKIPREADONLYclause.Read-onlytablespacesareincludedbydefault.Ifyouomitthem,thenyoucanaddthemlater.

∙YoucanexcludetablespacesfromtheduplicatedatabasewiththeSKIPTABLESPACEclause.YoucanexcludeanytablespaceexcepttheSYSTEMtablespaceortablespacescontainingrollbackorundosegments.

∙Youcancreatetheduplicatedatabaseinanewhost.Ifthedirectorystructureisthesameonthenewhost,thenyoucanspecifytheNOFILENAMECHECKoptionandreusethetargetdatafilefilenamesfortheduplicatedatafiles.

∙YoucanduplicateatargetdatabaseonatraditionalfilesystemtoanASMorOracleManagedFileslocation.

∙Youcanrecovertheduplicatedatabasetoapastpointintime,usingusetheSETUNTILcommandorDUPLICATE...UNTILcommand.Bydefault,theDUPLICATEcommandcreatestheduplicatedatabasebyusingthemostrecentbackupsofthetargetdatabaseandthenperformsrecoverytothemostrecentconsistentpointcontainedintheincrementalbackupsandarchivedlogs.

∙Youcanregistertheduplicatedatabaseinthesamerecoverycatalogasthetargetdatabase.ThisoptionispossiblebecauseRMANgivestheduplicatedatabaseanew,uniqueDBIDduringduplication.

Note:

Ifyoucopythetargetdatabasebymeansofoperatingsystemutilities,thentheDBIDofthecopieddatabaseremainsthesameastheoriginaldatabase.Toregisterthecopydatabaseinthesamerecoverycatalogwiththeoriginal,youmustchangetheDBIDwiththeDBNEWIDutility(refertoOracleDatabaseUtilities).

∙Insomecases,youcansettheduplicatedatabaseDB_NAMEdifferentlyfromthetargetdatabaseDB_NAME.Morespecifically,iftheduplicatedatabaseexistsinthesameOraclehomeasthetarget,thentheDB_NAMEinitializationparametermustbedifferent.IftheduplicatedatabaseisinadifferentOraclehomefromthetargetdatabase,thentheDB_NAMEsettingfortheduplicatedatabasemustbeuniqueamongdatabasesinitsOraclehome.Thisistruewhetherornottheduplicatedatabaseisonthesamehostasthetarget.

DuplicatingaDatabase:

PrerequisitesandRestrictions

RMANduplicationinvolvesanumberofprerequisites,restrictions,andcaveats.ReviewtherestrictionssectionoftheDUPLICATEcommandintheOracleDatabaseRecoveryManagerReferenceforacompletelist.

GeneratingFilesfortheDuplicateDatabase

Whenduplicatingadatabase,RMANcreatestherequireddatabasefiles.Thissectiondescribesthesestagesoffilecreation:

∙CreatingtheDuplicateControlFiles

∙CreatingtheDuplicateOnlineRedoLogs

∙RenamingDatafilesWhenDuplicatingaDatabase

CreatingtheDuplicateControlFiles

TheDUPLICATEcommandcreatesthecontrolfilesbyusingthenameslistedintheinitializationparameterfileoftheauxiliaryinstance.Whenchoosingnamesfortheduplicatedatabasecontrolfiles,makesurethatyousettheinitializationparametersettingscorrectlysothatyoudonotoverwritetheproductionfilesatthetargetdatabase.

CreatingtheDuplicateOnlineRedoLogs

Table 11-1liststheoptionsforcreatingthenamesoftheduplicateonlineredologs.Theoptionsappearintheorderofprecedence.

Table11-1OrderofPrecedenceforOnlineRedoLogFilenameCreation

Order

Method

Result

1

SpecifytheLOGFILEclauseofDUPLICATEcommand.

Createsonlineredologsasspecified.

2

SetLOG_FILE_NAME_CONVERTinitializationparameter.

Transformstargetfilenames,forexample,fromlog_*toduplog_*.Notethatyoucanspecifymultipleconversionpairs.

Thisparameterallowstheredologtoexistaslongasthesizematches,becauseitusestheREUSEparameterwhencreatingthelogs.

3

Dononeoftheprecedingsteps.

Makestheduplicatefilenamesthesameasthetargetfilenames.YoumustspecifytheNOFILENAMECHECKoptionwhenusingthismethodandtheduplicatedatabaseshouldbeinadifferenthost.

TheorderofprecedencedetermineshowRMANrenamestheonlineredologs.Forexample,ifyouspecifyboththeLOGFILEclauseandtheLOG_FILE_NAME_CONVERTparameter,thenRMANusestheLOGFILEclause.Ifyouspecifyneitherofthefirsttwooptions,thenRMANusestheoriginaltargetredologfilenamesfortheduplicatedatabasefiles.

Caution:

Ifthetargetandduplicatedatabasesareinthesamehost,thendonotusethenameofanonlineredologcurrentlyinusebythetargetdatabase.

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

当前位置:首页 > 人文社科 > 法律资料

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2