All technological notes.
Redo LogRedo Log File 单一文件When a member of a redo log file group is lost and if the group still has at least one member:
Solution:
alert log.Restore the missing file by first dropping the lost redo log member, Then add a new member to replace the lost redo log member.
ALTER DATABASE DROP LOGFILE MEMBER '';ALTER DATABASE ADD LOGFILE MEMBER '' TO GROUP nmedia failure is due to the loss of a disk drive or controller, rename the missing file.如果磁盘驱动问题, 需要重命名If the group has already been archived, or if you are in NOARCHIVELOG mode, you may:如果是 noarchivelog, 可以清除组
log group to re-create the missing file or filesALTER DATABASE CLEAR LOGFILE GROUP #ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP #full database backup of the whole database.Redo Log Group 一个组Redo log groups cycle through three different states as part of the normal running of the Oracle database:
CURRENT:
LGWR process is currently writing redo data to it for any transactions going on in the database.ACTIVE:
data files all data changes that are represented in the redo log group.redo data that is required for instance recovery.INACTIVE:
CURRENT log group.
If you have lost an entire redo log group, then all copies of the log files for that group are unusable or gone. 所有 redo 文件都不可用
When in the INACTIVE state:
log switch events occur. 如果可以修复, 整个组可以重用log file.如果不能修复,清除 log 文件
When in the ACTIVE state:
instance recovery. 无论当前是否正在写入, 只要在该状态都需要恢复.log file group is no longer needed for instance recovery, and you can proceed as if the group were in the inactive state. 如果可以对齐, 则组状态相当于 inactive.When in the CURRENT state:
LGWR process fail in this case.
point-in-time recovery, and then open the database with the RESETLOGS option.
SELECT GROUP#, STATUS, ARCHIVED FROM V$LOG;
When you clear a log file, you are indicating that it can be reused.
If the redo log group has not been archived,
redo log for recovery. 没有 archive 时, 意味着有备份依赖该组redo log file. 需要立即备份, 然后 log file 不能再用It is possible that the redo log is required to recover an offline data file.
Command
-- If the log file has already been archived
ALTER DATABASE CLEAR LOGFILE GROUP <n>;
-- if not been archived and not needed
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP <n>
-- if not been archived and needed for data file
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP <n>
UNRECOVERABLE DATAFILE