Log File Management in DB2  for Linux, UNIX, and Windows Ron Castelletto IBM Canada Lab [email_address]
Agenda <ul><li>How does DB2 ensures no data loss on crash ? </li></ul><ul><li>Log file management  </li></ul><ul><li>Log f...
Database Fundamentals <ul><li>The ACID properties </li></ul><ul><ul><li>Atomicity – all actions in the TXN happen or none ...
Atomicity and Durability <ul><li>Atomicity </li></ul><ul><ul><li>Transactions may abort (rollback) </li></ul></ul><ul><li>...
Properties of Database Transactions <ul><li>Concurrency control is in effect </li></ul><ul><ul><li>Share (read) and exclus...
The Buffer Pool <ul><li>“ Force” write of data pages to disk at commit  </li></ul><ul><ul><li>Provides durability </li></u...
Forcing and Stealing Pages <ul><li>No Force (why Durability is hard)  </li></ul><ul><ul><li>Reminder: “Force” is writing a...
Logging <ul><li>DB2 records all modifications for every update in log records </li></ul><ul><ul><li>Log records are writte...
Write Ahead Logging <ul><li>Write Ahead Logging Protocol  </li></ul><ul><ul><li>1) Log records for an update must be writt...
Bufferpool and Log buffer – all log records flushed 300 old new Buffer pools 200 new 200 new 300 old 300 new 100 100 101 1...
Bufferpool and Log buffer – some logrecs flushed 300 old new Buffer pools 200 old 200 new 300 old 300 new 100 100 101 101 ...
ERROR - commit not flushed 300 old new Buffer pools 200 new 200 new 300 new 300 new 100 100 101 101 201 new 301 new Table ...
ERROR – page flushed before log record (row 201)‏ 300 old new Buffer pools 200 new 200 new 300 new 300 new 100 100 101 101...
Log Space Reservation S0000020.log S0000021.log S0000023.log Active log directory Other Transactions (committed)‏ 1000 100...
Out Of Log Space S0000020.log S0000021.log S0000023.log Active log directory Other Transactions (committed)‏ 1000 1000 100...
MAX_LOG database configuration parameter S0000020.log S0000021.log S0000023.log Active log directory Transaction 1000  12 ...
NUM_LOG_SPAN database cfg parameter S0000020.log S0000021.log Active log directory Transaction 1000  Other Transactions 10...
Infinite active logs - LOGSECOND = -1 Archived logs  Database Configuration Archived logs LOG 100 Active log directory Act...
Controlling Minbuff - SOFTMAX <ul><li>Specifies the percentage of the logfilsiz when a soft checkpoint will: </li></ul><ul...
Database crash recovery - Softmax = 200 Tablespace Containers Buffer Pools S0000020.log S0000021.log S0000022.log Min Buff...
Database crash recovery - Softmax = 50 Table space Containers Buffer Pools S0000020.log S0000021.log S0000022.log Min Buff...
DB2 log archive processing S0000020.log S0000021.log S0000022.log Active log directory transaction 1000 transaction 1001 t...
DB2 log archive processing - Backlog S0000020.log S0000021.log S0000022.log Active log directory transaction 1000 transact...
What if Archiving does not work for a long time? <ul><li>Eventually, the filesystem becomes full .... </li></ul><ul><li>DB...
Log disk full condition handling DB2 Database Log Buffer Active Log Files Active log path Inactive  Unarchived Logs  Offli...
DB2 log archive processing - FAILARCHPATH S0000020.log S0000021.log S0000022.log Active log directory transaction 1000 tra...
Protecting the DB2 logs  Log Buffer DB2 Database Primary Disk Operating System Mirroring or Hardware RAID Mirror Disk DB2 ...
Protecting the DB2 Active logs - Log mirroring  Log Buffer DB2 Database DB2 Active Logs copy 1 Protection from accidental ...
Archiving logs to Local and Remote disks db2 update db cfg for salesdb using logarchmeth1 disk:/dbarchlcl db2 update db cf...
Log File Management in DB2  for Linux, UNIX, and Windows   THE END Ron Castelletto IBM Canada Lab [email_address]
Upcoming SlideShare
Loading in …5
×

Information Management – DB2 © 2009 IBM Corporation

969 views
872 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
969
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • This presentation shows you that with proper knowledge and basic planning, upgrading to DB2 9 or DB2 9.5 does not have to be a frightening activity nor a troublesome one. We take you through the best practices for upgrading to the latest release of DB2 9 (DB2 9.5) on the Linux, UNIX, and Windows operating platforms, planning your upgrade, and enabling new features in the latest release. You will see that upgrading is a simple and easy task.
  • system time changes - forward - backward file system backup while db is running - will not be restorable When infinite logging is in use, we&apos;re potentially dealing with massive amounts of log space and we can&apos;t guarantee in any way how much space is available in the archive target location (where we can move active logs to). Therefore, we can&apos;t reserve the space for compensation log records. What happened below is that the active log path filled *and* the archive target filled. Because of that there is no active log space available for us to undo the transaction being rolled back, we have no choice but to bring the database down. To avoid this, users can set the &amp;quot;block on log disk full&amp;quot; (blk_log_dsk_ful) database configuration parameter. With that set, transactions trying to write log records, but can&apos;t because we can&apos;t allocate a new log file, will wait/block until a new log file can be allocated. In the scenario below, this would have waited indefinitely until somebody manually intervened and made space available (which is probably preferable to most users given the alternative of the database coming down). I think a doc defect should be opened for the LOGSECOND parameter (specifically the section I referenced above). We should recommend that if infinite logging is set, that blk_log_dsk_ful should be enabled as well. LOG SPACE: example: 100 MB log space, out of space when txn hits approx 40-45MB inserted data (because of reserved space for comp records). use max-log: This parameter indicates the percentage of primary log space that can be consumed by one transaction. to control txns that consume a lot of space exmaple 2: typically, multiple txns each has reserved space example 3: single small txn but does not commit, use num log span: This parameter indicates the number of active log files that an active transaction can span. DISK SPACE: archive target is down/not working, log dir fills up, cannot allocate new log files - not a problem until log space is consumed. use BLK_DSK_FUL - to avoid db down due to disk space use FAILARCHDIR - to offload inactive, unarchived files to free logdir space max-log: This parameter indicates the percentage of primary log space that can be consumed by one transaction. num log span: This parameter indicates the number of active log files that an active transaction can span. - rfwd to PIT and log chains - write ahead logging, lowtran/minbuff and how they are used in crash rec and rfwd processing - log file mgmt incl. how logprimary is used, archiving and renaming of log files, management of log space (ie: rollback reserving space for log records), &apos;out of disk space&apos; and BLK_DSK_FUL cfg parm, as well as mirror log and infinite log modes - log archiving modes and cfg parms: LOGARCHMETH1/2, FAILARCHPATH, or anything other related topics (log shipping/standby databases, log sync issues for DPF databases, etc.)‏ lowtran/minbuff examples show lowtran&lt;minbuff, show minbuff&lt;lowtran 3 inserts no commit : show nothing flushed, show logs flushed, buffer not flushed, show both flushed, show counter example: buff flushed by not log rec 3 inserts with commit: show counter example, log recs not flushed (nothing flushed)‏ write ahead logging - flush log buff before buffer pool - show pagelsn, log rec lsn relationship crash rec - fwd phase, bck phase explain out of log space, out of diskspace - log primary, blk_dsk_ful log archives: when full, rename when needed - firstarch&lt;head, firstarch&gt;head standby - rfwd pending mirror log logarchmeth1/2 failarchpath infinite log -&gt; crash rec, rollback needs log retrieve system time changes - forward - backward file sytem backup while db is running - will not be restorable When infinite logging is in use, we&apos;re potentially dealing with massive amounts of log space and we can&apos;t guarantee in any way how much space is available in the archive target location (where we can move active logs to). Therefore, we can&apos;t reserve the space for compensation log records. What happened below is that the active log path filled *and* the archive target filled. Because of that there is no active log space available for us to undo the transaction being rolled back, we have no choice but to bring the database down. To avoid this, users can set the &amp;quot;block on log disk full&amp;quot; (blk_log_dsk_ful) database configuration parameter. With that set, transactions trying to write log records, but can&apos;t because we can&apos;t allocate a new log file, will wait/block until a new log file can be allocated. In the scenario below, this would have waited indefinitely until somebody manually intervened and made space available (which is probably preferable to most users given the alternative of the database coming down). I think a doc defect should be opened for the LOGSECOND parameter (specifically the section I referenced above). We should recommend that if infinite logging is set, that blk_log_dsk_ful should be enabled as well. onlline backup with include logs (may need to retrieve log files)‏ log sync explain
  • - all log records flushed
  • No bufferpool pages flushed not all logs flushed crash recovery is still okay !
  • ALL buffer pool is flushed but COMMIT record is not flushed - all updates to disk get rolled back committed updates for row 300 and 301 are lost
  • All bufferpool is flushed, but Row 201 is flushed before the log record is written Uncommitted data in Row 201 remains after crash recovery
  • Looks like there is1+ free log space
  • This presentation shows you that with proper knowledge and basic planning, upgrading to DB2 9 or DB2 9.5 does not have to be a frightening activity nor a troublesome one. We take you through the best practices for upgrading to the latest release of DB2 9 (DB2 9.5) on the Linux, UNIX, and Windows operating platforms, planning your upgrade, and enabling new features in the latest release. You will see that upgrading is a simple and easy task.
  • Information Management – DB2 © 2009 IBM Corporation

    1. 1. Log File Management in DB2 for Linux, UNIX, and Windows Ron Castelletto IBM Canada Lab [email_address]
    2. 2. Agenda <ul><li>How does DB2 ensures no data loss on crash ? </li></ul><ul><li>Log file management </li></ul><ul><li>Log file archiving </li></ul><ul><li>Removing single points of failure </li></ul>
    3. 3. Database Fundamentals <ul><li>The ACID properties </li></ul><ul><ul><li>Atomicity – all actions in the TXN happen or none happen </li></ul></ul><ul><ul><li>Consistency – if each TXN is consistent, and the DB starts as consistent, the DB ends up consistent </li></ul></ul><ul><ul><li>Isolation – execution of one TXN is isolated from that of other TXNs </li></ul></ul><ul><ul><li>Durability – if a TXN commit, its effects persists </li></ul></ul><ul><li>The Recovery Manager ensure Atomicity and Durability </li></ul>
    4. 4. Atomicity and Durability <ul><li>Atomicity </li></ul><ul><ul><li>Transactions may abort (rollback) </li></ul></ul><ul><li>Durability </li></ul><ul><ul><li>What if DB2 stops running (eg, power failure) ? </li></ul></ul><ul><li>After system crashes </li></ul><ul><ul><li>T1, T2, T3 should be durable </li></ul></ul><ul><ul><li>T4 and T5 should abort </li></ul></ul>
    5. 5. Properties of Database Transactions <ul><li>Concurrency control is in effect </li></ul><ul><ul><li>Share (read) and exclusive (write) locking </li></ul></ul><ul><li>Updates happen in place </li></ul><ul><ul><li>Data is overwritten on disk </li></ul></ul><ul><li>A simple solution for atomicity and durability ? </li></ul><ul><ul><li>Use a “force” and “no steal” buffer pool </li></ul></ul>
    6. 6. The Buffer Pool <ul><li>“ Force” write of data pages to disk at commit </li></ul><ul><ul><li>Provides durability </li></ul></ul><ul><ul><li>But poor performance </li></ul></ul><ul><li>“ No stealing” of pages from uncommited Txns </li></ul><ul><ul><li>However, “no steal” implies poor performance </li></ul></ul><ul><ul><li>But, if 'steal' allowed, how to ensure atomicity ? No Steal Steal Force No Force </li></ul></ul>
    7. 7. Forcing and Stealing Pages <ul><li>No Force (why Durability is hard) </li></ul><ul><ul><li>Reminder: “Force” is writing all modified pages for this TXN at commit time </li></ul></ul><ul><ul><li>What is system crashes before all pages written ? </li></ul></ul><ul><ul><li>Need to know what changes were lost before I/O completed so can redo them. </li></ul></ul><ul><li>Steal (why enforcing Atomicity is hard) </li></ul><ul><ul><li>Reminder: “Steal” is allowing a new TXN to steal a slot in the buffer pool, ie: write a modified page to disk before the TXN commits </li></ul></ul><ul><ul><li>What is the TXN aborts ? Need to know what modification were written to disk so can undo the change. </li></ul></ul><ul><li>Solution: write log records to support redo/undo of changes </li></ul>
    8. 8. Logging <ul><li>DB2 records all modifications for every update in log records </li></ul><ul><ul><li>Log records are written sequentially to log files(s)‏ </li></ul></ul><ul><ul><li>Should be placed on a different disk </li></ul></ul><ul><ul><li>Log record should contain as little possible (old/new data)‏ </li></ul></ul><ul><ul><li>Multiples log records fit on a single log page </li></ul></ul><ul><ul><li>Log records represent an ordered list of update TXNs </li></ul></ul>
    9. 9. Write Ahead Logging <ul><li>Write Ahead Logging Protocol </li></ul><ul><ul><li>1) Log records for an update must be written to disk, before the corresponding data page is written </li></ul></ul><ul><ul><li>2) write all log records for a TXN when it commits </li></ul></ul><ul><li>1) guarantees Atomicity </li></ul><ul><li>2) guarantees Durability </li></ul>
    10. 10. Bufferpool and Log buffer – all log records flushed 300 old new Buffer pools 200 new 200 new 300 old 300 new 100 100 101 101 201 old new 201 new 301 old Table space Containers Read Only Committed Update Uncommitted Update Page Cleaners I/O Servers Logger DB2 Agent DB2 Agent S0000020.log S0000021.log Active Log Directory Min Buff LSN = Oldest Changed Page in Buffer pool Low Tran LSN = Oldest Uncommited Log Record Min Buff LSN Low Tran LSN 201 new 301 new SQLOGCTL.LFH.1 SQLOGCTL.LFH.2 Log Control File Log Buffer 301 old new 200 old new 300 old new 200 old new commit 301 old new 300 old new 201 old new commit
    11. 11. Bufferpool and Log buffer – some logrecs flushed 300 old new Buffer pools 200 old 200 new 300 old 300 new 100 100 101 101 201 old 301 old Table space Containers Read Only Committed Update Uncommitted Update Page Cleaners I/O Servers Logger DB2 Agent DB2 Agent S0000020.log S0000021.log Active Log Directory Min Buff LSN = Oldest Changed Page in Buffer pool Low Tran LSN = Oldest Uncommited Log Record Min Buff LSN Low Tran LSN 201 new 301 new SQLOGCTL.LFH.1 SQLOGCTL.LFH.2 Log Control File Log Buffer 301 old new 200 old new 300 old new 200 old new commit 301 old new 300 old new 201 old new commit
    12. 12. ERROR - commit not flushed 300 old new Buffer pools 200 new 200 new 300 new 300 new 100 100 101 101 201 new 301 new Table space Containers Read Only Committed Update Uncommitted Update Page Cleaners I/O Servers Logger DB2 Agent DB2 Agent S0000020.log S0000021.log Active Log Directory Min Buff LSN = Oldest Changed Page in Buffer pool Low Tran LSN = Oldest Uncommited Log Record Min Buff LSN Low Tran LSN 201 new 301 new SQLOGCTL.LFH.1 SQLOGCTL.LFH.2 Log Control File Log Buffer 301 old new 200 old new 300 old new 200 old new commit 301 old new 300 old new 201 old new
    13. 13. ERROR – page flushed before log record (row 201)‏ 300 old new Buffer pools 200 new 200 new 300 new 300 new 100 100 101 101 201 new 301 new Table space Containers Read Only Committed Update Uncommitted Update Page Cleaners I/O Servers Logger DB2 Agent DB2 Agent S0000020.log S0000021.log Active Log Directory Min Buff LSN = Oldest Changed Page in Buffer pool Low Tran LSN = Oldest Uncommited Log Record Min Buff LSN Low Tran LSN 201 new 301 new SQLOGCTL.LFH.1 SQLOGCTL.LFH.2 Log Control File Log Buffer 301 old new 200 old new 300 old new 200 old new commit 301 old new 300 old new 201 old new commit
    14. 14. Log Space Reservation S0000020.log S0000021.log S0000023.log Active log directory Other Transactions (committed)‏ 1000 1000 1000 S0000025.log S0000022.log 1001 S0000024.log 1001 1000 Transaction 1000
    15. 15. Out Of Log Space S0000020.log S0000021.log S0000023.log Active log directory Other Transactions (committed)‏ 1000 1000 1000 S0000024.log S0000022.log 1001 S0000024.log 1001 Transaction 1000 and 1001 (reserved)‏ 1000 Reserved Transaction 1000 Reserved
    16. 16. MAX_LOG database configuration parameter S0000020.log S0000021.log S0000023.log Active log directory Transaction 1000 12 MB Limit Other Transactions 1000 1000 1000 S0000024.log S0000022.log 1000 1000 S0000024.log max_log * (logfilsiz * 4096 *logprimary) / 100 50 * (1000 * 4096 * 6 ) / 100 = 12 MB -964 sqlcode Database CFG logfilsiz 1000 logprimary 6 max_log 50
    17. 17. NUM_LOG_SPAN database cfg parameter S0000020.log S0000021.log Active log directory Transaction 1000 Other Transactions 1000 S0000023.log S0000022.log 1000 num_log_span = 2 db2 Force application -964 SQLCODE Database CFG logfilsiz 1000 logprimary 4 num_log_span 2
    18. 18. Infinite active logs - LOGSECOND = -1 Archived logs Database Configuration Archived logs LOG 100 Active log directory Active Logs LOGSECOND = -1 LOGPRIMARY= 6 LOGARCHMETH1=DISK:/db/archive OVERFLOWLOGPATH = /db/tp1/ologs FIRST ACTIVE LOG = S0000100.LOG Log CTL File Low Tran LSN Log Manager LOG 101 LOG 102 LOG 103 LOG 104 LOG 116 LOG 118 LOG 119 LOG 117 LOG 120 LOG 98 LOG 99 LOG 107 LOG 108 LOG 109 LOG 110 LOG 106 LOG 105 LOG 111 LOG 112 LOG 113 LOG 114 LOG 115 LOG 121 LOG 121 LOG 122 LOG 123 LOG 124 LOG 126 LOG 125
    19. 19. Controlling Minbuff - SOFTMAX <ul><li>Specifies the percentage of the logfilsiz when a soft checkpoint will: </li></ul><ul><ul><li>Write the log control file to disk (Sqlogctl.lfh)‏ </li></ul></ul><ul><ul><li>Call an asynchronous page cleaner (Log space page cleaners)‏ </li></ul></ul><ul><li>Range: 1 to 100 * number of primary logs. </li></ul><ul><li>Default = 100 (soft checkpoint in every logfile). </li></ul><ul><li>Lower value will reduce the time required to restart a database during crash recovery. </li></ul><ul><li>The smaller the number, the greater overhead of normal database logging activity due to page clean activity. </li></ul>
    20. 20. Database crash recovery - Softmax = 200 Tablespace Containers Buffer Pools S0000020.log S0000021.log S0000022.log Min Buff LSN 1006 1000 1007 1001 1004 1008 1010 1005 1001 1009 Current LOGFILSIZ = 1000 SOFTMAX = 200 200% * ( 1000 * 4K ) = 8MB 1001 1003 1004 1005 1006 1007 1008 1009 1010 1003 Active log directory Log CTL File Page Cleaner Page Cleaner 1002 1002 1002 xxxx Change NOT Written to Disk xxxx Updates to Log CTL Change Written to Disk
    21. 21. Database crash recovery - Softmax = 50 Table space Containers Buffer Pools S0000020.log S0000021.log S0000022.log Min Buff LSN 1006 1000 1007 1007 1004 1008 1010 1005 1001 1009 Current LOGFILSIZ = 1000 SOFTMAX = 50 50% * ( 1000 * 4K ) = 2MB 1001 1003 1004 1005 1006 1007 1008 1009 1010 1003 Active log directory Log CTL File Page Cleaner Page Cleaner 1002 1002 1008 xxxx Change NOT Written to Disk xxxx Updates to Log CTL Change Written to Disk
    22. 22. DB2 log archive processing S0000020.log S0000021.log S0000022.log Active log directory transaction 1000 transaction 1001 transaction 1002 transaction 1003 1000 1000 1001 1001 1002 1003 1003 1 2 3 DB2 Log Manager 4 Activity Action Taken Point 1 Log S0000020 full Log Manager archives Log 20. Transaction 1000 is oldest current transaction (lowtran lsn)‏. Cannot rename log 20. Point 3 Transaction 1000 Commits Point 2 Transaction 1000 commits Log 20 no longer an active log, can be renamed to Log 23. Point 4 Transaction 1002 commits Log S0000021 can be renamed to Log 24 1003 1002 Log S0000021 full Log Manager archives Log 21. Transaction 1002 is oldest current transaction (lowtran lsn)‏. Cannot rename log 21.
    23. 23. DB2 log archive processing - Backlog S0000020.log S0000021.log S0000022.log Active log directory transaction 1000 transaction 1001 transaction 1002 transaction 1003 1000 1000 1000 1001 1001 1002 1003 1003 1 2 3 DB2 Log Manager 4 Activity Action Taken Point 1 Log S0000020 full Log Manager begins to Archive Log 20 but FAILS. Transaction 1000 is oldest current transaction (lowtran lsn)‏ Point 2 Log S0000021 full Log Manager does not Archive log 21 until 20 is done. Point 3 Transaction 1000 Commits Log 20 not active log and not archived. Txn 1003 is lowtran lsn. Log 21 is first active log. Log 23 is created Point 4 Active log dir contains 4 logs Log 20 is not active, and unarchived. Logs 21-23 are active logs. 1003
    24. 24. What if Archiving does not work for a long time? <ul><li>Eventually, the filesystem becomes full .... </li></ul><ul><li>DB2 cannot pre-allocate log files to maintain LOGPRIMARY ... </li></ul><ul><li>Later, run out of disk space provided by pre-allocated log files. </li></ul><ul><li>This scenario is 'out of disk space', distinct from 'out of log space' </li></ul><ul><li>Default behaviour, database comes down with severe error </li></ul><ul><li>How to avoid this ? 2 solutions ... </li></ul>
    25. 25. Log disk full condition handling DB2 Database Log Buffer Active Log Files Active log path Inactive Unarchived Logs Offline Archive Log Files DB2 Log Manager DISK FULL! <ul><li>If NO (default)‏ </li></ul><ul><ul><li>Database comes down with severe error (out of disk space)‏ </li></ul></ul><ul><li>If YES </li></ul><ul><ul><li>Update transactions wait for new log </li></ul></ul><ul><ul><li>Read only transactions continue </li></ul></ul><ul><ul><li>Write message to db2diag.log </li></ul></ul><ul><ul><li>Wait 5 minutes and retry creating new log </li></ul></ul><ul><ul><li>Check for completed log archive and rename log </li></ul></ul>..... BLK_LOG_DSK_FUL = YES ..... CFG
    26. 26. DB2 log archive processing - FAILARCHPATH S0000020.log S0000021.log S0000022.log Active log directory transaction 1000 transaction 1001 transaction 1002 transaction 1003 1000 1000 1000 1001 1001 1002 1003 1003 1 2 3 DB2 Log Manager 4 Activity Action Taken Point 1 Log S0000020 full Log Manager begins to archive Log 20 but FAILS. Transaction 1000 is oldest current transaction (lowtran lsn)‏ Point 2 Log S0000021 full Log Manager does not archive log 21 until 20 is done. Point 3 Transaction 1000 Commits Log 20 no longer an active log, but is not archived. Txn 1003 is lowtran lsn. Log 21 is first active log. Log 20 is moved to FAILPATH. Log 23 created. Point 4 Archiving works again. Log 20 is archived from FAILPATH, Log 21 is archived from active log dir. 1003 FAILARCH directory S0000020.log 1000 1001 1001
    27. 27. Protecting the DB2 logs Log Buffer DB2 Database Primary Disk Operating System Mirroring or Hardware RAID Mirror Disk DB2 Logs Mirror Copy No protection from accidental deletion of active logs. <ul><li>Recovery from Log media failure: </li></ul><ul><ul><li>Operating System facilities - Software RAID and Disk Mirrors </li></ul></ul><ul><ul><li>RAID Hardware: </li></ul></ul><ul><ul><ul><li>RAID 1 - Mirroring </li></ul></ul></ul><ul><ul><ul><li>RAID 5 - Parity Based </li></ul></ul></ul>
    28. 28. Protecting the DB2 Active logs - Log mirroring Log Buffer DB2 Database DB2 Active Logs copy 1 Protection from accidental deletion of active logs. CFG ..... LOGPATH = /database/tp1/logs MIRRORLOGPATH = /database/tp1/logmir ..... /database/tp1/logs /database/tp1/logmir DB2 Active Logs copy 2
    29. 29. Archiving logs to Local and Remote disks db2 update db cfg for salesdb using logarchmeth1 disk:/dbarchlcl db2 update db cfg for salesdb using logarchmeth2 disk:/dbarchdr salesdb Database Table Spaces Database Directory Active Logs db2 Log Manager DB CFG Remote Archive logs Local Archive logs /dbarchdr/INST1/SALESDB/NODE0000 /dbarchlcl/INST1/SALESDB/NODE0000 SYS2 SYS1 Recovery History <ul><li>Path Includes: </li></ul><ul><li>Instance Name </li></ul><ul><li>Database Name </li></ul><ul><li>Database Partition (NODExxxx)‏ </li></ul>
    30. 30. Log File Management in DB2 for Linux, UNIX, and Windows THE END Ron Castelletto IBM Canada Lab [email_address]

    ×