Oracle 恢復一例

xchui702發表於2011-07-19

今天上班收到郵件資料庫備份報錯的郵件:發現是由一個datafile 15找不到。

Recovery Manager: Release 11.2.0.1.0 - Production on Mon Jul 18 19:30:02 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDIAMP01 (DBID=3771178002)

RMAN> run{
2>    configure controlfile autobackup on;
3>    backup as compressed backupset database plus archivelog delete
3> input;
4>    delete obsolete;
5>    }
6>
7>
using target database control file instead of recovery catalog old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored


Starting backup at 18-JUL-11
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1162 device type=DISK channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=2085 RECID=2057 STAMP=756799114 input archived log thread=1 sequence=2086 RECID=2058 STAMP=756807214 input archived log thread=1 sequence=2087 RECID=2059 STAMP=756820998 input archived log thread=1 sequence=2088 RECID=2060 STAMP=756822612 input archived log thread=1 sequence=2089 RECID=2061 STAMP=756846195 input archived log thread=1 sequence=2090 RECID=2062 STAMP=756847814 channel ORA_DISK_1: starting piece 1 at 18-JUL-11 channel ORA_DISK_1: finished piece 1 at 18-JUL-11 piece handle=/u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_18/o1_mf_annnn_TAG20110718T193015_7286b8g5_.bkp tag=TAG20110718T193015 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15 channel ORA_DISK_1: deleting archived log(s) archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_18/o1_mf_1_2085_726prbf6_.arc RECID=2057 STAMP=756799114 archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_18/o1_mf_1_2086_726yog4v_.arc RECID=2058 STAMP=756807214 archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_18/o1_mf_1_2087_727d45rm_.arc RECID=2059 STAMP=756820998 archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_18/o1_mf_1_2088_727fpn5x_.arc RECID=2060 STAMP=756822612 archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_18/o1_mf_1_2089_7284qm5l_.arc RECID=2061 STAMP=756846195 archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_18/o1_mf_1_2090_7286b65t_.arc RECID=2062 STAMP=756847814 Finished backup at 18-JUL-11

Starting backup at 18-JUL-11
using channel ORA_DISK_1
RMAN-06169: could not read file header for datafile 15 error reason 4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 07/18/2011 19:30:32
RMAN-06056: could not access datafile 15

Recovery Manager complete.

前後也收到了大量關於此檔案丟失的alert.log的資訊的郵件:
Mon Jul 18 19:20:35 2011
Errors in file /u01/app/oracle/diag/rdbms/cdiamp01/cdiamp01/trace/cdiamp01_m000_24737.trc:
ORA-01135: file 15 accessed for DML/query is offline
ORA-01110: data file 15: '/u01/oradata/CDIAMP01/datafile/o1_mf_moia_6xvc8hd0_.dbf'

解決方法如下:
1. 確認此檔案不存在:
SQL> ! ls /u01/oradata/CDIAMP01/datafile/o1_mf_moia_6xvc8hd0_.dbf
ls: /u01/oradata/CDIAMP01/datafile/o1_mf_moia_6xvc8hd0_.dbf: No such file or directory

2. 先使 datafile 15 離線
SQL> alter database datafile 15 offline;

Database altered.

3. 檢查該檔案的備份:
RMAN> list backup of datafile 15;

using target database control file instead of recovery catalog

List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
148     Full    4.12G      DISK        00:24:11     11-JUL-11     
        BP Key: 148   Status: AVAILABLE  Compressed: YES  Tag: TAG20110711T193024
        Piece Name: /u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_11/o1_mf_nnndf_TAG20110711T193024_71oqpkg4_.bkp
  List of Datafiles in backup set 148
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  15      Full 11236772271 11-JUL-11 /u01/oradata/CDIAMP01/datafile/o1_mf_moia_6xvc8hd0_.dbf

4. 還原datafile 15
RMAN> restore datafile 15;

Starting restore at 19-JUL-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=778 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00015 to /u01/oradata/CDIAMP01/datafile/o1_mf_moia_6xvc8hd0_.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_11/o1_mf_nnndf_TAG20110711T193024_71oqpkg4_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_11/o1_mf_nnndf_TAG20110711T193024_71oqpkg4_.bkp tag=TAG20110711T193024
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:06
Finished restore at 19-JUL-11

4. 恢復: 要使用的archived log原來已經備份了,會臨時自動從備份中還原供恢復使用,使用完後會自動刪除
RMAN> recover datafile 15;

Starting recover at 19-JUL-11
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 2091 is already on disk as file /u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_18/o1_mf_1_2091_728h3tx3_.arc
archived log for thread 1 with sequence 2092 is already on disk as file /u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_18/o1_mf_1_2092_728h690s_.arc
archived log for thread 1 with sequence 2093 is already on disk as file /u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2093_729m39t4_.arc
archived log for thread 1 with sequence 2094 is already on disk as file /u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2094_729m3l13_.arc
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2042
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_11/o1_mf_annnn_TAG20110711T195442_71os42n9_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_11/o1_mf_annnn_TAG20110711T195442_71os42n9_.bkp tag=TAG20110711T195442
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2042_729qt6jh_.arc thread=1 sequence=2042
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2042_729qt6jh_.arc RECID=2067 STAMP=756898502
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2043
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2044
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2045
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2046
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2047
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2048
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_12/o1_mf_annnn_TAG20110712T193007_71rd20bs_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_12/o1_mf_annnn_TAG20110712T193007_71rd20bs_.bkp tag=TAG20110712T193007
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:18
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2043_729qt7yz_.arc thread=1 sequence=2043
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2043_729qt7yz_.arc RECID=2073 STAMP=756898511
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2044_729qt833_.arc thread=1 sequence=2044
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2044_729qt833_.arc RECID=2069 STAMP=756898511
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2045_729qt816_.arc thread=1 sequence=2045
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2045_729qt816_.arc RECID=2072 STAMP=756898511
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2046_729qt808_.arc thread=1 sequence=2046
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2046_729qt808_.arc RECID=2071 STAMP=756898511
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2047_729qt83q_.arc thread=1 sequence=2047
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2047_729qt83q_.arc RECID=2070 STAMP=756898511
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2048_729qt84o_.arc thread=1 sequence=2048
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2048_729qt84o_.arc RECID=2068 STAMP=756898507
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2049
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2050
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2051
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2052
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2053
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2054
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_13/o1_mf_annnn_TAG20110713T193013_71v0g5r5_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_13/o1_mf_annnn_TAG20110713T193013_71v0g5r5_.bkp tag=TAG20110713T193013
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2049_729qtvf9_.arc thread=1 sequence=2049
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2049_729qtvf9_.arc RECID=2076 STAMP=756898532
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2050_729qtvg5_.arc thread=1 sequence=2050
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2050_729qtvg5_.arc RECID=2075 STAMP=756898531
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2051_729qtvb3_.arc thread=1 sequence=2051
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2051_729qtvb3_.arc RECID=2078 STAMP=756898532
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2052_729qtv99_.arc thread=1 sequence=2052
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2052_729qtv99_.arc RECID=2079 STAMP=756898532
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2053_729qtvc0_.arc thread=1 sequence=2053
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2053_729qtvc0_.arc RECID=2077 STAMP=756898532
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2054_729qtvgz_.arc thread=1 sequence=2054
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2054_729qtvgz_.arc RECID=2074 STAMP=756898531
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2055
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2056
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2057
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2058
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2059
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2060
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_14/o1_mf_annnn_TAG20110714T193011_71xnt3xz_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_14/o1_mf_annnn_TAG20110714T193011_71xnt3xz_.bkp tag=TAG20110714T193011
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2055_729qvcs2_.arc thread=1 sequence=2055
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2055_729qvcs2_.arc RECID=2084 STAMP=756898549
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2056_729qvcvb_.arc thread=1 sequence=2056
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2056_729qvcvb_.arc RECID=2083 STAMP=756898549
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2057_729qvcr7_.arc thread=1 sequence=2057
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2057_729qvcr7_.arc RECID=2085 STAMP=756898549
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2058_729qvcsr_.arc thread=1 sequence=2058
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2058_729qvcsr_.arc RECID=2081 STAMP=756898549
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2059_729qvctm_.arc thread=1 sequence=2059
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2059_729qvctm_.arc RECID=2082 STAMP=756898549
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2060_729qvcwh_.arc thread=1 sequence=2060
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2060_729qvcwh_.arc RECID=2080 STAMP=756898547
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2061
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2062
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2063
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2064
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2065
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2066
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2067
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2068
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2069
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2070
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2071
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2072
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_15/o1_mf_annnn_TAG20110715T193014_720966ow_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_15/o1_mf_annnn_TAG20110715T193014_720966ow_.bkp tag=TAG20110715T193014
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2061_729qvwl7_.arc thread=1 sequence=2061
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2061_729qvwl7_.arc RECID=2086 STAMP=756898572
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2062_729qvwkh_.arc thread=1 sequence=2062
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2062_729qvwkh_.arc RECID=2087 STAMP=756898572
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2063_729qvwgd_.arc thread=1 sequence=2063
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2063_729qvwgd_.arc RECID=2091 STAMP=756898573
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2064_729qvwh8_.arc thread=1 sequence=2064
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2064_729qvwh8_.arc RECID=2092 STAMP=756898573
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2065_729qvwdz_.arc thread=1 sequence=2065
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2065_729qvwdz_.arc RECID=2089 STAMP=756898572
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2066_729qvwfr_.arc thread=1 sequence=2066
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2066_729qvwfr_.arc RECID=2090 STAMP=756898572
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2067_729qvwjv_.arc thread=1 sequence=2067
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2067_729qvwjv_.arc RECID=2088 STAMP=756898572
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2068_729qwdnn_.arc thread=1 sequence=2068
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2068_729qwdnn_.arc RECID=2096 STAMP=756898577
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2069_729qvwhw_.arc thread=1 sequence=2069
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2069_729qvwhw_.arc RECID=2093 STAMP=756898573
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2070_729qwddl_.arc thread=1 sequence=2070
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2070_729qwddl_.arc RECID=2095 STAMP=756898577
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2071_729qwdk7_.arc thread=1 sequence=2071
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2071_729qwdk7_.arc RECID=2097 STAMP=756898577
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2072_729qwdrb_.arc RECID=2094 STAMP=756898573
media recovery complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2073
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2074
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2075
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2076
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2077
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2078
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2079
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_16/o1_mf_annnn_TAG20110716T193013_722xl5sw_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_16/o1_mf_annnn_TAG20110716T193013_722xl5sw_.bkp tag=TAG20110716T193013
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2073_729qwrj0_.arc RECID=2103 STAMP=756898595
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2074_729qwrkn_.arc RECID=2099 STAMP=756898595
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2075_729qwrjl_.arc RECID=2102 STAMP=756898595
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2076_729qwrhk_.arc RECID=2104 STAMP=756898595
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2077_729qwrk6_.arc RECID=2101 STAMP=756898595
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2078_729qwrl8_.arc RECID=2100 STAMP=756898595
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2079_729qwrlr_.arc RECID=2098 STAMP=756898595
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2080
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2081
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2082
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2083
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2084
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_17/o1_mf_annnn_TAG20110717T193012_725ky55h_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_17/o1_mf_annnn_TAG20110717T193012_725ky55h_.bkp tag=TAG20110717T193012
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2080_729qx7nc_.arc RECID=2107 STAMP=756898610
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2081_729qx7lg_.arc RECID=2109 STAMP=756898610
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2082_729qx7lz_.arc RECID=2108 STAMP=756898610
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2083_729qx7mq_.arc RECID=2106 STAMP=756898610
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2084_729qx7op_.arc RECID=2105 STAMP=756898607
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2085
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2086
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2087
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2088
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2089
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2090
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_18/o1_mf_annnn_TAG20110718T193015_7286b8g5_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/CDIAMP01/backupset/2011_07_18/o1_mf_annnn_TAG20110718T193015_7286b8g5_.bkp tag=TAG20110718T193015
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:26
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2085_729qxqmj_.arc RECID=2113 STAMP=756898631
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2086_729qxqfx_.arc RECID=2115 STAMP=756898631
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2087_729qxqgd_.arc RECID=2114 STAMP=756898631
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2088_729qxqgw_.arc RECID=2111 STAMP=756898630
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2089_729qxqlz_.arc RECID=2112 STAMP=756898631
channel default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2090_729qxqqo_.arc RECID=2110 STAMP=756898619
Finished recover at 19-JUL-11

5. 檢查此檔案狀態,並使它online.
SQL> select file_name,ONLINE_STATUS from dba_data_files where file_id=15;

FILE_NAME                                                                        ONLINE_STATUS
-------------------------------------------------------------------------------- -------------
/u01/oradata/CDIAMP01/datafile/o1_mf_moia_729qol4c_.dbf                          OFFLINE

SQL> alter database datafile 15 online;

Database altered

SQL> select file_name,ONLINE_STATUS from dba_data_files where file_id=15;

FILE_NAME                                                                        ONLINE_STATUS
-------------------------------------------------------------------------------- -------------
/u01/oradata/CDIAMP01/datafile/o1_mf_moia_729qol4c_.dbf                          ONLINE

6. 至此資料庫恢復正常。

注意在恢復檔案時候,會在alert.log出現以下類是錯誤:這是恢復過程中找不到archivelog出現的,後來會在backupset中找到來恢復。
alter database recover logfile '/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2042_729qt6jh_.arc'
Media Recovery Log /u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2042_729qt6jh_.arc
ORA-279 signalled during: alter database recover logfile '/u01/app/oracle/flash_recovery_area/CDIAMP01/archivelog/2011_07_19/o1_mf_1_2042_729qt6jh_.arc'...

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

相關文章