資料檔案丟失的恢復
報錯資訊:
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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 電腦檔案丟失資料恢復資料恢復
- Sql Server資料庫檔案丟失的恢復方法SQLServer資料庫
- DATA GUARD主庫丟失資料檔案的恢復(3)
- DATA GUARD主庫丟失資料檔案的恢復(1)
- DATA GUARD主庫丟失資料檔案的恢復(2)
- 【資料庫資料恢復】Sql Server資料庫檔案丟失的資料恢復過程資料庫資料恢復SQLServer
- 【北亞資料恢復】MongoDB資料遷移檔案丟失的MongoDB資料恢復案例資料恢復MongoDB
- 【資料庫資料恢復】mdb_catalog.wt檔案丟失的MongoDB資料恢復案例資料庫資料恢復MongoDB
- 【伺服器資料恢復】xfs檔案系統資料丟失的資料恢復案例伺服器資料恢復
- macOS Big Sur系統如何恢復丟失的資料檔案?Mac
- 剪下的檔案還能恢復嗎,恢復剪貼丟失的檔案
- 資料庫資料恢復—MongoDB資料庫檔案丟失,啟動報錯的資料恢復案例資料庫資料恢復MongoDB
- MongoDB資料庫報錯,資料庫檔案丟失資料恢復案例MongoDB資料庫資料恢復
- 丟失的隨身碟檔案如何恢復?
- 【虛擬機器資料恢復】Hyper-V虛擬化檔案丟失的資料恢復案例虛擬機資料恢復
- 硬碟資料丟失如何恢復?硬碟
- 分割槽丟失資料恢復資料恢復
- 檔案丟失不用怕:超實用的Mac資料恢復軟體!Mac資料恢復
- chkdsk 後資料丟失的恢復方法
- 伺服器資料丟失了怎麼恢復/分割槽丟失恢復教程伺服器
- 【伺服器資料恢復】SAN LUN對映出錯導致檔案系統資料丟失的資料恢復案例伺服器資料恢復
- 伺服器資料恢復—重灌系統導致XFS檔案系統分割槽丟失的資料恢復案例伺服器資料恢復
- 【Vsan資料恢復】斷電導致Vsan分散式儲存虛擬磁碟檔案丟失的資料恢復案例資料恢復分散式
- 【伺服器資料恢復】虛擬機器檔案丟失導致Hyper-V癱瘓的資料恢復伺服器資料恢復虛擬機
- 【raid資料恢復案例】raid擴容導致的資料丟失的資料恢復AI資料恢復
- 伺服器RAID資料丟失恢復伺服器AI
- OMV資料恢復NAS陣列丟失資料恢復陣列
- 如何恢復伺服器資料丟失伺服器
- 【伺服器資料恢復】XFS檔案系統分割槽分割槽丟失無法訪問的資料恢復案例伺服器資料恢復
- 伺服器資料恢復案例之RAID資訊丟失資料恢復伺服器資料恢復AI
- 【BBED】丟失歸檔檔案情況下的恢復
- 【資料庫資料恢復】LINUX EXT3檔案系統下ORACLE資料庫誤操作導致資料丟失的資料恢復案例資料庫資料恢復LinuxOracle
- 【伺服器資料恢復】RAID5崩潰後強制上線導致檔案丟失的資料恢復案例伺服器資料恢復AI
- Sqlserver系統資料庫和使用者資料庫日誌檔案全部丟失的恢復SQLServer資料庫
- NetApp資料恢復—NetApp儲存池中劃分的卷丟失的資料恢復案例APP資料恢復
- 【伺服器資料恢復】Hyper-V虛擬機器檔案丟失導致服務癱瘓的資料恢復案例伺服器資料恢復虛擬機
- 【伺服器資料恢復】異常斷電導致虛擬機器檔案丟失不能啟動的資料恢復案例伺服器資料恢復虛擬機
- 伺服器xfs資料丟失的資料恢復過程伺服器資料恢復
- 【資料庫資料恢復】斷電導致Oracle資料庫資料丟失的資料恢復案例資料庫資料恢復Oracle