RMAN 恢復之控制檔案篇(1/5)

djb1008發表於2011-06-07

1.1 案例環境描述

本文主要描述分別使用不同階段產生的控制檔案進行rman恢復。

1.1.1 作業系統環境

基本環境描述:

OS: Linux restoretest 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux

[@more@]

1.1.2資料庫環境

DB: oracle 10.2.0.4

SQL> select name from v$datafile;

/oradata/gcwz_web/system01.dbf

/oradata/gcwz_web/undotbs01.dbf

/oradata/gcwz_web/sysaux01.dbf

/oradata/gcwz_web/users01.dbf

/oradata/gcwz_web/test01.dbf

SQL> select name from v$tempfile;

/oradata/gcwz_web/temp01.dbf

SQL> select name from v$controlfile;

/oradata/gcwz_web/control01.ctl

/oradata/gcwz_web/control02.ctl

/oradata/gcwz_web/control03.ctl

SQL> select name,dbid from v$database;

GCWZ_WEB 3469129477

[oracle@restoretest archivelog]$ ls -lt

-rwxr-xr-x 1 oracle dba 1601536 Feb 2 11:22 1_59_690800133.dbf

-rwxr-xr-x 1 oracle dba 13824 Feb 2 11:29 1_60_690800133.dbf

[oracle@restoretest archivelog]$ cd /rman

[oracle@restoretest rman]$ ls -lt

-rw-r----- 1 oracle oinstall 7110656 Feb 2 10:38 control_73

-rw-r----- 1 oracle oinstall 7143424 Feb 2 10:36 full_72_709900586_1

-rw-r----- 1 oracle oinstall 290930688 Feb 2 10:36 full_71_709900579_1

-rw-r----- 1 oracle oinstall 7110656 Feb 2 10:15 cntrl_69_1_709899322

Rman target /

Rman>list backup of database;

BS Key Type LV Size Device Type Elapsed Time Completion Time

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

54 Full 277.45M DISK 00:00:00 02-FEB-10

BP Key: 54 Status: AVAILABLE Compressed: NO Tag: TAG20100202T103618

Piece Name: /rman/full_71_709900579_1

List of Datafiles in backup set 54

File LV Type Ckp SCN Ckp Time Name

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

1 Full 1129995 02-FEB-10 /oradata/gcwz_web/system01.dbf

2 Full 1129995 02-FEB-10 /oradata/gcwz_web/undotbs01.dbf

3 Full 1129995 02-FEB-10 /oradata/gcwz_web/sysaux01.dbf

4 Full 1129995 02-FEB-10 /oradata/gcwz_web/users01.dbf

5 Full 1129995 02-FEB-10 /oradata/gcwz_web/test01.dbf

RMAN> list archivelog all;

List of Archived Log Copies

Key Thrd Seq S Low Time Name

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

43 1 59 A 01-FEB-10 /archivelog/1_59_690800133.dbf

41 1 60 A 02-FEB-10 /archivelog/1_60_690800133.dbf

Rman>list backup of controlfile;

BS Key Type LV Size Device Type Elapsed Time Completion Time

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

52 Full 6.77M DISK 00:00:00 02-FEB-10

BP Key: 52 Status: AVAILABLE Compressed: NO Tag: TAG20100202T101522

Piece Name: /rman/cntrl_69_1_709899322

Control File Included: Ckp SCN: 1129959 Ckp time: 02-FEB-10

(這個控制檔案的備份是透過backup current controlfile format ‘cntrl_$s_%p_%t’產生的,在進行全庫備份前執行的。)

BS Key Type LV Size Device Type Elapsed Time Completion Time

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

53 Full 6.80M DISK 00:00:00 02-FEB-10

BP Key: 53 Status: AVAILABLE Compressed: NO Tag: TAG20100202T103618

Piece Name: /rman/full_72_709900586_1

Control File Included: Ckp SCN: 1129997 Ckp time: 02-FEB-10

(這個控制檔案的備份是執行了全庫備份時,自動產生的。)

BS Key Type LV Size Device Type Elapsed Time Completion Time

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

55 Full 6.77M DISK 00:00:00 02-FEB-10

BP Key: 55 Status: AVAILABLE Compressed: NO Tag: TAG20100202T103829

Piece Name: /rman/control_73

Control File Included: Ckp SCN: 1130068 Ckp time: 02-FEB-10

(這個控制檔案的備份是透過backup current controlfile format ‘control_%F’產生的,在進行全庫備份後執行的。)

所以這三個控制檔案是全庫備份的前,當時,後的三個版本.

透過檔案的時間可以看出先後:

[root@restoretest rman]# ls -lt

-rw-r----- 1 oracle oinstall 7110656 Feb 2 10:38 control_73

-rw-r----- 1 oracle oinstall 7143424 Feb 2 10:36 full_72_709900586_1

-rw-r----- 1 oracle oinstall 290930688 Feb 2 10:36 full_71_709900579_1

-rw-r----- 1 oracle oinstall 7110656 Feb 2 10:15 cntrl_69_1_709899322

控制檔案備份檔名

時期

控制檔案SCN

/rman/cntrl_69_1_709899322

rman全備份前

1129959

/rman/full_72_709900586_1

rman全備份中

1129997

/rman/control_73

rman全備份後

1130068

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

NAME FIRST_CHANGE# NEXT_CHANGE#

/archivelog/1_60_690800133.dbf 1129918 1130034

/archivelog/1_59_690800133.dbf 1128303 1129918

下一篇:RMAN 恢復之控制檔案篇(2/5)

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

相關文章