oracle檔案管理之 redo log

polestar123發表於2009-07-21

提交完成標誌:
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部落格 ” ,連結:http://blog.itpub.net/70612/viewspace-1024363/,如需轉載,請註明出處,否則將追究法律責任。

相關文章