日志文件分:online redo log file & archived redo log file
online redo logfile:
丢失一组redo log file的一个成员不影响数据库,但会向alert中发出告警信息。
丢失一组redo log则数据库会shutdown.
日志切换 ALTER SYSTEM SWITCH LOGFILE;
生成检查点 ALTER SYSTEM CHECKPOINT;
实例恢复参数 fast_start_mttr_target (8i: fast_start_io_target)
日志组
SELECT group#, sequence#, members, bytes/1024/1024 AS "file_size(M)", archived, status FROM v$log;
日志组的添加
-- 若原有3个组,序号分别为:1,2,3,在指定组序号的情况下添加组8
ALTER DATABASE ADD LOGFILE GROUP 8 ('/oracle/oradata/bigdata/redo04.log','/oracle/oradata/bigdata/redo06.log') 5M;
-- 若未指定组序号,新增组序号为4
ALTER DATABASE ADD LOGFILE ('/oracle/oradata/bigdata/redo04.log','/oracle/oradata/bigdata/redo06.log') 5M;
日志组的移除,如果日志组不能移动切换下日志或shutdown数据库
ALTER DATABASE DROP LOGFILE GROUP 5;
组成员
SELECT * FROM v$logfile;
组成员的添加
alter database add logfile member 'D:\APP\ORADATA\DEMO\REDO21.LOG' to group 1, 'D:\APP\ORADATA\DEMO\REDO22.LOG' to group 2;
组成员的删除(操作系统上的物理文件仍然存在,利用OS命令删除之)
ALTER DATABASE DROP LOGFILE MEMBER 'D:\APP\ORADATA\DEMO\REDO22.LOG';
清除Online redo LOG FILE
ALTER DATABASE CLEAR LOGFILE GROUP 5; -- v$log.sequence#=0
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 5; -- 日志文件不能归档
OMF的配置
ALTER SYSTEM SET db_create_online_log_dest_1='D:\app\oradata\demo\OMF1';
ALTER SYSTEM SET db_create_online_log_dest_2='D:\app\oradata\demo\OMF2';
OMF配置的日志组删除与手工配置的组删除操作方法一致,不过OMF配置的组删除后,其成员文件也从磁盘上删除。
-- The End --
阅读(745) | 评论(0) | 转发(0) |