首页 > 数据库 > Oracle > oracle文件管理之 redo log
提交完成标志:
Only when all redo records
associated with a given transaction are safely on disk in the online logs is the user
process notified that the transaction has been committed.
■ If archiving is disabled (the database is in NOARCHIVELOG mode), a filled redo log
file is available after the changes recorded in it have been written to the datafiles.
■ If archiving is enabled (the database is in ARCHIVELOG mode), a filled redo log file
is available to LGWR after the changes recorded in it have been written to the
datafiles and the file has been archived.
Multiplexing Redo Log Files
强制log switch时间间隔1800秒:ARCHIVE_LAG_TARGET =1800
增加日志组和成员:
ALTER DATABASE
ADD LOGFILE ('/oracle/dbs/log1c.rdo', '/oracle/dbs/log2c.rdo') SIZE 500K;
ALTER DATABASE
ADD LOGFILE GROUP 10 ('/oracle/dbs/log1c.rdo', '/oracle/dbs/log2c.rdo')
SIZE 500K;
ALTER DATABASE ADD LOGFILE MEMBER '/oracle/dbs/log2b.rdo' TO GROUP 2;
ALTER DATABASE ADD LOGFILE MEMBER '/oracle/dbs/log2c.rdo'
TO ('/oracle/dbs/log2a.rdo', '/oracle/dbs/log2b.rdo');
强制切换log组,
ALTER SYSTEM SWITCH LOGFILE;
如果当前日志受损,可以清除logfile。
ALTER DATABASE CLEAR LOGFILE GROUP 3;
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 3;
相关视图:
V$LOG
V$LOGFILE
V$LOG_HISTORY
查看日志切换频率的语句
select b.recid,
to_char(b.first_time,'dd-mon-yy hh:mi:ss') start_time,
a.recid,
to_char(a.first_time,'dd-mon-yy hh:mi:ss') end_time,
round(((a.first_time - b.first_time)*24)*60,2) minutes
from v$log_history a,v$log_history b
where a.recid = b.recid+1
order by a.first_time asc;
建议redo log半个小时切换一次,根据业务调整redo log大小
关于存储:
建议redo log放在高速磁盘上,不要放在raid5上,因为raid5写速度比较差
[@more@]来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70612/viewspace-1024363/ ,如需转载,请注明出处,否则将追究法律责任。