Thursday, January 23, 2014

Optimal redo logfile size in Oracle

If you have a small redo log file then you will see frequent log switches, in case of large redo logfile you might be at risk of losing data during instance crash. The optimal redo logfile size should not have more than 5 switches per hour.

You can use below query to find the number of log switches per hour

col day format a15;
col hour format a4;
col total format 999;
select to_char(first_time,'yyyy-mm-dd') day, to_char(first_time,'hh24') hour, count(*) total
from v$log_history
group by to_char(first_time,'yyyy-mm-dd'),to_char(first_time,'hh24')
order by to_char(first_time,'yyyy-mm-dd'),to_char(first_time,'hh24') asc;


To resize the redo logfile size follow the steps in below link

In Oracle 10g, the Redo Logfile Size Advisor introduced and using this you can determine the optimal redo log size based upon FAST_START_MTTR_TARGET parameter. You must set a non-zero value to enable redo log file size advisor.

FAST_START_MTTR_TARGET – this parameter enables you to specific number of seconds the database takes to perform crash recovery. Based up on this value Oracle determines the checkpoint writes to meet the target.

If you DONT set FAST_START_MTTR_TARGET then OPTIMAL_LOGFILE_SIZE in V$INSTANCE_RECOVERY will not populated with recommend redo log file size.

SQL> show parameter FAST_START_MTTR_TARGET
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
fast_start_mttr_target integer 0

SQL> select optimal_logfile_size from v$instance_recovery;
OPTIMAL_LOGFILE_SIZE
--------------------------------

User must set FAST_START_MTTR_TARGET to a non-zero value then OPTIMAL_LOGFILE_SIZE in V$INSTANCE_RECOVERY will be populated with recommend redo log file size.

Here I am setting FAST_START_MTTR_TARGET=60 (sec), you will see that OPTIMAL_LOGFILE_SIZE will be populated with recommended value.

SQL> alter system set FAST_START_MTTR_TARGET=60 scope=both;
System altered.

SQL> select OPTIMAL_LOGFILE_SIZE from v$instance_recovery;
OPTIMAL_LOGFILE_SIZE
--------------------
151

Now the checkpoints are driven by FAST_START_MTTR_TARGET parameter.

In some cases user will see many log switches during batch job window and there is no log switches out of batch job window. In this case you need to optimal value for redo log size and may need to set archive_lag_target to force redo log switches to increase the frequency during non-batch job window.

For more information on archive_lag_target refer below Oracle document.
http://docs.oracle.com/cd/B19306_01/server.102/b14237/initparams009.htm

Regards
Satishbabu Gunukula, Oracle ACE
http://www.oracleracexpert.com

22 comments:

  1. Replies
    1. Great Article android based projects

      Java Training in Chennai Project Center in Chennai Java Training in Chennai projects for cse The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training Project Centers in Chennai

      Delete
  2. We Develop apps for your Android or IOS system in affordable price IOS System Design or Website design are available!!

    Buzz For Android

    ReplyDelete
  3. thank you very useful information admin, and pardon me permission to share articles here may help :

    Cara menyembuhkan gabagen
    Obat osteoporosis

    ReplyDelete
  4. http://www.antiacneliyoskin.com/cream-pencerah-wajah-terbaik/
    http://www.antiacneliyoskin.com/cream-pencerah-wajah-kusam/
    http://www.antiacneliyoskin.com/cream-pencerah-wajah-kinclong/
    http://www.antiacneliyoskin.com/cream-pencerah-untuk-ibu-menyusui/
    http://www.antiacneliyoskin.com/cream-pencerah-untuk-ibu-hamil/
    http://www.antiacneliyoskin.com/krim-pencerah-wajah-yang-ampuh/
    http://www.antiacneliyoskin.com/cream-pencerah-untuk-kulit-berminyak/
    http://www.antiacneliyoskin.com/krim-pencerah-untuk-kulit-berjerawat/

    ReplyDelete
  5. افضل الخدمات الخاصة باعمال نقل العفش مع الفك والتركيب في الطائف تقدمها افضل شركات نقل عفش الطائف وهي تعتبر من افضل الشركات المتخصصة في اعمال نقل الاثاث بواسطة فريق عمل مميز ومحترف وسيارات نقل عفش حديثة ومجهزة لأعمال نقل الاثاث بالطائف مقفلة ومبطنة من الداخل وستحصل على افضل خدمات شركات نقل العفش بالطائف باحترافية عالية وبالضمان من افضل شركة نقل عفش الطائف المتميزة والمؤهلة

    ReplyDelete
  6. اقوى الخدمات الخاصة بأعمال نقل العفش مع الفك والتركيب في الرياض يقدمها موقع خدماتي الذي يضم افضل شركات نقل عفش بالرياض التي تقدم خدماتها بمنتهى الاحترافية والدقة معتمدين على فريق عمل مدرب جيدا ونجارين متخصصين

    ReplyDelete
  7. As I am looking at your writing, I regret being unable to do outdoor activities due to Corona 19, and I miss my old daily life. If you also miss the daily life of those days, would you please visit my site once? My site is a site where I post about photos and daily life when I was free.토토커뮤니티

    ReplyDelete
  8. I like this website its a master peace ! Glad I found this on google .
    I must say, as a lot as I enjoyed reading what you had to say, I couldn't help but lose interest after a while.
    스포츠토토

    ReplyDelete
  9. Very helpful to me and I am sure to all the commentators here!
    I appreciate you and hopping for some more informative posts!
    성인웹툰

    ReplyDelete
  10. It as really a great and helpful piece of info. I am glad that you shared this helpful info with us. Please keep us up to date like this. Thank you for sharing.
    토토사이트

    ReplyDelete
  11. It’s so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also.
    카지노사이트

    ReplyDelete
  12. This article is very helpful and interesting too. Keep doing this in future. I will support you.
    토토사이트

    ReplyDelete
  13. I finally found what I was looking for! I'm so happy. 안전한놀이터 Your article is what I've been looking for for a long time. I'm happy to find you like this. Could you visit my website if you have time? I'm sure you'll find a post of interest that you'll find interesting.

    ReplyDelete
  14. Please keep on posting such quality articles as this is a rare thing to find these days. I am always searching online for posts that can help me. watching forward to another great blog. Good luck to the author! all the best! 스포츠토토사이트

    ReplyDelete
  15. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future. 토토사이트추천

    ReplyDelete