資料檔案丟失的恢復
報錯資訊:
SQL> startup
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 511708752 bytes
Database Buffers 331350016 bytes
Redo Buffers 5132288 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/u01/app/oracle/oradata/orcl/test01.dbf':
確認丟失資料檔案號:
SQL> col name for a50
SQL> select file#,name from v$datafile;
FILE# NAME
---------- --------------------------------------------------
1 /u01/app/oracle/oradata/orcl/system01.dbf
2 /u01/app/oracle/oradata/orcl/sysaux01.dbf
3 /u01/app/oracle/oradata/orcl/undotbs01.dbf
4 /u01/app/oracle/oradata/orcl/users01.dbf
5 /u01/app/oracle/oradata/orcl/example01.dbf
6 /u01/app/oracle/oradata/orcl/test01.dbf
6 rows selected.
使用rman進行恢復:
[oracle@localhost ~]$ rman target / nocatalog
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Aug 21 20:15:20 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1383986269, not open)
using target database control file instead of recovery catalog
RMAN> report schema;
Report of database schema for database with db_unique_name ORCL
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 680 SYSTEM *** /u01/app/oracle/oradata/orcl/system01.dbf
2 480 SYSAUX *** /u01/app/oracle/oradata/orcl/sysaux01.dbf
3 60 UNDOTBS1 *** /u01/app/oracle/oradata/orcl/undotbs01.dbf
4 5 USERS *** /u01/app/oracle/oradata/orcl/users01.dbf
5 100 EXAMPLE *** /u01/app/oracle/oradata/orcl/example01.dbf
6 0 TEST *** /u01/app/oracle/oradata/orcl/test01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 /u01/app/oracle/oradata/orcl/temp01.dbf
開始恢復:
RMAN> restore datafile 6;
Starting restore at 21-AUG-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=17 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 00006 to /u01/app/oracle/oradata/orcl/test01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/backup/indb1_0bpghe88_1_1
channel ORA_DISK_1: piece handle=/u01/app/backup/indb1_0bpghe88_1_1 tag=INDB1
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 21-AUG-14
RMAN> recover datafile 6;
Starting recover at 21-AUG-14
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 21-AUG-14
嘗試重新開啟資料庫:
SQL> alter database open;
Database altered.
SQL> select * from test.t1;
ID NAME
---------- --------------------------------------------------
1 grace
2 joe
SQL> startup
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 511708752 bytes
Database Buffers 331350016 bytes
Redo Buffers 5132288 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/u01/app/oracle/oradata/orcl/test01.dbf':
確認丟失資料檔案號:
SQL> col name for a50
SQL> select file#,name from v$datafile;
FILE# NAME
---------- --------------------------------------------------
1 /u01/app/oracle/oradata/orcl/system01.dbf
2 /u01/app/oracle/oradata/orcl/sysaux01.dbf
3 /u01/app/oracle/oradata/orcl/undotbs01.dbf
4 /u01/app/oracle/oradata/orcl/users01.dbf
5 /u01/app/oracle/oradata/orcl/example01.dbf
6 /u01/app/oracle/oradata/orcl/test01.dbf
6 rows selected.
使用rman進行恢復:
[oracle@localhost ~]$ rman target / nocatalog
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Aug 21 20:15:20 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1383986269, not open)
using target database control file instead of recovery catalog
RMAN> report schema;
Report of database schema for database with db_unique_name ORCL
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 680 SYSTEM *** /u01/app/oracle/oradata/orcl/system01.dbf
2 480 SYSAUX *** /u01/app/oracle/oradata/orcl/sysaux01.dbf
3 60 UNDOTBS1 *** /u01/app/oracle/oradata/orcl/undotbs01.dbf
4 5 USERS *** /u01/app/oracle/oradata/orcl/users01.dbf
5 100 EXAMPLE *** /u01/app/oracle/oradata/orcl/example01.dbf
6 0 TEST *** /u01/app/oracle/oradata/orcl/test01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 /u01/app/oracle/oradata/orcl/temp01.dbf
開始恢復:
RMAN> restore datafile 6;
Starting restore at 21-AUG-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=17 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 00006 to /u01/app/oracle/oradata/orcl/test01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/backup/indb1_0bpghe88_1_1
channel ORA_DISK_1: piece handle=/u01/app/backup/indb1_0bpghe88_1_1 tag=INDB1
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 21-AUG-14
RMAN> recover datafile 6;
Starting recover at 21-AUG-14
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 21-AUG-14
嘗試重新開啟資料庫:
SQL> alter database open;
Database altered.
SQL> select * from test.t1;
ID NAME
---------- --------------------------------------------------
1 grace
2 joe
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29800581/viewspace-1255840/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 資料檔案丟失如何恢復
- RMAN恢復案例:丟失全部資料檔案恢復
- RMAN完全恢復丟失的資料檔案
- 普通資料檔案丟失的恢復方法
- 資料檔案丟失損壞的恢復--
- 電腦檔案丟失資料恢復資料恢復
- Oracle備份與恢復【丟失資料檔案的恢復】Oracle
- 歸檔模式下資料檔案丟失的恢復模式
- 恢復案例:歸檔模式下丟失全部資料檔案的恢復模式
- 備份恢復之資料檔案丟失
- RMAN恢復案例:丟失非系統資料檔案恢復
- 恢復丟失的控制檔案
- rman恢復--歸檔模式有備份,丟失資料檔案的恢復模式
- rman恢復--歸檔模式無備份,丟失資料檔案的恢復模式
- 控制檔案丟失恢復
- 【控制檔案丟失恢復】
- rman 恢復---歸檔丟失and資料檔案損壞
- 引數檔案控制檔案和資料檔案丟失的恢復
- Sql Server資料庫檔案丟失的恢復方法SQLServer資料庫
- 資料檔案丟失的恢復(改變目錄)
- 撤消表空間資料檔案丟失的恢復.
- 完全恢復之所有資料庫檔案丟失資料庫
- 資料庫各種檔案丟失恢復大全。資料庫
- 【恢復】Redo日誌檔案丟失的恢復
- RMAN恢復案例:無恢復目錄,丟失全部資料檔案、控制檔案、日誌檔案恢復
- 控制檔案全部丟失的恢復
- 控制檔案部分丟失的恢復
- Oracle Password檔案丟失的恢復Oracle
- 控制檔案丟失的RMAN恢復
- 歸檔模式下丟失普通資料檔案並恢復模式
- 【資料庫資料恢復】Sql Server資料庫檔案丟失的資料恢復過程資料庫資料恢復SQLServer
- DATA GUARD主庫丟失資料檔案的恢復(2)
- DATA GUARD主庫丟失資料檔案的恢復(3)
- DATA GUARD主庫丟失資料檔案的恢復(1)
- 磁碟損壞導致資料檔案丟失的恢復
- 利用rman做資料檔案丟失的恢復實驗
- 在open狀態下恢復丟失的資料檔案
- 【伺服器資料恢復】xfs檔案系統資料丟失的資料恢復案例伺服器資料恢復