備份恢復實驗(1)丟失部分控制檔案

路途中的人2012發表於2016-03-11
001 關閉資料庫

點選(此處)摺疊或開啟

  1. SYS@ORCL> shutdown immediate
  2. Database closed.
  3. Database dismounted.
  4. ORACLE instance shut down.
  5. SYS@ORCL> quit
  6. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  7. With the Partitioning, OLAP, Data Mining and Real Application Testing options
002 在作業系統級別刪除一個控制檔案

點選(此處)摺疊或開啟

  1. [oracle@hhu ~] rm /u01/app/oracle/oradata/ORCL/control01.ctl
003 嘗試開啟資料庫,報錯

點選(此處)摺疊或開啟

  1. [oracle@hhu ~]$ sqlplus / as sysdba

  2. SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 11 09:55:29 2016

  3. Copyright (c) 1982, 2013, Oracle. All rights reserved.

  4. Connected to an idle instance.

  5. SYS@ORCL> startup mount
  6. ORACLE instance started.

  7. Total System Global Area 1653518336 bytes
  8. Fixed Size         2253784 bytes
  9. Variable Size         1006636072 bytes
  10. Database Buffers     637534208 bytes
  11. Redo Buffers         7094272 bytes
  12. ORA-00205: error in identifying control file, check alert log for more info
004 根據提示進入alert.log檢視被刪除的控制檔名及其具體路徑(假定事先不知道被刪除的控制檔案具體路徑及控制檔名)

點選(此處)摺疊或開啟

  1. [oracle@hhu ~]$ cd /u01/app/oracle/diag/rdbms/orcl/ORCL/trace
  2. [oracle@hhu trace]$ cat alert_ORCL.log
  3. ALTER DATABASE MOUNT
  4. ORA-00210: cannot open the specified control file
  5. ORA-00202: control file: '/u01/app/oracle/oradata/ORCL/control01.ctl'
  6. ORA-27037: unable to obtain file status
  7. Linux-x86_64 Error: 2: No such file or directory
  8. Additional information: 3
  9. ORA-205 signalled during: ALTER DATABASE MOUNT...
005 關閉資料庫,將完整的控制檔案複製到alert.log提示的位置

點選(此處)摺疊或開啟

  1. SYS@ORCL> shutdown abort
  2. ORACLE instance shut down.
  3. [oracle@hhu ORCL]$ cp /u01/app/oracle/fast_recovery_area/ORCL/control02.ctl /u01/app/oracle/oradata/ORCL/control01.ctl
006 將資料庫啟動到mount狀態,再將其open

點選(此處)摺疊或開啟

  1. SYS@ORCL> startup mount
  2. ORACLE instance started.

  3. Total System Global Area 1653518336 bytes
  4. Fixed Size         2253784 bytes
  5. Variable Size         1006636072 bytes
  6. Database Buffers     637534208 bytes
  7. Redo Buffers         7094272 bytes
  8. Database mounted.
  9. SYS@ORCL> alter database open;

  10. Database altered.
恢復成功。

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

相關文章