Saturday, 8 December 2018

Improving Read Availability of the HADR Standby database… Avoiding the Replay-only Window

- David Sciaraffa, Software Engineering Manager – IBM Db2


A Db2 database can be easily configured for high availability by maintaining a real-time synchronized peer database using a feature called High Availability Disaster Recovery, or more commonly known as ‘HADR’.  An HADR standby database stays synchronized with a primary database by replaying log-record data reflective of all changes made on the primary database. HADR is quite simple to configure, and is virtually seamless to applications.  HADR is an extremely popular Db2 feature, and is well documented within the Db2 Knowledge Center, as well as the HADR Developerworks Wiki.


Reads on Standby feature

In Db2 Version 9.7, IBM introduced an HADR feature called “Reads on Standby”, which allows for read-only SQL queries to read data from the HADR standby database, as depicted in the following diagram:

image


Of the several restrictions present in the Reads on Standby feature, one restriction in-particular made it difficult for many users to broadly adopt, specifically called the replay-only window



Replay-only Window restriction (prior to Version 11.1.4.4)

When an HADR standby database is replaying log-record data, if it encounters a log-record for a maintenance or Data Definition Language (DDL) operation (such as most CREATE, ALTER, or DROP statements, REORG, RUNSTATS, and other such operations), the standby database triggers a condition called the "replay-only window", where all executing queries on the standby database are interrupted, all database connections are terminated and new connections to the standby are blocked (receiving an SQL1224N error code).   Only after the replay of the DDL or maintenance operation has completed, are new connections allowed on the standby database again. 

The types of DDL statements and maintenance operations that cause a replay-only window are well documented, and also listed below for reference:

 image  image


The following diagram depicts the process-flow and effect of the replay-only window:

image


When the replay-only window is triggered, diagnostic messages appear in the db2diag.log, like so:

2017-11-22-15.48.36.321657-300 I522432E731           LEVEL: Info
PID : 25476 TID : 140255646705408 KTID : 26687< PROC : db2sysc INSTANCE: db2inst1 NODE : 000 DB : TESTDB APPHDL : 0-8 APPID: *LOCAL.DB2.171122204107 HOSTNAME: myhost1 EDUID : 87 EDUNAME: db2redom (TESTDB) FUNCTION: DB2 UDB, recovery manager, SQLP_REPLAY_ONLY_WINDOW_STAT::sqlpStartHadrReplayOnlyWindow, probe:9140 MESSAGE : Replay only window is triggered by this log record: LogStreamId / TID< / LSO / action
and:
2017-11-22-15.49.28.915844-300 E546560E554           LEVEL: Warning
PID     : 25476                TID : 140255646705408 KTID : 26687<
PROC    : db2sysc
INSTANCE: db2inst1             NODE : 000            DB   : TESTDB
APPHDL  : 0-8                  APPID: *LOCAL.DB2.171122204107
HOSTNAME: myhost1
EDUID   : 87                   EDUNAME: db2redom (TESTDB)
FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::HdrEndRep
layOnlyWindow, probe:210
DATA #1 : String, 73 bytes
Replay only window is inactive, connections to Active Standby are allowed

Additional information on how to monitor the replay-only window is described in sections ‘Diagnostic log messages during replay-only window’ and ‘Monitoring the replay-only window’ in Knowledge Center topic Replay-only window (and replay-only window avoidance) on the active standby database.

The replay-only window can be a show-stopper to the usefulness of the Reads on Standby feature, when applications on the primary database perform DDL operations often, since the frequency of replay-only window on the standby database increases, and thus queries on the standby are interrupted often.  The create and drop of temporary tables appear to be a very common DDL operation inherent in many workloads.


Replay-only Window avoidance (starting in v11.1.4.4)

Starting in Db2 Version 11.1 Mod Pack 4 Fix Pack 4 (v11.1.4.4), a significant improvement to the replay-only window is now available, by enabling the DB2_HADR_ROS_AVOID_REPLAY_ONLY_WINDOW registry variable.

When the registry variable is set to ON, the standby database does not enter the replay-only window. Instead, only existing application connections on the standby database which hold locks on tables, indexes or other objects that conflict with the DDL or maintenance operation to be replayed will be forced off. Other connections, including new connections, are permitted to continue, as depicted in the following diagram:


image


With this improvement, a create or drop of a temporary table on the primary database, which are the most common DDL operations in day-to-day workloads, do not cause any interruption to application connections on the standby database.  Furthermore, the impact from a DDL or maintenance operation performed on a regular table on the primary database is limited only to application connections on the standby database which hold or require a lock on that specific table at the time that the operation is being replayed on the standby.

Note, application connections on the standby database may experience a brief lock-wait condition if the table or object they are trying to access currently has a DDL or maintenance log-record replayed on it. For information on how to determine if an application on the standby database is in a prolonged lock-wait behind a DDL log-record replay operation, see section ‘Monitoring lock conflicts when replay-only window avoidance is enabled’ in Knowledge Center topic Replay-only window (and replay-only window avoidance) on the active standby database.


Additional note,  even when replay-only window avoidance is enabled, the following few DDL operations will still cause a full replay-only window on the standby database:

image



I hope this information is useful. If you have any thoughts or questions, feel free to submit a comment below. 

Tuesday, 27 November 2018

Db2 and Db2-on-Cloud - Technical Advocate Newsletter – November 2018

image_thumb23_thumb



    Announcement - Db2 Version 11.1 Mod4 Fix Pack4 (v11.1.4.4) is Available for Download
    What's new in Modification Pack 4: https://ibm.co/2E0H3tu
    List of high impact & pervasive (HIPER) fixes (APARs): https://www-01.ibm.com/support/docview.wss?uid=swg21994955
    List of all fixes (APARs) included in this fixpack: https://www-01.ibm.com/support/docview.wss?uid=swg21995889
    Fixpack download page: https://www-01.ibm.com/support/docview.wss?uid=ibm10741687


    Conferences & Summits - Think 2019 (February 12-15, San Francisco, CA)
    Think 2019 is the one business and technology conference designed to deliver the technical training, strategic expertise, and impactful lessons every organization now needs to compete in today's changing world. As our flagship event, Think offers an exclusive look into the technologies, the strategies, and the services that set IBM apart as the leader for enterprise-grade AI, cloud, and cybersecurity.
    Our exciting lineup of speakers keeps growing, with NFL legend and San Francisco favorite Joe Montana joining us to share how his skills have helped him find success on and off the field.
    https://www.ibm.com/events/think/


    Roadmaps -
    Db2 Development Roadmaps are Now Accessible to Everyone
    Curious about the feature and function committed to upcoming versions of Db2? You can now explore live development roadmaps for Db2 and the IBM Analytics family of products. This content is live and subject to change.
    http://bit.ly/2DJ7p2o


    Seminar -
    Data Server Manager - Proof of Technology (Nov 28, Chicago IL)
    Please join us for a light continental breakfast and lunch as we learn about Data Server Manager (DSM) for DB2 LUW. Topics include Monitoring, Tuning, Configuration, and Administration.
    https://ibm.co/2DJnLrt


    Conference -
    International Db2 Users Group Conference - Call for Speakers (June 2-6, 2019)
    A call for speakers for the International Db2 Users Group (IDUG) Technical Conference on June 2 - 6 2019 in Charlotte, North Carolina is currently under way. This is a great opportunity for Database Architects, Administrators, Planners, and Application Developers to:
    · Spotlight interesting projects and experiences with Db2 or the Db2 family of products.
    · Gather insight and discussion on your Db2 project, leverage the experience of other experts.
    · Network with other Db2 professionals and consultants.
    · Build your brand and exposure as a database technical professional.
    https://www.idug.org/p/cm/ld/fid=1519


    Webinar - A Crash Course on Db2 pureScale, and It's Benefits
    IBM Champions, and Db2 Certification Book Authors, Mohan Saraswatipura and Kent Collins return as our special guests to give us a crash course on Db2 pureScale and its advantages. Gather a wealth of excellent information on Db2 pureScale including best practices, database manager configuration settings, database configuration settings, registry variables, HADR considerations, how to size memory, monitoring, workload manager (WLM), and much more! Get the PDF for reference AND watch our replay so that you don't miss Kent's helpful explanations! Continue...
    Watch the replay: http://bit.ly/2FOxQGC


    Webinar -
    SAP on Db2 (from Oracle) Success Story, and Db2 SAP on AWS
    Arwel Owen (Princess Ltd) completed a VERY successful migration from Oracle to Db2, and then another migration to Db2 V11.1.2.2 SAP on AWS Cloud. The compression, cost savings, and performance results are simply ASTOUNDING! Watch our fun and informative replay for details...
    Watch the replay: https://www.dbisoftware.com/blog/db2nightshow.php?id=752

    Webinar - What's New in Db2 Warehouse (Dec 7, 2018)
    Join us for our next "What's New: Db2 Warehouse" to hear about the latest features and functionality of our latest release.
    https://ibm.co/2PTuFBS


    Webinar -
    Troubleshooting Db2 LUW Production Issues
    Downtime is expensive. Most DBAs have been in the hot seat with management demanding rapid information and problem resolution. Michael shares his robust triage plan. Watch and learn from an experienced pro. Michael Krafick (IBM Champion Senior DBA) makes great use of entertaining and helpful graphics, he's funny, he speaks from the heart and with solid knowledge and experience, and he shares ideas and tips that will help you be successful.
    Watch the replay: https://www.dbisoftware.com/blog/db2nightshow.php?id=757


    Flash -
    Db2 Version 10.5 Fix Pack 10 for AIX 64bit has been republished with additional optimizations
    Db2 Version 10.5 Fix Pack 10 for AIX 64bit was published on July 10, 2018 without optimization on a few libraries, which may result in database performance degradation in some workload scenarios. This package was republished on October 22, 2018 with optimizations that match previous Fix Packs, and users should deploy this new version.
    https://www-01.ibm.com/support/docview.wss?uid=ibm10735519


    Flash - A tablespace may be unrecoverable via restore+rollforward if an extent reclamation occurred on an MDC or ITC table while the Online Backup was running
    If an Online Backup operation is in progress, and extent reclamation occurs on a MDC or ITC table, then a future RESTORE and ROLLFORWARD TO END OF BACKUP operation from this backup image may fail and leave this table space unavailable to recover.
    https://www-01.ibm.com/support/docview.wss?uid=ibm10741877



    Db2 Community - Follow the Db2 Developer and Administrator Community
    Share. Solve. Do More.
    https://developer.ibm.com/data/db2/


    Announcement -
    End of Support (EOS) for Db2 Version 10.5 is April 30, 2020.
    Effective April 30, 2020, IBM will withdraw support for Db2 Version 10.5. Extended support will be available beyond this date.
    https://ibm.co/2NCGTNi


    Follow-us! - Stay up to date on the latest news from the Db2 team
    IBM Support Community: (http://ow.ly/rPsM30fHnwI)
    Db2 Support Twitter channel: @AskIBMAnalytics (https://twitter.com/AskIBMAnalytics)
    AskIBMAnalytics Facebook channel: @AskIBMAnalytics (https://www.facebook.com/AskIBMAnalytics/)
    developerWorks Answers (forum): https://developer.ibm.com/answers/topics/
    Thoughts from Db2 Support (blog): https://www.ibm.com/developerworks/community/blogs/IMSupport?lang=en
    Db2 Technical Advocacy Wiki: https://www.ibm.com/developerworks/community/groups/community/Db2_Technical_Advocacy_Program

Friday, 14 September 2018

Db2 and Db2-on-Cloud - Technical Advocate Newsletter - Sept 2018

image



Announcement - Db2 Version 10.5 Fix Pack 10 (v10.5.0.10) is Available for Download
List of high impact & pervasive (HIPER) fixes (APARs): https://www-01.ibm.com/support/docview.wss?uid=swg21994955
List of all fixes (APARs) included in this fixpack: http://www-01.ibm.com/support/docview.wss?uid=swg21633303
Fixpack download page: https://www-01.ibm.com/support/docview.wss?uid=swg24045012

Announcement -
Db2 Version 11.1 Mod3 Fix Pack3 iFix002 (v11.1.3.3.ifix2) is Available for Download
List of high impact & pervasive (HIPER) fixes (APARs): https://www-01.ibm.com/support/docview.wss?uid=swg21647054
List of all fixes (APARs) included in this fixpack: http://www-01.ibm.com/support/docview.wss?uid=swg21995889
Fixpack download page: https://www-01.ibm.com/support/docview.wss?uid=ibm10720009

Announcement -
End of Support (EOS) for Db2 Version 10.5 is April 30, 2020.
Effective April 30, 2020, IBM will withdraw support for Db2 Version 10.5. Extended support will be available beyond this date.
https://ibm.co/2NCGTNi

Virtual Conference -
2018 Db2 Lab Day - Monday October 1, 2018
Please join us for a great set of sessions on our 2018 Db2 Lab Day. Db2 is at the core of IBM’s Hybrid Data Management strategy. This will be a full day of sessions to update you on all the latest news related to Db2 and the Db2-based Common SQL Engine offerings and strategy..
https://www.idug.org/p/cm/ld/fid=1625

Conferences & Summits -
Upcoming International Db2 Users Group (IDUG) Technical Conferences & Summits
The events offer new educational opportunities and more training than ever before! Attendees will experience: Five days of education sessions; Half and full-day workshops; More than 100 one-hour technical sessions; Three expert panels on Db2 for z/OS, Db2 & Application Development; Opportunities to get certified; And much more!
IDUG & IBM Data Tech Summit, 8 – 10 October 2018 | San Jose, California, USA: https://www.idug.org/p/cm/ld/fid=1591
IDUG EMEA Db2 Tech Conference, 4 – 8 November, 2018 | Malta: https://www.idug.org/EMEA2018

Webinar -
What's New in Db2 on Cloud
From the time that we announced the free tier (Lite Plan) at THINK 2018, the past few months have shown significant enhancements to Db2 on Cloud. In that time, we have brought federation capabilities to make it easier to connect to another Db2 database, offsite disaster recovery to ensure the highest levels of availability and ease-of-use updates to our web console and IAM/backups integration. Join us for a two-part series where we will do a deep dive into all of this and a few other core features to help you get the most out of using Db2 on Cloud. Part one on September 13th will cover HADR and Federation. Part two on October 18th will cover IAM and backups and various web console enhancements.
Part 1: http://bit.ly/2Ogfdet
Part 2: http://bit.ly/2p1kb3H

Webinar -
Adaptive Workload Management in Db2 Warehouse
IBM Db2 Warehouse (and Db2 Warehouse on Cloud) has recently rolled out a new Adaptive Workload Management technology that allows you to easily manage your database resources across workloads and ensure they meet their desired performance objectives. This exciting new technology automatically manages the scheduling and execution of work in your system based on resource targets you assign, ensuring stable and reliable performance even in the face of the most highly concurrent workloads. This session will introduce you to these new capabilities and show you how you can leverage them in your own environment.
Register to access the video replay: ibm.biz/Db2TT_Jul2018

Announcement -
Data Virtualization (Federation) for Db2 on Cloud
IBM is happy to announce Db2 Data Virtualization features for Db2 on Cloud. Sometimes called “federation”, this feature lets our customers access data from multiple different databases with a single query. With this latest addition, users will now be able to access data that is located on any of their Db2 or Informix data sources including both cloud and on premises systems. This functionality is supported on all versions of Db2 on Cloud, except for the free Lite plan. However, users can use the Lite plan as a target that you can pull data from.
https://www.ibm.com/blogs/bluemix/2018/06/announcing-data-virtualization-federation-db2-cloud/

Announcement -
Disaster Recovery Node for Db2 on Cloud
Disaster recovery (DR) is now available on Db2 on Cloud. This new features leverages Db2’s HADR technology and lets users add a DR Node on demand in an offsite data center of their choice. In an unlikely event where the primary data server is affected by external circumstances, such as a natural disaster, users can failover to their Geo-Replicated Disaster Recovery Node with a few clicks. Users can also fail back to their primary node just as easily.
https://www.ibm.com/blogs/bluemix/2018/07/db2-cloud-announces-disaster-recovery-node/

Blog -
Improving Performance in Your Data Warehouse – Part 1
This article is one in a series that focuses on improving performance in Db2 Warehouse. The first part provides some background information and lays out the first and most important aspect of query optimization, namely, cardinality estimation or estimating the number of rows that flows through the various operators in a query execution plan. Subsequent articles will discuss other topics of interest to query performance.
https://www.idug.org/p/bl/et/blogaid=779

Redbook -
Running an SAP System on IBM Db2 11.1 with the Db2 pureScale Feature
This document explains how you create an SAP system running on IBM Db2 with the Db2 pureScale Feature. It describes how you can convert the IBM Db2 11.1 database of an existing SAP system to an IBM Db2 11.1 database with the Db2 pureScale Feature, and how to install a new SAP system on IBM Db2 11.1 with the Db2 pureScale Feature.
https://help.sap.com/viewer/db6_purescale_11_1

_____________________________________________________________________________________________


Db2 Community -
Follow the Db2 Developer and Administrator Community

Share. Solve. Do More.

https://developer.ibm.com/data/db2/

Follow-us! -
Stay up to date on the latest news from the Db2 team
IBM Support Community: (http://ow.ly/rPsM30fHnwI)
Db2 Support Twitter channel: @AskIBMAnalytics (https://twitter.com/AskIBMAnalytics)
AskIBMAnalytics Facebook channel: @AskIBMAnalytics (https://www.facebook.com/AskIBMAnalytics/)
developerWorks Answers (forum): https://developer.ibm.com/answers/topics/
Thoughts from Db2 Support (blog): https://www.ibm.com/developerworks/community/blogs/IMSupport?lang=en
Db2 Technical Advocacy Wiki: https://www.ibm.com/developerworks/community/groups/community/Db2_Technical_Advocacy_Program

Tuesday, 22 May 2018

Db2 and Db2-on-Cloud - Technical Advocate Newsletter – May 2018

image_thumb2


Announcement - Db2 Version 11.1 Mod3 Fix Pack3 iFix001 (v11.1.3.3.ifix1) is Available for Download
List of high impact & pervasive (HIPER) fixes (APARs): http://www-01.ibm.com/support/docview.wss?uid=swg21994955
List of all fixes (APARs) included in this fixpack: http://www-01.ibm.com/support/docview.wss?uid=swg21995889
Fixpack download page: http://www-01.ibm.com/support/docview.wss?uid=swg24044872


Webinar - What's New in Db2 V11.1.3.3 for SAP Solutions
Join us for a live webinar on June 7 (or access the replay after June 7).
With IBM DB2 11.1.3.3, SAP customer can experience significant gain in BW ETL processing with BLU extensions such as BLU secondary indexes and BLU parallel insert. In addition, you will find enhancements for Db2 Encryption integration with SAP, Db2 for SAP in Google Cloud, and Db2 performance improvements for SAP Core Data Services, which are heavily used by modern SAP user interface FIORI. Presented by Karl Fleckenstein, IBM Senior Technical Staff Member.
To Register: http://bit.ly/2rZL4a6


Tech Talk -
Db2 Security and Compliance Support
Although security and compliance are deeply intertwined, they are not the same. One is used to ensure that something (in our case, data) is only accessed by individuals who have been authorized to access it, while the other is used to put a specific set of controls in place that ensures an organization is abiding by a regulation. With GDPR requirements going into effect, are your data solutions in compliance? Attend this Webcast to understand: Differences between security and compliance; Some of the more common compliance regulations companies must adhere to; An overview of GDPR; A deep dive into the Db2 security mechanisms that can be used to support different compliance specification provisions; Putting it all together. Presented by Roger Sanders, IBM Db2 Offering Manager.
http://bit.ly/2IXWKno


Blog -
A RESTful Approach for Working with Db2
A number of years ago, a consortium of vendors worked together to develop a standard protocol for communicating to database servers using RESTful API calls. This article will explain some of the features that are available in the IBM Data Server Gateway for OData Version 1.0.0. (OData Gateway). The OData Gateway enables you to quickly create OData RESTful services to query and update data in IBM Db2 LUW. An introduction to the OData gateway is found in the following developerWorks article.
http://bit.ly/2s3yEwZ


Blog -
Db2 Warehouse on Cloud - Flex Performance - harder, better, faster, stronger
A few months ago, we re-imagined data warehousing in the IBM Cloud with Flex Performance, the flagship tier of our new Flex line of offerings. Flex brings new levels of elasticity, speed, and resiliency to data warehousing on the IBM Cloud, and forms the foundation for our strategy moving forward. We’re working continuously to not only strengthen and enhance its capabilities, but to also make them more accessible to you so you can better leverage them and get the most out of your data warehouse. Today, we’re proud to announce a significant update to our Flex family..
https://www.ibm.com/blogs/bluemix/2018/05/flex-harder-better-faster-stronger/


Webinar - What’s New in Db2 Warehouse
Join us for this LIVE webinar on June 8 (or access the replay after June 8).
Hear about the latest Db2 Warehouse release and "What's New". Presented by Mitesh Shah, IBM Offering Manager for Db2 Warehouse.
http://bit.ly/2GDNcc1


Conference -
Central Canada Db2 Users Group (June 4 & 5)
In its 33rd year, the Central Canada Db2 User Group continues to offer quality technical Db2 education. Our 2-day conference brings together many of the best speakers from IDUG NA and the Db2 Labs. Two days packed with educational opportunities within the professional surroundings of the Bank of Montreal Institute for Learning. If you are in the Toronto area, or can make the trip to join us, you should not miss this opportunity.
For more details and to register, go to
http://www.ccdb2.ca/home.htm.

__________________________________________________________________________



Db2 Community - Follow the Db2 Developer and Administrator Community
Share. Solve. Do More.
https://developer.ibm.com/data/db2/

Follow-us! - Stay up to date on the latest news from the Db2 team
IBM Support Community: (http://ow.ly/rPsM30fHnwI)
Db2 Support Twitter channel: @AskIBMAnalytics (https://twitter.com/AskIBMAnalytics)
AskIBMAnalytics Facebook channel: @AskIBMAnalytics (https://www.facebook.com/AskIBMAnalytics/)
developerWorks Answers (forum): https://developer.ibm.com/answers/topics/
Thoughts from Db2 Support (blog): https://www.ibm.com/developerworks/community/blogs/IMSupport?lang=en
Db2 Technical Advocacy Wiki: https://www.ibm.com/developerworks/community/groups/community/Db2_Technical_Advocacy_Program


Saturday, 28 April 2018

Monitoring the replay-only-window on a Db2 HADR standby database

- David Sciaraffa, Software Development Manager – IBM Db2


In Db2 systems configured for high availability disaster recovery (HADR), all data changes which are made on the primary database are also transmitted and replayed on one or more secondary ‘standby’ databases.  If a system failure occurs on the primary database server, applications can be rerouted to the standby database almost instantaneously (and usually done so through automation).
Db2 HADR is simple to configure, and mostly invisible to the applications accessing the database. There are many excellent resources online for getting started with HADR:
Step by Step Procedure to set up HADR replication between DB2 databases
IBM Developerworks Db2 HADR Wiki (Tutorial, Getting-Started, Performance Monitoring and Tuning, more…)


Performing SQL queries on a standby database (“Reads-on-Standby”) --
It is possible to allow applications to connect to the Db2 standby database and perform SQL read-only queries.  We refer to standby databases which are enabled for this as a “Reads-on-Standby” database.
Reads-on-Standby databases are simple to enable. There are numerous resources available to help get started:
Get the most from the DB2 HADR standby database: Using the reads on standby capability
HADR reads on standby feature
Reads on standby restrictions


Limitation of HADR Reads-on-Standby databases – the “replay-only-window”

A current limitation of Reads-on-Standby databases is the “replay-only-window”. When an application on the primary database performs a ‘DDL’ operation (such as creating or altering a regular or temporary table, view, or other database object) all application connections on the standby database will be momentary forced off (any currently executing queries will be interrupted). After the unit-of-work containing the DDL operation is fully replayed on the Standby database, application connections and queries on the standby database are permitted again.  The list of DDL and utility operations which trigger the replay-only-window are documented in Replay-only window on the active standby database.


What does a replay-only-window look like?

First, let’s establish a connection on the standby database, and start running some basic read-only queries:

[standby db server]

$ db2pd -db hadr105 -hadr | grep HADR_ROLE
                             HADR_ROLE = STANDBY

$ db2 connect to hadr105

   Database Connection Information

   Database server        = DB2/LINUXX8664 10.5.9
   SQL authorization ID   = DB2INST1
   Local database alias   = HADR105

$ while [[ 1 ]]
   do
   db2 -v "select FIRSTNME from EMPLOYEE with UR";
   done

Let’s invoke a simple DDL statement on the primary database, to trigger a replay-only-window on the standby database:

[primary db server]

$ db2pd -db hadr105 -hadr | grep HADR_ROLE
                            HADR_ROLE = PRIMARY

$ db2 create table table1 '(c1 int)'
DB20000I  The SQL command completed successfully.

When the replay-only-window is triggered on the standby database, all running queries on the standby database will be interrupted and their associated database connections will be forced off resulting in an SQL1224N error:

[standby db server]

$ db2 "select FIRSTNME from EMPLOYEE"
SQL1224N  The database manager is not able to accept new requests, has
terminated all requests in progress, or has terminated the specified request
because of an error or a forced interrupt.  SQLSTATE=55032

Also, if an attempt is made to establish a connection to the standby database while a replay-only-window is active, an SQL1776N reason 4 is returned:

[standby db server]

$ db2 connect to hadr1113
SQL1776N  The command cannot be issued on an HADR database. Reason code = "4".


How can I monitor the replay-only-window?

In all Db2 versions:
The STANDBY_REPLAY_ONLY_WINDOW_ACTIVE value of ‘db2pd –hadr’ or the MON_GET_HADR() table function will have a value of ‘Y’ on the standby database for the duration of the replay-only-window:

[standby db server]

$ db2pd –db hadr105 –hadr

                            HADR_ROLE = STANDBY
                           REPLAY_TYPE = PHYSICAL
                         HADR_SYNCMODE = NEARSYNC
                            STANDBY_ID = 0
                         LOG_STREAM_ID = 0
                            HADR_STATE = PEER
                            HADR_FLAGS = TCP_PROTOCOL
                   PRIMARY_MEMBER_HOST = hotellnx108
                     PRIMARY_INSTANCE = db2inst1
                       PRIMARY_MEMBER = 0
                   STANDBY_MEMBER_HOST = hotellnx111
                      STANDBY_INSTANCE = db2inst1
                       STANDBY_MEMBER = 0
                   HADR_CONNECT_STATUS = CONNECTED
              HADR_CONNECT_STATUS_TIME = 04/28/2018 18:55:38.089002 (1524956138)
           HEARTBEAT_INTERVAL(seconds) = 30
                      HEARTBEAT_MISSED = 0
                    HEARTBEAT_EXPECTED = 283
                 HADR_TIMEOUT(seconds) = 120
         TIME_SINCE_LAST_RECV(seconds) = 0
              PEER_WAIT_LIMIT(seconds) = 0
            LOG_HADR_WAIT_CUR(seconds) = 0.000
     LOG_HADR_WAIT_RECENT_AVG(seconds) = 0.000308
    LOG_HADR_WAIT_ACCUMULATED(seconds) = 1.909
                   LOG_HADR_WAIT_COUNT = 986
SOCK_SEND_BUF_REQUESTED,ACTUAL(bytes) = 0, 16384
SOCK_RECV_BUF_REQUESTED,ACTUAL(bytes) = 0, 87380
             PRIMARY_LOG_FILE,PAGE,POS = S0000002.LOG, 725, 55945845
             STANDBY_LOG_FILE,PAGE,POS = S0000002.LOG, 725, 55945845
                   HADR_LOG_GAP(bytes) = 0
      STANDBY_REPLAY_LOG_FILE,PAGE,POS = S0000002.LOG, 725, 55945789
        STANDBY_RECV_REPLAY_GAP(bytes) = 2
                      PRIMARY_LOG_TIME = 04/28/2018 21:17:06.000000 (1524964626)
                      STANDBY_LOG_TIME = 04/28/2018 21:17:06.000000 (1524964626)
               STANDBY_REPLAY_LOG_TIME = 04/28/2018 21:17:06.000000 (1524964626)
          STANDBY_RECV_BUF_SIZE(pages) = 512
              STANDBY_RECV_BUF_PERCENT = 0
           STANDBY_SPOOL_LIMIT(pages) = 13000
                 STANDBY_SPOOL_PERCENT = 0
                    STANDBY_ERROR_TIME = NULL
                  PEER_WINDOW(seconds) = 0
              READS_ON_STANDBY_ENABLED = Y
     STANDBY_REPLAY_ONLY_WINDOW_ACTIVE = Y
      STANDBY_REPLAY_ONLY_WINDOW_START = 04/28/2018 21:17:32.000000 (1524964652)
STANDBY_REPLAY_ONLY_WINDOW_TRAN_COUNT = 1


In Db2 version 11.1.2.2 and previous releases:
The db2 diagnostic log file (db2diag.log) on the standby database will contain the following messages:

[standby db server]

$ less /home/db2inst1/sqllib/db2dump/db2diag.log

2018-04-28-18.36.18.723755-240 E41445875E502         LEVEL: Warning
PID     : 483                  TID : 140327683876608 PROC : db2sysc
INSTANCE: dsciaraf             NODE : 000            DB   : HADR105
APPHDL  : 0-12                 APPID: *LOCAL.DB2.180428222707
HOSTNAME: hotellnx111
EDUID   : 685                  EDUNAME: db2redom (HADR105)
FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::HdrForceAppsInReplayOnlyWindow
, probe:100
DATA #1 : String, 28 bytes
Replay only window is active

2018-04-28-18.36.18.724354-240 I41446378E490         LEVEL: Info
PID     : 483                  TID : 140327683876608 PROC : db2sysc
INSTANCE: db2inst1             NODE : 000            DB   : HADR105
APPHDL  : 0-12                 APPID: *LOCAL.DB2.180428222707
HOSTNAME: hotellnx111
EDUID   : 685                  EDUNAME: db2redom (HADR105)
FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::HdrKickPooledAgents, probe:10
DATA #1 : <preformatted>
Interrupting agent with eduid:688

2018-04-28-18.36.18.724607-240 I41446869E500         LEVEL: Info
PID     : 483                  TID : 140327683876608 PROC : db2sysc
INSTANCE: db2inst1             NODE : 000            DB   : HADR105
APPHDL  : 0-12                 APPID: *LOCAL.DB2.180428222707
HOSTNAME: hotellnx111
EDUID   : 685                  EDUNAME: db2redom (HADR105)
FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::HdrKickPooledAgents, probe:20
DATA #1 : <preformatted>
Waiting for last disassociation from the db

When the replay-only-windows is completed, and applications allowed to reconnect to the standby database, the following db2diag.log message is displayed:

2018-04-28-18.36.18.973225-240 E41447370E539         LEVEL: Warning
PID     : 483                  TID : 140327683876608 PROC : db2sysc
INSTANCE: db2inst1             NODE : 000            DB   : HADR105
APPHDL  : 0-12                 APPID: *LOCAL.DB2.180428222707
HOSTNAME: hotellnx111
EDUID   : 685                  EDUNAME: db2redom (HADR105)
FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::HdrEndReplayOnlyWindow, probe:
210
DATA #1 : String, 73 bytes
Replay only window is inactive, connections to Active Standby are allowed

In addition to these db2diag.log entries, it is possible to parse db2 recovery log files to determine which log-records (if any) will cause a replay-only-window, by using the db2fmtlog_replayonlywindow tool, which can be downloaded from the Db2 HADR wiki here: (link). Since db2 recovery log files are mostly identical on both primary and standby databases, this tool can be run on log files resided on either database (or the log archive path):

[primary or standby db server]

$ db2 get db config for hadr105 | grep "Path to log files"
  Path to log files = /home/db2inst1/db2inst1/NODE0000/SQL00001/LOGSTREAM0000/

$ cd /home/db2inst1/db2inst1/NODE0000/SQL00001/LOGSTREAM0000/

$ db2fmtlog_replayonlywindow_linux 0-2

  |------|------------------------------------------------------------------------
   | LREC |  5171  000408D1  00000000029D
   |------|------------------------------------------------------------------------
   | LREC |                     Record LSO = 45190368
   |      |                     Record TID = 00000000029D
   |      |                         Action = DDL
   |------|------------------------------------------------------------------------
   | LREC |  5180  00040921  00000000037E
   |------|------------------------------------------------------------------------
   | LREC |                     Record LSO = 45197733
   |      |                     Record TID = 00000000037E
   |      |                         Action = DDL

Also, when the LOG_DDL_STMTS database configuration parameter is set to yes on the Primary database (at the time the DDL operation was performed and it’s log records were generated within the recovery log file), then the DDL statement itself will also be displayed:

  |------|------------------------------------------------------------------------
  | LREC |  5171  000408D1  00000000029D
  |------|------------------------------------------------------------------------
  | LREC |                     Record LSO = 45190368
  |      |                     Record TID = 00000000029D
  |      |                         Action = DDL
  |------|------------------------------------------------------------------------
  | LREC |  5171  000408D2  00000000029D
  |------|------------------------------------------------------------------------
  | LREC |                     Record LSO = 45190796
  |      |                     Record TID = 00000000029D
  |      |                  DDL Statement = create table t3 (c1 int)
  |------|------------------------------------------------------------------------
  | LREC |  5180  00040921  00000000037E
  |------|------------------------------------------------------------------------
  | LREC |                     Record LSO = 45197733
  |      |                     Record TID = 00000000037E
  |      |                         Action = DDL
  |------|------------------------------------------------------------------------
  | LREC |  5180  00040922  00000000037E
  |------|------------------------------------------------------------------------
  | LREC |                     Record LSO = 45198161
  |      |                     Record TID = 00000000037E
  |      |                 DDL Statement = create table t4 (c1 int)


In Db2 version 11.1.3.3 and newer releases:
The db2 diagnostic log file (db2diag.log) on the standby database has been enhanced to provide additional details when a replay-only-window occurs.  The frequency of these diagnostic messages can be configured using the DB2_HADR_REPLAY_ONLY_WINDOW_DIAGLEVEL registry variable.  A value of 0 meaning no additional diagnostic messages, a value of 1 meaning only the first log-record/DDL statement within the unit-of-work will be displayed, and a value of 2 means all log-records/DDL statements within the unit-of-work will be displayed.

[standby db server]

$ db2pd -db hadr1113 | grep HADR_ROLE
                             HADR_ROLE = STANDBY

$ less /home/db2inst1/sqllib/db2dump/db2diag.log

2018-04-28-19.31.28.182828-240 I41576483E762         LEVEL: Info
PID     : 8721                 TID : 140697919284992 PROC : db2sysc
INSTANCE: db2inst1             NODE : 000            DB   : HADR1113
APPHDL  : 0-11                 APPID: *LOCAL.DB2.180428225527
HOSTNAME: hotellnx111
EDUID   : 397                  EDUNAME: db2redom (HADR1113)
FUNCTION: DB2 UDB, recovery manager, SQLP_REPLAY_ONLY_WINDOW_STAT::sqlpStartHadrReplayOnlyWindow,
probe:9140
MESSAGE : Replay only window is triggered by this log record: LogStreamId / TID
           / LSO / action
DATA #1 : db2LogStreamIDType, PD_TYPE_DB2_LOG_STREAM_ID, 2 bytes
0
DATA #2 : SQLP_TID, PD_TYPE_SQLP_TID, 6 bytes
00000000029D
DATA #3 : unsigned integer, 8 bytes
45190368
DATA #4 : String, 3 bytes
DDL

2018-04-28-19.31.28.183183-240 E41577246E504         LEVEL: Warning
PID     : 8721                 TID : 140697919284992 PROC : db2sysc
INSTANCE: dsciaraf             NODE : 000            DB   : HADR1113
APPHDL  : 0-11                 APPID: *LOCAL.DB2.180428225527
HOSTNAME: hotellnx111
EDUID   : 397                  EDUNAME: db2redom (HADR1113)
FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::HdrForceAppsInReplayOnlyWindow, probe:100
DATA #1 : String, 28 bytes
Replay only window is active

2018-04-28-19.31.28.183344-240 I41577751E502         LEVEL: Info
PID     : 8721                 TID : 140697919284992 PROC : db2sysc
INSTANCE: dsciaraf             NODE : 000            DB   : HADR1113
APPHDL  : 0-11                 APPID: *LOCAL.DB2.180428225527
HOSTNAME: hotellnx111
EDUID   : 397                  EDUNAME: db2redom (HADR1113)
FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::HdrKickPooledAgents, probe:20
DATA #1 : <preformatted>
Waiting for last disassociation from the db

And same as previous releases, when the replay-only-windows is completed, and applications allowed to reconnect to the standby database, the following db2diag.log message is displayed:

2018-04-28-19.31.28.375434-240 E41579289E541         LEVEL: Warning
PID     : 8721                 TID : 140697919284992 PROC : db2sysc
INSTANCE: dsciaraf             NODE : 000            DB   : HADR1113
APPHDL  : 0-11                 APPID: *LOCAL.DB2.180428225527
HOSTNAME: hotellnx111
EDUID   : 397                  EDUNAME: db2redom (HADR1113)
FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::HdrEndReplayOnlyWindow, probe:210
DATA #1 : String, 73 bytes
Replay only window is inactive, connections to Active Standby are allowed

Also, when the LOG_DDL_STMTS database configuration parameter is set to yes on the Primary database (at the time the DDL operation was performed and it’s log records were generated within the recovery log file and transmitted to the standby database), then the DDL statement will also be printed into the db2diag.log starting in v11.1.3.3 and new releases:

2018-04-28-19.31.28.183524-240 I41578254E544         LEVEL: Info
PID     : 8721                 TID : 140697919284992 PROC : db2sysc
INSTANCE: dsciaraf             NODE : 000            DB   : HADR1113
APPHDL  : 0-11                 APPID: *LOCAL.DB2.180428225527
HOSTNAME: hotellnx111
EDUID   : 397                  EDUNAME: db2redom (HADR1113)
FUNCTION: DB2 UDB, recovery manager, SQLP_REPLAY_ONLY_WINDOW_STAT::sqlpSetDDLStmtForHadrReplayOnly
Window, probe:9150
MESSAGE : DDL statement text
DATA #1 : String, 24 bytes
create table table3 (c1 int)

In addition, available in v11.1.3.3 and newer releases, the db2fmtlog tool is available in the sqllib/bin/ folder, and it’s REPLAYONLYWINDOW option can be used to display all log records (if any) that will cause a replay-only-window.  If the LOG_DDL_STMTS database configuration parameter is set to yes on the Primary database (at the time the DDL operation was performed and it’s log records were generated), then the statement itself is displayed as well:

[primary or standby db server]

$ db2 get db config for hadr105 | grep "Path to log files"
  Path to log files = /home/db2inst1/db2inst1/NODE0000/SQL00001/LOGSTREAM0000/

$ cd /home/db2inst1/db2inst1/NODE0000/SQL00001/LOGSTREAM0000/

$ ~/sqllib/bin/db2fmtlog -replayonlywindow 0-10

|------|------------------------------------------------------------------------
| LREC |                     Record LSO = 45190796
|      |                     Record TID = 00000000029D
|      |                  DDL Statement = create table t3 (c1 int)
|------|------------------------------------------------------------------------
| LREC |  5180  00040921  00000000037E
|------|------------------------------------------------------------------------
| LREC |                     Record LSO = 45197733
|      |                     Record TID = 00000000037E
|      |                         Action = DDL
|------|------------------------------------------------------------------------
| LREC |  5180  00040922  00000000037E
|------|------------------------------------------------------------------------
| LREC |                     Record LSO = 45198161
|      |                     Record TID = 00000000037E
|      |                  DDL Statement = create table t4 (c1 int)


How can the replay-only-window be avoided?

In Db2 version 11.1.3.3 and prior releases, the database administrator should implement monitoring for replay-only-window’s. Should the replay-only-windows occur frequently enough to hinder application productivity (or increase in frequency over time), then the DDL statements causing replay-only-windows should be determined (as described above), and applications teams should be engaged to determine if these DDL statements can be reduced in frequency.

Application’s which perform queries against the standby database should plan to expect SQL1224N errors on occasion (due to the replay-only-window), and implement handling to automatically re-connect to the database and re-submit and interrupted query.


Stayed tuned for a drastic improvement which eliminates the replay-only-window in a future Db2 version.



I hope this information is useful. If you have any thoughts or questions, feel free to submit a comment below.












Monday, 16 April 2018

Format and display Db2 log file information using db2fmtlog

- David Sciaraffa, Software Development Manager – IBM Db2


In high performance database (and data storage) systems, the hardening of data changes to permanent storage (disk) is often managed by algorithms which batch many changes together into fewer larger I/O operations. This is meant to minimize the exponential cost disparity between cpu/memory versus I/O, to optimize performance. 

Db2 write-ahead logging strategy
In order to achieve durability (in the case of a system failure) for data changes which reside in-memory but have not yet been written to permanent storage, many systems utilizes a write-ahead logging protocol – meaning that information pertaining to a data change is written to special transaction log files on permanent storage, before those corresponding data changes are batched together and written to disk. Examples of write-head logging protocols are abundant in mainstream IT systems, such as in journaled file systems, volume managers, and database management systems, such as Db2.


Db2 recovery log files
The Db2 recovery log files are a fundamental aspect of database tuning and administration, and all Database Administrators should have basic familiarity with log files. Db2’s recovery logs are well documented in both configuration and management, a few useful starting points provided here:

IBM DB2 Knowledge Center – Database Logging: https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.ha.doc/doc/c0006073.html
Managing Db2 transaction log files: http://db2commerce.com/2011/05/04/managing-db2-transaction-log-files/


Administration tasks requiring log files
It’s not uncommon for a Database Administrator to perform some manual manipulation of Db2 recovery log files, usually the result of a support ticket, or recovery event. As an example, a DBA might be required to restore a database backup image to a secondary system, and perform a rollforward of all log file data to a point in time, in which case a DBA may need to manually copy active and/or archived recovery log files to another system.

A log file’s name does not tell us much about the log file itself. For example, consider log file “S0000117.LOG”. We know this is the 117th log file generated in sequence since the database was created, but not much else.  Sometimes, high level information about log files is required, such as knowing the database which a log file belongs to, whether the log file is compressed or encrypted, or other details often useful for Db2 customer support in problem determination.



Starting in version 11.1.3.3, the db2fmtlog tool is available in the ~/sqllib/bin folder of the db2 instance owner userid home path.


db2fmtlog tool

The db2fmtlog tool takes a log file sequence number (or range of numbers) as an input parameter, and displays high level information about the log file(s):

$ cd ~/path_where_some_log_files_reside/

$ ls -l
-rw------- 1 db2inst1 db2grp1 4104192 Apr 14 13:46 S0000117.LOG
-rw------- 1 db2inst1 db2grp1 4104192 Apr 14 13:46 S0000118.LOG
-rw------- 1 db2inst1 db2grp1 4104192 Apr 14 13:48 S0000119.LOG
-rw------- 1 db2inst1 db2grp1 4104192 Apr 14 13:52 S0000120.LOG
-rw------- 1 db2inst1 db2grp1 4104192 Apr 14 14:01 S0000121.LOG
…etc…


$ /home/db2inst1/sqllib/bin/db2fmtlog 117-118

Log File S0000117.LOG:
    Extent Number              117
    Format Version             14
    Architecture Level Version V:11 R:1 M:3 F:3 I:0 SB:0
    Encrypted                  Yes
    Compression Mode           OFF
    Number of Pages            1000
    Partition                  0
    Log Stream                 0
    Database Seed              1610235396
    Log File Chain ID          0
    Master Key Label           DB2_SYSGEN_db2inst1__2018-04-16-09.31.20_24111712
    Previous Extent ID         2018-04-14-17.01.44.000000 GMT
    Current Extent ID          2018-04-14-17.01.45.000000 GMT
    Database log ID            2018-04-05-16.35.08.000000 GMT
    Topology Life ID           2018-04-05-16.35.08.000000 GMT
    First LFS/LSN              10400/000000000004700A
    Last LFS/LSN               10594/000000000004D99F
    LSO range                  61140001 to 65216000

Log File S0000118.LOG:
    Extent Number              118
    Format Version             14
    Architecture Level Version V:11 R:1 M:3 F:3 I:0 SB:0
    Encrypted                  Yes
    Compression Mode           OFF
    Number of Pages            1000
    Partition                  0
    Log Stream                 0
    Database Seed              1610235396
    Log File Chain ID          0
    Master Key Label           DB2_SYSGEN_db2inst1__2018-04-16-09.31.20_24111712
    Previous Extent ID         2018-04-14-17.01.45.000000 GMT
    Current Extent ID          2018-04-14-17.01.46.000000 GMT
    Database log ID            2018-04-05-16.35.08.000000 GMT
    Topology Life ID           2018-04-05-16.35.08.000000 GMT
    First LFS/LSN              10594/000000000004D9A0
    Last LFS/LSN               Unset
    LSO range                  65216001 to 69292000


The information displayed contains the following fields:

Extent Number –
The log file sequence number, which is also evident within the log file name.

Format Version –
An [internal] log file structure version number.

Architecture Level Version –
The version of Db2 when the log file was generated (V=Version, R=Release, M=Modification, F=Fixpack, I=iFix, SB=Special Build#)

Encrypted –
Whether the log file (and database) are natively encrypted. (See ‘Master Key Label’ for the associated key label).

Compression Mode –
Whether the log file is compressed (possible values are: OFF, ON, NX842, ZLIB, Unknown).

Number of Pages –
The number of 4k log pages within the log file. This will usually reflect the LOGFILSZ db config parameter, but can be smaller when log files are truncated.

Partition –
The database partition number where this log file was generated. (Always 0 for non-partitioned databases).

Log Stream –
The log stream number associated with the member where this log file was generated. (Always 0 for non-pureScale databases).

Database Seed –
The unique database identifier. (You can use db2ckbkp to display the database seed of a backup image).

Log File Chain ID –
The log chain number. (Db2 will begin a new log chain when a restore+rollforward is completed to a point in time that is not the end of the full log stream).

Master Key Label –
The master key label. (Displayed when a database, and it’s corresponding log files, are natively encrypted).

Previous Extent ID –
A unique timestamp identifier for the previous log file in the sequence.

Current Extent ID –
A unique timestamp identifier for the current log file.

Database log ID –

A unique timestamp identifier for the database from which this log file was generated.

Topology Life ID –

A unique timestamp representing the database topology (formation of pureScale members) when this log file was generated.

First LFS/LSN –
The unique Log Flush Sequence number and Log Sequence Number of the first log record within this log file. [This field is generally not useful for Database Administrators, but could be useful to a Db2 Support analyst].

Last LFS/LSN –
The unique Log Flush Sequence number and Log Sequence Number of the last log record within this log file. [This field is generally not useful for Database Administrators, but could be useful to a Db2 Support analyst].

LSO range –
The range of log record Log Sequence Offsets within this log file. [This field is generally not useful for Database Administrators, but could be useful to a Db2 Support analyst].


In addition to the log file information displayed by db2fmtlog, there are additional options:

LSNRANGE
- Displays only the first, last LFS/LSN ranges, and LSO range for each log file.

REPLAYONLYWINDOW
- Displays all log records which cause “replay only windows” in HADR Reads-on-Standby (ROS) environments. In addition, if the LOG_DDL_STMTS db config parameter was enabled at the time the log file was generated, then the DDL statement text will also be displayed.


For additional details about these options, and the db2fmtlog tool, please see: http://www-01.ibm.com/support/docview.wss?uid=swg22014054


I hope this information is useful. If you have any thoughts or questions, feel free to submit a comment below.

Saturday, 31 March 2018

Faster rollback processing of very large transactions in Db2 v11.1.3.3

- David Sciaraffa, Software Development Manager – IBM Db2


In database management systems, it is common for periodic batch workloads to perform large quantities of insert, update, or delete operations. These are often referred to as the ‘nightly batch job’. These large batch processing operations can put pressure on database management resources.

In Db2, to satisfy the Durability property of ACID compliance, all insert/update/delete (i/u/d) of data rows are also recorded into the database recovery log files. This log file data may be required later to recover from system failure, interrupt, or for replication purposes. For large batch operations, log file data often spans many log files.

Diagram 1) depicts how large batch operations can generate log records that span multiple log files:

image


Note: Db2 recovery log files exploit Direct I/O and bypass the file system cache in order to optimize write performance. This is imperative given the performance sensitivity of writing log file data, and useful since there is minimal read activity of the recovery log files during database runtime.

As a common best practice, large batch operations should be divided into smaller batches, with explicit COMMIT operations performed after each small batch, to avoid filling the Db2 active log space, and to lessen the amount of work to undo or redo in case of an interrupt or failure. Nevertheless, large batch operations often exist, and can be interrupted, either intentionally by the user or unintentionally as the result of being forced off the database by workload management enforcement settings.

When large batch operations are interrupted or fail, potentially large quantities of data row changes must be rolled back or undone. This requires reading through all the transaction log data that was recorded into the recovery log files since the beginning of the batch job.  Since Db2 recovery log files use Direct I/O during database runtime (not crash-recovery), Db2 does not benefit from file system prefetching and caching when reading back these log-records.

Starting in Db2 Version 11.1.3.3, there is a significant performance improvement for rollback processing during database runtime for large units of work, through the autonomous use of filesystem caching (buffered I/O) when reading recovery log file data.

By autonomously re-opening log files with file system caching (buffered I/O), reading log data from these files benefits from the buffering of the file system cache.

Diagram 2) depicts how rollback processing of large units of work may benefit from buffered I/O when reading transaction log data back, in order to undo data row changes:

image


Internal tests showed significant improvements (up to a 3x!) in rollback processing time for very large transactions.

image


This improvement is available by default starting in v11.1.3.3, no configuration or registry settings need to be enabled.



I hope this information is useful. If you have any thoughts or questions, feel free to submit a comment below.

Monday, 26 March 2018

Db2 and Db2-on-Cloud - Technical Advocate Newsletter – March 2018

image_thumb2


Event - Relive 'Think 2018' Conference
The visionary speakers and experts at Think 2018 have shared their solutions for some of the world’s most daunting challenges. And now you can access their technical prowess and profound insights anytime.
https://ibm.co/2GrrGLE


Announcement - Db2 11.1 Mod Pack 3 is Available for Download
Summary of the modification pack: https://ibm.co/2tSYbby
List of high impact & pervasive (HIPER) fixes (APARs): https://ibm.co/2ze6H7L
List of all fixes (APARs) included in this fixpack: http://www-01.ibm.com/support/docview.wss?uid=swg21995889
Fixpack download page: https://ibm.co/2IUa895


Announcement - Introducing IBM Cloud Private for Data
IBM Cloud Private for Data is an engineered solution for data science, data engineering and application building, with no assembly required. It provides seamless access to data across on-premises and all clouds; a cloud-native data architecture, behind the firewall; and data ingestion rates of up to 250 billion events per day. What Kubernetes solved for application developers (dependency management, portability, etc), IBM Cloud Private for Data will solve for data developers and speed the journey to AI. For details: https://ibm.co/2pG6VSz


Anniversary -
Celebrating 25 years of Db2!
March 2018 is the 25th anniversary of the Db2 relational database product on Linux UNIX and Windows! Few tech products in the world grow to this kind of success. The world runs on the back of Db2 — stock markets, investment banks, hospitals, insurance firms, pension funds, manufacturers, retailers, railways, shipping and logistics companies, airlines, schools, and governments. A talented team of business leaders, strategists, engineers, researchers and innovators, support staff, and sales professionals has made it happen. Today we celebrate and tip our hats to a remarkable technology and the team that created it.
https://ibm.co/2DWmMAL


Webinar -
Favorite Tuning Tips & Tricks for Db2
SELECTIVITY, OPTGUIDELINES, Runstats, Indexes, Bufferpool Design, REORGs, monitoring advice, and more!! No wonder Joe Geller won Best User Speaker at IDUG Lisbon 2017! Joe's presentation is full of terrific advice and tips! Watch and learn...
http://bit.ly/2GpHpL9


Walkthrough - Db2 on Cloud - Free Tier
IBM Db2 on Cloud is built for robust performance and provides a high availability option with a 99.99% up-time SLA. Scale up or down as needed and leverage rolling security updates for peace of mind. Db2 on Clound is a fully managed service; scale CPU up or down and pay for what you use on a daily basis. You can also scale CPU and storage independently. Enables you to move to the cloud with Db2 and Oracle PL/SQL compatibility. Offers support for numerous data connectivity methods and types. Helps you comply with data protection laws. Includes at-rest database encryption and SSL connections. High availability plans provide seamless rolling security updates.
https://www.ibm.com/cloud/db2-on-cloud


Conference - 2018 North America - International Db2 User Group Tech Conference
The premier North America Db2 Conference will take place on April 29 - May 3, 2018 in Philadelphia, Pennsylvania. Make your plans to attend and experience the latest in Db2 technologies, networking opportunities and the technical content you need to be successful.
The 2018 event offers new educational opportunities and more training than ever before! Attendees will experience: Five days of education sessions; Half and full-day workshops; More than 100 one-hour technical sessions; Three expert panels on z/OS, LUW & Application Development.
And much more!
http://www.idug.org/na2018

__________________________________________________________________________


Support Community - Follow the IBM Support Community

Check out how IBM is improving your Db2 support experience!
http://ow.ly/rPsM30fHnwI
Wiki - Db2 Development-Advocate Wiki

The Db2 Development Advocate Wiki is a publically accessible wiki with information about the development advocacy program, and forums for Q&A about the program. You'll also find a list of historic newsletter content.
https://www.ibm.com/developerworks/community/groups/community/Db2_Technical_Advocacy_Program


Follow-us! - Stay up to date on the latest news from the Db2 team
Db2 Support Twitter channel: @AskIBMAnalytics (https://twitter.com/AskIBMAnalytics)
Facebook page: @DB2Community (https://www.facebook.com/DB2community/)
AskIBMAnalytics Facebook channel: @AskIBMAnalytics (https://www.facebook.com/AskIBMAnalytics/)
developerWorks Answers (forum): https://developer.ibm.com/answers/topics/
Thoughts from Db2 Support (blog): https://www.ibm.com/developerworks/community/blogs/IMSupport?lang=en
Db2 Technical Advocacy Wiki: https://www.ibm.com/developerworks/community/groups/community/Db2_Technical_Advocacy_Program

Translate