實驗2:offline Redo Log File 故障(內容錯誤)


select * from v$log;

select * from v$logfile;

利用O.S.指令來修改redo log file的內容


SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel

或者

alter system switch logfile;
*
ERROR at line 1:
ORA-01034: ORACLE not available


select * from v$log
*
ERROR at line 1:
ORA-01034: ORACLE not available


SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  319886536 bytes
Fixed Size                   451784 bytes
Variable Size             150994944 bytes
Database Buffers          167772160 bytes
Redo Buffers                 667648 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/oradata/sent/redo/redo01.log'

shutdown abort;

因為每個群組只有一個Redo Log File,假設有兩個,資料庫運作不會有問題,
只要把好的複製到壞的就可以了。


方法一:清空內容
alter database clear logfile '/oradata/sent/redo/redo01.log';

alter database open;


方法二:
shutdown abort;
startup mount;
alter database drop logfile group 1;
利用O.S.刪除group 1 的檔案
alter database add logfile group 1  ('/oradata/sent/redo/redo01.log') size 50M;
alter database open;