ResetLogs 選項學習與測試
ResetLogs 選項學習與測試
目錄
1 ResetLogs Overview
2 When do we need ResetLog
3 ResetLog的作用
4 在RMAN 中OPEN RESETLOGS 與 SQLPLUS中OPEN RESETLOGS 的區別
5 在重建控制檔案的時候使用ResetLog
1 ResetLogs Overview
The primary function of resetlogs is to discard the redo that was not applied during incomplete recovery, ensuring that the skipped redo can never be accidentally applied by a subsequent recovery. To accomplish this, resetlogs effectively invalidates all existing redo in all online and archived redo logfiles. This has the side effect of making any existing datafile backups unusable for future recovery operations.Resetlogs also reinitializes the controlfile information about online logs and redo threads, clears the contents of any existing online redo log files, creates the online redo log files if they do not currently exist, and resets the log sequence number in all threads to one.
2 When do we need ResetLog
以下條件需要使用resetlog
1)在不完全恢復(介質恢復)
2)使用備份控制檔案(backup的控制檔案一般從日誌檔案和資料庫的資訊以及SCN的資訊,相比目前的狀態都已經過期了)
3 ResetLog的作用
(1) 將重做日誌的序列號設為1
(2) 一般以該子句開啟資料庫後,要立即備份資料庫,因為這個子句會使資料庫以前的備份不能用.
(3) 在重做日誌當前日誌組出現錯誤時,要以該子句開啟資料庫.該子句會重新設定重做日誌檔案的狀態.
(4) 讓資料庫系統歸檔初始化,重新生成歸檔檔案.
4 在RMAN 中OPEN RESETLOGS 與 SQLPLUS中OPEN RESETLOGS 的區別
1) If you run the RMAN command (not the SQL statement) ALTER DATABASE OPEN RESETLOGS, then RMAN automatically creates a new database incarnation record in the recovery catalog. RMAN implicitly and automatically issues a RESET DATABASE command, which specifies that this new incarnation of the database is the current incarnation. RMAN associates all subsequent backups and log archiving done by the target database with the new database incarnation.
2) If you issue the SQL statement (not the RMAN command) ALTER DATABASE OPEN RESETLOGS, then RMAN does not automatically run a RESET DATABASE command. Hence, RMAN cannot access the recovery catalog because it cannot distinguish between a RESETLOGS command and an accidental restore of an old control file. To solve this problem, you must manually run the RESET DATABASE command in RMAN after executing the SQL statement ALTER DATABASE OPEN RESETLOGS.
The RESET DATABASE command updates the repository to indicate that the target database has been opened with the RESETLOGS option. In the rare situation in which you wish to restore backups of a prior incarnation of the database, use the RESET DATABASE TO INCARNATION key command to change the current incarnation to an older incarnation. For example, if you accidentally drop a table immediately after the most recent RESETLOGS, then you may want to
recover the database to just before the time of the most recent RESETLOGS and then open it with the RESETLOGS option, thereby creating a new incarnation.
5 在重建控制檔案的時候使用ResetLog
create controlfile resetlogs/noresetlogs
1) 用noresetlogs重建控制檔案時,控制檔案中 datafile checkpoint scn來自online logs中的Current log頭
2) 用resetlogs重建控制檔案時,控制檔案中datafile Checkpoint SCN來自各資料檔案頭(Start SCN)。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10248702/viewspace-628775/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 測試主機網路連通性ping命令引數選項-linux網路管理學習Linux
- 效能測試學習(1)-效能測試分類與常見術語
- 安全測試學習
- Flutter 學習之路 - 測試(單元測試,Widget 測試,整合測試)Flutter
- javascript的學習測試JavaScript
- 測試學習SQL篇SQL
- rust學習十二、測試Rust
- 軟體測試學習教程—迴歸測試
- 活動 | 優選專項測試,等你來挑戰!
- Vue.js原始碼學習一 —— 資料選項 State 學習Vue.js原始碼
- 學習筆記之測試筆記
- 軟體測試整理學習
- 學習旅途(軟體測試)
- 介面測試學習之jsonJSON
- 介面測試學習之 jsonJSON
- MySQL學習 - 基準測試MySql
- 活動 |優選業務專項測試,只等你來!
- 滲透測試學習之隱藏蹤跡與規避檢測一
- 滲透測試學習之隱藏蹤跡與規避檢測三
- 滲透測試學習之隱藏蹤跡與規避檢測四
- 滲透測試學習之隱藏蹤跡與規避檢測五
- 滲透測試學習之隱藏蹤跡與規避檢測六
- 滲透測試學習之隱藏蹤跡與規避檢測七
- 滲透測試學習之隱藏蹤跡與規避檢測八
- 滲透測試學習之隱藏蹤跡與規避檢測十
- 滲透測試學習之隱藏蹤跡與規避檢測二
- 軟體測試學習教程——LoadRunner實現介面測試
- 軟體測試學習教程—軟體測試質量
- 軟體測試學習——移動端功能測試分析
- 軟體測試學習 ——五種軟體測試模型模型
- 軟體測試培訓分享:學習能力差可以學習軟體測試嗎
- 【專項測試系列】-快取擊穿、穿透、雪崩專項測試快取穿透
- 【分享】—如何學習軟體測試
- 【軟體測試】學習筆記筆記
- 軟體測試學習路線
- Netty 框架學習 —— 單元測試Netty框架
- 滲透測試學習記錄
- 為什麼現在越來越多的人選擇學習軟體測試?
- 軟體測試學習教程—軟體測試基本知識