使用RMAN備份集和過時的控制檔案進行資料庫的恢復(1/2)

djb1008發表於2010-09-15

  1. 環境描述

資料庫的軟體安裝在伺服器本地儲存上,歸檔日誌也儲存在伺服器的本地儲存上,資料庫的資料檔案,控制檔案,REDO LOG檔案,密碼檔案,SPFILE都儲存在磁碟儲存陣列上。

資料庫使用RMAN進行備份,備份集儲存在磁碟儲存陣列上,每天兩次將RMAN備份集複製到異地。

RMAN 備份的後設資料(METADATA)資訊儲存在資料庫控制檔案中,沒有使用CATALOG庫進行登記管理,保留的時間引數(control_file_record_keep_time)設定為預設的7天。

RMAN的備份設定中,沒有開啟控制檔案的自動備份。

由於磁碟儲存陣列的突然崩潰,所有儲存在磁碟陣列上的資料都無法恢復。目前只能找到一個很舊的控制檔案,不含有最近的RMAN備份後設資料;最新的RMAN備份集;連續的歸檔日誌。

很慶幸,現實中沒有發生這個災難事件,我們做了下面的試驗,模擬該事件的發生,並制定完整的資料庫恢復方案與詳細的操作步驟。

  1. 試驗環境的準備

[@more@]

2.1 資料庫冷備份

C:>SET ORACLE_SID=AIDU;

C:>SQLPLUS /NOLOG

SQL>CONN / AS SYSDBA

SQL>SHUTDOWN IMMEDIATE;

將資料庫目錄的所有檔案複製到冷備份目錄

COPY C:ORADATAAIDU*.* C:ORADATAAIDUaidu_cool_bak_2006-06-23

2.2 刪除所有的歷史歸檔日誌檔案和所有舊的RMAN備份集

在冷備份完成以後,刪除歸檔日誌檔案和RMAN備份集,因為這些檔案已經不再需要,或者說我們不需要恢復到冷備份以前的狀態,為了簡化試驗環境,在試驗前將這些檔案刪除,以免干擾本次試驗。

這些刪除都是OS下手工刪除檔案。

刪除所有的歷史歸檔日誌檔案和RMAN備份集,以免干擾本次試驗。

記錄資料庫起始的SCN

2.3 記錄資料庫起始的SCN

C:>SQLPLUS /NOLOG

SQL>CONN / AS SYSDBA;

SQL>STARTUP;

SQL> select file#,name,checkpoint_change#,sysdate from v$datafile order by file#

FILE# NAME CHECKPOINT_CHANGE# SYSDATE

---------- ------------------------------ ------------------ ---------------------

1 C:ORADATAAIDUSYSTEM01.DBF 1220663 2006-06-23 14:16:27

2 C:ORADATAAIDUUNDOTBS01.DBF 1220663 2006-06-23 14:16:27

3 C:ORADATAAIDUSYSAUX01.DBF 1220663 2006-06-23 14:16:27

4 C:ORADATAAIDUUSERS01.DBF 1220663 2006-06-23 14:16:27

SQL> select sysdate,dbid,db_unique_name,checkpoint_change# from v$database;

SYSDATE DBID DB_UNIQUE_NAME CHECKPOINT_CHANGE#

------------------- ---------- ------------------------------ ------------------

2006-06-2314:16:27 451307475 aidu 1220663

2.4 準備資料庫測試物件資料

檢查存在TEST02,TEST03,每個表兩條記錄.

SQL> conn aidu/aidu

SQL> select count(1) from test02;

COUNT(1)

2

SQL> select count(1) from test03;

COUNT(1)

2

建立TEST_BEFORE_BAK ,並向其中插入524288

SQL> create table test_before_bak as select * from test02;

Table created.

SQL> INSERT INTO TEST_BEFORE_BAK SELECT * FROM TEST_BEFORE_BAK;

2 rows created.

SQL> INSERT INTO TEST_BEFORE_BAK SELECT * FROM TEST_BEFORE_BAK;

4 rows created.

重複執行這個語句多次,最後在TEST_BEFORE_BAK 表中插入524288條記錄.

SQL> INSERT INTO TEST_BEFORE_BAK SELECT * FROM TEST_BEFORE_BAK;

262144 rows created.

SQL> COMMIT;

Commit complete.

SQL> SELECT COUNT(1) FROM TEST_BEFORE_BAK;

COUNT(1)

524288

SQL> alter system switch logfile;

System altered.

2.5 記錄RMAN全備份前的資料庫SCN

SQL> select sysdate,dbid,db_unique_name,checkpoint_change# from v$database;

SYSDATE DBID DB_UNIQUE_NAME CHECKPOINT_CHANGE#

------------------- ---------- ------------------------------ ------------------

2006-06-23 14:31:50 451307475 aidu 1221932

SQL> select file#,name,checkpoint_change#,sysdate from v$datafile order by file#;

FILE# NAME CHECKPOINT_CHANGE# SYSDATE

---------- ------------------------------ ------------------ -------------------

1 C:ORADATAAIDUSYSTEM01.DBF 1221932 2006-06-23 14:31:58

2 C:ORADATAAIDUUNDOTBS01.DBF 1221932 2006-06-23 14:31:58

3 C:ORADATAAIDUSYSAUX01.DBF 1221932 2006-06-23 14:31:58

4 C:ORADATAAIDUUSERS01.DBF 1221932 2006-06-23 14:31:58

此時檢視一下日誌歸檔的情況:

SQL>select name,sequence#,first_change#,next_change#,status from v$archived_log

order by sequence#

NAME SEQUENCE# FIRST_CHANGE# NEXT_CHANGE# STSTUS

------------------------------ ---------- ------------- ------------ -

C:ORADATAFLASH_RECOVERY_AREA 7 1218584 1221932 A

AIDUARCHIVELOG2006_06_23O1

_MF_1_7_29Q2KNG5_.ARC

C:ORADATAFLASH_RECOVERY_AREA 8 1221932 1222099 A

AIDUARCHIVELOG2006_06_23O1

_MF_1_8_29Q2KWYR_.ARC

C:ORADATAFLASH_RECOVERY_AREA 9 1222099 1222206 A

AIDUARCHIVELOG2006_06_23O1

_MF_1_9_29Q2POVC_.ARC

2.6 RMAN配置管理與RMAN全備份

2.6.1 登陸RMAN

C:Documents and SettingsAdministrator>set nls_lang=AMERICAN_AMERICA.ZHS16GBK

C:Documents and SettingsAdministrator>rman target /

connected to target database: AIDU (DBID=451307475)

2.6.2 顯示RMAN當前配置

RMAN> show all;

using target database control file instead of recovery catalog

RMAN configuration parameters are:

CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default

CONFIGURE BACKUP OPTIMIZATION OFF; # default

CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE MAXSETSIZE TO UNLIMITED; # default

CONFIGURE ENCRYPTION FOR DATABASE OFF; # default

CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default

CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default

CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:ORACLEPRODUCT10.2.0DB_1DATABASESNCFAIDU.ORA'; # default

2.6.3 建議調整RMAN的配置,設定為CONTROLFILE 自動備份,RMAN 備份集為壓縮備份

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;

本次試驗的情況是CONTROLFILE的自動備份沒有開啟,所以恢復時無法在RMAN備份中找到CONTROLFILE的複本

2.6.4 檢查並標記過期或者丟失的歸檔日誌,RMAN備份集資訊,並刪除這些後設資料

RMAN>CROSSCHECK ARCHIVELOG ALL;

RMAN>CROSSCHECK BACKUP;

RMAN>DELETE OBSOLETE;

2.6.5 備份資料庫,資料檔案採用FULL方式備份,同時備份歸檔日誌檔案,並自動將已經備份到RMAN備份中的當前歸檔日誌檔案刪除,以釋放儲存空間.

RMAN>RUN{

ALLOCATE CHANNEL D1 TYPE DISK;

BACKUP FULL DATABASE PLUS ARCHIVELOG;

RELEASE CHANNEL D1;}

2.6.6 檢視RMAN備份集的情況.

RMAN> list backup;

List of Backup Sets

===================

BS Key Type LV Size Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ -------------------

4 Full 157.85M DISK 00:01:03 2006-06-23 14:52:31

BP Key: 4 Status: AVAILABLE Compressed: YES Tag: TAG20060623T145128

Piece Name: C:ORADATAFLASH_RECOVERY_AREAAIDUBACKUPSET2006_06_23O1_MF_NNNDF_TAG20060623T145128_29Q3VKC7_.BKP

List of Datafiles in backup set 4

File LV Type Ckp SCN Ckp Time Name

---- -- ---- ---------- ------------------- ----

1 Full 1222932 2006-06-23 14:51:28 C:ORADATAAIDUSYSTEM01.DBF

2 Full 1222932 2006-06-23 14:51:28 C:ORADATAAIDUUNDOTBS01.DBF

3 Full 1222932 2006-06-23 14:51:28 C:ORADATAAIDUSYSAUX01.DBF

4 Full 1222932 2006-06-23 14:51:28 C:ORADATAAIDUUSERS01.DBF

BS Key Type LV Size Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ -------------------

5 Full 7.11M DISK 00:00:03 2006-06-23 14:57:45

BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20060623T145742

Piece Name: C:ORADATAFLASH_RECOVERY_AREAAIDUAUTOBACKUP2006_06_23O1_MF_S_593881062_29Q477VT_.BKP

Control File Included: Ckp SCN: 1223098 Ckp time: 2006-06-23 14:57:42

SPFILE Included: Modification time: 2006-06-23 14:08:16

此時檢檢視到: 所有的歸檔日誌檔案都被RMAN自動刪除了.

2.7 記錄RMAN全備份後的資料庫SCN

RMAN 備份完成後,SQLPLUS 中檢視資料庫的SCN狀態.資料庫與資料檔案的SCN號不一樣,主要是因為沒有全庫執行CHECKPOINT.

SQL> select sysdate,dbid,db_unique_name,checkpoint_change# from v$database;

SYSDATE DBID DB_UNIQUE_NAME CHECKPOINT_CHANGE#

------------------- ---------- ------------------------------ ------------------

2006-06-23 15:10:04 451307475 aidu 1222845

SQL> select file#,name,checkpoint_change#,sysdate from v$datafile order by file#;

FILE# NAME CHECKPOINT_CHANGE# SYSDATE

---------- ------------------------------ ------------------ -------------------

1 C:ORADATAAIDUSYSTEM01.DBF 1222932 2006-06-23 15:10:35

2 C:ORADATAAIDUUNDOTBS01.DBF 1222932 2006-06-23 15:10:35

3 C:ORADATAAIDUSYSAUX01.DBF 1222932 2006-06-23 15:10:35

4 C:ORADATAAIDUUSERS01.DBF 1222932 2006-06-23 15:10:35

2.8 全備份後,進行資料插入和日誌切換操作

SQL> conn aidu/aidu

SQL> create table test_after_bak as select * from test_before_BAK;

SQL> CONN / AS SYSDBA

SQL> ALTER SYSTEM SWITCH LOGFILE;

SQL> ALTER SYSTEM CHECKPOINT;

System altered.

SQL> select sysdate,dbid,db_unique_name,checkpoint_change# from v$database;

SYSDATE DBID DB_UNIQUE_NAME CHECKPOINT_CHANGE#

------------------- ---------- ------------------------------ ------------------

2006-06-23 15:15:01 451307475 aidu 1224200

SQL> select file#,name,checkpoint_change#,sysdate from v$datafile order by file#;

FILE# NAME CHECKPOINT_CHANGE# SYSDATE

---------- ------------------------------ ------------------ -------------------

1 C:ORADATAAIDUSYSTEM01.DBF 1224200 2006-06-23 15:15:05

2 C:ORADATAAIDUUNDOTBS01.DBF 1224200 2006-06-23 15:15:05

3 C:ORADATAAIDUSYSAUX01.DBF 1224200 2006-06-23 15:15:05

4 C:ORADATAAIDUUSERS01.DBF 1224200 2006-06-23 15:15:05

SQL> select name,SEQUENCE#,first_change#,next_change#,status from v$archived_log where status='A'

NAME SEQUENCE# FIRST_CHANGE# NEXT_CHANGE# S

------------------------------ ---------- ------------- ------------ -

C:ORADATAFLASH_RECOVERY_AREA 11 1222845 1223979 A

AIDUARCHIVELOG2006_06_23O1

_MF_1_11_29Q52LG5_.ARC

C:ORADATAFLASH_RECOVERY_AREA 12 1223979 1224186 A

AIDUARCHIVELOG2006_06_23O1

_MF_1_12_29Q567DP_.ARC

SQL>SHUTDOWN IMMEDIATE;

2.9 總結

這個時候我們已經準備好了試驗環境.

冷備--&gt插入表1--&gt全備份--&gt插入表2--&gt歸檔切換--&gtdown...

下面就可以開始進行具體的災難模擬和災難恢復操作了.

  1. 災難模擬與災難恢復

3.1 災難模擬

刪除資料庫資料檔案目錄下的所有檔案,模擬伺服器的盤櫃出現故障,盤櫃無法訪問,所有的資料檔案、控制檔案丟失,資料庫無法訪問。

C>DELETE C:ORADATAAIDU*.*

本次模擬的情況是有一份舊的控制檔案和一份RMAN全備份集,RMAN 全備份後連續的歸檔日誌檔案。

3.2 災難恢復

3.2.1 控制檔案的恢復

COPY C:oradataaidu_cool_bak_2006-06-23CON*.CTL C:ORADATAAIDU

在這個環節我們也可以透過建控制的指令碼,手工建立一個空白的控制檔案.生成建立控制檔案的指令碼可以透過SQL語句'alter database bakcup control to trace',然後去編輯trace檔案就可以生成control的建立指令碼.control檔案的指令碼範例見最後的附件內容.

3.2.2清除控制檔案中的RMAN後設資料

C:>RMAN TARGET /

RMAN>STARTUP MOUNT;

RMAN>LIST BACKUP; ##可以看到有很多舊的備份集情況,但這些檔案已經不存在了.

RMAN>CROSSCHECK BACKUP;

RMAN>CROSSCHECK ARCHIVELOG ALL;

RMAN>DELETE OBSOLETE;

RMAN>DELETE EXPIRED BACKUPSET;

RMAN>DELETE EXPIRED ARCHIVELOG ALL;

RMAN>LIST BACKUP; ##沒有備份集顯示了.

3.2.3 登記RMAN備份集和當前歸檔日誌目錄資訊到控制檔案中

RMAN>CATALOG START WITH 'C:oradataflash_recovery_areaAIDUBACKUPSET2006_06_23';

searching for all files that match the pattern C:oradataflash_recovery_areaAIDUBACKUPSET2006_06_23

List of Files Unknown to the Database

=====================================

File Name: C:ORADATAFLASH_RECOVERY_AREAAIDUBACKUPSET2006_06_23O1_MF_NNNDF_TAG20060623T145128_29Q3VKC7_.BKP

Do you really want to catalog the above files (enter YES or NO)? YES

cataloging files...

cataloging done

List of Cataloged Files

=======================

File Name: C:ORADATAFLASH_RECOVERY_AREAAIDUBACKUPSET2006_06_23O1_MF_NNNDF_TAG20060623T145128_29Q3VKC7_.BKP

RMAN> CATALOG START WITH 'C:oradataflash_recovery_areaAIDUARCHIVELOG2006_06_23';

searching for all files that match the pattern C:oradataflash_recovery_areaAIDUARCHIVELOG2006_06_23

List of Files Unknown to the Database

=====================================

File Name: C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_11_29Q52LG5_.ARC

File Name: C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_12_29Q567DP_.ARC

Do you really want to catalog the above files (enter YES or NO)? YES

cataloging files...

cataloging done

List of Cataloged Files

=======================

File Name: C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_11_29Q52LG5_.ARC

File Name: C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_12_29Q567DP_.ARC

RMAN> list archivelog all;

List of Archived Log Copies

Key Thrd Seq S Low Time Name

------- ---- ------- - ------------------- ----

28 1 11 A 2006-06-23 14:49:35 C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_11_29Q52LG5_.ARC

29 1 12 A 2006-06-23 15:12:18 C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_12_29Q567DP_.ARC

3.2.4 配置RMAN 引數

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

3.2.5 使用RMAN 進行RESTORE,恢復資料檔案(DATA FILES

RMAN> run{

2> allocate channel d1 type disk;

3> restore database;

4> release channel d1;}

allocated channel: d1

channel d1: sid=47 devtype=DISK

Starting restore at 2006-06-23 15:47:04

channel d1: starting datafile backupset restore

channel d1: specifying datafile(s) to restore from backup set

restoring datafile 00001 to C:ORADATAAIDUSYSTEM01.DBF

restoring datafile 00002 to C:ORADATAAIDUUNDOTBS01.DBF

restoring datafile 00003 to C:ORADATAAIDUSYSAUX01.DBF

restoring datafile 00004 to C:ORADATAAIDUUSERS01.DBF

channel d1: reading from backup piece C:ORADATAFLASH_RECOVERY_AREAAIDUBACKUPSET2006_06_23O1_MF_NNNDF_TAG20060623T145128_29Q3VKC7_.BKP

channel d1: restored backup piece 1

piece handle=C:ORADATAFLASH_RECOVERY_AREAAIDUBACKUPSET2006_06_23O1_MF_NNNDF_TAG20060623T145128_29Q3VKC7_.BKP tag=TAG20060623T145128

channel d1: restore complete, elapsed time: 00:01:25

Finished restore at 2006-06-23 15:48:30

released channel: d1

3.2.6 SQLPLUS 中查詢當前的資料檔案的SCN DATABASE SCN

可以看到SCN 號為冷備份的SCN,因為我們此時使用的是冷備份的控制檔案作為舊的控制檔案,並使用它進行RMAN的恢復操作。

SQL> select file#,name,checkpoint_change#,sysdate from v$datafile order by file#

FILE# NAME CHECKPOINT_CHANGE# SYSDATE

---------- ------------------------------ ------------------ -------------------

1 C:ORADATAAIDUSYSTEM01.DBF 1220662 2006-06-23 15:51:40

2 C:ORADATAAIDUUNDOTBS01.DBF 1220662 2006-06-23 15:51:40

3 C:ORADATAAIDUSYSAUX01.DBF 1220662 2006-06-23 15:51:40

4 C:ORADATAAIDUUSERS01.DBF 1220662 2006-06-23 15:51:40

SQL>select sysdate,dbid,db_unique_name,checkpoint_change# from v$database;

SYSDATE DBID DB_UNIQUE_NAME CHECKPOINT_CHANGE#

------------------- ---------- ------------------------------ ------------------

2006-06-23 15:53:26 451307475 aidu 1220662

3.2.7 使用RMAN 進行RECOVER操作

結果是失敗的。RMANRECOVER時報DATAFILE 1 必須先RESTORE,(注意:先前我們已經做了該檔案的RESTORE),主要是因為資料檔案頭的SCN 與當前控制檔案的頭的SCN是不相同的,同時找不到兩個SCN之間的歸檔日誌檔案,用於恢復操作以同步SCN

RMAN> RUN{

2> ALLOCATE CHANNEL D1 TYPE DISK;

3> RECOVER DATABASE;

4> RELEASE CHANNEL D1;}

allocated channel: D1

channel D1: sid=47 devtype=DISK

Starting recover at 2006-06-23 15:54:37

released channel: D1

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of recover command at 06/23/2006 15:54:38

RMAN-06094: datafile 1 must be restored

3.2.8 RMAN恢復操作小結

到此,我們應該清楚的明白,單靠RMAN是不可以完成這次的災難恢復工作了,這個時候應該考慮結合SQLPLUS 來進行資料庫的恢復工作,RMAN只是完成將最新的資料檔案(data files)從RMAN備份集中恢復回來,剩下的工作應該交給SQLPLUS了。

3.2.9 手工建立新的控制檔案

SQL>CONN / AS SYSDBA

SQL>ALTER DATABASE BACKUP CONTROLFILE TO TRACE;

編輯trace檔案,建立生成控制檔案的教本指令碼檔案.因為沒有redo檔案,所以選擇resetlogs方式,檔案內容見附件C:TEMPCREATE_CONTROLFILE.TXT.

SQL>SHUTDOWN IMMEDIATE;

刪除資料庫資料檔案目錄下的控制檔案

SQL>host DELETE C:ORADATAAIDUCONT*.CTL

SQL>STARTUP NOMOUNT;

SQL>@C:TEMPCREATE_CONTROLFILE.TXT;

控制建立成功後,將自動將資料庫啟動到MOUNT狀態。

SQL> SELECT OPEN_MODE,CHECKPOINT_CHANGE# FROM V$DATABASE;

OPEN_MODE CHECKPOINT_CHANGE#

---------- ------------------

MOUNTED 0

SQL> select file#,name,checkpoint_change#,sysdate from v$datafile order by file#;

FILE# NAME CHECKPOINT_CHANGE# SYSDATE

---------- ------------------------------ ------------------ -------------------

1 C:ORADATAAIDUSYSTEM01.DBF 1222932 2006-06-23 16:03:50

2 C:ORADATAAIDUUNDOTBS01.DBF 1222932 2006-06-23 16:03:50

3 C:ORADATAAIDUSYSAUX01.DBF 1222932 2006-06-23 16:03:50

4 C:ORADATAAIDUUSERS01.DBF 1222932 2006-06-23 16:03:50

注意:此時DATABASESCN號為0,而資料庫檔案的SCN號為RMAN全備份時的SCN

3.2.10 使用SQLPLUS進行不完整恢復

SQL> recover database using backup controlfile until cancel;

ORA-00279: change 1222932 generated at 06/23/2006 14:51:28 needed for thread 1

ORA-00289: suggestion :C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_11_%U_.ARC

ORA-00280: change 1222932 for thread 1 is in sequence #11

Specify log: {=suggested | filename | AUTO | CANCEL}

AUTO

ORA-00279: change 1223979 generated at 06/23/2006 15:12:18 needed for thread 1

ORA-00289: suggestion :C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_12_%U_.ARC

ORA-00280: change 1223979 for thread 1 is in sequence #12

ORA-00278: log file'C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_11_29Q52LG5_.ARC' no longer needed for this recovery

ORA-00279: change 1224186 generated at 06/23/2006 15:14:15 needed for thread 1

ORA-00289: suggestion :C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_13_%U_.ARC

ORA-00280: change 1224186 for thread 1 is in sequence #13

ORA-00278: log file'C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_12_29Q567DP_.ARC' no longer needed for this recovery

ORA-00308: cannot open archived log'C:ORADATAFLASH_RECOVERY_AREAAIDUARCHIVELOG2006_06_23O1_MF_1_13_%U_.ARC'

ORA-27041: unable to open file

OSD-04002: ????????????

O/S-Error: (OS 2) ??????????????????????

我們知道最後一個歸檔日誌檔案序號為12,所以報找不到序號13是正常的.

SQL>ALTER DATABASE OPEN RESETLOGS;

3.2.11 檢查資料庫恢復後的狀態

SQL>SELECT COUNT(1) FROM AIDU.TEST_BEFORE_BAK;

COUNT(1)

----------

524288

SQL> SELECT COUNT(1) FROM AIDU.TEST_AFTER_BAK;

COUNT(1)

----------

524288

可以看到RMAN 備份前後的資料都恢復回來了,這次的試驗是無法恢復REDO檔案中的內容,REDO 檔案隨著盤陣的丟失而丟失,儲存在當前REDO檔案中的內容將隨之丟失無法恢復。

未完,接http://djb1008.itpub.net/post/42280/505709

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/32980/viewspace-1038406/,如需轉載,請註明出處,否則將追究法律責任。

相關文章