一般情况下数据库的DBA都会对controlfile进行多路复用,这样可以保证控制文件的安全性,对于数据库而言只要数据文件和redolog、archivelog不丢,数据都是可以恢复的,只是controlfile丢失,会比较麻烦。环境:control01.ctl、control02.ctl、control03.ctl1、3个controlfile中的一个或者两个丢失,关闭数据库后,从没有没丢失的那个controlfile进行拷贝。2、3个控制文件全丢失,可以进行重构控制文件,一般情况下我们会对控制文件进行二进制文件备份(alterdatabasebackupcontrolfiletotraceas'*****'备份成二进制文件)(alterdatabasebackupcontrolfileto'***'是直接备份控制文件)以下是备份出来的二进制文件的内容:有两种情况,1、完全恢复的时候用(红色)2、不完全恢复的时候用(紫红)--ThefollowingarecurrentSystem-scopeREDOLogArchivalrelated--parametersandcanbeincludedinthedatabaseinitializationfile.--LOG_ARCHIVE_DEST=''--LOG_ARCHIVE_DUPLEX_DEST=''--LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf--DB_UNIQUE_NAME=orcl--LOG_ARCHIVE_CONFIG='SEND,RECEIVE,NODG_CONFIG'--LOG_ARCHIVE_MAX_PROCESSES=2--STANDBY_FILE_MANAGEMENT=MANUAL--STANDBY_ARCHIVE_DEST=?/dbs/arch--FAL_CLIENT=''--FAL_SERVER=''--LOG_ARCHIVE_DEST_1='LOCATION=/u01/app/oracle/oradata/orcl/arch'--LOG_ARCHIVE_DEST_1='OPTIONALREOPEN=300NODELAY'--LOG_ARCHIVE_DEST_1='ARCHNOAFFIRMNOEXPEDITENOVERIFYSYNC'--LOG_ARCHIVE_DEST_1='REGISTERNOALTERNATENODEPENDENCY'--LOG_ARCHIVE_DEST_1='NOMAX_FAILURENOQUOTA_SIZENOQUOTA_USEDNODB_UNIQUE_NAME'--LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'--LOG_ARCHIVE_DEST_STATE_1=ENABLE--BelowaretwosetsofSQLstatements,eachofwhichcreatesanew--controlfileandusesittoopenthedatabase.Thefirstsetopens--thedatabasewiththeNORESETLOGSoptionandshouldbeusedonlyif--thecurrentversionsofallonlinelogsareavailable.Thesecond--setopensthedatabasewiththeRESETLOGSoptionandshouldbeused--ifonlinelogsareunavailable.--Theappropriatesetofstatementscanbecopiedfromthetraceinto--ascriptfile,editedasnecessary,andexecutedwhenthereisa--needtore-createthecontrolfile.--Set#1.NORESETLOGScase--Thefollowingcommandswillcreateanewcontrolfileanduseit--toopenthedatabase.--DatausedbyRecoveryManagerwillbelost.--Additionallogsmayberequiredformediarecoveryofoffline--Usethisonlyifthecurrentversionsofallonlinelogsare--available.--Aftermountingthecreatedcontrolfile,thefollowingSQL--statementwillplacethedatabaseintheappropriate--protectionmode:--ALTERDATABASESETSTANDBYDATABASETOMAXIMIZEPERFORMANCESTARTUPNOMOUNTCREATECONTROLFILEREUSEDATABASEORCLNORESETLOGSARCHIVELOGMAXLOGFILES16MAXLOGMEMBERS3MAXDATAFILES100MAXINSTANCES8MAXLOGHISTORY292LOGFILEGROUP1'/u01/app/oracle/oradata/orcl/redo01.log'SIZE50M,GROUP2'/u01/app/oracle/oradata/orcl/redo02.log'SIZE50M,GROUP3'/u01/app/oracle/oradata/orcl/redo03.log'SIZE50M--STANDBYLOGFILEDATAFILE'/u01/app/oracle/oradata/orcl/system01.dbf','/u01/app/oracle/oradata/orcl/undotbs01.dbf','/u01/app/oracle/oradata/orcl/sysaux01.dbf','/u01/app/oracle/oradata/orcl/users01.dbf','/u01/app/oracle/oradata/orcl/example01.dbf','/u01/app/oracle/oradata/orcl/app1_01.dbf','/u01/app/oracle/oradata/orcl/app02_01.dbf'CHARACTERSETAL32UTF8--Commandstore-createincarnationtable--BelowlognamesMUSTbechangedtoexistingfilenameson--disk.Anyonelogfilefromeachbranchcanbeusedto--re-createincarnationrecords.--ALTERDATABASEREGISTERLOGFILE'/u01/app/oracle/oradata/orcl/arch/1_1_562360180.dbf';--ALTERDATABASEREGISTERLOGFILE'/u01/app/oracle/oradata/orcl/arch/1_1_772185780.dbf';--Recoveryisrequiredifanyofthedatafilesarerestoredbackups,--orifthelastshutdownwasnotnormalorimmediate.RECOVERDATABASE--Alllogsneedarchivingandalogswitchisneeded.ALTERSYSTEMARCHIVELOGALL;--Databasecannowbeopenednormally.ALTERDATABASEOPEN;--Commandstoaddtempfilestotemporarytablespaces.--Onlinetempfileshavecompletespaceinformation.--Othertempfilesmayrequireadjustment.ALTERTABLESPACETEMPADDTEMPFILE'/u01/app/oracle/oradata/orcl/temp01.dbf'SIZE20971520REUSEAUTOEXTENDONNEXT655360MAXSIZE32767M;--Endoftempfileadditions.--Set#2.RESETLOGScase--Thefollowingcommandswillcreateanewcontrolfileanduseit--toopenthedatabase.--DatausedbyRecoveryManagerwillbelost.--Thecontentsofonlinelogswillbelostandallbackupswill--beinvalidated.Usethisonlyifonlinelogsaredamaged.--Aftermountingthecreatedcontrolfile,thefollowingSQL--statementwillplacethedatabaseintheappropriate--protectionmode:--ALTERDATABASESETSTANDBYDATABASETOMAXIMIZEPERFORMANCESTARTUPNOMOUNTCREATECONTROLFILEREUSEDATABASEORCLRESETLOGSARCHIVELOGMAXLOGFILES16MAXLOGMEMBERS3MAXDATAFILES100MAXINSTANCES8MAXLOGHISTORY292LOGFILEGROUP1'/u01/app/oracle/oradata/orcl/redo01.log'SIZE50M,GROUP2'/u01/app/oracle/oradata/orcl/redo02.log'SIZE50M,GROUP3'/u01/app/oracle/oradata/orcl/redo03.log'SIZE50M--STANDBYLOGFILEDATAFILE'/u01/app/oracle/oradata/orcl/system01.dbf','/u01/app/oracle/oradata/orcl/undotbs01.dbf','/u01/app/oracle/oradata/orcl/sysaux01.dbf','/u01/app/oracle/oradata/orcl/users01.dbf','/u01/app/oracle/oradata/orcl/example01.dbf','/u01/app/oracle/oradata/orcl/app1_01.dbf','/u01/app/oracle/oradata/orcl/app02_01.dbf'CHARACTERSETAL32UTF8--Commandstore-createincarnationtable--BelowlognamesMUSTbechangedtoexistingfilenameson--disk.Anyonelogfilefromeachbranchcanbeusedto--re-createincarnationrecords.--ALTERDATABASEREGISTERLOGFILE'/u01/app/oracle/oradata/orcl/arch/1_1_562360180.dbf';--ALTERDATABASEREGISTERLOGFILE'/u01/app/oracle/oradata/orcl/arch/1_1_772185780.dbf';--Recovery