編輯:關於android開發
The DB2 log has two main functions: to reapply or back out units of recovery, and to rebuild DB2 back to a consistent state in the event of a failure
WHY NEED LOGGINGLet’s get the MOST out of the LOG since it’s here
OVERVIEW OF LOG WORK MECHANISM
USAGE OF EACH COMPONENTS
BYTE ADDRESSABLE(RBA=RELATIVE BYTE ADDRESS)
RBA START=0X00000000000
RBA END=0XFFFFFFFFFFF
RBA UNIQUELY DEFINE A LOG RECORD
LRSN=LOG SEQUENCE RANGE NUMBER,WHICH IS A MODIFIED TIMESTAMP BASE ON SYSPLEX STORCE CLOCK
LOG OUTPUTBUFFER
ACTIVE LOG
ARCHIVE LOG
WHEN DB2 GO TO THE LAST ACTIVE DATA SETS ,WRAP ROUND TO FIRST ACTIVE LOG DATA SETS
? Name: catalog.BSDS01 and catalog.BSDS02
? Must be two identical datasets
? Contains highest RBA logged
? Contains active log description (begin – end RBA and status)
? Contains archive log description
? Dataset name
? Volume name
? RBA range
? Contains other necessary system information
? System checkpoint history, BP-description, CCSID info etc
? Table in Directory so no user access available
? Contains the RBA when any tablespace or
partition is opened or closed for update
? Note this information is also in DB2 log
? SYSLGRNGX is used by DB2 to speed up
recovery by limiting the amount of log data which needs to be scanned
? MODIFY utility removes this information along with SYSCOPY rows
SYSLGRNGX is key to speeding up log processing during recovery Contains RBAs when tablespaces are open for update. Log ranges out ranges cannot contain updates for this tablespace and therefore we needed during the recovery process.SYSLGRNGX is also updated by running the Modify Recovery utilityFACTORS OF ARCHIVE LOG DATASETS
CONTAINDS THE BSDS INFORMATION BEFORE ARCHIVE IS WRITTEN FIRST LOG BEING ARCHIVED,IS STILL KNOWN AS ACTIVE LOG IN BSDSVCAT.ARCHIVEN.ANNNNNN
CONTAINS THE ACTUAL LOG FOR LOG RBA RANGE OF THAN LOG DATA SETSUPDATES BSDS WHEN COMPLETE
SYSIBM.SYSUTILX SYSIBM.DBD01 SYSIBM.SYSCOPYSYSTEM CHECKPOINTSUNDO/REDO LOG EXMPLAE
UPDATE T
SET COL='BBB'
WHERE ID=1
LRH004A002F 06000001 0E800006 CEA48CC9 0006CEA4 8D590526 0006CEA4 8D59C7C0
AF504B23 0000
*LG** 80010C00 02000000 02000006 CEA4049E 2B02 0000 00120101 00030900 000600C2 C2C200C1 C1C1
C2C2C2='BBB'
C1C1C1='AAA'
URID(0006CEA48CC9)RBA OF UR STARTED IN LOG
010C=DBID
0002==PAGE SET OBID
000000 02=PAGE ID
In case of the example the current value is BBB and after the update it should become AAA, but for some reason a ROLLBACK occurs, in that
case DB2 needs to undo this update. This undo by itself is also being logged. These log records are called compensation log records.
SUBTYPE(UPDATE IN-PLACE IN A DATA PAGE) CLR(YES)*LG** 80010C00 02000000 02000006 CEA550BF AB00 0000 00120101 00030900 000600C2 C2C200C1 C1C1
CLR(YES) which indicates it is a compensation log record
RECOVERY INFORMATION EXAMPLEDB2 writes “syscopy” information for certain system tables to the log instead of writing it to syscopy. The reason is simple. In case of a
disaster recovery, we need to recover the system in precise steps.Meaning that certain system tables have to be recovered before we can recover sysibm.syscopy. Therefore the backup information of those objects is written to the log.
SYSTEM CHECKPOINT (snapshot of activity on system)
V10: Minimum of # LOG records and # seconds
As the work is being done
? In Log output buffer (OUTBUFF)
? Regularly flushed to Active Log Dataset
Sequentially first active copy1 then active copy2 (DB2 V10 應該是雙寫)
? At Commit
? At Rollback
? Log Write threshold (WRTHRSH 20 pages without commit)
? Archive log command
? System Checkpoint
? Log Write Ahead Force
4 phases :
DB2 新增了一個參數BACKOUT(YES),這個參數應該不是太常用,更多的情況應該是使用imgcopy+log的方式去追,即point-in-time,這裡不進行介紹。
REPLICATION現在IDC內相當火的一個topic,它是實現雙活或是多活的基礎,平台版本的DBMS也有實現,比如mysql的mater-slave方式,即mysql本身就支持,不需要新增軟件,但是是單線程進行處理,為此很多vendors提供了增強版的版本使slave上支持並發。zos 上使用QREP+MQ實現,支持異構數據庫,延遲可以控制在分鐘以內。RPT=2MIN,RTO=2HOUR,
SOX Compliance這個更多是的是內審,外審的用途。相對來說使用審計LOG的方式,成本還是比較高的,有alternative software。
HEALTH CHECKSBEST PRACTICE,根據系統現在的運行情況,查看時候ACTIVE LOG,ACHIVE LOG是否運行異常。
多少一句,這個應該是目前平台比較欠缺的,可能目前也存在,只是我孤陋寡聞了。
DSN1LOGP? Formats DB2 log in a readable output
? Detailed or summarized (SUMMARY(YES/NO/ONLY)
? Include page set status (DATAONLY(YES/NO)
? Include SYSCOPY info (SYSCOPY(YES/NO)
? Limit range (from – to)
? Limit scope (e.g. URID,DBID,)
? Cannot read current active log
? Cannot read compressed logs by DFSMS
Will list certain parts of the BSDS information
? Log data set name(s), log ranges, volume(s) etc
? Active log status
? Conditional restart history
? System checkpoint history
? Backup system history
? Archive log history
? CCSID information
? Does not show Buffer pool configuration
? Be careful time values are in GMT except LTIME column
? Only runs when DB2 is down
? Allows to change BSDS content, USE WITH CARE!
? Add/Delete active and archive Logs
? Add/Delete system checkpoints
? Create conditional restart record (CRESTART)
? STARTRBA
? ENDRBA
? COLD START ? STARTRBA=ENDRBA
? Causes most of the time DATA LOSS
DSNJLOGF
? Pre-formats new active log dataset
? Avoids delay at first use !!
? MUST have TWO identical BSDS to start up
? What if one BSDS is broken ?
? DSNJ126I I/O ERROR FORCED SINGLE BSDS
? Do NOT stop DB2
? Issue command –RECOVER BSDS ? automate this!
? What if one BSDS is broken at start up?
? DB2 does not start
? IDCAMS rename/define, REPRO
對LOG PAGE 有一個感性認識,LOG 的邏輯結構復雜了,後續如果有需要在補充上吧。
1 BYTE=8BITS
1 NIBBLE=4BITS
LOG PAGE SIZE=4KB
LOG PAGE AVAIABLE SPACE=4075
LOG PAGE CONTROL INTERVAL
SIZE: LAST 21/X'15' BYTE OF PAGE
USAGE:CI DESCRIBE THE LOG PAGE
START RAB OF THE PAGE
LOG RBA DO NOT HAVE RBA-----IT'S START RBA of the page plus offset into page of the record
1 log rec maybe span may log pages
本文所有的內容均整理自互聯網,僅供參考學習,如有涉及版權問題,請自行刪除本文,謝謝。
git筆記,git學習筆記這篇有關git的博客,寫著寫著有些崩了。裡面有些碎碎念了。下次一定注意這個問題。 創建項目: midir xx :創建xx文件夾 git in
Android pendingInten 用法詳解 pendingIntent字面意義:等待的,未決定的Intent。 要得到一個pendingIntent對象,使用方法
Android反編譯和二次打包實戰 作為Android開發者,工作中少不了要反編譯別人的apk,當然主要目的還是為了學習到更多,取彼之長,補己之短。今天就來總結一下A
Gallery圖片點擊事件,package com.example.Gallery; import com.example.Gallery.R; import and