|
Create Standby Database
ThisdocumentdescribeshowtocreateanOraclestandbydatabase(PCB4)fromaprimarydatabase(PCB5),whatshouldbebackeduponprimarydatabaseinordertoenablestandbydatabaserecovery,howtosyncthestandbydatabasewiththeprimarydatabaseofflinearchives,andhowtoactivatestandbydatabaseatlast.ItalsomentionsthedailysupportnotesonsupportingOraclestandbydatabase.
1.Actionstobeperformedonprimarydatabase
Hot-backupdatabasedatafilesontheprimarysystem.
Createstandbycontrolfileafterhot-backupdone
SVRMGR>ALTERDATABASECREATESTANDBYCONTROLFILEAS<Backupcontrolfile>;
Ensureallonlinearchivesarearchived
SVRMGR>ALTERSYSTEMARCHIVELOGCURRENT;
d)Backupthecurrentinit<SID>.oraofthedatabase.
2.CreateOracleServiceforStandbydatabase
Tocreateanewdatabaseasstandbydatabasewithsame<SID>astheprimarydatabase.WecouldcreateasmallonewithSYSTEMtablespaceinitially,usingOracleDatabaseAssistant.IthelpscreationoftheOracleNTservices.
UsethesameOracleversiononcreatingthedatabase
EnsureOraclelistenercouldservethenewOracleservice.
OnNTservice,changetheoracleStart<SID>?servicetomanuallymode,toavoiditautomaticallystart-upontheNTreboot.
ShutdowntheoracleStart<SID>?serviceoncetheabovestepsdone,andensurethe揙racleService<SID>?serviceisstillrunningon.
3.CreateDBdirectories
Plscreatethedirectoriesforholdingthedatabasedatafiles,assameasthesettingasonprimarydatabase.
Youshouldfollowthesamedrivesmapping
Plscreatethedirectoriesforlogs,redologs,pfile,bdump,udumpetc,similartotheprimarydatabasealso.
4.TransferfilestoStandbyServer
Transferallofthehot-backupdatafilestothestandbysystem.
Thefilelistis
backupstandbycontrolfile
Hot-backupdatafiles
Allofflinearchivesavailableonarchiveddirectory
backupinit<SID>.orafile
Thedestinationofthetransferredfilesshouldbespecifiedas:
Backupstandbycontrolfile:
Copiedtoallmembersofthecontrolfiles,theexactdirectorypathasspecifiedinbackup
init<SID>.orafile.
Hot-backupdatafiles:
Copiedtooriginaldatafileslocation,exactlythesamedirectorypathasonprimarysystem.
Allofflinearchives:
CopiedtotheDBarchivedirectory,exactlythesamedirectorypathasonprimarysystem.
Backupinit<SID>.orafile:
Copiedto$ORACLE_HOME/dbsortheIFILEparameterrefertolocation.
5.SyncStandbyDatabase
5.1TurnStandbyDBonrecoverymode
a.EnsureoracleService<SID>?servicestarted.
b.MounttheDB
SVRMGR>CONNECTINTERNAL/<PASSWD>
SVRMGR>STARTUPNOMOUNTPFILE=<path>/init<SID>.ora
SVRMGR>ALTERDATABASEMOUNTSTANDBYDATABASE;
SVRMGR>EXIT;
WecouldplacetheabovecommandsintoaSTARTUP.SQL?anditwillbecalled
byabatchcommandstartup_standby.bat?.SeeAppendixfordetails.
YoucouldplaceashortcutonthedesktoponNTstandbyserver,todepictthejob.
5.2Applyarchivedlogs
a.EnsurethestandbyDBinrecoverymode.
b.Applythelogs
SVRMGR>CONNECTINTERNAL/<PASSWD>
SVRMGR>SETAUTORECOVERYON;
SVRMGR>RECOVERSTANDBYDATABASE;
SVRMGR>EXIT;
WecouldplacetheabovecommandsintoaRECOVER.SQL?script,anditwillbecalled
byabatchrecover.bat?.SeeAppendixfordetails.
5.3ContinuousApplyarchivedlogsinrecoverymode
Ensurearegularjobtocopytheprimaryofflinearchivestothestandbyserver.
Plsseeaync_log.bat?fileforareference.SeeAppendixfordetails.
YoucoulduseWINCRONtoscheduleajobtocopydrivearchivesfromprimarysitetolocal
archivedirectorywith1hrinterval.
Performtheapplyarchivedlogsinrecoverymode?joboncenewarchivesarrival
Plsseesync_log.bat?fileforareference.SeeAppendixfordetails.
YoucoulduseWINCRONtoschedulethejobtoapplyarchiveswith1hrinterval.
Performcleanjobonobsoleteofflinearchivesonstandbysystem
Plsseearchive.cmd?fileforareference.SeeAppendixfordetails.
YoucoulduseWINCRONtoschedulethejobtocleanobsoletearchiveswith2daysretention.
5.4ActivateStandbyDatabase
Toactivatethestandbydatabase,copythelatestofflinearchivelogsfromprimaryserverovertothestandbysystem.
ApplythearchivestothestandbydatabaseasmentionedonSection3.2.
Activatethestandbydatabase
SVRMGR>ALTERDATABASEACTIVATESTANDBYDATABASE;
ShutdownthestandbyDBtoresetfileheadersandclearallbuffers.
SVRMGR>SHUTDOWNNORMAL;
Openthedatabase.YoucouldstartitbyNT揙racleStart<SID>?serviceandthenenabletheservicetostartautomaticallynow.
Youdonotneedcopyanyonlineredologsfromtheprimaryservertothestandbysystemonceitisactivated.
TakeaDBhot-backupafterthedatabaseopens.
5.5SpecialNotes
Anyphysicalchangesthatoccurontheprimarymustbeaccomplishedonthestandbyaswell.
Newdatafilesaddedonprimarydatabase,fileentriesareaddedtothestandbycontrolfileonly.
Ifthestandbydatabasecan'tfindthephysicaldatafile,standbyrecoverywillstopwithan
ORA-1157error.
UseALTERDATABASECREATEDATAFILE<PATH>as<PATH>;?torecreatethephysical
datafileorphysicallycopythemissingdatafilestothestandbysystem.
YoucanaddordroplogfilesontheprimarywithoutaffectingthestandbyDB.
Ifyoudorecreationcontrolfile?ontheprimaryserver,youmustalsorecreatethecontrolfileforthestandbydatabase.Shutdownthestandbydatabase,anduseacurrentbackupstandbycontrolfilefromprimaryserver.
Jimi
GIT
查看上一页
返回分类首页 返回96PC首页
查看下一页 |