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
參考:
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)
參考:
總結:效能最佳化,儘量“庫存”更多的監控,分析指令碼。
########################################################################################
版權所有,文章允許轉載,但必須以連結方式註明源地址,否則追究法律責任!【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
參考:
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)
參考:
總結:效能最佳化,儘量“庫存”更多的監控,分析指令碼。
########################################################################################
版權所有,文章允許轉載,但必須以連結方式註明源地址,否則追究法律責任!【QQ交流群:53993419】
QQ:14040928
本文連結: http://blog.itpub.net/26442936/viewspace-1701223/
########################################################################################
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25462274/viewspace-2156407/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How to Dump Redo Log File Information --metalinkORM
- MySQL redo log最佳化MySql
- Oracle RAC+DG 調整redo/standby log fileOracle
- 更改online redo log file 提示 ORA-01511 ORA-01141
- undo log和redo log
- mysql之 redo logMySql
- MySQL的Redo log 以及Bin logMySql
- MySQL中的redo log和undo logMySql
- MySQL Undo Log和Redo Log介紹MySql
- 【Mysql】三大日誌 redo log、bin log、undo logMySql
- Oracle-真實環境的丟失current redo log file的故障恢復Oracle
- log file switch
- MySQL重做日誌(redo log)MySql
- Oracle redo解析之-1、oracle redo log結構計算Oracle Redo
- MySQL中的redo log和checkpointMySql
- InnoDB文件筆記(二)—— Redo Log筆記
- 硬核乾貨!一文掌握 binlog 、redo log、undo log
- MySQL中redo log、undo log、binlog關係以及區別MySql
- mysql日誌:redo log、binlog、undo log 區別與作用MySql
- 深入理解MySQL系列之redo log、undo log和binlogMySql
- MySQL 日誌系統 redo log、binlogMySql
- 【等待事件】log file sync事件
- log file sync等待事件事件
- MySQL學習之change buffer 和 redo logMySql
- MySQL如何計算統計redo log大小MySql
- 基於Redo Log和Undo Log的MySQL崩潰恢復流程MySql
- MySQL Redo log頁內邏輯怎麼理解MySql
- redo log 和 binlog 的一些總結
- 必須瞭解的mysql三大日誌-binlog、redo log和undo logMySql
- 3000幀動畫圖解MySQL為什麼需要binlog、redo log和undo log動畫圖解MySql
- log file sync等待事件處理思路事件
- 關於log file switch and checkpoint機制
- 【WAIT】 log file sync等待事件說明AI事件
- LOG FILE SYNC概述(第五篇)
- LOG FILE SYNC概述(第四篇)
- duplicate遇到RMAN-05535: warning: All redo log files were not defined
- MySQL中Redo Log相關的重要引數總結MySql
- 2 萬字 + 30 張圖 | 細聊 MySQL undo log、redo log、binlog 有什麼用?MySql