redo log file 優化
redo log file 優化
本文主要介紹redo log file大小的優化。
#######################################################################################
Oracle Environment=>11.2.0.4.0 rac on two nodes
OS Environment=>redhat 6.3 (64bit)
#######################################################################################
總體思路如下:
1.redo log file現狀監控
2.redo log file切換總覽
3.redo log file優化
3.1 官方建議20分鐘切換一次
3.2 MTTR角度優化
1.redo log file現狀監控
#redo log files 現狀監控#
set linesize 300
column REDOLOG_FILE_NAME format a50
SELECT
a.GROUP#,
a.THREAD#,
a.SEQUENCE#,
a.ARCHIVED,
a.STATUS,
b.MEMBER AS REDOLOG_FILE_NAME,
(a.BYTES/1024/1024) AS SIZE_MB
FROM v$log a
JOIN v$logfile b ON a.Group#=b.Group#
ORDER BY a.GROUP# ASC;
GROUP# THREAD# SEQUENCE# ARC STATUS REDOLOG_FILE_NAME SIZE_MB
---------- ---------- ---------- --- ---------------- -------------------------------------------------- ----------
1 1 4965 YES ACTIVE +DATA/BMCTEST/redo01.log 50
2 1 4966 NO CURRENT +DATA/BMCTEST/redo02.log 50
3 2 3405 YES INACTIVE +DATA/BMCTEST/redo03.log 50
4 2 3406 NO CURRENT +DATA/BMCTEST/redo04.log 50
2.redo log file切換總覽
#redo log files檢視指令碼#
select
Start_Date,
Start_Time,
Num_Logs,
Round(Num_Logs * (Vl.Bytes / (1024 * 1024)), 2) AS Mbytes,
Vdb.NAME AS Dbname
FROM
(SELECT To_Char(Vlh.First_Time, 'YYYY-MM-DD') AS Start_Date, To_Char(Vlh.First_Time, 'HH24') || ':00' AS Start_Time,
COUNT(Vlh.Thread#) Num_Logs
FROM
V$log_History Vlh
GROUP BY
To_Char(Vlh.First_Time, 'YYYY-MM-DD'),
To_Char(Vlh.First_Time, 'HH24') || ':00') Log_Hist,
V$log Vl,
V$database Vdb
WHERE
Vl.Group# = 1
ORDER BY
Log_Hist.Start_Date,
Log_Hist.Start_Time;
...........
2015-05-29 10:00 88 44000 BMCTEST
2015-05-29 11:00 22 11000 BMCTEST
2015-05-29 12:00 1 500 BMCTEST
2015-05-30 00:00 1 500 BMCTEST
2015-06-01 02:00 1 500 BMCTEST
2015-06-01 22:00 1 500 BMCTEST
2015-06-03 11:00 64 32000 BMCTEST
START_DATE START NUM_LOGS MBYTES DBNAME
---------- ----- ---------- ---------- ---------
2015-06-03 12:00 157 78500 BMCTEST
2015-06-03 13:00 49 24500 BMCTEST
2015-06-03 14:00 9 4500 BMCTEST
2015-06-03 15:00 17 8500 BMCTEST
參考:http://www.dba-oracle.com/m_redo_size.htm
3.redo log file優化
3.1 官方建議20分鐘切換一次
一般優化指導方針:
當前 10分鐘/切換 200M =>優化目標 20分鐘/切換=>200M*2=400M
#從效能切換角度,10分鐘切換一次,估算redo log files大小#(從0點到23點59分)#
SELECT
(SELECT ROUND(AVG(BYTES) / 1024 / 1024, 2) FROM V$LOG) AS "Redo size (MB)",
ROUND((10 / AVERAGE_PERIOD) * (SELECT AVG(BYTES)
FROM V$LOG) / 1024 / 1024, 2) AS "Recommended Size (MB)"
FROM (SELECT AVG((NEXT_TIME - FIRST_TIME) * 24 * 60) AS AVERAGE_PERIOD
FROM V$ARCHIVED_LOG
WHERE FIRST_TIME > SYSDATE - 3
AND TO_CHAR(FIRST_TIME, 'HH24:MI') BETWEEN
'00:00' AND '23:59');
Redo size (MB) Recommended Size (MB)
-------------- ---------------------
500 514.53
3.2 MTTR角度優化
#從恢復時間角度,MTTR角度#
SQL> ALTER SYSTEM SET FAST_START_MTTR_TARGET=60; #秒
System altered.
SQL> SELECT OPTIMAL_LOGFILE_SIZE FROM V$INSTANCE_RECOVERY;
OPTIMAL_LOGFILE_SIZE
--------------------
880(M)
參考:http://www.gokhanatil.com/2009/08/optimum-size-of-the-online-redo-log-files.html
總結:效能優化,儘量“庫存”更多的監控,分析指令碼。
########################################################################################
版權所有,文章允許轉載,但必須以連結方式註明源地址,否則追究法律責任!【QQ交流群:53993419】
QQ:14040928
本文連結: http://blog.itpub.net/26442936/viewspace-1701223/
########################################################################################
本文主要介紹redo log file大小的優化。
#######################################################################################
Oracle Environment=>11.2.0.4.0 rac on two nodes
OS Environment=>redhat 6.3 (64bit)
#######################################################################################
總體思路如下:
1.redo log file現狀監控
2.redo log file切換總覽
3.redo log file優化
3.1 官方建議20分鐘切換一次
3.2 MTTR角度優化
1.redo log file現狀監控
#redo log files 現狀監控#
set linesize 300
column REDOLOG_FILE_NAME format a50
SELECT
a.GROUP#,
a.THREAD#,
a.SEQUENCE#,
a.ARCHIVED,
a.STATUS,
b.MEMBER AS REDOLOG_FILE_NAME,
(a.BYTES/1024/1024) AS SIZE_MB
FROM v$log a
JOIN v$logfile b ON a.Group#=b.Group#
ORDER BY a.GROUP# ASC;
GROUP# THREAD# SEQUENCE# ARC STATUS REDOLOG_FILE_NAME SIZE_MB
---------- ---------- ---------- --- ---------------- -------------------------------------------------- ----------
1 1 4965 YES ACTIVE +DATA/BMCTEST/redo01.log 50
2 1 4966 NO CURRENT +DATA/BMCTEST/redo02.log 50
3 2 3405 YES INACTIVE +DATA/BMCTEST/redo03.log 50
4 2 3406 NO CURRENT +DATA/BMCTEST/redo04.log 50
2.redo log file切換總覽
#redo log files檢視指令碼#
select
Start_Date,
Start_Time,
Num_Logs,
Round(Num_Logs * (Vl.Bytes / (1024 * 1024)), 2) AS Mbytes,
Vdb.NAME AS Dbname
FROM
(SELECT To_Char(Vlh.First_Time, 'YYYY-MM-DD') AS Start_Date, To_Char(Vlh.First_Time, 'HH24') || ':00' AS Start_Time,
COUNT(Vlh.Thread#) Num_Logs
FROM
V$log_History Vlh
GROUP BY
To_Char(Vlh.First_Time, 'YYYY-MM-DD'),
To_Char(Vlh.First_Time, 'HH24') || ':00') Log_Hist,
V$log Vl,
V$database Vdb
WHERE
Vl.Group# = 1
ORDER BY
Log_Hist.Start_Date,
Log_Hist.Start_Time;
...........
2015-05-29 10:00 88 44000 BMCTEST
2015-05-29 11:00 22 11000 BMCTEST
2015-05-29 12:00 1 500 BMCTEST
2015-05-30 00:00 1 500 BMCTEST
2015-06-01 02:00 1 500 BMCTEST
2015-06-01 22:00 1 500 BMCTEST
2015-06-03 11:00 64 32000 BMCTEST
START_DATE START NUM_LOGS MBYTES DBNAME
---------- ----- ---------- ---------- ---------
2015-06-03 12:00 157 78500 BMCTEST
2015-06-03 13:00 49 24500 BMCTEST
2015-06-03 14:00 9 4500 BMCTEST
2015-06-03 15:00 17 8500 BMCTEST
參考:http://www.dba-oracle.com/m_redo_size.htm
3.redo log file優化
3.1 官方建議20分鐘切換一次
一般優化指導方針:
當前 10分鐘/切換 200M =>優化目標 20分鐘/切換=>200M*2=400M
#從效能切換角度,10分鐘切換一次,估算redo log files大小#(從0點到23點59分)#
SELECT
(SELECT ROUND(AVG(BYTES) / 1024 / 1024, 2) FROM V$LOG) AS "Redo size (MB)",
ROUND((10 / AVERAGE_PERIOD) * (SELECT AVG(BYTES)
FROM V$LOG) / 1024 / 1024, 2) AS "Recommended Size (MB)"
FROM (SELECT AVG((NEXT_TIME - FIRST_TIME) * 24 * 60) AS AVERAGE_PERIOD
FROM V$ARCHIVED_LOG
WHERE FIRST_TIME > SYSDATE - 3
AND TO_CHAR(FIRST_TIME, 'HH24:MI') BETWEEN
'00:00' AND '23:59');
Redo size (MB) Recommended Size (MB)
-------------- ---------------------
500 514.53
3.2 MTTR角度優化
#從恢復時間角度,MTTR角度#
SQL> ALTER SYSTEM SET FAST_START_MTTR_TARGET=60; #秒
System altered.
SQL> SELECT OPTIMAL_LOGFILE_SIZE FROM V$INSTANCE_RECOVERY;
OPTIMAL_LOGFILE_SIZE
--------------------
880(M)
參考:http://www.gokhanatil.com/2009/08/optimum-size-of-the-online-redo-log-files.html
總結:效能優化,儘量“庫存”更多的監控,分析指令碼。
########################################################################################
版權所有,文章允許轉載,但必須以連結方式註明源地址,否則追究法律責任!【QQ交流群:53993419】
QQ:14040928
本文連結: http://blog.itpub.net/26442936/viewspace-1701223/
########################################################################################
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26442936/viewspace-1701223/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle Dump Redo Log FileOracle
- redo的等待log file sync和log file parallel write和redo size設定Parallel
- Oracle之 等待事件log file sync + log file parallel write (awr優化)Oracle事件Parallel優化
- zt_Oracle Dump Redo Log File 說明Oracle
- Oracle RAC+DG 調整redo/standby log fileOracle
- MySQL redo log最佳化MySql
- redo log file 物理結構學習與測試
- log file sync等待事件的成因及優化方法事件優化
- Redo Log之一:理解Oracle redo logOracle Redo
- Redo Gap 處理與優化優化
- Redo Log File(inactive、active)損壞,處理恢復對策
- undo log和redo log
- MySQL:Redo & binlogMySql
- mysql之 redo logMySql
- oracle redo log operationOracle Redo
- log file sync 和 log file parallel writeParallel
- 優化 WebLogic優化Web
- MySQL的Redo log 以及Bin logMySql
- Oracle-真實環境的丟失current redo log file的故障恢復Oracle
- standby redo log的理解
- redo_log_switch_date
- Oracle redo log重組Oracle Redo
- MySQL中的redo log和undo logMySql
- MySQL Undo Log和Redo Log介紹MySql
- oracle weblogic 優化OracleWeb優化
- Redo Log之二:遷移redo log到不同的儲存路徑
- db file sequential read及優化優化
- log file switch
- Archived Redo Logs歸檔重做日誌介紹及其優點Hive
- Could not find first log file name in binary log index fileIndex
- 【Mysql】三大日誌 redo log、bin log、undo logMySql
- Archive Log模式下Redo Log、Check Point和Switch LogHive模式
- logminer工具對redo log或archive log的挖掘Hive
- MySQL 日誌系統 redo log、binlogMySql
- MySQL重做日誌(redo log)MySql
- (轉)老白的理解REDO LOG
- redo log日誌挖掘(二)
- redo log日誌挖掘(一)