SlideShare a Scribd company logo
Size of Redo Logs                                                               Administration Tips




How big should Redo Logs be?

This one is easy: "As big as is necessary to get the rate at which you log switch down to a
reasonable rate".

What a 'reasonable rate' is, of course, will depend from site to site and application to
application. The key point is that log switching too frequently is something to be avoided
at all costs.

Why? Because a log switch induces a full checkpoint on the database. That means it kicks
DBWR into action, flushing all dirty buffers related to the just-completed log out to disk,
after which CKPT must update the headers of every single data file and control file with
the latest SCN information. Checkpoints thus represent a huge I/O-fest, and if you value
performance, I/O is something to be avoided at all costs. Accordingly, you don't want to
be checkpointing like crazy -but if you are switching logs ever 4 seconds, you will be.

Since log switches usually only happen when a redo log has been filled, the principle
determinant of when a log switch takes place is the size of the log. Other things being
equal, big logs take longer to fill up than small ones -which means that big logs are slower
to cause checkpoints than small ones.

For this reason, I usually recommend absolutely humungous redo logs (in the order of a
couple of gigabytes big), since they will take for ever to fill up, and log switches (and
hence checkpoints) are a very rare occurrence. In fact, ideally, I wouldn't want to see a
log switch happening during the day at all. Instead, I'd have a cron job (or an AT job, if
you're running NT) which connects to the database at some unearthly hour, like 2 o'clock in
the morning, and issues the command 'ALTER SYSTEM SWITCH LOGFILE;'. That means the
mother-of-all-checkpoints is issued when no-one is around to worry about the performance
hit it causes.

There is, however, one proviso to all this, and it's a serious one. What happens during an
Instance Recovery? Well, SMON at startup notices that there are redo log records from a
time after the time of the last checkpoint, and replays them (i.e., rolls them all forward,
then notices half of them were never committed, and rolls those ones back again). Now
imagine what happens if you are log switching (and hence checkpointing) just once a day,
at 2am, and have an Instance crash the next day, at around 5pm: SMON will have to roll
an entire day's work forward before the database can be opened. That's a serious non-
availability issue.

So, there's a balance to be struck. Huge logs that seldom switch are great for performance,
but mean Instance Recoveries take for ever to complete. Small logs are lousy for
performance, but Instance Recoveries are done in a matter of moments. Somewhere along
that spectrum will be a spot where you can be happy, balancing performance with Instance
Recovery time. In search of that balance, many DBAs have, therefore, developed a
Copyright © Howard Rogers 2001            10/17/2001                                     Page 1 of 2
Size of Redo Logs                                                              Administration Tips


general rule of thumb that says 'I will switch logs around once every hour' (or perhaps once
every half hour or so). That's not bad as a rule of thumb, but that's all it is. You need to
find out whether applying such a “rule” degrades performance unacceptably in your
specific environment.

Incidentally: how do you find out how often your log switches are occurring?

Well, there are several ways, but perhaps the easiest is to locate your Alert Log. That will
be sitting in wherever the "background_dump_dest" init.ora parameter is pointing (you
could do a SHOW PARAMETER BACKGROUND to display that). Every log switch is recorded there,
along with the precise time (down to the second) when it happened. The relevant lines
usually read something like "Thread 1 advanced to Log Sequence 391". What you are
looking for is an average rate of switching over the course of a typical working day (you
will, of course, tend to switch rather more often during busy periods, and rather slower
during lunchtimes and at the end of the day).

If you find your average switching rate is too high, you can't correct the problem by
resizing existing logs. You have, instead, to add new logs of a bigger size, and remove the
small logs as a separate exercise. ALTER DATABASE ADD LOGFILE '/PATH/FILENAME' SIZE
500M is the command to add new, single member, groups.

ALTER DATABASE DROP LOGFILE GROUP 1 gets rid of all members of an existing group
(obviously replace the group number there with something appropriate).




Copyright © Howard Rogers 2001            10/17/2001                                    Page 2 of 2

More Related Content

What's hot

Npmwormdisclosure
NpmwormdisclosureNpmwormdisclosure
Npmwormdisclosure
Andrey Apuhtin
 
AventX 10.0 is Here and it's Fast!
AventX 10.0 is Here and it's Fast!AventX 10.0 is Here and it's Fast!
AventX 10.0 is Here and it's Fast!
STR Software
 
The Open-Source Monitoring Landscape
The Open-Source Monitoring LandscapeThe Open-Source Monitoring Landscape
The Open-Source Monitoring Landscape
Mike Merideth
 
Evolution of Monitoring and Prometheus (Dublin 2018)
Evolution of Monitoring and Prometheus (Dublin 2018)Evolution of Monitoring and Prometheus (Dublin 2018)
Evolution of Monitoring and Prometheus (Dublin 2018)
Brian Brazil
 
Akka Streams at Weeronline
Akka Streams at WeeronlineAkka Streams at Weeronline
Akka Streams at Weeronline
Fabio Tiriticco
 
Writing and testing high frequency trading engines in java
Writing and testing high frequency trading engines in javaWriting and testing high frequency trading engines in java
Writing and testing high frequency trading engines in java
Peter Lawrey
 
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Brian Brazil
 
State of the CLI- Kat Marchan
State of the CLI- Kat MarchanState of the CLI- Kat Marchan
State of the CLI- Kat Marchan
NodejsFoundation
 
Solidity intro
Solidity introSolidity intro
Solidity intro
Angello Pozo
 
High Frequency Trading and NoSQL database
High Frequency Trading and NoSQL databaseHigh Frequency Trading and NoSQL database
High Frequency Trading and NoSQL database
Peter Lawrey
 
An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)
Brian Brazil
 
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SPPrimeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Zabbix BR
 
Case study: formal verification of the Brain Fuck Scheduler
Case study: formal verification of the Brain Fuck SchedulerCase study: formal verification of the Brain Fuck Scheduler
Case study: formal verification of the Brain Fuck Scheduler
Mengxuan Xia
 
Compaction, Compaction Everywhere
Compaction, Compaction EverywhereCompaction, Compaction Everywhere
Compaction, Compaction Everywhere
DataStax Academy
 
Mysql Latency
Mysql LatencyMysql Latency
Mysql Latency
srubinstein
 
Gfs
GfsGfs
Quartz connector
Quartz connectorQuartz connector
Quartz connector
Rahul Kumar
 
Open HFT libraries in @Java
Open HFT libraries in @JavaOpen HFT libraries in @Java
Open HFT libraries in @Java
Peter Lawrey
 
Comparing processing frameworks v7
Comparing processing frameworks v7Comparing processing frameworks v7
Comparing processing frameworks v7
Gabriela Choy
 
Introduction to Java performance tuning
Introduction to Java performance tuningIntroduction to Java performance tuning
Introduction to Java performance tuning
Marouane Gazanayi
 

What's hot (20)

Npmwormdisclosure
NpmwormdisclosureNpmwormdisclosure
Npmwormdisclosure
 
AventX 10.0 is Here and it's Fast!
AventX 10.0 is Here and it's Fast!AventX 10.0 is Here and it's Fast!
AventX 10.0 is Here and it's Fast!
 
The Open-Source Monitoring Landscape
The Open-Source Monitoring LandscapeThe Open-Source Monitoring Landscape
The Open-Source Monitoring Landscape
 
Evolution of Monitoring and Prometheus (Dublin 2018)
Evolution of Monitoring and Prometheus (Dublin 2018)Evolution of Monitoring and Prometheus (Dublin 2018)
Evolution of Monitoring and Prometheus (Dublin 2018)
 
Akka Streams at Weeronline
Akka Streams at WeeronlineAkka Streams at Weeronline
Akka Streams at Weeronline
 
Writing and testing high frequency trading engines in java
Writing and testing high frequency trading engines in javaWriting and testing high frequency trading engines in java
Writing and testing high frequency trading engines in java
 
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
 
State of the CLI- Kat Marchan
State of the CLI- Kat MarchanState of the CLI- Kat Marchan
State of the CLI- Kat Marchan
 
Solidity intro
Solidity introSolidity intro
Solidity intro
 
High Frequency Trading and NoSQL database
High Frequency Trading and NoSQL databaseHigh Frequency Trading and NoSQL database
High Frequency Trading and NoSQL database
 
An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)
 
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SPPrimeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
 
Case study: formal verification of the Brain Fuck Scheduler
Case study: formal verification of the Brain Fuck SchedulerCase study: formal verification of the Brain Fuck Scheduler
Case study: formal verification of the Brain Fuck Scheduler
 
Compaction, Compaction Everywhere
Compaction, Compaction EverywhereCompaction, Compaction Everywhere
Compaction, Compaction Everywhere
 
Mysql Latency
Mysql LatencyMysql Latency
Mysql Latency
 
Gfs
GfsGfs
Gfs
 
Quartz connector
Quartz connectorQuartz connector
Quartz connector
 
Open HFT libraries in @Java
Open HFT libraries in @JavaOpen HFT libraries in @Java
Open HFT libraries in @Java
 
Comparing processing frameworks v7
Comparing processing frameworks v7Comparing processing frameworks v7
Comparing processing frameworks v7
 
Introduction to Java performance tuning
Introduction to Java performance tuningIntroduction to Java performance tuning
Introduction to Java performance tuning
 

Viewers also liked

Idea generation 110214
Idea generation 110214Idea generation 110214
Idea generation 110214DamionVize
 
Things Thomas Missed
Things Thomas MissedThings Thomas Missed
Things Thomas Missed
Michael Smith
 
Imperial Distribution CaseStudy-Vunani-2012
Imperial Distribution CaseStudy-Vunani-2012Imperial Distribution CaseStudy-Vunani-2012
Imperial Distribution CaseStudy-Vunani-2012IMPERIAL Logistics
 
Taocp 1.4.1 subroutine
Taocp 1.4.1 subroutineTaocp 1.4.1 subroutine
Taocp 1.4.1 subroutine
Youngkwon Lee
 
IxDworks mini-workshop: Testing Paper Prototyping
IxDworks mini-workshop: Testing Paper PrototypingIxDworks mini-workshop: Testing Paper Prototyping
IxDworks mini-workshop: Testing Paper PrototypingInteractionDesign
 
History of CHI
History of CHIHistory of CHI
History of CHI
Erik Duval
 
Android os분석(중문)
Android os분석(중문)Android os분석(중문)
Android os분석(중문)
chon2010
 
Introduction of W3C HTML5 Korean Interest Group
Introduction of W3C HTML5 Korean Interest GroupIntroduction of W3C HTML5 Korean Interest Group
Introduction of W3C HTML5 Korean Interest GroupWonsuk Lee
 
[KUG Award 2009] Storytelling Sung Yong Seo
[KUG Award 2009] Storytelling Sung Yong Seo[KUG Award 2009] Storytelling Sung Yong Seo
[KUG Award 2009] Storytelling Sung Yong SeoKeynote User Group
 
Sri et al,2014_Two-Artificial-Diet-Formulations-For-Troides-Helena-Linne-Larv...
Sri et al,2014_Two-Artificial-Diet-Formulations-For-Troides-Helena-Linne-Larv...Sri et al,2014_Two-Artificial-Diet-Formulations-For-Troides-Helena-Linne-Larv...
Sri et al,2014_Two-Artificial-Diet-Formulations-For-Troides-Helena-Linne-Larv...Sri Ngatimin
 
The Rub of the green
The Rub of the greenThe Rub of the green
The Rub of the green
cherrywhite2020
 
"BaseSpace Apps- Is One Enough?' Biomatters' CTO D.Matt Landry on Bioinformat...
"BaseSpace Apps- Is One Enough?' Biomatters' CTO D.Matt Landry on Bioinformat..."BaseSpace Apps- Is One Enough?' Biomatters' CTO D.Matt Landry on Bioinformat...
"BaseSpace Apps- Is One Enough?' Biomatters' CTO D.Matt Landry on Bioinformat...
Biomatters
 
부산 국제 영화제
부산 국제 영화제부산 국제 영화제
부산 국제 영화제
송환 이
 
Building brands together helsinki final
Building brands together   helsinki finalBuilding brands together   helsinki final
Building brands together helsinki final
Nick Coates
 
Monthly realty watch Jan 2014
Monthly realty watch Jan 2014Monthly realty watch Jan 2014
Monthly realty watch Jan 2014
PROPTIGER
 
Academy of Art University Fashion Show Book 2014
Academy of Art University Fashion Show Book 2014Academy of Art University Fashion Show Book 2014
Academy of Art University Fashion Show Book 2014Jan Jonak
 
Sagip Pisay
Sagip PisaySagip Pisay

Viewers also liked (17)

Idea generation 110214
Idea generation 110214Idea generation 110214
Idea generation 110214
 
Things Thomas Missed
Things Thomas MissedThings Thomas Missed
Things Thomas Missed
 
Imperial Distribution CaseStudy-Vunani-2012
Imperial Distribution CaseStudy-Vunani-2012Imperial Distribution CaseStudy-Vunani-2012
Imperial Distribution CaseStudy-Vunani-2012
 
Taocp 1.4.1 subroutine
Taocp 1.4.1 subroutineTaocp 1.4.1 subroutine
Taocp 1.4.1 subroutine
 
IxDworks mini-workshop: Testing Paper Prototyping
IxDworks mini-workshop: Testing Paper PrototypingIxDworks mini-workshop: Testing Paper Prototyping
IxDworks mini-workshop: Testing Paper Prototyping
 
History of CHI
History of CHIHistory of CHI
History of CHI
 
Android os분석(중문)
Android os분석(중문)Android os분석(중문)
Android os분석(중문)
 
Introduction of W3C HTML5 Korean Interest Group
Introduction of W3C HTML5 Korean Interest GroupIntroduction of W3C HTML5 Korean Interest Group
Introduction of W3C HTML5 Korean Interest Group
 
[KUG Award 2009] Storytelling Sung Yong Seo
[KUG Award 2009] Storytelling Sung Yong Seo[KUG Award 2009] Storytelling Sung Yong Seo
[KUG Award 2009] Storytelling Sung Yong Seo
 
Sri et al,2014_Two-Artificial-Diet-Formulations-For-Troides-Helena-Linne-Larv...
Sri et al,2014_Two-Artificial-Diet-Formulations-For-Troides-Helena-Linne-Larv...Sri et al,2014_Two-Artificial-Diet-Formulations-For-Troides-Helena-Linne-Larv...
Sri et al,2014_Two-Artificial-Diet-Formulations-For-Troides-Helena-Linne-Larv...
 
The Rub of the green
The Rub of the greenThe Rub of the green
The Rub of the green
 
"BaseSpace Apps- Is One Enough?' Biomatters' CTO D.Matt Landry on Bioinformat...
"BaseSpace Apps- Is One Enough?' Biomatters' CTO D.Matt Landry on Bioinformat..."BaseSpace Apps- Is One Enough?' Biomatters' CTO D.Matt Landry on Bioinformat...
"BaseSpace Apps- Is One Enough?' Biomatters' CTO D.Matt Landry on Bioinformat...
 
부산 국제 영화제
부산 국제 영화제부산 국제 영화제
부산 국제 영화제
 
Building brands together helsinki final
Building brands together   helsinki finalBuilding brands together   helsinki final
Building brands together helsinki final
 
Monthly realty watch Jan 2014
Monthly realty watch Jan 2014Monthly realty watch Jan 2014
Monthly realty watch Jan 2014
 
Academy of Art University Fashion Show Book 2014
Academy of Art University Fashion Show Book 2014Academy of Art University Fashion Show Book 2014
Academy of Art University Fashion Show Book 2014
 
Sagip Pisay
Sagip PisaySagip Pisay
Sagip Pisay
 

Similar to Redosize

Redo log
Redo logRedo log
Redo log
PaweOlchawa1
 
On The Building Of A PostgreSQL Cluster
On The Building Of A PostgreSQL ClusterOn The Building Of A PostgreSQL Cluster
On The Building Of A PostgreSQL Cluster
Srihari Sriraman
 
Database architectureby howard
Database architectureby howardDatabase architectureby howard
Database architectureby howard
oracle documents
 
Help! my sql server log file is too big!!! tech republic
Help! my sql server log file is too big!!!   tech republicHelp! my sql server log file is too big!!!   tech republic
Help! my sql server log file is too big!!! tech republicKaing Menglieng
 
Low level java programming
Low level java programmingLow level java programming
Low level java programming
Peter Lawrey
 
The Fundamental Characteristics of Storage concepts for DBAs
The Fundamental Characteristics of Storage concepts for DBAsThe Fundamental Characteristics of Storage concepts for DBAs
The Fundamental Characteristics of Storage concepts for DBAs
Alireza Kamrani
 
Oracle Performance Tuning DE(v1.2)-part2.ppt
Oracle Performance Tuning DE(v1.2)-part2.pptOracle Performance Tuning DE(v1.2)-part2.ppt
Oracle Performance Tuning DE(v1.2)-part2.ppt
VenugopalChattu1
 
Sql server difference faqs- 7
Sql server difference faqs- 7Sql server difference faqs- 7
Sql server difference faqs- 7
Umar Ali
 
35 dbatune3
35 dbatune335 dbatune3
35 dbatune3
Anil Pandey
 
Steps to identify ONTAP latency related issues
Steps to identify ONTAP latency related issuesSteps to identify ONTAP latency related issues
Steps to identify ONTAP latency related issues
Ashwin Pawar
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Quantum Leaps, LLC
 
[Cassandra summit Tokyo, 2015] Cassandra 2015 最新情報 by ジョナサン・エリス(Jonathan Ellis)
[Cassandra summit Tokyo, 2015] Cassandra 2015 最新情報 by ジョナサン・エリス(Jonathan Ellis)[Cassandra summit Tokyo, 2015] Cassandra 2015 最新情報 by ジョナサン・エリス(Jonathan Ellis)
[Cassandra summit Tokyo, 2015] Cassandra 2015 最新情報 by ジョナサン・エリス(Jonathan Ellis)
datastaxjp
 
515689311-Postgresql-DBA-Architecture.pptx
515689311-Postgresql-DBA-Architecture.pptx515689311-Postgresql-DBA-Architecture.pptx
515689311-Postgresql-DBA-Architecture.pptx
ssuser03ec3c
 
Mutexes 2
Mutexes 2Mutexes 2
Troubleshooting SQL Server
Troubleshooting SQL ServerTroubleshooting SQL Server
Troubleshooting SQL ServerStephen Rose
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Miro Samek
 
Survey of task scheduler
Survey of task schedulerSurvey of task scheduler
Survey of task schedulerelisha25
 
Using AWR for IO Subsystem Analysis
Using AWR for IO Subsystem AnalysisUsing AWR for IO Subsystem Analysis
Using AWR for IO Subsystem Analysis
Texas Memory Systems, and IBM Company
 
Deterministic behaviour and performance in trading systems
Deterministic behaviour and performance in trading systemsDeterministic behaviour and performance in trading systems
Deterministic behaviour and performance in trading systems
Peter Lawrey
 

Similar to Redosize (20)

Redo log
Redo logRedo log
Redo log
 
On The Building Of A PostgreSQL Cluster
On The Building Of A PostgreSQL ClusterOn The Building Of A PostgreSQL Cluster
On The Building Of A PostgreSQL Cluster
 
Database architectureby howard
Database architectureby howardDatabase architectureby howard
Database architectureby howard
 
Help! my sql server log file is too big!!! tech republic
Help! my sql server log file is too big!!!   tech republicHelp! my sql server log file is too big!!!   tech republic
Help! my sql server log file is too big!!! tech republic
 
Low level java programming
Low level java programmingLow level java programming
Low level java programming
 
The Fundamental Characteristics of Storage concepts for DBAs
The Fundamental Characteristics of Storage concepts for DBAsThe Fundamental Characteristics of Storage concepts for DBAs
The Fundamental Characteristics of Storage concepts for DBAs
 
Oracle Performance Tuning DE(v1.2)-part2.ppt
Oracle Performance Tuning DE(v1.2)-part2.pptOracle Performance Tuning DE(v1.2)-part2.ppt
Oracle Performance Tuning DE(v1.2)-part2.ppt
 
Sql server difference faqs- 7
Sql server difference faqs- 7Sql server difference faqs- 7
Sql server difference faqs- 7
 
35 dbatune3
35 dbatune335 dbatune3
35 dbatune3
 
Steps to identify ONTAP latency related issues
Steps to identify ONTAP latency related issuesSteps to identify ONTAP latency related issues
Steps to identify ONTAP latency related issues
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
 
[Cassandra summit Tokyo, 2015] Cassandra 2015 最新情報 by ジョナサン・エリス(Jonathan Ellis)
[Cassandra summit Tokyo, 2015] Cassandra 2015 最新情報 by ジョナサン・エリス(Jonathan Ellis)[Cassandra summit Tokyo, 2015] Cassandra 2015 最新情報 by ジョナサン・エリス(Jonathan Ellis)
[Cassandra summit Tokyo, 2015] Cassandra 2015 最新情報 by ジョナサン・エリス(Jonathan Ellis)
 
515689311-Postgresql-DBA-Architecture.pptx
515689311-Postgresql-DBA-Architecture.pptx515689311-Postgresql-DBA-Architecture.pptx
515689311-Postgresql-DBA-Architecture.pptx
 
Mutexes 2
Mutexes 2Mutexes 2
Mutexes 2
 
Troubleshooting SQL Server
Troubleshooting SQL ServerTroubleshooting SQL Server
Troubleshooting SQL Server
 
Analyzing awr report
Analyzing awr reportAnalyzing awr report
Analyzing awr report
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
 
Survey of task scheduler
Survey of task schedulerSurvey of task scheduler
Survey of task scheduler
 
Using AWR for IO Subsystem Analysis
Using AWR for IO Subsystem AnalysisUsing AWR for IO Subsystem Analysis
Using AWR for IO Subsystem Analysis
 
Deterministic behaviour and performance in trading systems
Deterministic behaviour and performance in trading systemsDeterministic behaviour and performance in trading systems
Deterministic behaviour and performance in trading systems
 

More from oracle documents

Applyinga blockcentricapproachtotuning
Applyinga blockcentricapproachtotuningApplyinga blockcentricapproachtotuning
Applyinga blockcentricapproachtotuning
oracle documents
 
Windowsosauthent
WindowsosauthentWindowsosauthent
Windowsosauthent
oracle documents
 
Whatistnsnames
WhatistnsnamesWhatistnsnames
Whatistnsnames
oracle documents
 
Whatisadatabaselink
WhatisadatabaselinkWhatisadatabaselink
Whatisadatabaselink
oracle documents
 
Varraysandnestedtables
VarraysandnestedtablesVarraysandnestedtables
Varraysandnestedtables
oracle documents
 
Usertracing
UsertracingUsertracing
Usertracing
oracle documents
 
Userpasswrd
UserpasswrdUserpasswrd
Userpasswrd
oracle documents
 
Userlimit
UserlimitUserlimit
Userlimit
oracle documents
 
Undo internalspresentation
Undo internalspresentationUndo internalspresentation
Undo internalspresentation
oracle documents
 
Undo internals paper
Undo internals paperUndo internals paper
Undo internals paper
oracle documents
 
Tablespacelmt
TablespacelmtTablespacelmt
Tablespacelmt
oracle documents
 
Tablerename
TablerenameTablerename
Tablerename
oracle documents
 
Sql scripting sorcerypresentation
Sql scripting sorcerypresentationSql scripting sorcerypresentation
Sql scripting sorcerypresentation
oracle documents
 
Sql scripting sorcerypaper
Sql scripting sorcerypaperSql scripting sorcerypaper
Sql scripting sorcerypaper
oracle documents
 
Sql for dbaspresentation
Sql for dbaspresentationSql for dbaspresentation
Sql for dbaspresentation
oracle documents
 
Sequencereset
SequenceresetSequencereset
Sequencereset
oracle documents
 
Rollbacksizes
RollbacksizesRollbacksizes
Rollbacksizes
oracle documents
 
Rollbackshrinks
RollbackshrinksRollbackshrinks
Rollbackshrinks
oracle documents
 
Rollbacklmt
RollbacklmtRollbacklmt
Rollbacklmt
oracle documents
 
Rollbackblocking
RollbackblockingRollbackblocking
Rollbackblocking
oracle documents
 

More from oracle documents (20)

Applyinga blockcentricapproachtotuning
Applyinga blockcentricapproachtotuningApplyinga blockcentricapproachtotuning
Applyinga blockcentricapproachtotuning
 
Windowsosauthent
WindowsosauthentWindowsosauthent
Windowsosauthent
 
Whatistnsnames
WhatistnsnamesWhatistnsnames
Whatistnsnames
 
Whatisadatabaselink
WhatisadatabaselinkWhatisadatabaselink
Whatisadatabaselink
 
Varraysandnestedtables
VarraysandnestedtablesVarraysandnestedtables
Varraysandnestedtables
 
Usertracing
UsertracingUsertracing
Usertracing
 
Userpasswrd
UserpasswrdUserpasswrd
Userpasswrd
 
Userlimit
UserlimitUserlimit
Userlimit
 
Undo internalspresentation
Undo internalspresentationUndo internalspresentation
Undo internalspresentation
 
Undo internals paper
Undo internals paperUndo internals paper
Undo internals paper
 
Tablespacelmt
TablespacelmtTablespacelmt
Tablespacelmt
 
Tablerename
TablerenameTablerename
Tablerename
 
Sql scripting sorcerypresentation
Sql scripting sorcerypresentationSql scripting sorcerypresentation
Sql scripting sorcerypresentation
 
Sql scripting sorcerypaper
Sql scripting sorcerypaperSql scripting sorcerypaper
Sql scripting sorcerypaper
 
Sql for dbaspresentation
Sql for dbaspresentationSql for dbaspresentation
Sql for dbaspresentation
 
Sequencereset
SequenceresetSequencereset
Sequencereset
 
Rollbacksizes
RollbacksizesRollbacksizes
Rollbacksizes
 
Rollbackshrinks
RollbackshrinksRollbackshrinks
Rollbackshrinks
 
Rollbacklmt
RollbacklmtRollbacklmt
Rollbacklmt
 
Rollbackblocking
RollbackblockingRollbackblocking
Rollbackblocking
 

Redosize

  • 1. Size of Redo Logs Administration Tips How big should Redo Logs be? This one is easy: "As big as is necessary to get the rate at which you log switch down to a reasonable rate". What a 'reasonable rate' is, of course, will depend from site to site and application to application. The key point is that log switching too frequently is something to be avoided at all costs. Why? Because a log switch induces a full checkpoint on the database. That means it kicks DBWR into action, flushing all dirty buffers related to the just-completed log out to disk, after which CKPT must update the headers of every single data file and control file with the latest SCN information. Checkpoints thus represent a huge I/O-fest, and if you value performance, I/O is something to be avoided at all costs. Accordingly, you don't want to be checkpointing like crazy -but if you are switching logs ever 4 seconds, you will be. Since log switches usually only happen when a redo log has been filled, the principle determinant of when a log switch takes place is the size of the log. Other things being equal, big logs take longer to fill up than small ones -which means that big logs are slower to cause checkpoints than small ones. For this reason, I usually recommend absolutely humungous redo logs (in the order of a couple of gigabytes big), since they will take for ever to fill up, and log switches (and hence checkpoints) are a very rare occurrence. In fact, ideally, I wouldn't want to see a log switch happening during the day at all. Instead, I'd have a cron job (or an AT job, if you're running NT) which connects to the database at some unearthly hour, like 2 o'clock in the morning, and issues the command 'ALTER SYSTEM SWITCH LOGFILE;'. That means the mother-of-all-checkpoints is issued when no-one is around to worry about the performance hit it causes. There is, however, one proviso to all this, and it's a serious one. What happens during an Instance Recovery? Well, SMON at startup notices that there are redo log records from a time after the time of the last checkpoint, and replays them (i.e., rolls them all forward, then notices half of them were never committed, and rolls those ones back again). Now imagine what happens if you are log switching (and hence checkpointing) just once a day, at 2am, and have an Instance crash the next day, at around 5pm: SMON will have to roll an entire day's work forward before the database can be opened. That's a serious non- availability issue. So, there's a balance to be struck. Huge logs that seldom switch are great for performance, but mean Instance Recoveries take for ever to complete. Small logs are lousy for performance, but Instance Recoveries are done in a matter of moments. Somewhere along that spectrum will be a spot where you can be happy, balancing performance with Instance Recovery time. In search of that balance, many DBAs have, therefore, developed a Copyright © Howard Rogers 2001 10/17/2001 Page 1 of 2
  • 2. Size of Redo Logs Administration Tips general rule of thumb that says 'I will switch logs around once every hour' (or perhaps once every half hour or so). That's not bad as a rule of thumb, but that's all it is. You need to find out whether applying such a “rule” degrades performance unacceptably in your specific environment. Incidentally: how do you find out how often your log switches are occurring? Well, there are several ways, but perhaps the easiest is to locate your Alert Log. That will be sitting in wherever the "background_dump_dest" init.ora parameter is pointing (you could do a SHOW PARAMETER BACKGROUND to display that). Every log switch is recorded there, along with the precise time (down to the second) when it happened. The relevant lines usually read something like "Thread 1 advanced to Log Sequence 391". What you are looking for is an average rate of switching over the course of a typical working day (you will, of course, tend to switch rather more often during busy periods, and rather slower during lunchtimes and at the end of the day). If you find your average switching rate is too high, you can't correct the problem by resizing existing logs. You have, instead, to add new logs of a bigger size, and remove the small logs as a separate exercise. ALTER DATABASE ADD LOGFILE '/PATH/FILENAME' SIZE 500M is the command to add new, single member, groups. ALTER DATABASE DROP LOGFILE GROUP 1 gets rid of all members of an existing group (obviously replace the group number there with something appropriate). Copyright © Howard Rogers 2001 10/17/2001 Page 2 of 2