新增資料檔案與恢復cf
Recovering Through an Added Datafile with a Backup Control File: Scenario
引自: b14192.pdf p404
如果有以下場景發生,
1 備份資料庫
2 建立了一個表空間,新增了兩個資料檔案
3 恢復了控制檔案,並開始做介質恢復
將會出現下述錯誤
ORA-00283: recovery session canceled due to errors
ORA-01244: unnamed datafile(s) added to control file by media recovery
ORA-01110: data file 6: '/u01/app/oracle/oradata/al32/test02.dbf'
ORA-01110: data file 5: '/u01/app/oracle/oradata/al32/test01.dbf'
解決方法描述如下
[@more@]啟動資料庫
SQL> startup
ORACLE instance started.
Total System Global Area 1258291200 bytes
Fixed Size 2083728 bytes
Variable Size 352322672 bytes
Database Buffers 889192448 bytes
Redo Buffers 14692352 bytes
Database mounted.
Database opened.
確定當前的資料檔案
SQL> select file#,name from v$dbfile;
FILE# NAME
---------- -------------------------------------------------------
4 /u01/app/oracle/oradata/al32/ts_ww01.dbf
3 /u01/app/oracle/oradata/al32/sysaux01.dbf
2 /u01/app/oracle/oradata/al32/undotbs01.dbf
1 /u01/app/oracle/oradata/al32/system01.dbf
SQL> select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
TEMP
TS_WW
對資料庫做個備份
RMAN> backup incremental level 0 database;
Starting backup at 20110114.08:55:45
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/al32/system01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/al32/undotbs01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/al32/sysaux01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/al32/ts_ww01.dbf
channel ORA_DISK_1: starting piece 1 at 20110114.08:55:45
channel ORA_DISK_1: finished piece 1 at 20110114.08:56:00
piece handle=/u01/fra/AL32/backupset/2011_01_14/o1_mf_nnnd0_TAG20110114T085545_6lz7rkk6_.bkp tag=TAG20110114T085545 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 20110114.08:56:00
channel ORA_DISK_1: finished piece 1 at 20110114.08:56:01
piece handle=/u01/fra/AL32/backupset/2011_01_14/o1_mf_ncsn0_TAG20110114T085545_6lz7s0qq_.bkp tag=TAG20110114T085545 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 20110114.08:56:01
新增表空間
SQL>
1 create tablespace test datafile
2 '/u01/app/oracle/oradata/al32/test01.dbf' size 10M,
3 '/u01/app/oracle/oradata/al32/test02.dbf' size 10M
4 extent management local
5* segment space management auto
6 /
Tablespace created.
停止例項
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
RMAN> startup nomount
Oracle instance started
Total System Global Area 1258291200 bytes
Fixed Size 2083728 bytes
Variable Size 352322672 bytes
Database Buffers 889192448 bytes
Redo Buffers 14692352 bytes
恢復控制檔案
RMAN> restore controlfile from autobackup;
Starting restore at 20110114.08:59:02
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
recovery area destination: /u01/fra
database name (or database unique name) used for search: AL32
channel ORA_DISK_1: no autobackups found in the recovery area
autobackup search outside recovery area not attempted because DBID was not set
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 01/14/2011 08:59:04
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece
RMAN> restore controlfile from '/u01/fra/AL32/backupset/2011_01_14/o1_mf_ncsn0_TAG20110114T085545_6lz7s0qq_.bkp';
Starting restore at 20110114.08:59:23
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output filename=/u01/app/oracle/oradata/al32/control01.ctl
output filename=/u01/app/oracle/oradata/al32/control02.ctl
output filename=/u01/app/oracle/oradata/al32/control03.ctl
Finished restore at 20110114.08:59:25
mount資料庫
RMAN> sql 'alter database mount';
sql statement: alter database mount
released channel: ORA_DISK_1
嘗試恢復資料庫
RMAN> recover database;
Starting recover at 20110114.09:00:54
Starting implicit crosscheck backup at 20110114.09:00:54
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 20110114.09:00:55
Starting implicit crosscheck copy at 20110114.09:00:55
using channel ORA_DISK_1
Finished implicit crosscheck copy at 20110114.09:00:55
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/fra/AL32/backupset/2011_01_14/o1_mf_ncsn0_TAG20110114T085545_6lz7s0qq_.bkp
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 1 is already on disk as file /u01/app/oracle/oradata/al32/redo01.log
archive log filename=/u01/app/oracle/oradata/al32/redo01.log thread=1 sequence=1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/14/2011 09:00:57
ORA-01422: exact fetch returns more than requested number of rows
RMAN-20505: create datafile during recovery
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/u01/app/oracle/oradata/al32/redo01.log'
ORA-00283: recovery session canceled due to errors
ORA-01244: unnamed datafile(s) added to control file by media recovery
ORA-01110: data file 6: '/u01/app/oracle/oradata/al32/test02.dbf'
ORA-01110: data file 5: '/u01/app/oracle/oradata/al32/test01.dbf'
檢視當前資料檔案
SQL> conn /as sysdba
Connected.
SQL> select file#,name from v$dbfile;
FILE# NAME
---------- -------------------------------------------------------
4 /u01/app/oracle/oradata/al32/ts_ww01.dbf
3 /u01/app/oracle/oradata/al32/sysaux01.dbf
2 /u01/app/oracle/oradata/al32/undotbs01.dbf
1 /u01/app/oracle/oradata/al32/system01.dbf
5 /u01/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00005
6 /u01/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00006
檢視alert日誌,確認檔案號與檔名稱
$ tail $ORACLE_BASE/admin/al32/bdump/alert_al32.log
Media Recovery Log /u01/app/oracle/oradata/al32/redo01.log
File #5 added to control file as 'UNNAMED00005'. Originally created as:
'/u01/app/oracle/oradata/al32/test01.dbf'
File #6 added to control file as 'UNNAMED00006'. Originally created as:
'/u01/app/oracle/oradata/al32/test02.dbf'
Some recovered datafiles maybe left media fuzzy
Media recovery may continue but open resetlogs may fail
Fri Jan 14 09:00:57 2011
Media Recovery failed with error 1244
ORA-283 signalled during: alter database recover logfile '/u01/app/oracle/oradata/al32/redo01.log'...
將檔名修改正確
SQL> alter database rename file
2 '/u01/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00005' to
3 '/u01/app/oracle/oradata/al32/test01.dbf';
Database altered.
SQL> alter database rename file
2 '/u01/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00006' to
3 '/u01/app/oracle/oradata/al32/test02.dbf';
Database altered.
繼續恢復操作
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 9467942 generated at 01/14/2011 08:57:31 needed for thread 1
ORA-00289: suggestion : /u01/fra/AL32/archivelog/2011_01_14/o1_mf_1_1_%u_.arc
ORA-00280: change 9467942 for thread 1 is in sequence #1
Specify log: {
/u01/app/oracle/oradata/al32/redo01.log
Log applied.
Media recovery complete.
SQL> alter database open noresetlogs;
alter database open noresetlogs
*
ERROR at line 1:
ORA-01588: must use RESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
SQL>
完成恢復
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271063/viewspace-1044641/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 備份與恢復--重建控制檔案後資料檔案損壞的恢復
- Oracle備份與恢復【丟失資料檔案的恢復】Oracle
- PostgreSQL資料檔案災難恢復-解析與資料dumpSQL
- 資料恢復-電腦管家檔案恢復工具資料恢復
- rman恢復資料檔案 恢復表空間
- 同時丟失控制檔案與資料檔案的恢復
- 如何恢復在全備後新增了資料檔案的資料庫資料庫
- 恢復之重建資料檔案
- ORACLE 只讀資料檔案備份與恢復Oracle
- 【資料庫資料恢復】透過恢復NDF檔案修復資料庫的資料恢復過程資料庫資料恢復
- RMAN恢復案例:無恢復目錄,丟失全部資料檔案、控制檔案、日誌檔案恢復
- RMAN恢復案例:丟失全部資料檔案恢復
- 備份與恢復系列 八 丟失所有資料檔案的還原與恢復
- 資料檔案誤刪--但有資料檔案的copy恢復
- 恢復之還原資料檔案
- 資料檔案丟失的恢復
- [ORACLE ASM] AMDU 恢復資料檔案OracleASM
- Bak檔案恢復到資料庫資料庫
- 資料檔案丟失如何恢復
- 【資料庫資料恢復】MongoDB資料庫檔案損壞的資料恢復案例資料庫資料恢復MongoDB
- rman備份恢復-rman恢復資料檔案測試
- rman恢復時跳過資料檔案,進行恢復
- 【備份與恢復】archivelog模式中資料檔案的恢復Hive模式
- 【備份與恢復】noarchivelog模式中資料檔案的恢復Hive模式
- 備份與恢復--重新控制檔案資料字典和控制檔案不一致的恢復
- 備份與恢復(Parameter 檔案恢復篇)
- 資料恢復新姿勢——通過ibd和frm檔案恢復資料資料恢復
- 恢復案例:歸檔模式下丟失全部資料檔案的恢復模式
- bbed 與檔案頭恢復
- 備份與恢復系列 九 丟失表空間資料檔案的還原與恢復
- SQL Server 2008資料庫新增資料檔案後Standby庫的恢復SQLServer資料庫
- ORACLE9I RMAN恢復資料庫後需要手工新增臨時資料檔案Oracle資料庫
- 備份與恢復--資料檔案損壞或丟失
- RMAN恢復案例:丟失非系統資料檔案恢復
- rman恢復資料檔案-----塊折斷
- RM 刪除資料檔案恢復操作
- 【資料庫資料恢復】Sql Server資料庫檔案丟失的資料恢復過程資料庫資料恢復SQLServer
- 【伺服器資料恢復】StorNext檔案系統資料恢復案例伺服器資料恢復