recover database using backup control file
recover database using backup control file
簡單說兩句:
要理解recoverdatabase using backup controlfile,先理解 recover database
也就是說,不加usingbackup controlfile的情況。
在 普通的recover database 或者 recover tablespace, recover datafile時, Oracle會以當前controlfile所紀錄的SCN為準,利用archivelog和 redo log的redo entry, 把相關的datafile 的 block恢復到“當前controlfile所紀錄的SCN”。而某些情況下,Oracle需要把資料恢復到比當 前controlfile所紀錄的SCN還要靠後的位置(比如說,controlfile是backupcontrolfile, 或者 controlfile是根據trace create的。),這時候,就需要用using backup controlfile. 恢復就不會受“當前controlfile所紀錄的SCN”的限制。
這時候的限制就來自於你的語句(untiltime , until scn),或者可用的archivelog(until cancel) ...
-------------------------------------------
首先這裡我們先介紹四個SCN概念。
1、系統檢查點scn
當一個檢查點動作完成後,Oracle就把系統檢查點的SCN儲存到控制檔案中。
select checkpoint_change# from v$database;
2,資料檔案檢查點scn
當一個檢查點動作完成後,Oracle就把每個資料檔案的scn單獨存放在控制檔案中。
select name,checkpoint_change# fromv$datafile;
3,啟動scn
Oracle把這個檢查點的scn儲存在每個資料檔案的檔案頭中,這個值稱為啟動scn,因為它用於在資料庫例項啟動時,
檢查是否需要執行資料庫恢復。
select name,checkpoint_change# fromv$datafile_header
4、終止scn
每個資料檔案的終止scn都儲存在控制檔案中。
select name,last_change# from v$datafile
以下條件需要使用usingbackup controlfile
1)、使用備份控制檔案
2)、重建resetlogs控制檔案,如果重建立noresetlogs不必要使用using backup controlfile
2、alter database open resetlog
指定RESETLOGS將重設當前LOG sequence number為1,拋棄所有日誌資訊。
以下條件需要使用resetlog
1)在不完全恢復(介質恢復)
2)使用備份控制檔案
使用resetlogs開啟資料庫後務必完整地備份一次資料庫。
3、create controlfile resetlogs/noresetlogs
1)用Noresetlogs重建控制檔案時,控制檔案中 datafile Checkpoint來自Online logs中的Current log頭
2)用Resetlogs重建控制檔案時,控制檔案中datafile Checkpoint來自各資料檔案頭。
當systemscn,datafile scn,start scn 不全相等,需要介質恢復,如果stopscn null需要例項恢復
resetlogs拋棄所有在上一次恢復沒有用到的日誌資訊,確保不被重新用與恢復。
1、系統正常關閉:
system scn=datafile scn=start scn=stop scn
1)system scn=datafile scn=start scn,不需要介質恢復
2)stopscn not null,不需要例項恢復
2、系統異常關閉:
system scn=datafile scn=start scn,stop scn null
1)system scn=datafile scn=start scn,不需要介質恢復
2)stopscn null,需要例項恢復
3、舊資料檔案
system scn=datafile scn>start scn,stop scn null/notnull
1)system scn=datafile scn>start scn,需要介質恢復成system scn=datafilescn=start scn
2)stopscn null,需要例項恢復,not null 不需要例項恢復
4、備份控制檔案
system scn=datafile scn<=start scn(當資料檔案為舊的相等),stop scn notnull/null
1)system scn=datafile scn<=start scn,需要使用using backup controlfile介質恢復成system scn=datafile scn=start
scn=current log scn(當前日誌最大SCN)
2)為保證上一次恢復沒有用到log日誌不被使用,必須resetlogs
5、重建noresetlogs控制檔案
控制檔案中 datafileCheckpoint來自Online logs中的Current log頭
current log scn=system scn=datafilescn>=start scn,stop scn not null/null
1)current log scn=system scn=datafilescn>=start scn,需要介質恢復成systemscn=datafile scn=start scn=redolog scn(當前日誌最大SCN),stopscn not null
2)stopscn not null 不需要例項恢復
6、重建resetlogs控制檔案
控制檔案中datafileCheckpoint來自各資料檔案頭。
system scn>=datafile scn=start scn,stopscn not null/null
1)system scn>=datafile scn=start scn,需要使用using backup controlfile介質恢復成system scn=datafile scn=startscn(當前日誌最大SCN),stopscn not null
2)stop notnull,因為SCN已經為redolog scn,log已經不能使用,必須resetlogs
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29519108/viewspace-2140632/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- recover database using backup controlfileDatabase
- recover database using backup controlfile與 recover database 的區別Database
- recover database using backup controlfile理解Database
- recover database until cancel using backup controlfileDatabase
- Recover database using backup controlfile until cancelDatabase
- recover database using backup controlfile利用archivelog files.DatabaseHive
- How to restore and recover a database from an RMAN backup_881395.1RESTDatabase
- Database Clone by rebuilding control file.DatabaseRebuild
- ORA-00245: control file backup operation failedAI
- recover database until cancel和 recover database區別Database
- ORA-00245:control file backup failed;targetis likely on local file systemAI
- ORA-00245: control file backup failed; target is likely on a local file systemAI
- oracle create a new database using backup controlfile to traceOracleDatabase
- Case two -- Recover a datafile in primary site from the backup taken in standby site without using c
- 【ORACLE】ORA-00245: control file backup operation failedOracleAI
- Recover_DatabaseDatabase
- rman recover databaseDatabase
- Recover a Database Having Added a Datafile Since Last Backup (Doc ID 29430.1)DatabaseAST
- Oracle 12C Transport a Database to a Different Platform Using Backup SetsOracleDatabasePlatform
- Case One -- Recover a datafile in primary site from the backup taken in standby site using catalog d
- recover database until timeDatabase
- Recreate stdby Control File When dbf Are On ASM And Using OMF-734862.1ASM
- 冷備手工完全恢復(recover database,recover tablespace,recover datafile)Database
- 12C Duplicating a Database to a Remote Host by Using Backup-based DuplicationDatabaseREM
- 【oracle】ORA-01580 error creating control backup fileOracleError
- ORA-01103: database name 'ORCLDG' in control file is not 'ORCL'Database
- How to recover windows volume control?Windows
- oracle full database backupOracleDatabase
- Rman backup standby databaseDatabase
- Cold Database backup scriptDatabase
- 12c-RECOVER PLUGGABLE DATABASEDatabase
- Oracle 12c: Recover tables using RMANOracle
- Cold backup and restore the entire databaseRESTDatabase
- rman backup database force 功能Database
- control file parallel writeParallel
- Recover A Lost Datafile With No Backup (Doc ID 1060605.6)
- SQLBackupAndFTP12.0 failed to backup database with full backup typeSQLFTPAIDatabase
- reduce the database log fileDatabase