【備份恢復】歸檔模式下丟失系統關鍵資料檔案 利用RMAN備份恢復
在 ARCHIVELOG 模式下丟失了系統關鍵資料檔案
1.檢視資料庫為歸檔模式
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 11
Next log sequence to archive 13
Current log sequence 13
SQL>
2.透過RMAN備份system表空間
[oracle@wang FRA]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 2 10:36:00 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA11GR2 (DBID=237843809)
RMAN> backup tablespace system;
Starting backup at 02-OCT-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=46 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORA11GR2/system01.dbf
channel ORA_DISK_1: starting piece 1 at 02-OCT-16
channel ORA_DISK_1: finished piece 1 at 02-OCT-16
piece handle=/u01/app/FRA/ORA11GR2/backupset/2016_10_02/o1_mf_nnndf_TAG20161002T103616_cz0wo0c0_.bkp tag=TAG20161002T103616 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 02-OCT-16
channel ORA_DISK_1: finished piece 1 at 02-OCT-16
piece handle=/u01/app/FRA/ORA11GR2/backupset/2016_10_02/o1_mf_ncsnf_TAG20161002T103616_cz0wojgw_.bkp tag=TAG20161002T103616 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-OCT-16
3.刪除system表空間
——檢視錶空間對應的路徑及檔名:
SYS@ORA11GR2>select file_name from dba_data_files where tablespace_name='SYSTEM';
FILE_NAME
----------------------------------------------------------------------------
/u01/app/oracle/oradata/ORA11GR2/system01.dbf
SYS@ORA11GR2>!ls /u01/app/oracle/oradata/ORA11GR2/system01.dbf
/u01/app/oracle/oradata/ORA11GR2/system01.dbf
SYS@ORA11GR2>
SYS@ORA11GR2>!rm /u01/app/oracle/oradata/ORA11GR2/system01.dbf
SYS@ORA11GR2>!ls /u01/app/oracle/oradata/ORA11GR2/system01.dbf
ls: /u01/app/oracle/oradata/ORA11GR2/system01.dbf: No such file or directory
4.此時重啟資料庫後,會因為system資料檔案丟失而提示錯誤
SYS@ORA11GR2>shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@ORA11GR2>
SYS@ORA11GR2>startup
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2257800 bytes
Variable Size 503319672 bytes
Database Buffers 322961408 bytes
Redo Buffers 2392064 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/u01/app/oracle/oradata/ORA11GR2/system01.dbf'
5.透過RMAN恢復system表空間
[oracle@wang FRA]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 2 10:45:04 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORA11GR2 (DBID=237843809, not open)
RMAN> restore tablespace system;(重儲)
Starting restore at 02-OCT-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 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 00001 to /u01/app/oracle/oradata/ORA11GR2/system01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/FRA/ORA11GR2/backupset/2016_10_02/o1_mf_nnndf_TAG20161002T103616_cz0wo0c0_.bkp
channel ORA_DISK_1: piece handle=/u01/app/FRA/ORA11GR2/backupset/2016_10_02/o1_mf_nnndf_TAG20161002T103616_cz0wo0c0_.bkp tag=TAG20161002T103616
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 02-OCT-16
RMAN> recover tablespace system;(恢復)
Starting recover at 02-OCT-16
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 02-OCT-16
RMAN> alter database open;(開庫)
database opened
恢復成功!!!!!!!!!!!1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2126535/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- dg丟失歸檔,使用rman增量備份恢復
- 12 使用RMAN備份和恢復檔案
- XFS檔案系統的備份、恢復、修復
- RMAN備份恢復典型案例——資料檔案存在壞快
- RMAN備份恢復典型案例——RMAN備份&系統變慢
- rman 增量備份恢復
- RMAN備份恢復技巧
- Oracle使用備份檔案集恢復歸檔日誌Oracle
- Linux中XFS檔案系統的備份,恢復,修復Linux
- 從備份片中恢復某個指定得歸檔或者資料檔案
- RMAN備份異機恢復
- 備份與恢復:polardb資料庫備份與恢復資料庫
- 檔案的基本管理和XFS檔案系統備份恢復
- 實戰:xfs檔案系統的備份和恢復
- RMAN備份恢復效能優化優化
- RMAN備份與恢復測試
- RAC備份恢復之Voting備份與恢復
- RMAN備份恢復典型案例——異機恢復未知DBID
- 資料庫備份恢復資料庫
- RMAN備份恢復典型案例——資料庫卡頓資料庫
- 【BBED】丟失歸檔檔案情況下的恢復
- Oracle 備份恢復篇之RMAN catalogOracle
- ORACLE DG從庫 Rman備份恢復Oracle
- rman備份異機恢復(原創)
- vivo 資料庫備份恢復系統演化資料庫
- Linux 系統的備份恢復Linux
- 電腦檔案丟失資料恢復資料恢復
- 【伺服器資料恢復】xfs檔案系統資料丟失的資料恢復案例伺服器資料恢復
- 怎樣恢復Mac檔案及資料夾資料?BackupLoupe for mac(資料恢復備份助手)3.5.4Mac資料恢復
- MySQL備份與恢復——基於Xtrabackup物理備份恢復MySql
- Mysql資料備份與恢復MySql
- 如何從Active Backup for Business備份中恢復檔案
- 如何備份及恢復Linux檔案許可權Linux
- mydumper備份恢復
- Mysql備份恢復MySql
- 備份和恢復
- RMAN備份恢復典型案例——ORA-00245
- Windows oracle 11g rman備份恢復到linux系統WindowsOracleLinux
- Linux 系統的備份與恢復Linux