每个thread 至少有两个日志组,如果删除后少于两个日志组,则需要先创建一组然后再删除。
日志组状态
inactive
active
current
先添加一个
alter database add logfile thread 1 group 5
orcl1>select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 5 52428800 512 2 NO CURRENT 25413218 19-MAR-13 2.8147E+14
2 1 4 52428800 512 2 YES INACTIVE 25412979 19-MAR-13 25413218 19-MAR-13
3 2 9 52428800 512 2 NO CURRENT 25413448 19-MAR-13 2.8147E+14 19-MAR-13
4 2 8 52428800 512 2 YES INACTIVE 25412983 19-MAR-13 25412989 19-MAR-13
orcl1>alter database add logfile thread 1 group 5 size 50M;
Database altered.
orcl1>select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 5 52428800 512 2 NO CURRENT 25413218 19-MAR-13 2.8147E+14
2 1 4 52428800 512 2 YES INACTIVE 25412979 19-MAR-13 25413218 19-MAR-13
3 2 9 52428800 512 2 NO CURRENT 25413448 19-MAR-13 2.8147E+14 19-MAR-13
4 2 8 52428800 512 2 YES INACTIVE 25412983 19-MAR-13 25412989 19-MAR-13
5 1 0 52428800 512 2 YES UNUSED 0 0
orcl1>/
GROUP# MEMBER
---------- ------------------------------------------------------------
2 +DATA/orcl/onlinelog/group_2.263.810372071
2 +DG1/orcl/onlinelog/group_2.264.810372071
1 +DATA/orcl/onlinelog/group_1.264.810372069
1 +DG1/orcl/onlinelog/group_1.263.810372071
3 +DATA/orcl/onlinelog/group_3.262.810372071
3 +DG1/orcl/onlinelog/group_3.265.810372073
4 +DATA/orcl/onlinelog/group_4.259.810372073
4 +DG1/orcl/onlinelog/group_4.266.810372073
5 +DATA/orcl/onlinelog/group_5.257.810447597
5 +DG1/orcl/onlinelog/group_5.280.810447599
参数db_create_file_dest指定的位置 和db_recovery_file_dest 里创建member
active or current的日志损坏
alter database clear logfile group 5;
alter database clear unarchived logfile group 5;
如果以上的都不成功;
shutdown所有实例,mount发生日志损坏的实例
sql>recover database until cancel;
sql>alter database open resetlogs;
启动其他实例;
如果RAC环境某个实例的联机日志发生损坏,导致该实例无法启动,需要根据v$log.status判断受损日志状态,
如果是active/current,则需要进行一下操作:
关闭所有实例---因为要做不完全恢复其实,因为这种情况要有数据丢失。
在受损的实例上,启动到mount状态
执行alter database open resetlogs
如果需要,先用sql>recover database until cancel 来模拟一下不完全恢复;
实例启动成功后,启动其他实例;
立即备份。
如果是inactive状态日志,把改组日志drop掉就可以了。
参考图书:
大话oracle rac