三思筆記
因爲稍微遇到點問題,所以記一下
因爲oracle運行過程中自動鎖定聯機重做日誌,所以手動刪除聯機重做日誌,下面記錄,丟失非當前聯機重做日誌文件的恢復方法
1,查看聯機重做日誌的狀態
[oracle@cindy ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sun Aug 31 23:55:30 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select group#,thread#,sequence#,members,archived,status from v$log;
GROUP# THREAD# SEQUENCE# MEMBERS ARC STATUS
---------- ---------- ---------- ---------- --- ----------------
1 1 1 1 NO CURRENT
2 1 0 1 YES UNUSED
3 1 0 1 YES UNUSED
SQL> select group#,member from v$logfile;
GROUP#
----------
MEMBER
--------------------------------------------------------------------------------
3
/u02/oradata/ora11g/redo03.log
2
/u02/oradata/ora11g/redo02.log
1
/u02/oradata/ora11g/redo01.log
可見group# 爲3的是非當前
2,shutdown immediate,然後手動刪除redo03
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
[oracle@cindy ~]$ cd /u02/oradata/ora11g
[oracle@cindy ora11g]$ ls
cindy01.dbf control01.ctl example01.dbf redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf
[oracle@cindy ora11g]$ rm redo03.log
3,啓動數據庫,報錯
SQL> startup
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size 2228944 bytes
Variable Size 322964784 bytes
Database Buffers 88080384 bytes
Redo Buffers 4272128 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 4134
Session ID: 1 Serial number: 5
此時報錯信息與書上不同,恕我是個菜鳥,也百度了,解決辦法很多,但是未找到我想要的,最後在朋友的提醒下,是啓動方式不對,恢復的時候不要用startup
故
4,shutdown abort
SQL> shutdown abort;
ORACLE instance shut down.
5,啓動到mount狀態
SQL> startup mount;
ORACLE instance started.
Total System Global Area 417546240 bytes
Fixed Size 2228944 bytes
Variable Size 322964784 bytes
Database Buffers 88080384 bytes
Redo Buffers 4272128 bytes
Database mounted.
6,重建該組重做日誌
SQL> alter database clear logfile group 3;
Database altered.
7,打開數據庫
SQL> alter database open;
Database altered.