通過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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 10g跨越resetlogs恢復-incarnationOracle 10g
- rman通過之前的incarnation恢復資料庫!資料庫
- reset incarnation的分析之一
- Oracle穿越incarnation恢復資料Oracle
- rman 穿越incarnation恢復資料
- 恢復出廠設定 Factory Reset 呼叫過程
- oracle實驗記錄 (恢復-使用resetlogs open前備份恢復)Oracle
- 恢復使用過Reset5的系統啟用介面
- open resetlogs後資料恢復資料恢復
- 有關resetlogs和incarnation關係的理解
- Spring Boot 通過CORS實現跨域Spring BootCORS跨域
- oracle實驗記錄 (恢復-rman reset incatnation(1))Oracle
- Oracle資料庫恢復之resetlogsOracle資料庫
- git reset --hard 操作後的資料恢復Git資料恢復
- 通過duplicat恢復資料庫資料庫
- 10可以穿越resetlogs恢復資料庫!資料庫
- 所有控制檔案損壞的恢復--resetlogs方式
- 透過搭建恢復目錄實現RMAN異地備份和恢復
- oracle用備份的控制檔案恢復後不用resetlogs開啟方式的恢復Oracle
- MySQL 通過 binlog 恢復資料MySql
- MySQL通過Binlog恢復刪除的表MySql
- Oracle BBED 跳過歸檔實現完全恢復Oracle
- 恢復控制檔案避免使用resetlogs選項
- [網摘學習]Git版本恢復命令resetGit
- RMAN深入解析之--Incarnation應用(不完全恢復)
- 通過binlog恢復mysql資料庫MySql資料庫
- 使用RESETLOGS重建控制檔案恢復資料庫資料庫
- 資料庫resetlogs後進行rman恢復7資料庫
- 資料庫resetlogs後進行rman恢復6資料庫
- 資料庫resetlogs後進行rman恢復5資料庫
- 資料庫resetlogs後進行rman恢復4資料庫
- 資料庫resetlogs後進行rman恢復3資料庫
- 資料庫resetlogs後進行rman恢復2資料庫
- 資料庫resetlogs後進行rman恢復1資料庫
- 通過binlog恢復mysql備份之前的資料MySql
- 通過flashback database恢復被刪除的表空間Database
- 資料恢復新姿勢——通過ibd和frm檔案恢復資料資料恢復
- 詳解 CmProcess 跨程式通訊的實現