通過reset incarnation實現跨resetlogs的恢復
環境:Linux Redhat4 ,Oracle 10g,file system
通過reset database to incarnation 3;回到上一次resetlog所在的incarnation.
目前只有3月24號的備份和所有的歸檔,準備恢復資料庫到3月25號13:20到16:50之間,也就是跨過
incarnation 4的resetlogs.
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ORCL 1090770270 PARENT 1 2005-06-30 19:09:40
2 2 ORCL 1090770270 PARENT 446075 2005-07-07 01:58:57
3 3 ORCL 1090770270 CURRENT 1010774 2008-03-25 13:20:57
4 4 ORCL 1090770270 ORPHAN 1012317 2008-03-25 16:52:20
RMAN> run
2> {
3> set until time='2008-03-25 13:40:00';
4> restore database;
5> recover database;
6> alter database open resetlogs;
7> }
executing command: SET until clause
Starting restore at 2008-03-25 18:05:57
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
skipping datafile 1; already restored to file /u01/app/oracle/oradata/orcl/system01.dbf
skipping datafile 2; already restored to file /u01/app/oracle/oradata/orcl/undotbs01.dbf
skipping datafile 3; already restored to file /u01/app/oracle/oradata/orcl/sysaux01.dbf
skipping datafile 4; already restored to file /u01/app/oracle/oradata/orcl/users01.dbf
skipping datafile 5; already restored to file /u01/app/oracle/oradata/orcl/example01.dbf
skipping datafile 6; already restored to file /u01/app/oracle/oradata/orcl/staging01.dbf
restore not done; all files readonly, offline, or already restored
Finished restore at 2008-03-25 18:05:57
Starting recover at 2008-03-25 18:05:57
using channel ORA_DISK_1
starting media recovery
media recovery failed
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/25/2008 18:05:58
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover if needed
start until time 'MAR 25 2008 13:40:00'
ORA-00283: recovery session canceled due to errors
ORA-38727: FLASHBACK DATABASE requires a current control file.
這個datafile已經是24號restore過來的,由於只切換了incarnation,controlfile還是incarnation 4的.
RMAN> restore controlfile from autobackup;
Starting restore at 2008-03-25 18:06:26
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/25/2008 18:06:26
RMAN-06496: must use the TO clause when the database is mounted or open
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
4 Full 6.80M DISK 00:00:00 2008-03-24 17:05:29
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20080324T170529
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_24/o1_mf_s_650221529_3ygvps8h_.bkp
Control File Included: Ckp SCN: 934330 Ckp time: 2008-03-24 17:05:29
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
5 Full 6.80M DISK 00:00:00 2008-03-24 17:08:40
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20080324T170840
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_24/o1_mf_s_650221720_3ygvwrll_.bkp
Control File Included: Ckp SCN: 934500 Ckp time: 2008-03-24 17:08:40
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
6 Full 6.80M DISK 00:00:00 2008-03-24 17:12:50
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20080324T171250
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_24/o1_mf_s_650221970_3ygw4l9q_.bkp
Control File Included: Ckp SCN: 934659 Ckp time: 2008-03-24 17:12:50
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
10 Full 6.80M DISK 00:00:00 2008-03-24 17:18:20
BP Key: 10 Status: AVAILABLE Compressed: NO Tag: TAG20080324T171820
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_24/o1_mf_s_650222300_3ygwgw8v_.bkp
Control File Included: Ckp SCN: 935569 Ckp time: 2008-03-24 17:18:20
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
12 Full 6.80M DISK 00:00:00 2008-03-25 13:10:47
BP Key: 11 Status: AVAILABLE Compressed: NO Tag: TAG20080325T131047
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650293847_3yk2bqr2_.bkp
Control File Included: Ckp SCN: 1010240 Ckp time: 2008-03-25 13:10:47
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
13 Full 6.80M DISK 00:00:01 2008-03-25 13:21:09
BP Key: 12 Status: AVAILABLE Compressed: NO Tag: TAG20080325T132107
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650294467_3yk2y4nk_.bkp
Control File Included: Ckp SCN: 1011647 Ckp time: 2008-03-25 13:21:07
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
14 Full 6.80M DISK 00:00:00 2008-03-25 14:37:30
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20080325T143730
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650298991_3yk7fbd0_.bkp
Control File Included: Ckp SCN: 1016697 Ckp time: 2008-03-25 14:36:31
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
15 Full 6.80M DISK 00:00:00 2008-03-25 15:52:18
BP Key: 14 Status: AVAILABLE Compressed: NO Tag: TAG20080325T155218
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650303538_3ykcslo0_.bkp
Control File Included: Ckp SCN: 1022568 Ckp time: 2008-03-25 15:52:18
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
16 Full 6.80M DISK 00:00:00 2008-03-25 15:52:20
BP Key: 15 Status: AVAILABLE Compressed: NO Tag: TAG20080325T155220
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650303540_3ykcsnfd_.bkp
Control File Included: Ckp SCN: 1022575 Ckp time: 2008-03-25 15:52:20
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
17 Full 6.80M DISK 00:00:01 2008-03-25 15:52:22
BP Key: 16 Status: AVAILABLE Compressed: NO Tag: TAG20080325T155221
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650303541_3ykcsp61_.bkp
Control File Included: Ckp SCN: 1022580 Ckp time: 2008-03-25 15:52:21
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
18 Full 6.80M DISK 00:00:01 2008-03-25 15:57:01
BP Key: 17 Status: AVAILABLE Compressed: NO Tag: TAG20080325T155700
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650303820_3ykd2f5k_.bkp
Control File Included: Ckp SCN: 1022902 Ckp time: 2008-03-25 15:57:00
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
19 Full 6.80M DISK 00:00:00 2008-03-25 15:57:36
BP Key: 18 Status: AVAILABLE Compressed: NO Tag: TAG20080325T155736
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650303856_3ykd3jov_.bkp
Control File Included: Ckp SCN: 1022929 Ckp time: 2008-03-25 15:57:36
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
20 Full 6.80M DISK 00:00:01 2008-03-25 16:52:31
BP Key: 19 Status: AVAILABLE Compressed: NO Tag: TAG20080325T165230
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650307150_3ykhbgx3_.bkp
Control File Included: Ckp SCN: 1012597 Ckp time: 2008-03-25 16:52:30
RMAN>
檢視備份,發現沒有controlfile在incarnation 3時的備份.
通過reset database to incarnation 3;回到上一次resetlog所在的incarnation.
目前只有3月24號的備份和所有的歸檔,準備恢復資料庫到3月25號13:20到16:50之間,也就是跨過
incarnation 4的resetlogs.
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ORCL 1090770270 PARENT 1 2005-06-30 19:09:40
2 2 ORCL 1090770270 PARENT 446075 2005-07-07 01:58:57
3 3 ORCL 1090770270 CURRENT 1010774 2008-03-25 13:20:57
4 4 ORCL 1090770270 ORPHAN 1012317 2008-03-25 16:52:20
RMAN> run
2> {
3> set until time='2008-03-25 13:40:00';
4> restore database;
5> recover database;
6> alter database open resetlogs;
7> }
executing command: SET until clause
Starting restore at 2008-03-25 18:05:57
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
skipping datafile 1; already restored to file /u01/app/oracle/oradata/orcl/system01.dbf
skipping datafile 2; already restored to file /u01/app/oracle/oradata/orcl/undotbs01.dbf
skipping datafile 3; already restored to file /u01/app/oracle/oradata/orcl/sysaux01.dbf
skipping datafile 4; already restored to file /u01/app/oracle/oradata/orcl/users01.dbf
skipping datafile 5; already restored to file /u01/app/oracle/oradata/orcl/example01.dbf
skipping datafile 6; already restored to file /u01/app/oracle/oradata/orcl/staging01.dbf
restore not done; all files readonly, offline, or already restored
Finished restore at 2008-03-25 18:05:57
Starting recover at 2008-03-25 18:05:57
using channel ORA_DISK_1
starting media recovery
media recovery failed
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/25/2008 18:05:58
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover if needed
start until time 'MAR 25 2008 13:40:00'
ORA-00283: recovery session canceled due to errors
ORA-38727: FLASHBACK DATABASE requires a current control file.
這個datafile已經是24號restore過來的,由於只切換了incarnation,controlfile還是incarnation 4的.
RMAN> restore controlfile from autobackup;
Starting restore at 2008-03-25 18:06:26
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/25/2008 18:06:26
RMAN-06496: must use the TO clause when the database is mounted or open
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
4 Full 6.80M DISK 00:00:00 2008-03-24 17:05:29
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20080324T170529
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_24/o1_mf_s_650221529_3ygvps8h_.bkp
Control File Included: Ckp SCN: 934330 Ckp time: 2008-03-24 17:05:29
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
5 Full 6.80M DISK 00:00:00 2008-03-24 17:08:40
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20080324T170840
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_24/o1_mf_s_650221720_3ygvwrll_.bkp
Control File Included: Ckp SCN: 934500 Ckp time: 2008-03-24 17:08:40
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
6 Full 6.80M DISK 00:00:00 2008-03-24 17:12:50
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20080324T171250
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_24/o1_mf_s_650221970_3ygw4l9q_.bkp
Control File Included: Ckp SCN: 934659 Ckp time: 2008-03-24 17:12:50
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
10 Full 6.80M DISK 00:00:00 2008-03-24 17:18:20
BP Key: 10 Status: AVAILABLE Compressed: NO Tag: TAG20080324T171820
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_24/o1_mf_s_650222300_3ygwgw8v_.bkp
Control File Included: Ckp SCN: 935569 Ckp time: 2008-03-24 17:18:20
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
12 Full 6.80M DISK 00:00:00 2008-03-25 13:10:47
BP Key: 11 Status: AVAILABLE Compressed: NO Tag: TAG20080325T131047
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650293847_3yk2bqr2_.bkp
Control File Included: Ckp SCN: 1010240 Ckp time: 2008-03-25 13:10:47
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
13 Full 6.80M DISK 00:00:01 2008-03-25 13:21:09
BP Key: 12 Status: AVAILABLE Compressed: NO Tag: TAG20080325T132107
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650294467_3yk2y4nk_.bkp
Control File Included: Ckp SCN: 1011647 Ckp time: 2008-03-25 13:21:07
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
14 Full 6.80M DISK 00:00:00 2008-03-25 14:37:30
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20080325T143730
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650298991_3yk7fbd0_.bkp
Control File Included: Ckp SCN: 1016697 Ckp time: 2008-03-25 14:36:31
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
15 Full 6.80M DISK 00:00:00 2008-03-25 15:52:18
BP Key: 14 Status: AVAILABLE Compressed: NO Tag: TAG20080325T155218
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650303538_3ykcslo0_.bkp
Control File Included: Ckp SCN: 1022568 Ckp time: 2008-03-25 15:52:18
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
16 Full 6.80M DISK 00:00:00 2008-03-25 15:52:20
BP Key: 15 Status: AVAILABLE Compressed: NO Tag: TAG20080325T155220
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650303540_3ykcsnfd_.bkp
Control File Included: Ckp SCN: 1022575 Ckp time: 2008-03-25 15:52:20
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
17 Full 6.80M DISK 00:00:01 2008-03-25 15:52:22
BP Key: 16 Status: AVAILABLE Compressed: NO Tag: TAG20080325T155221
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650303541_3ykcsp61_.bkp
Control File Included: Ckp SCN: 1022580 Ckp time: 2008-03-25 15:52:21
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
18 Full 6.80M DISK 00:00:01 2008-03-25 15:57:01
BP Key: 17 Status: AVAILABLE Compressed: NO Tag: TAG20080325T155700
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650303820_3ykd2f5k_.bkp
Control File Included: Ckp SCN: 1022902 Ckp time: 2008-03-25 15:57:00
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
19 Full 6.80M DISK 00:00:00 2008-03-25 15:57:36
BP Key: 18 Status: AVAILABLE Compressed: NO Tag: TAG20080325T155736
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650303856_3ykd3jov_.bkp
Control File Included: Ckp SCN: 1022929 Ckp time: 2008-03-25 15:57:36
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
20 Full 6.80M DISK 00:00:01 2008-03-25 16:52:31
BP Key: 19 Status: AVAILABLE Compressed: NO Tag: TAG20080325T165230
Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/autobackup/2008_03_25/o1_mf_s_650307150_3ykhbgx3_.bkp
Control File Included: Ckp SCN: 1012597 Ckp time: 2008-03-25 16:52:30
RMAN>
檢視備份,發現沒有controlfile在incarnation 3時的備份.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/175005/viewspace-231106/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 在rman恢復中incarnation的概念
- Oracle資料庫恢復之resetlogsOracle資料庫
- Spring Boot 通過CORS實現跨域Spring BootCORS跨域
- git reset --hard 操作後的資料恢復Git資料恢復
- RMAN深入解析之--Incarnation應用(不完全恢復)
- MySQL 通過 binlog 恢復資料MySql
- 通過duplicat恢復資料庫資料庫
- 透過搭建恢復目錄實現RMAN異地備份和恢復
- 資料恢復新姿勢——通過ibd和frm檔案恢復資料資料恢復
- Oracle為什麼使用備份的控制檔案恢復後一定要resetlogsOracle
- mysql通過frm、idb檔案恢復資料MySql
- 詳解 CmProcess 跨程式通訊的實現
- 通過佇列實現棧OR通過棧實現佇列佇列
- 【資料庫資料恢復】透過恢復NDF檔案修復資料庫的資料恢復過程資料庫資料恢復
- Mysql通過ibd檔案恢復資料的步驟詳解MySql
- MySQL恢復過程MySql
- EventBus,輕鬆實現跨元件跨執行緒通訊元件執行緒
- 7.6 實現程式掛起與恢復
- 告警與恢復告警原理及實現
- LRU 實現 通過 LinkedHashMapHashMap
- 通過模板實現POI
- Rman_異地、跨平臺、跨版本的恢復總結及案例
- [iptables] 基於iptables實現的跨網路通訊
- 通過rman為客戶實現linux下oracle11.2.0.4到windows下oracle同版本資料庫的異機恢復。LinuxOracleWindows資料庫
- Go實戰 22 | 網路程式設計:通過 RPC 實現跨平臺服務Go程式設計RPC
- 本地Mac通過堡壘機代理實現跨堡壘機scp問題Mac
- 走過路過來看看各種實現跨域的方式~跨域
- ManualResetEvent實現執行緒的暫停與恢復執行緒
- 基於 Vuex 的時移操作(撤回/恢復)實現Vue
- vsan儲存資料恢復過程—虛擬機器故障恢復過程資料恢復虛擬機
- 通過redis實現session共享RedisSession
- 資料庫恢復過程資料庫
- 通過 App Groups 實現程式間通訊APP
- Java的通過管道來實現執行緒通訊Java執行緒
- vim編輯過程中斷,恢復時出現警告
- Python 通過List 實現佇列的操作Python佇列
- RMAN恢復實踐
- 儲存崩潰資料恢復過程;資料恢復案例資料恢復
- 【北亞資料恢復】通過碎片拼接技術恢復XenServer伺服器磁碟中SQL Server資料庫資料資料恢復Server伺服器SQL資料庫