SlideShare une entreprise Scribd logo
1  sur  26
Redo Waits

             Kyle Hailey
http://perfvision.com/ftp/emea2010
  Kyle.hailey@embarcadero.com


                                     #.1
In This Section:



1.   Log Buffer Space
2.   Log File Sync
3.   Log File Switch Completion
4.   Log File Switch (checkpoint incomplete)
5.   Log File Switch (private strand flush incomplete)
6.   Log File Switch (archiving needed)
7.   Switch Log File Command


                      Copyright 2006 Kyle Hailey         #.2
Log File Waits
                    SGA
           Log    Library Buffer
           Buffer Cache Cache
                       Buffer Cache
             Log Buffer
                                                     DBWR
LGWR
                            User1

                           User2

                           User3


 REDO Log Files                                Data Files
                  Copyright 2006 Kyle Hailey                #.3
Log File Operations
 Redo is written to disk when
   User commits
   Log Buffer 1/3 full (_log_io_size)
   Log Buffer fills 1M
   Every 3 seconds
   DBWR asks LGWR to flush redo

 Sessions Commiting wait for LGWR




                        Copyright 2006 Kyle Hailey   #.4
log buffer space

 Wait for space in the redo log buffer in SGA
 Solution
  1.   Increase log_buffer parameter in init.ora
          Above 3M log_buffer little affect, if still a problem then
           backup is at disk level
  1.   Improve disk IO for redo
          Faster disk
          Raw file
          Direct IO
          Dedicated disk
 p1, p2, p3 – no values

                             Copyright 2006 Kyle Hailey                 #.5
Log Buffer Space
                      SGA
             Log    Library Buffer
             Buffer Cache Cache
                         Buffer Cache
                 Log Buffer

 LGWR
                               User1
                                                  1. Log Buffer too small
                              User2
                                                  2. LGWR too slow
                              User3                     Slow disk
                             Insert
                             Update
REDO Log Files               delete
                                                                      #.6
                     Copyright 2006 Kyle Hailey
log file sync
 Wait for redo flush upon:
   Commit
   Rollback

 Arguments
   P1 = buffer# in log buffer that needs to be flushed
   P2 = not used
   P3 = not used

         select parameter1, parameter2, parameter3
         from v$event_name
         where name=‘log file sync';
         PARAMETER1          PARAMETER2 PARAMETER3
         buffer#
                     Copyright 2006 Kyle Hailey
                                                          #.7
Log File Sync
                     SGA
            Log    Library Buffer
            Buffer Cache Cache


                                                   DBWR
 LGWR
                            User1

                           User2

                            User3
                      Commit;
REDO Log Files        wait for LGWR             Data Files

                   Copyright 2006 Kyle Hailey                #.8
Log File Sync: Solutions
 Commit less
        Often possible in loops that commit every loop
             Commit every 50 or 100 instead
        Possibly 10gR2
             ALTER SYSTEM SET COMMIT_WRITE = BATCH, NOWAIT
                  Commit could be lost if machine crash or IO error
 Improve IO
      Use Raw Device or Direct IO
      Consider Ram Disks
      Can stripe if redo writes are comparable to stripe size
             Striping shouldn’t hurt
             Striping can help
                Ex: imp – can have large redo writes – can improve by 10-
                  30%
 Alternate disks for redo and archiving of redo

(_high_priority_processes)


                                Copyright 2006 Kyle Hailey                   #.9
Log File Sync depends on:
 log file parallel write
    Time   it takes for LGWR to write out changes
 If log file sync =~ log file parallel write
    And   the time is slow ( > 3ms) look into IO issues
 If log file sync >> log file parallel write
    Look   at CPU starvation issues




                          Copyright 2006 Kyle Hailey       #.10
Separating LGWR and ARCH




 LGWR                                         ARCH

          Redo 1                    Redo 2



         Redo 3
                                     Redo 4



               Copyright 2006 Kyle Hailey            #.11
Log file switch completion
 No p1,p2,p3
 Wait for lgwr to switch log files when generating
  redo
 Solution:
   Increase    redo log file size
        Reduce frequency of switches




                            Copyright 2006 Kyle Hailey   #.12
log file switch completion
                                                                 Block xxxx
                          SGA                                    Block xxxx
Sessions         Log    Library Buffer                           Block xxxx
                                                                 Block xxxx
writing redo     Buffer Cache Cache
                             Buffer Cache                        Block xxxx
wait while                                                       Block xxxx

switch happens     Log Buffer                                    Block xxxx
                                                                 Block xxxx

                                                          DBWR
    LGWR
                                 User3
                                User2
                              User1
                             Commit;
1          2          3    Wait for
  REDO Log Files           LGWR                     Data Files
Wait : log file switch completion
                       Copyright 2006 Kyle Hailey                      #.13
log file switch (checkpoint incomplete)


  No p1,p2,p3 args
  Wait for checkpoint to complete because all log
   files are full
  Solutions
    Increase   size of log files




                           Copyright 2006 Kyle Hailey   #.14
log file switch (checkpoint incomplete) : Diag
Sessions                SGA                              Checkpoint 1   1
writing redo   Log    Library Buffer                     Block xxxx
wait while
                                                               Checkpoint 2
                                                         Block xxxx          2
               Buffer Cache Cache
                           Buffer Cache                  Block xxxx xxxx
                                                               Block
switch AND                                                     BlockCheckpoint 3
                                                         Block xxxx xxxx         3
checkpoint       Log Buffer                                    Block xxxx
                                                         Block xxxx Block xxxx
                                                               Block xxxx
                                                         Block xxxx Block xxxx
happen                                                         Block xxxx
                                                         Block xxxx Block xxxx
                                                         DBWR  Block xxxx
                                                         Block xxxx Block xxxx
   LGWR                                                        BlockBlock xxxx
                                                                     xxxx
                                                               BlockBlock xxxx
                                                                     xxxx
                                User3                               Block xxxx
                                                                    Block xxxx
                               User2
                             User1
                            Commit;
                  3         Wait for
    REDO Log Files          LGWR                   Data Files

                      Copyright 2006 Kyle Hailey                            #.15
log file switch (archiving needed)
 No p1,p2,p3
 Database “hangs” for transactions

  archive log stop;
  -- make room in log_archive_dest
  archive log start;




                      Copyright 2006 Kyle Hailey   #.16
log file switch (archiving needed)                         :



                        SGA
               Log    Library Buffer
               Buffer Cache Cache
                           Buffer Cache
                 Log Buffer

    LGWR
                          ARCH




                  3
    REDO Log Files                                 Archive Dest

                      Copyright 2006 Kyle Hailey                  #.17
switch logfile command
 Same as log file switch completion but the
  command is executed by the dba
   Alter   system switch logfile;




                          Copyright 2006 Kyle Hailey   #.18
Concerns – Recovery Time
 What happens to recovery time if I change my redo
  log file sizes
 Larger Redo Log size can increase recovery time
  but
 There are init.ora parameters to limit this




                    Copyright 2006 Kyle Hailey   #.19
Incremental Checkpoints (9iR2+)

  FAST_START_MTTR_TARGET
     Seconds   to Recovery
     Easy and accuracy
     Is overridden by FAST_START_IO_TARGET
     Is overridden by LOG_CHECKPOINT_INTERVAL

  alter system set fast_start_mttr_target=17 scope=both;

 SQL> select ESTIMATED_MTTR from V$INSTANCE_RECOVERY;
  SQL> select ESTIMATED_MTTR from V$INSTANCE_RECOVERY;
 ESTIMATED_MTTR
 ESTIMATED_MTTR
 --------------
 --------------
             21
             21

                        Copyright 2006 Kyle Hailey         #.20
Recovery and Checkpoints
                          SGA
                 Log    Library Buffer                   DBWR
                 Buffer Cache Cache



    LGWR
                                                      Data Files


                                           Current Position

                                     Needed for Recovery
1        2             3
                                           Incremental Checkpoint

     REDO Log Files Copyright 2006 Kyle Hailey                      #.21
DBWR dirty List and LGWR

                           Buffers


                                                          DBWR usually
                                                          just writes out
                       LGWR Current                       dirty blocks at
                       Position                           end of LRU
                                                          until checkpoint
                           Incremental Checkpoint
                                                          DBWR
                            Checkpoint a
Now, DBWR                   Block xxxx
keeps a                     Block xxxx
checkpoint list that        Block xxxx
                            Block xxxx
it writes out

                             Copyright 2006 Kyle Hailey              #.22
DBWR dirty List


 MRU - Hot           Buffer Headers                       LRU - Cold




 DBWR also has to                    Dirty List
 track dirty blocks at the           Block xxxx
  cold end of the LRU                Block xxxx
                                     Block xxxx             DBWR
                                     Block xxxx




                             Copyright 2006 Kyle Hailey            #.23
DBWR merges Dirty and Checkpoint


 MRU - Hot                Buffer Headers                         LRU - Cold




             Checkpoint a              Dirty List
             Block xxxx
             Block xxxx
                                       Block xxxx
                                       Block xxxx
                                                                DBWR
             Block xxxx                Block xxxx
             Block xxxx                Block xxxx


                          Write List
                          Block xxxx
                          Block xxxx
                          Block xxxx
                          Block xxxx                          Data Files
                                 Copyright 2006 Kyle Hailey                #.24
log file switch (private strand flush incomplete)

 New wait 10g
 Like a “log file switch Completion”




                      Copyright 2006 Kyle Hailey    #.25
Redo Wait Solutions
log file sync
   Commit less, put redo logs on faster disks
log buffer space
   Increase log buffer no more than 32M, then tune LGWR
log file switch completion
   Increase log file sizes
log file switch (checkpoint incomplete)
   Add log files (or increase log file size)
switch logfile command
       Avoid switching log files
    log file switch (private strand flush incomplete)
         increase log file sizes
log file switch (archiving needed) ***
   Archive log running out of space


                               Copyright 2006 Kyle Hailey   #.26

Contenu connexe

Tendances

35. multiplepartitionallocation
35. multiplepartitionallocation35. multiplepartitionallocation
35. multiplepartitionallocationmyrajendra
 
WalB: Block-level WAL. Concept.
WalB: Block-level WAL. Concept.WalB: Block-level WAL. Concept.
WalB: Block-level WAL. Concept.Takashi Hoshino
 
Unix reference sheet
Unix reference sheetUnix reference sheet
Unix reference sheetapajadeh
 
Stratified B-trees - HotStorage11
Stratified B-trees - HotStorage11Stratified B-trees - HotStorage11
Stratified B-trees - HotStorage11Acunu
 
2011.06.20 stratified-btree
2011.06.20 stratified-btree2011.06.20 stratified-btree
2011.06.20 stratified-btreeAcunu
 
Collaborate nfs kyle_final
Collaborate nfs kyle_finalCollaborate nfs kyle_final
Collaborate nfs kyle_finalKyle Hailey
 

Tendances (7)

NFS and Oracle
NFS and OracleNFS and Oracle
NFS and Oracle
 
35. multiplepartitionallocation
35. multiplepartitionallocation35. multiplepartitionallocation
35. multiplepartitionallocation
 
WalB: Block-level WAL. Concept.
WalB: Block-level WAL. Concept.WalB: Block-level WAL. Concept.
WalB: Block-level WAL. Concept.
 
Unix reference sheet
Unix reference sheetUnix reference sheet
Unix reference sheet
 
Stratified B-trees - HotStorage11
Stratified B-trees - HotStorage11Stratified B-trees - HotStorage11
Stratified B-trees - HotStorage11
 
2011.06.20 stratified-btree
2011.06.20 stratified-btree2011.06.20 stratified-btree
2011.06.20 stratified-btree
 
Collaborate nfs kyle_final
Collaborate nfs kyle_finalCollaborate nfs kyle_final
Collaborate nfs kyle_final
 

Similaire à Oracle 10g Performance: chapter 08 redo

Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...
Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...
Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...Fwdays
 
Less01 architecture
Less01 architectureLess01 architecture
Less01 architectureAmit Bhalla
 
Building a Distributed Message Log from Scratch
Building a Distributed Message Log from ScratchBuilding a Distributed Message Log from Scratch
Building a Distributed Message Log from ScratchTyler Treat
 
Replication tutorial presentation
Replication tutorial presentationReplication tutorial presentation
Replication tutorial presentationcolderboy17
 
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By PresentationRemote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By PresentationRemote DBA Services
 
Oracle 10g Performance: chapter 07 io
Oracle 10g Performance: chapter 07 ioOracle 10g Performance: chapter 07 io
Oracle 10g Performance: chapter 07 ioKyle Hailey
 
Ibm tivoli storage manager how to migrate the library manager function redp0140
Ibm tivoli storage manager how to migrate the library manager function redp0140Ibm tivoli storage manager how to migrate the library manager function redp0140
Ibm tivoli storage manager how to migrate the library manager function redp0140Banking at Ho Chi Minh city
 
Ibm tivoli storage manager how to migrate the library manager function redp0140
Ibm tivoli storage manager how to migrate the library manager function redp0140Ibm tivoli storage manager how to migrate the library manager function redp0140
Ibm tivoli storage manager how to migrate the library manager function redp0140Banking at Ho Chi Minh city
 
Directory Write Leases in MagFS
Directory Write Leases in MagFSDirectory Write Leases in MagFS
Directory Write Leases in MagFSMaginatics
 
WebSphere : High Performance Extensible Logging
WebSphere : High Performance Extensible LoggingWebSphere : High Performance Extensible Logging
WebSphere : High Performance Extensible LoggingJoseph's WebSphere Library
 
Leo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLeo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLéopold Gault
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache KafkaShiao-An Yuan
 
Tips and Tricks for Operating Apache Kafka
Tips and Tricks for Operating Apache KafkaTips and Tricks for Operating Apache Kafka
Tips and Tricks for Operating Apache KafkaAll Things Open
 
Loggly - Benchmarking 5 Node.js Logging Libraries
Loggly - Benchmarking 5 Node.js Logging LibrariesLoggly - Benchmarking 5 Node.js Logging Libraries
Loggly - Benchmarking 5 Node.js Logging LibrariesSolarWinds Loggly
 
AdvFS/Advanced File System Ccncepts
AdvFS/Advanced File System CcnceptsAdvFS/Advanced File System Ccncepts
AdvFS/Advanced File System CcnceptsJustin Goldberg
 
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...Amazon Web Services
 
Is ruby logger thread(process)-safe? at RubyConf 2013
Is ruby logger thread(process)-safe? at RubyConf 2013Is ruby logger thread(process)-safe? at RubyConf 2013
Is ruby logger thread(process)-safe? at RubyConf 2013Naotoshi Seo
 
Remote Dba Team Oracle Architecture In Nutshell
Remote Dba Team   Oracle Architecture In NutshellRemote Dba Team   Oracle Architecture In Nutshell
Remote Dba Team Oracle Architecture In NutshellRemote DBA Services
 

Similaire à Oracle 10g Performance: chapter 08 redo (20)

Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...
Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...
Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...
 
Less01 architecture
Less01 architectureLess01 architecture
Less01 architecture
 
Building a Distributed Message Log from Scratch
Building a Distributed Message Log from ScratchBuilding a Distributed Message Log from Scratch
Building a Distributed Message Log from Scratch
 
Presentation
PresentationPresentation
Presentation
 
Replication tutorial presentation
Replication tutorial presentationReplication tutorial presentation
Replication tutorial presentation
 
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By PresentationRemote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation
Remote DBA team-1Z0-042 Oracle Sga In Nutshell Oracle Dba Learn By Presentation
 
App D
App DApp D
App D
 
Oracle 10g Performance: chapter 07 io
Oracle 10g Performance: chapter 07 ioOracle 10g Performance: chapter 07 io
Oracle 10g Performance: chapter 07 io
 
Ibm tivoli storage manager how to migrate the library manager function redp0140
Ibm tivoli storage manager how to migrate the library manager function redp0140Ibm tivoli storage manager how to migrate the library manager function redp0140
Ibm tivoli storage manager how to migrate the library manager function redp0140
 
Ibm tivoli storage manager how to migrate the library manager function redp0140
Ibm tivoli storage manager how to migrate the library manager function redp0140Ibm tivoli storage manager how to migrate the library manager function redp0140
Ibm tivoli storage manager how to migrate the library manager function redp0140
 
Directory Write Leases in MagFS
Directory Write Leases in MagFSDirectory Write Leases in MagFS
Directory Write Leases in MagFS
 
WebSphere : High Performance Extensible Logging
WebSphere : High Performance Extensible LoggingWebSphere : High Performance Extensible Logging
WebSphere : High Performance Extensible Logging
 
Leo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 DaysLeo's notes - Oracle DBA 2 Days
Leo's notes - Oracle DBA 2 Days
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
Tips and Tricks for Operating Apache Kafka
Tips and Tricks for Operating Apache KafkaTips and Tricks for Operating Apache Kafka
Tips and Tricks for Operating Apache Kafka
 
Loggly - Benchmarking 5 Node.js Logging Libraries
Loggly - Benchmarking 5 Node.js Logging LibrariesLoggly - Benchmarking 5 Node.js Logging Libraries
Loggly - Benchmarking 5 Node.js Logging Libraries
 
AdvFS/Advanced File System Ccncepts
AdvFS/Advanced File System CcnceptsAdvFS/Advanced File System Ccncepts
AdvFS/Advanced File System Ccncepts
 
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
 
Is ruby logger thread(process)-safe? at RubyConf 2013
Is ruby logger thread(process)-safe? at RubyConf 2013Is ruby logger thread(process)-safe? at RubyConf 2013
Is ruby logger thread(process)-safe? at RubyConf 2013
 
Remote Dba Team Oracle Architecture In Nutshell
Remote Dba Team   Oracle Architecture In NutshellRemote Dba Team   Oracle Architecture In Nutshell
Remote Dba Team Oracle Architecture In Nutshell
 

Plus de Kyle Hailey

Hooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume LelargeHooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume LelargeKyle Hailey
 
Performance insights twitch
Performance insights twitchPerformance insights twitch
Performance insights twitchKyle Hailey
 
History of database monitoring
History of database monitoringHistory of database monitoring
History of database monitoringKyle Hailey
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Kyle Hailey
 
Successfully convince people with data visualization
Successfully convince people with data visualizationSuccessfully convince people with data visualization
Successfully convince people with data visualizationKyle Hailey
 
Virtual Data : Eliminating the data constraint in Application Development
Virtual Data :  Eliminating the data constraint in Application DevelopmentVirtual Data :  Eliminating the data constraint in Application Development
Virtual Data : Eliminating the data constraint in Application DevelopmentKyle Hailey
 
DBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application DevelopmentDBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application DevelopmentKyle Hailey
 
Accelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual DataAccelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual DataKyle Hailey
 
Delphix and Pure Storage partner
Delphix and Pure Storage partnerDelphix and Pure Storage partner
Delphix and Pure Storage partnerKyle Hailey
 
Mark Farnam : Minimizing the Concurrency Footprint of Transactions
Mark Farnam  : Minimizing the Concurrency Footprint of TransactionsMark Farnam  : Minimizing the Concurrency Footprint of Transactions
Mark Farnam : Minimizing the Concurrency Footprint of TransactionsKyle Hailey
 
Dan Norris: Exadata security
Dan Norris: Exadata securityDan Norris: Exadata security
Dan Norris: Exadata securityKyle Hailey
 
Martin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle GuysMartin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle GuysKyle Hailey
 
Data as a Service
Data as a Service Data as a Service
Data as a Service Kyle Hailey
 
Data Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloningData Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloning Kyle Hailey
 
BGOUG "Agile Data: revolutionizing database cloning'
BGOUG  "Agile Data: revolutionizing database cloning'BGOUG  "Agile Data: revolutionizing database cloning'
BGOUG "Agile Data: revolutionizing database cloning'Kyle Hailey
 
Denver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationDenver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationKyle Hailey
 
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]Kyle Hailey
 
Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix Kyle Hailey
 
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseOaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseKyle Hailey
 

Plus de Kyle Hailey (20)

Hooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume LelargeHooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume Lelarge
 
Performance insights twitch
Performance insights twitchPerformance insights twitch
Performance insights twitch
 
History of database monitoring
History of database monitoringHistory of database monitoring
History of database monitoring
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle
 
Successfully convince people with data visualization
Successfully convince people with data visualizationSuccessfully convince people with data visualization
Successfully convince people with data visualization
 
Virtual Data : Eliminating the data constraint in Application Development
Virtual Data :  Eliminating the data constraint in Application DevelopmentVirtual Data :  Eliminating the data constraint in Application Development
Virtual Data : Eliminating the data constraint in Application Development
 
DBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application DevelopmentDBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application Development
 
Accelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual DataAccelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual Data
 
Delphix and Pure Storage partner
Delphix and Pure Storage partnerDelphix and Pure Storage partner
Delphix and Pure Storage partner
 
Mark Farnam : Minimizing the Concurrency Footprint of Transactions
Mark Farnam  : Minimizing the Concurrency Footprint of TransactionsMark Farnam  : Minimizing the Concurrency Footprint of Transactions
Mark Farnam : Minimizing the Concurrency Footprint of Transactions
 
Dan Norris: Exadata security
Dan Norris: Exadata securityDan Norris: Exadata security
Dan Norris: Exadata security
 
Martin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle GuysMartin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle Guys
 
What is DevOps
What is DevOpsWhat is DevOps
What is DevOps
 
Data as a Service
Data as a Service Data as a Service
Data as a Service
 
Data Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloningData Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloning
 
BGOUG "Agile Data: revolutionizing database cloning'
BGOUG  "Agile Data: revolutionizing database cloning'BGOUG  "Agile Data: revolutionizing database cloning'
BGOUG "Agile Data: revolutionizing database cloning'
 
Denver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationDenver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualization
 
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
 
Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix
 
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseOaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
 

Dernier

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Dernier (20)

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Oracle 10g Performance: chapter 08 redo

  • 1. Redo Waits Kyle Hailey http://perfvision.com/ftp/emea2010 Kyle.hailey@embarcadero.com #.1
  • 2. In This Section: 1. Log Buffer Space 2. Log File Sync 3. Log File Switch Completion 4. Log File Switch (checkpoint incomplete) 5. Log File Switch (private strand flush incomplete) 6. Log File Switch (archiving needed) 7. Switch Log File Command Copyright 2006 Kyle Hailey #.2
  • 3. Log File Waits SGA Log Library Buffer Buffer Cache Cache Buffer Cache Log Buffer DBWR LGWR User1 User2 User3 REDO Log Files Data Files Copyright 2006 Kyle Hailey #.3
  • 4. Log File Operations  Redo is written to disk when  User commits  Log Buffer 1/3 full (_log_io_size)  Log Buffer fills 1M  Every 3 seconds  DBWR asks LGWR to flush redo  Sessions Commiting wait for LGWR Copyright 2006 Kyle Hailey #.4
  • 5. log buffer space  Wait for space in the redo log buffer in SGA  Solution 1. Increase log_buffer parameter in init.ora  Above 3M log_buffer little affect, if still a problem then backup is at disk level 1. Improve disk IO for redo  Faster disk  Raw file  Direct IO  Dedicated disk  p1, p2, p3 – no values Copyright 2006 Kyle Hailey #.5
  • 6. Log Buffer Space SGA Log Library Buffer Buffer Cache Cache Buffer Cache Log Buffer LGWR User1 1. Log Buffer too small User2 2. LGWR too slow User3  Slow disk Insert Update REDO Log Files delete #.6 Copyright 2006 Kyle Hailey
  • 7. log file sync  Wait for redo flush upon:  Commit  Rollback  Arguments  P1 = buffer# in log buffer that needs to be flushed  P2 = not used  P3 = not used select parameter1, parameter2, parameter3 from v$event_name where name=‘log file sync'; PARAMETER1 PARAMETER2 PARAMETER3 buffer# Copyright 2006 Kyle Hailey #.7
  • 8. Log File Sync SGA Log Library Buffer Buffer Cache Cache DBWR LGWR User1 User2 User3 Commit; REDO Log Files wait for LGWR Data Files Copyright 2006 Kyle Hailey #.8
  • 9. Log File Sync: Solutions  Commit less  Often possible in loops that commit every loop  Commit every 50 or 100 instead  Possibly 10gR2  ALTER SYSTEM SET COMMIT_WRITE = BATCH, NOWAIT  Commit could be lost if machine crash or IO error  Improve IO  Use Raw Device or Direct IO  Consider Ram Disks  Can stripe if redo writes are comparable to stripe size  Striping shouldn’t hurt  Striping can help  Ex: imp – can have large redo writes – can improve by 10- 30%  Alternate disks for redo and archiving of redo (_high_priority_processes) Copyright 2006 Kyle Hailey #.9
  • 10. Log File Sync depends on:  log file parallel write  Time it takes for LGWR to write out changes  If log file sync =~ log file parallel write  And the time is slow ( > 3ms) look into IO issues  If log file sync >> log file parallel write  Look at CPU starvation issues Copyright 2006 Kyle Hailey #.10
  • 11. Separating LGWR and ARCH LGWR ARCH Redo 1 Redo 2 Redo 3 Redo 4 Copyright 2006 Kyle Hailey #.11
  • 12. Log file switch completion  No p1,p2,p3  Wait for lgwr to switch log files when generating redo  Solution:  Increase redo log file size  Reduce frequency of switches Copyright 2006 Kyle Hailey #.12
  • 13. log file switch completion Block xxxx SGA Block xxxx Sessions Log Library Buffer Block xxxx Block xxxx writing redo Buffer Cache Cache Buffer Cache Block xxxx wait while Block xxxx switch happens Log Buffer Block xxxx Block xxxx DBWR LGWR User3 User2 User1 Commit; 1 2 3 Wait for REDO Log Files LGWR Data Files Wait : log file switch completion Copyright 2006 Kyle Hailey #.13
  • 14. log file switch (checkpoint incomplete)  No p1,p2,p3 args  Wait for checkpoint to complete because all log files are full  Solutions  Increase size of log files Copyright 2006 Kyle Hailey #.14
  • 15. log file switch (checkpoint incomplete) : Diag Sessions SGA Checkpoint 1 1 writing redo Log Library Buffer Block xxxx wait while Checkpoint 2 Block xxxx 2 Buffer Cache Cache Buffer Cache Block xxxx xxxx Block switch AND BlockCheckpoint 3 Block xxxx xxxx 3 checkpoint Log Buffer Block xxxx Block xxxx Block xxxx Block xxxx Block xxxx Block xxxx happen Block xxxx Block xxxx Block xxxx DBWR Block xxxx Block xxxx Block xxxx LGWR BlockBlock xxxx xxxx BlockBlock xxxx xxxx User3 Block xxxx Block xxxx User2 User1 Commit; 3 Wait for REDO Log Files LGWR Data Files Copyright 2006 Kyle Hailey #.15
  • 16. log file switch (archiving needed)  No p1,p2,p3  Database “hangs” for transactions archive log stop; -- make room in log_archive_dest archive log start; Copyright 2006 Kyle Hailey #.16
  • 17. log file switch (archiving needed) : SGA Log Library Buffer Buffer Cache Cache Buffer Cache Log Buffer LGWR ARCH 3 REDO Log Files Archive Dest Copyright 2006 Kyle Hailey #.17
  • 18. switch logfile command  Same as log file switch completion but the command is executed by the dba  Alter system switch logfile; Copyright 2006 Kyle Hailey #.18
  • 19. Concerns – Recovery Time  What happens to recovery time if I change my redo log file sizes  Larger Redo Log size can increase recovery time but  There are init.ora parameters to limit this Copyright 2006 Kyle Hailey #.19
  • 20. Incremental Checkpoints (9iR2+)  FAST_START_MTTR_TARGET  Seconds to Recovery  Easy and accuracy  Is overridden by FAST_START_IO_TARGET  Is overridden by LOG_CHECKPOINT_INTERVAL alter system set fast_start_mttr_target=17 scope=both; SQL> select ESTIMATED_MTTR from V$INSTANCE_RECOVERY; SQL> select ESTIMATED_MTTR from V$INSTANCE_RECOVERY; ESTIMATED_MTTR ESTIMATED_MTTR -------------- -------------- 21 21 Copyright 2006 Kyle Hailey #.20
  • 21. Recovery and Checkpoints SGA Log Library Buffer DBWR Buffer Cache Cache LGWR Data Files Current Position Needed for Recovery 1 2 3 Incremental Checkpoint REDO Log Files Copyright 2006 Kyle Hailey #.21
  • 22. DBWR dirty List and LGWR Buffers DBWR usually just writes out LGWR Current dirty blocks at Position end of LRU until checkpoint Incremental Checkpoint DBWR Checkpoint a Now, DBWR Block xxxx keeps a Block xxxx checkpoint list that Block xxxx Block xxxx it writes out Copyright 2006 Kyle Hailey #.22
  • 23. DBWR dirty List MRU - Hot Buffer Headers LRU - Cold DBWR also has to Dirty List track dirty blocks at the Block xxxx cold end of the LRU Block xxxx Block xxxx DBWR Block xxxx Copyright 2006 Kyle Hailey #.23
  • 24. DBWR merges Dirty and Checkpoint MRU - Hot Buffer Headers LRU - Cold Checkpoint a Dirty List Block xxxx Block xxxx Block xxxx Block xxxx DBWR Block xxxx Block xxxx Block xxxx Block xxxx Write List Block xxxx Block xxxx Block xxxx Block xxxx Data Files Copyright 2006 Kyle Hailey #.24
  • 25. log file switch (private strand flush incomplete)  New wait 10g  Like a “log file switch Completion” Copyright 2006 Kyle Hailey #.25
  • 26. Redo Wait Solutions log file sync Commit less, put redo logs on faster disks log buffer space Increase log buffer no more than 32M, then tune LGWR log file switch completion Increase log file sizes log file switch (checkpoint incomplete) Add log files (or increase log file size) switch logfile command Avoid switching log files log file switch (private strand flush incomplete) increase log file sizes log file switch (archiving needed) *** Archive log running out of space Copyright 2006 Kyle Hailey #.26

Notes de l'éditeur

  1. Users who are creating redo information typically from Insert update delete Statements have to write the information into the redo log buffer. If the buffer fills up before the LGWR can write out the information then users have to wait.
  2. Redo log 1 fills up. LGWR switches to log Redo log 2 which requires Get next log file from control file Get Redo Copy and Redo Allocation latch Flush redo Close File Update Controlfile Set new file to Current Set old file to Active If in Archivelog mode add file to archive list Open all members of new logfile group Write the SCN to the headers Enable redo log generation At the same time DBWR makes a list of all blocks in the buffer cache that are dirty And have redo in log 1. This list of blocks has to be written out To disk before LGWR can reuse log 1
  3. In this case none of the DBWR checkpoints 1, 2 or 3 finish before LGWR filled up all 3 redo logs. IN this case users must wait until DBWR finishes the checkpoints of writing all the dirty blocks out. In older versions of Oracle the checkpoints were merged together, so all 3 checkpoints had to finish before Redo log 1 could be reusued. In later versions ( I think starting in 9) the checkpoints were kept separate thus once checkpoint 1 had finished, then log 1 could be reused.
  4. IN this case the archiver for some reason, hasn’t been able to archive log 1 and now LGWR needs to reause it. IN this case all transactional activity in the database comes to a halt. To any user with tranactions, the database has effectively hung. This is almost always caused by the archive destination filling. Make room on the destination disk. You can manually stop and start the archiver to make sure it restarts after room is made archive log stop; -- make room in log_archive_dest archive log start;
  5. select ESTIMATED_MTTR from v$instance_recovery; From Chris Foot 10G Automatic Checkpoint Tuning If you do not set FAST_START_MTTR_TARGET, or set it to a very large value, Oracle10g will provide automatic checkpoint tuning. The database will write out dirty blocks from the cache as fast as possible without negatively impacting database performance. The DBA is no longer required to set any of the aforementioned checkpoint parameters. SELECT TARGET_MTTR, ESTIMATED_MTTR, CKPT_BLOCK_WRITES FROM V$INSTANCE_RECOVERY CKPT_BLOCK_WRITES = represents overhead from fast_start_mttr_target
  6. From Metalink: The message means that we haven't completed writing all the redo information to the log when we are trying to switch. It is similar in nature to a "checkpoint not complete" except that is only involves the redo being written to the log. The log switch can not occur until all of the redo has been written. A "strand" is new terminology for 10g and it deals with latches for redo . Strands are a mechanism to allow multiple allocation latches for processes to write redo more efficiently in the redo buffer and is related to the log_parallelism parameter present in 9i. The concept of a strand is to ensure that the redo generation rate for an instance is optimal and that when there is some kind of redo contention then the number of strands is dynamically adjusted to compensate. The initial allocation for the number of strands depends on the number of CPU's and is started with 2 strands with one strand for active redo generation. For large scale enterprise systems the amount of redo generation is large and hence these strands are *made active* as and when the foregrounds encounter this redo contention (allocated latch related contention) when this concept of dynamic strands comes into play. There is always shared strands and a number of private strands . Oracle 10g has some major changes in the mechanisms for redo (and undo), which seem to be aimed at reducing contention. Instead of redo being recorded in real time, it can be recorded 'privately' and pumped into the redo log buffer on commit. Similary the undo can be generated as 'in memory undo' and applied in bulk. This affect the memory used for redo management and the possibility to flush it in pieces. The message you get is related to internal Cache Redo File management. You can disregard these messages as normal messages. When you switch logs all private strands have to be flushed to the current log before the switch is allowed to proceed.
  7. ARCHIVE_LAG_TARGET