search
HomeBackend DevelopmentPHP TutorialA DB2 Performance Tuning Roadmap --LOG INTRODUCTION_PHP教程

A DB2 Performance Tuning Roadmap --LOG INTRODUCTION

The content of this article is a supplement to the DB2 STAT LOG AVITIVITY part when organizing reports. It mainly introduces the DB2 LOG function, overhead, and related How to use DB2 log and the existing DB2 Log utilities provided by IBM to understand the components and the working mechanism between them. Finally, we give a perceptual understanding of the logic of DB2 log.
  • 1 LOG OVERVIEW
    • DB2 LOG FUNDAMENTALS
      • LOG AIM:
      • WHY NEED LOGGING
      • IN PERFECT WORLD
      • OVERVIEW OF LOG WORK MECHANISM
  • 2 UNDERSTANDING OF LOG
    • LOG IMPLEMENTATION
      • 1 LOG RBA
      • 2 WHEN DATA SHARING INVOLED-LRSN
      • 3 LOG PAGE DATA SETS
        • FACTORS OF ACTIVE LOG DATA SETS:
        • BSDS – Boot Strap Data Set
        • SYSLGRNX-DLD
        • FACTORS OF ARCHIVE LOG DATASETS
    • LOG STRUCTURE
      • WHAT IS BEING LOGGED?
        • INFORMATION OF UR
        • PAGE SET INFORMATION
        • RECOVERY INFOMATION FOR
        • SYSTEM CHECKPOINTS
        • UNDO/REDO LOG EXMPLAE
        • COMPENSATION OF LOG EXMPLE
        • RECOVERY INFORMATION EXAMPLE
        • SYSTEM CHECKPOINTS DETAIL
      • WHEN IS LOGGING
    • LOG USAGE
      • Start DB2
      • Recovery of objects
      • REPLICATION
      • SOX Compliance
      • HEALTH CHECKS
    • LOG UTILITES,WORKING WITH THE LOG
      • DSN1LOGP
      • DSNJU004、DSNJU003
        • DSNJU004
        • DSNJU003 (a.k.a Change Log Inventory)
      • DSNJLOGF
      • RECOVER BSDS
        • #RECOVER BSDS
  • LOG RELATED DATASET
    • LOG PAGE FORMAT


1 LOG OVERVIEW

DB2 LOG FUNDAMENTALS

LOG AIM:

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 LOGGING
  1. overhead
  2. it costs in ters of performance,dasd,dministration,cleanup
  3. it's assurance-just in case of an accidentIN PERFECT WORLD
    1. no need to rollback
    2. no need to recover
    3. no program errors
    4. no hardware errors
    5. no power failtures
    6. no hurricances,terror attacks,fraud....

Let’s get the MOST out of the LOG since it’s here

OVERVIEW OF LOG WORK MECHANISM

A DB2 Performance Tuning Roadmap --LOG INTRODUCTION_PHP教程
USAGE OF EACH COMPONENTS

  1. Active logs
    Where DB2 puts the current log information
  2. Log Buffers
    Where log information is held BEFORE externalisation to DASD
  3. Bootstrap Datasets
    These hold information about the current active and archive log datasets
  4. Archive logs
    These are copies of ‘old’ active log datasets
  5. SYSLGRNX
    DB2 keeps track of WHEN objects are (possibly) being updated

2 UNDERSTANDING OF LOG

LOG IMPLEMENTATION

1 LOG RBA

BYTE ADDRESSABLE(RBA=RELATIVE BYTE ADDRESS)
RBA START=0X00000000000
RBA END=0XFFFFFFFFFFF
RBA UNIQUELY DEFINE A LOG RECORD

2 WHEN DATA SHARING INVOLED-LRSN

A DB2 Performance Tuning Roadmap --LOG INTRODUCTION_PHP教程
LRSN=LOG SEQUENCE RANGE NUMBER,WHICH IS A MODIFIED TIMESTAMP BASE ON SYSPLEX STORCE CLOCK

3 LOG PAGE DATA SETS

LOG OUTPUTBUFFER
ACTIVE LOG
ARCHIVE LOG

A DB2 Performance Tuning Roadmap --LOG INTRODUCTION_PHP教程
WHEN DB2 GO TO THE LAST ACTIVE DATA SETS ,WRAP ROUND TO FIRST ACTIVE LOG DATA SETS

FACTORS OF ACTIVE LOG DATA SETS:
  1. ACTIVE LOG DATA SETS NUMBER
  2. ACTIVE LOG DATA SETS SIZE
  3. SINGLE OR DUAL ACTIVE LOG
  4. PERFORMANCE CONSIDERATION:
    1. FAST DASD
    2. CONSIDER STRIPPING
    3. DB2 ZPARM OUTBUFFER LOGAPSTG
BSDS – Boot Strap Data Set

? 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

SYSLGRNX-DLD

? 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 utility 
FACTORS OF ARCHIVE LOG DATASETS
  1. ALWAYS PRODUCE TWO FILES FOR ONE ACTIVE LOGS
    IT IS AN ASYNCHRONOUS PROCESS
    VCAT.ARCHLOGN.BNNNNNN
    CONTAINDS THE BSDS INFORMATION BEFORE ARCHIVE IS WRITTEN FIRST LOG BEING ARCHIVED,IS STILL KNOWN AS ACTIVE LOG IN BSDS 
    VCAT.ARCHIVEN.ANNNNNN
    CONTAINS THE ACTUAL LOG FOR LOG RBA RANGE OF THAN LOG DATA SETSUPDATES BSDS WHEN COMPLETE 
  2. DB2 ZPARMS ARCHPFX1 ARCHPFX2 TSTAMP=YES|NO|EXT
    VCAT.ARCHIVEN.DXXXXX.TXXXXX.BNNNNNNNN
  3. WHEN ARCHIVE:
    ACTIVE LOG FULL
    TRUNCATED:ARCHIVE LOG COMAMND OR ERROR

LOG STRUCTURE

WHAT IS BEING LOGGED?INFORMATION OF UR
  1. BEGIN/END UR INFORMATION
  2. UNDO/REDO STATEMENTS and compensation log rec
  3. commit rollback processing

PAGE SET INFORMATION
  1. OPEN/CLOSE PAGE SET
  2. PENDING STATUS INFORMATION(COPY,CHECK,REORG)
  3. START/STOP INFORMATION(include which mode ut)
  4. DBD INFORECOVERY INFOMATION FORINVOLED TABLES:
    SYSIBM.SYSUTILX SYSIBM.DBD01 SYSIBM.SYSCOPY 
    SYSTEM 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

COMPENSATION OF LOG EXMPLE

A DB2 Performance Tuning Roadmap --LOG INTRODUCTION_PHP教程
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 EXAMPLE

DB2 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 CHECKPOINTS DETAIL

SYSTEM CHECKPOINT (snapshot of activity on system)

  1. WHAT IS IN SYSTEM CHECKPOINT
    1. Entry per active thread (amongst other status inflight/in commit etc)
    2. Entry per open page set (including exception status)
    3. Page externalization
  2. How often should one be taken ?
    1. Every 3-5 minutes (many sites are at 15-20 minutes)
    2. CHKFREQ : V9 : # LOG records or # seconds
       V10: Minimum of # LOG records and # seconds 
  3. Important for (re)start up performance
    ? Start up ALWAYS from LAST CHECKPOINT
WHEN IS LOGGING

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 应该是双写)
A DB2 Performance Tuning Roadmap --LOG INTRODUCTION_PHP教程
? At Commit
? At Rollback
? Log Write threshold (WRTHRSH 20 pages without commit)
? Archive log command
? System Checkpoint
? Log Write Ahead Force

LOG USAGE

Start DB2

4 phases :

  1. Log initialization
    Read/compare BSDS
    Find current active log dataset and end of log
  2. Current status rebuild
    Read last system checpoint
  3. Forward log recovery
    Do all work for INCOMMIT and INDOUBT threads
  4. Backward log recovery
    Do all work for INABORT and INFLIGHT threads
  5. ALWAYS start from LAST SYSTEM CHECKPOINT
    Amount of work varies (ab)normal shutdowN
Recovery of objects

DB2 新增了一个参数BACKOUT(YES),这个参数应该不是太常用,更多的情况应该是使用imgcopy+log的方式去追,即point-in-time,这里不进行介绍。

REPLICATION

It is a very popular topic in IDC now. It is the basis for realizing double-active or multi-active. It is also implemented in platform version of DBMS, such as mysql’s mater-slave method, which is supported by mysql itself and does not need to be added. Software, but it is processed by a single thread. For this reason, many vendors provide enhanced versions to support concurrency on the slave. QREP MQ is implemented on zos, supporting heterogeneous databases, and the delay can be controlled within minutes. RPT=2MIN, RTO=2HOUR,

SOX Compliance

This is more for internal audit and external audit. Relatively speaking, the cost of using the audit LOG method is relatively high, and there are alternative software.

HEALTH CHECKS

BEST PRACTICE, based on the current operation of the system, check whether the ACTIVE LOG and ACHIVE LOG are running abnormally.

LOG UTILITES, WORKING WITH THE LOG

How many sentences? This should be something that is lacking in the current platform. It may still exist, but I am ignorant.

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

DSNJU004, DSNJU003DSNJU004

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

DSNJU003 (a.k.a Change Log Inventory)

? 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
? LOSS

DSNJLOGF

DSNJLOGF
? Pre-formats new active log dataset
? Avoids delay at first use !!

RECOVER BSDS#RECOVER BSDS

? 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 FORMAT

I have a perceptual understanding of LOG PAGE. The logical structure of LOG is complicated. I will add it later if necessary.
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
All the contents of this article are collected from the Internet and are for reference and study only. If there are any copyright issues, please delete this article yourself. Thank you.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1097746.htmlTechArticleA DB2 Performance Tuning Roadmap --LOG INTRODUCTION The content of this article is about the DB2 STAT LOG AVITIVITY part when organizing the report A supplement, mainly introduces the function of DB2 LOG, overhead,...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
如何在 iPhone 和 Android 上关闭蓝色警报如何在 iPhone 和 Android 上关闭蓝色警报Feb 29, 2024 pm 10:10 PM

根据美国司法部的解释,蓝色警报旨在提供关于可能对执法人员构成直接和紧急威胁的个人的重要信息。这种警报的目的是及时通知公众,并让他们了解与这些罪犯相关的潜在危险。通过这种主动的方式,蓝色警报有助于增强社区的安全意识,促使人们采取必要的预防措施以保护自己和周围的人。这种警报系统的建立旨在提高对潜在威胁的警觉性,并加强执法机构与公众之间的沟通,以共尽管这些紧急通知对我们社会至关重要,但有时可能会对日常生活造成干扰,尤其是在午夜或重要活动时收到通知时。为了确保安全,我们建议您保持这些通知功能开启,但如果

在Android中实现轮询的方法是什么?在Android中实现轮询的方法是什么?Sep 21, 2023 pm 08:33 PM

Android中的轮询是一项关键技术,它允许应用程序定期从服务器或数据源检索和更新信息。通过实施轮询,开发人员可以确保实时数据同步并向用户提供最新的内容。它涉及定期向服务器或数据源发送请求并获取最新信息。Android提供了定时器、线程、后台服务等多种机制来高效地完成轮询。这使开发人员能够设计与远程数据源保持同步的响应式动态应用程序。本文探讨了如何在Android中实现轮询。它涵盖了实现此功能所涉及的关键注意事项和步骤。轮询定期检查更新并从服务器或源检索数据的过程在Android中称为轮询。通过

如何在Android中实现按下返回键再次退出的功能?如何在Android中实现按下返回键再次退出的功能?Aug 30, 2023 am 08:05 AM

为了提升用户体验并防止数据或进度丢失,Android应用程序开发者必须避免意外退出。他们可以通过加入“再次按返回退出”功能来实现这一点,该功能要求用户在特定时间内连续按两次返回按钮才能退出应用程序。这种实现显著提升了用户参与度和满意度,确保他们不会意外丢失任何重要信息Thisguideexaminesthepracticalstepstoadd"PressBackAgaintoExit"capabilityinAndroid.Itpresentsasystematicguid

Android逆向中smali复杂类实例分析Android逆向中smali复杂类实例分析May 12, 2023 pm 04:22 PM

1.java复杂类如果有什么地方不懂,请看:JAVA总纲或者构造方法这里贴代码,很简单没有难度。2.smali代码我们要把java代码转为smali代码,可以参考java转smali我们还是分模块来看。2.1第一个模块——信息模块这个模块就是基本信息,说明了类名等,知道就好对分析帮助不大。2.2第二个模块——构造方法我们来一句一句解析,如果有之前解析重复的地方就不再重复了。但是会提供链接。.methodpublicconstructor(Ljava/lang/String;I)V这一句话分为.m

如何在2023年将 WhatsApp 从安卓迁移到 iPhone 15?如何在2023年将 WhatsApp 从安卓迁移到 iPhone 15?Sep 22, 2023 pm 02:37 PM

如何将WhatsApp聊天从Android转移到iPhone?你已经拿到了新的iPhone15,并且你正在从Android跳跃?如果是这种情况,您可能还对将WhatsApp从Android转移到iPhone感到好奇。但是,老实说,这有点棘手,因为Android和iPhone的操作系统不兼容。但不要失去希望。这不是什么不可能完成的任务。让我们在本文中讨论几种将WhatsApp从Android转移到iPhone15的方法。因此,坚持到最后以彻底学习解决方案。如何在不删除数据的情况下将WhatsApp

同样基于linux为什么安卓效率低同样基于linux为什么安卓效率低Mar 15, 2023 pm 07:16 PM

原因:1、安卓系统上设置了一个JAVA虚拟机来支持Java应用程序的运行,而这种虚拟机对硬件的消耗是非常大的;2、手机生产厂商对安卓系统的定制与开发,增加了安卓系统的负担,拖慢其运行速度影响其流畅性;3、应用软件太臃肿,同质化严重,在一定程度上拖慢安卓手机的运行速度。

Android中动态导出dex文件的方法是什么Android中动态导出dex文件的方法是什么May 30, 2023 pm 04:52 PM

1.启动ida端口监听1.1启动Android_server服务1.2端口转发1.3软件进入调试模式2.ida下断2.1attach附加进程2.2断三项2.3选择进程2.4打开Modules搜索artPS:小知识Android4.4版本之前系统函数在libdvm.soAndroid5.0之后系统函数在libart.so2.5打开Openmemory()函数在libart.so中搜索Openmemory函数并且跟进去。PS:小知识一般来说,系统dex都会在这个函数中进行加载,但是会出现一个问题,后

Android APP测试流程和常见问题是什么Android APP测试流程和常见问题是什么May 13, 2023 pm 09:58 PM

1.自动化测试自动化测试主要包括几个部分,UI功能的自动化测试、接口的自动化测试、其他专项的自动化测试。1.1UI功能自动化测试UI功能的自动化测试,也就是大家常说的自动化测试,主要是基于UI界面进行的自动化测试,通过脚本实现UI功能的点击,替代人工进行自动化测试。这个测试的优势在于对高度重复的界面特性功能测试的测试人力进行有效的释放,利用脚本的执行,实现功能的快速高效回归。但这种测试的不足之处也是显而易见的,主要包括维护成本高,易发生误判,兼容性不足等。因为是基于界面操作,界面的稳定程度便成了

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor