SlideShare a Scribd company logo
DB2DART
   DART



  Iqbal Goralwalla
   DB2Night Show
  October 14, 2011
The Information Management Specialists
About Triton
• Formed in 1996
• IBM Premier Business Partner
• Largest independent DB2 Consultancy in the UK
• Strong team of highly experienced and certified DB2
  specialists
• Work with customers across a range of sectors
  providing them with DB2 consultancy and support for
  both DB2 LUW and DB2 z/OS
• Preferred DB2 services supplier to IBM UK and others

                The Information Management Specialists
About Me
• Head of Midrange (DB2 on LUW) at Triton
  Consulting
• Principal Consultant on DB2 LUW
• Experience of DB2 LUW since DB2 Common
  Server
• IBM Champion for Data Management
• Tendency to talk too much

             The Information Management Specialists
DB2DART
•   DB2DART – An Overview
•   My 3 Key DB2DARTs
•   My bonus DB2DART
•   Anything on DB2DART and DPF?
•   What about INSPECT?
•   GOTCHAS

              The Information Management Specialists
DB2DART – An Overview
                                                           db2top
• One of the less used
                                                          db2pd
  performance reporting
                                                         db2exfmt
  tools
                                                        db2diag
• Historically used with                               db2support
  IBM support
                                                      db2trc
• DBAs can use the tool –                             db2dart
  increases productivity
                                               Why am I here?


             The Information Management Specialists
DB2DART – An Overview
• Database Analysis and Reporting Tool
• “Offline” tool for checking the architectural correctness of a
  database
     Checks validity of meta-data structures, page headers, row
     headers, etc.
• Critical for investigating problems involving data corruption
• Runs against the data on disk
     Not aware of what’s in the buffer pool
     May show false errors if users are connected to the database



                  The Information Management Specialists
DB2DART – An Overview
• Granularity
    Database: db2dart <db> /DB
    Tablespace: db2dart <db> /TS
    Table: db2dart <db> /T /TSI /OI
• Options for inspecting, formatting, and repairing
  data
• Run db2dart /H to see all of the supported
  options

                The Information Management Specialists
DB2DART – Inspecting data




Examples:
db2dart <db> /DB
db2dart <db> /TS /TSI 2
db2dart <db> /T /TSI 2 /OI 6

              The Information Management Specialists
DB2DART – Formatting data




 Example: db2dart <db> /DD /TSI 2 /OI 6

           The Information Management Specialists
DB2DART – Repairing data




          The Information Management Specialists
DB2DART – My 3 Key DB2DARTs
                      DARTs
1. Storage Reclamation and High Water Mark
2. Index Corruption
3. Extracting Data




            The Information Management Specialists
Storage Reclamation – the DBA
dilemma
                                               Why is the
                                               space not being
Deleted thousands of                           released?
rows

Dropped a BIG table

Reorged the table


             The Information Management Specialists
Storage Reclamation – HWM for DMS
tablespaces
• High Water Mark (HWM) is the highest numbered page
  that is currently allocated in a DMS tablespace
• HWM can be much higher than the number of pages
  currently in use due to:
     Dropped tables or delete activity
     Offline table reorg using same tablespace
     Index reorg using “allow read or write access”
• Makes it difficult to release unused disk space for reuse
• HWM can be seen using LIST TABLESPACES SHOW DETAIL or
  GET SNAPSHOT FOR TABLESPACES

                   The Information Management Specialists
Storage Reclamation – HWM for DMS
tablespaces
• LIST TABLESPACES SHOW DETAIL




            The Information Management Specialists
HWM – Dropped table (1)
   DMS TABLESPACE                                 DMS TABLESPACE




         T1                                             T1
      5 pages                                        5 pages
                             Drop table T2

         T2                                            Free
      3 pages                                        3 pages
         T1                                             T1
      2 pages                                        2 pages

                             Table Space HWM
    Used pages = 10                                Used pages = 8
                             does NOT change
    HWM = 10                                       HWM = 10



                    The Information Management Specialists
HWM – Dropped table (2)
   DMS TABLESPACE                                 DMS TABLESPACE




         T1                                           Free
      5 pages                                        5 pages
                             Drop table T1

         T2                                             T2
      3 pages                                        3 pages
         T1                                            Free
      2 pages                                        2 pages

                             Table Space HWM
    Used pages = 10                                Used pages = 3
                             DOES change
    HWM = 10                                       HWM = 8



                    The Information Management Specialists
HWM – Offline Table Reorg (1)
                          REORG TABLE T1
   DMS TABLESPACE          INTERMEDIATE STATE      DMS TABLESPACE




         T1                       T1                   Free
      5 pages                                         7 pages



                                                         T1
        Free                     T1                   4 pages
                                Shadow
       6 pages
                                Copy


    Used pages = 5                                  Used pages = 4
    HWM = 5                   Table Space HWM       HWM = 11
                              INCREASES

                     The Information Management Specialists
HWM – Offline Table Reorg (2)
                          REORG TABLE T1
   DMS TABLESPACE          INTERMEDIATE STATE      DMS TABLESPACE



                                  T1
        Free                    Shadow                 T1
      7 pages                   Copy                  4 pages



                                                       Free
         T1
                                  T1                  7 pages
      4 pages



                                                    Used pages = 4
    Used pages = 4
    HWM = 11                  Table Space HWM       HWM = 4
                              DECREASES

                     The Information Management Specialists
HWM headaches
• Space not released even though free extents available
• Redirected RESTORE needs space equal to or greater
  than the HWM
     All extents in DMS table spaces up to the HWM copied to
     the backup image.
     Tablespaces containers cannot be reduced below HWM
• ALTER TABLESPACE <drop container/reduce containers
  size> only affects extents above the HWM


                 The Information Management Specialists
Storage Reclamation – the DBA
dilemma (DB2 9.1/9.5)
           Shall I call IBM                   DB2DART
           Support?




                                              Not when
                                              I’m around!


          The Information Management Specialists
Storage Reclamation – DB2DART 1
                         DART
• db2dart /DHWM – display table space and high-
  water mark information
    A map of the extents in the table space, showing
    objects owning them
    The ID and type of the object holding the high-water
    mark extent
    Amount of free extents and in-use extents below the
    high-water mark
    TIP: If online, use db2pdcfg –flushbp first (V9.1FP5,
    V9.5FP1)
               The Information Management Specialists
db2dart /DHWM



                       LIST TABLESPACES SHOW DETAIL




        The Information Management Specialists
db2dart /DHWM – Drop table ID 5



                      LIST TABLESPACES SHOW DETAIL




         The Information Management Specialists
Storage Reclamation – DB2DART
• db2dart /LHWM – Assists in lowering the high-water
  mark
     Table space ID and desired high-water mark are required
     May not be possible to actually lower it to the desired level
     Use "0" for the desired high-water mark to go as low as
     possible
     Result is a list of operations to execute (EXPORT/LOAD,
     REORG, etc.)
     Estimate of resulting in use and free extents below the
     high-water mark is displayed for each step

                  The Information Management Specialists
db2dart /LHWM




        The Information Management Specialists
db2dart /LHWM – after REORG




         The Information Management Specialists
Storage Reclamation – DB2DART
• db2dart /RHWM – Removes empty SMP
  extents holding up the high-water mark
    DB2 9.5 – ALTER TABLESPACE <tbsp>
    REDUCE/DROP
     ► Drops/reduces containers to the table space’s high-
       water mark
     ► First removes empty SMP extents

     ► No need for db2dart /RHWM




                The Information Management Specialists
Storage Reclamation – DB2DART
enhancements
• V9.1 FP4 – db2dart /DHWM and /LHWM can be
  run against active/inconsistent database
    IZ04647 http://www-
    01.ibm.com/support/docview.wss?uid=swg1IZ04647
• V9.1 FP5 – db2dart /DHWM is not correct when
  an empty SMP extent is holding the HWM
    IZ07663 http://www-
    01.ibm.com/support/docview.wss?uid=swg1IZ07663


              The Information Management Specialists
Storage Reclamation – DB2 9.7
• For a DMS or Automatic Storage table space created in
  DB2 9.7, you can use reclaimable storage to return
  unused storage to the system for reuse.
• For Automatic Storage table spaces, the REDUCE MAX
  option of ALTER TABLESPACE can be used to release all
  unused spaced
• For DMS, two steps are required to release the unused
  extents
     The High Water can be reduced to match the number of
     used extents with the LOWER HIGH WATER MARK option
     The REDUCE, RESIZE or DROP options then be used
• Reclaiming storage is an online operation

                The Information Management Specialists
Index Corruption
• Possible causes
    Hardware or software failure
    Killing an executing process (e.g., LOAD)
    After migration from one system to another
• Symptoms
    Bad page errors
    SQL0980C during a backup database command
    SQL0902C – database marked bad

              The Information Management Specialists
Index Corruption – the DBA dilemma
              Restore from
              backup?
             Shall I call IBM
             Support?                         DB2DART




                                              Not when
                                              I’m around!


          The Information Management Specialists
Index Corruption – DB2DART 2
                      DART
• Find out which indexes are problematic
    db2dart <db> /DD /TSI <pool id> /OI <object id>
    db2dart <db> /DI /TSI <pool id> /OI <object id>
• Mark indexes as invalid
    db2dart <db> /MI /TSI <pool id> /OI <object id>
• Indexes recreated based on INDEXREC (database
  configuration parameter)
     ► RESTART
     ► ACCCESS
     ► Monitor using db2diag.log



                The Information Management Specialists
Index Corruption – DB2DART
• Indexes recreated:
    First access of invalid index
    RESTART DATABASE
    LOAD – Build phase
    Classic offline table reorg
• To prevent access to problematic index
    LOCK TABLE IN EXCLUSIVE MODE


               The Information Management Specialists
Index Corruption – DB2DART –
Partitioned tables/indexes
• db2dart /MI requires table space ID and index
  object ID.
    For partitioned indexes, use INDPARTITIONOBJECTID
    and INDPARTITIONTBSPACEID from
    SYSCAT.INDEXPARTITIONS.




              The Information Management Specialists
Extracting Data
• Table space or database is corrupt or inaccessible
• Access to “bad/damaged” data causes an
  instance crash
• Need to salvage data
    Cannot use SQL to select data
    Cannot use Export
    Restore from backup image
     ► Does one exist?
     ► Circular logging?



                The Information Management Specialists
Extracting Data – the DBA dilemma

           Shall I call IBM                   DB2DART
           Support?




                                              Not when
                                              I’m around!


          The Information Management Specialists
Extracting Data – DB2 DART 3
• db2dart <db> /DDEL
• Dumped in delimited ASCII format
• Prompted for
    table name (or ID),
    table space ID,
    starting page,
    number of pages, and
    output file name
• LONG VARCHAR or LOB data will not be dumped

              The Information Management Specialists
Extracting Data – DB2DART
• May require multiple invocations
    Dump up to “bad/damaged” page using /DDEL option
     ►   Aborts on reaching corruption
    Dump “bad/damaged” page using /DD option
     ►   Incorrupt data can be viewed
    Dump rest of pages after “bad/damaged” page using
    /DDEL option and appropriate start page
• Some data loss inevitable

                  The Information Management Specialists
Backup Pending State (aka “Forced
backup”)
• LOAD with COPY NO (default)
• Logging strategy changed (circular to
  archival)
• LOGARCHIVE enabled
• LOGFILSIZ changed while using raw
  device for logging


              The Information Management Specialists
Backup Pending State – the DBA
dilemma
           Do I really need                   DB2DART
           to do a backup?




                                              Not when
                                              I’m around!


          The Information Management Specialists
Backup Pending State – bonus DB2DART
                                DART
• db2dart <db> /CHST /WHAT DBBP OFF




            The Information Management Specialists
DB2DART – Does it work with DPF?
• Yes!
• Run db2dart on desired partition or on all
  partitions
• Use db2_all to run db2dart on all partitions in a
  single invocation
• Default destination of report file is in diagnostic
  directory

               The Information Management Specialists
DB2DART – IBM service options
• /ETS – extends the table limit in a 4 KB table
  space (DMS only), if possible
• /MT – marks table with drop-pending state
    Needs password – supplied by IBM
• /IP – initializes the data page of a table as empty
    Needs password – supplied by IBM



              The Information Management Specialists
What about INSPECT?
• Online “equivalent” of DB2DART
• Integrated into runtime engine resulting in
  performance gains
    Makes use of prefetchers and buffer pools
• Runs on all logical nodes in a partitioned system
    Can be directed to run on specific nodes
• Can estimate row compression results for table,
  dictionary based on sample
              The Information Management Specialists
What about INSPECT?
• Granular: inspection can be on database,
  tablespace, or a table
• Results (unformatted) are written to the
  specified file (placed in diagnostic directory
  path). Use db2inspf to format results




              The Information Management Specialists
DB2DART vs. INSPECT
• INSPECT does not provide any of the formatting or
  repair options that db2dart provides
• Unlike DB2DART, INSPECT of a tablespace will only
  process objects that reside in that tablespace. It will
  not inspect:
     Corresponding index objects residing in a different
     tablespace
     LOB objects residing in a different tablespace
     Note: running DB2DART on an INDEX tablespace would
     not seek out the parent data

               The Information Management Specialists
DB2DART – Gotchas
• Security – user with authority to run the db2dart
  tool or with access to the db2dart output can
  gain access to information that they might not be
  authorized for
• LOAD – ALLOW READ ACCESS option not
  supported if indexes marked invalid



              The Information Management Specialists
Summary & Conclusions
• DB2DART is a very powerful tool
• Can be used by DBAs to deal with:
    Storage Reclamation
    Index Corruption
    Extracting Data
    Database backup pending state
• Increases productivity

              The Information Management Specialists

More Related Content

What's hot

Db2 V12 incompatibilities_&amp;_improvements_over_V11
Db2 V12 incompatibilities_&amp;_improvements_over_V11Db2 V12 incompatibilities_&amp;_improvements_over_V11
Db2 V12 incompatibilities_&amp;_improvements_over_V11
Abhishek Verma
 
DB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and OptimisationDB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
John Campbell
 
DB2 Accounting Reporting
DB2  Accounting ReportingDB2  Accounting Reporting
DB2 Accounting Reporting
John Campbell
 
DB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer ExperiencesDB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer Experiences
John Campbell
 
DB2UDB_the_Basics Day2
DB2UDB_the_Basics Day2DB2UDB_the_Basics Day2
DB2UDB_the_Basics Day2
Pranav Prakash
 
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
John Campbell
 
How should I monitor my idaa
How should I monitor my idaaHow should I monitor my idaa
How should I monitor my idaa
Cuneyt Goksu
 
Db2 for z os trends
Db2 for z os trendsDb2 for z os trends
Db2 for z os trends
Cuneyt Goksu
 
DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5
Pranav Prakash
 
Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013
Dale McInnis
 
IBM DB2 Analytics Accelerator Trends & Directions by Namik Hrle
IBM DB2 Analytics Accelerator  Trends & Directions by Namik Hrle IBM DB2 Analytics Accelerator  Trends & Directions by Namik Hrle
IBM DB2 Analytics Accelerator Trends & Directions by Namik Hrle
Surekha Parekh
 
Perfect trio : temporal tables, transparent archiving in db2 for z_os and idaa
Perfect trio : temporal tables, transparent archiving in db2 for z_os and idaaPerfect trio : temporal tables, transparent archiving in db2 for z_os and idaa
Perfect trio : temporal tables, transparent archiving in db2 for z_os and idaa
Cuneyt Goksu
 
D02 Evolution of the HADR tool
D02 Evolution of the HADR toolD02 Evolution of the HADR tool
D02 Evolution of the HADR tool
Jeyabarathi (JB) Chakrapani
 
DB2 for z/OS Real Storage Monitoring, Control and Planning
DB2 for z/OS Real Storage Monitoring, Control and PlanningDB2 for z/OS Real Storage Monitoring, Control and Planning
DB2 for z/OS Real Storage Monitoring, Control and Planning
John Campbell
 
Db2 analytics accelerator technical update
Db2 analytics accelerator  technical updateDb2 analytics accelerator  technical update
Db2 analytics accelerator technical update
Cuneyt Goksu
 
Db2 and storage management (mullins)
Db2 and storage management (mullins)Db2 and storage management (mullins)
Db2 and storage management (mullins)
Craig Mullins
 
DB2UDB_the_Basics Day 3
DB2UDB_the_Basics Day 3DB2UDB_the_Basics Day 3
DB2UDB_the_Basics Day 3
Pranav Prakash
 
DB2 LUW Access Plan Stability
DB2 LUW Access Plan StabilityDB2 LUW Access Plan Stability
DB2 LUW Access Plan Stability
dmcmichael
 
DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4
Pranav Prakash
 
Efficient Monitoring & Tuning of Dynamic SQL in DB2 for z/OS by Namik Hrle ...
Efficient Monitoring & Tuning of Dynamic SQL in DB2 for z/OS  by  Namik Hrle ...Efficient Monitoring & Tuning of Dynamic SQL in DB2 for z/OS  by  Namik Hrle ...
Efficient Monitoring & Tuning of Dynamic SQL in DB2 for z/OS by Namik Hrle ...
Surekha Parekh
 

What's hot (20)

Db2 V12 incompatibilities_&amp;_improvements_over_V11
Db2 V12 incompatibilities_&amp;_improvements_over_V11Db2 V12 incompatibilities_&amp;_improvements_over_V11
Db2 V12 incompatibilities_&amp;_improvements_over_V11
 
DB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and OptimisationDB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
 
DB2 Accounting Reporting
DB2  Accounting ReportingDB2  Accounting Reporting
DB2 Accounting Reporting
 
DB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer ExperiencesDB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer Experiences
 
DB2UDB_the_Basics Day2
DB2UDB_the_Basics Day2DB2UDB_the_Basics Day2
DB2UDB_the_Basics Day2
 
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
DB2 for z/OS Bufferpool Tuning win by Divide and Conquer or Lose by Multiply ...
 
How should I monitor my idaa
How should I monitor my idaaHow should I monitor my idaa
How should I monitor my idaa
 
Db2 for z os trends
Db2 for z os trendsDb2 for z os trends
Db2 for z os trends
 
DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5
 
Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013
 
IBM DB2 Analytics Accelerator Trends & Directions by Namik Hrle
IBM DB2 Analytics Accelerator  Trends & Directions by Namik Hrle IBM DB2 Analytics Accelerator  Trends & Directions by Namik Hrle
IBM DB2 Analytics Accelerator Trends & Directions by Namik Hrle
 
Perfect trio : temporal tables, transparent archiving in db2 for z_os and idaa
Perfect trio : temporal tables, transparent archiving in db2 for z_os and idaaPerfect trio : temporal tables, transparent archiving in db2 for z_os and idaa
Perfect trio : temporal tables, transparent archiving in db2 for z_os and idaa
 
D02 Evolution of the HADR tool
D02 Evolution of the HADR toolD02 Evolution of the HADR tool
D02 Evolution of the HADR tool
 
DB2 for z/OS Real Storage Monitoring, Control and Planning
DB2 for z/OS Real Storage Monitoring, Control and PlanningDB2 for z/OS Real Storage Monitoring, Control and Planning
DB2 for z/OS Real Storage Monitoring, Control and Planning
 
Db2 analytics accelerator technical update
Db2 analytics accelerator  technical updateDb2 analytics accelerator  technical update
Db2 analytics accelerator technical update
 
Db2 and storage management (mullins)
Db2 and storage management (mullins)Db2 and storage management (mullins)
Db2 and storage management (mullins)
 
DB2UDB_the_Basics Day 3
DB2UDB_the_Basics Day 3DB2UDB_the_Basics Day 3
DB2UDB_the_Basics Day 3
 
DB2 LUW Access Plan Stability
DB2 LUW Access Plan StabilityDB2 LUW Access Plan Stability
DB2 LUW Access Plan Stability
 
DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4
 
Efficient Monitoring & Tuning of Dynamic SQL in DB2 for z/OS by Namik Hrle ...
Efficient Monitoring & Tuning of Dynamic SQL in DB2 for z/OS  by  Namik Hrle ...Efficient Monitoring & Tuning of Dynamic SQL in DB2 for z/OS  by  Namik Hrle ...
Efficient Monitoring & Tuning of Dynamic SQL in DB2 for z/OS by Namik Hrle ...
 

Similar to DB2DART - DB2Night Show October 2011

DB2 and storage management
DB2 and storage managementDB2 and storage management
DB2 and storage management
Craig Mullins
 
DB2 and Storage Management
DB2 and Storage ManagementDB2 and Storage Management
DB2 and Storage Management
Craig Mullins
 
DB2 TABLESPACES
DB2 TABLESPACESDB2 TABLESPACES
DB2 TABLESPACES
Rahul Anand
 
Presentation db2 best practices for optimal performance
Presentation   db2 best practices for optimal performancePresentation   db2 best practices for optimal performance
Presentation db2 best practices for optimal performance
solarisyougood
 
Inside tempdb
Inside tempdbInside tempdb
Inside tempdb
Miroslav Dimitrov
 
Optimize TempDB
Optimize TempDB Optimize TempDB
Optimize TempDB
Ravish Ranjan
 
Presentation db2 best practices for optimal performance
Presentation   db2 best practices for optimal performancePresentation   db2 best practices for optimal performance
Presentation db2 best practices for optimal performance
xKinAnx
 
DB2 10 Webcast #1 Overview And Migration Planning
DB2 10 Webcast #1   Overview And Migration PlanningDB2 10 Webcast #1   Overview And Migration Planning
DB2 10 Webcast #1 Overview And Migration Planning
Carol Davis-Mann
 
DB2 10 Webcast #1 - Overview And Migration Planning
DB2 10 Webcast #1 - Overview And Migration PlanningDB2 10 Webcast #1 - Overview And Migration Planning
DB2 10 Webcast #1 - Overview And Migration Planning
Laura Hood
 
Tempdb, More permanent than you think
Tempdb, More permanent than you thinkTempdb, More permanent than you think
Tempdb, More permanent than you think
Paresh Motiwala, PMP®
 
#DNUG45 - IBM Notes and Domino Performance Boost - Reloaded
 #DNUG45 - IBM Notes and Domino Performance Boost - Reloaded #DNUG45 - IBM Notes and Domino Performance Boost - Reloaded
#DNUG45 - IBM Notes and Domino Performance Boost - Reloaded
Christoph Adler
 

Similar to DB2DART - DB2Night Show October 2011 (11)

DB2 and storage management
DB2 and storage managementDB2 and storage management
DB2 and storage management
 
DB2 and Storage Management
DB2 and Storage ManagementDB2 and Storage Management
DB2 and Storage Management
 
DB2 TABLESPACES
DB2 TABLESPACESDB2 TABLESPACES
DB2 TABLESPACES
 
Presentation db2 best practices for optimal performance
Presentation   db2 best practices for optimal performancePresentation   db2 best practices for optimal performance
Presentation db2 best practices for optimal performance
 
Inside tempdb
Inside tempdbInside tempdb
Inside tempdb
 
Optimize TempDB
Optimize TempDB Optimize TempDB
Optimize TempDB
 
Presentation db2 best practices for optimal performance
Presentation   db2 best practices for optimal performancePresentation   db2 best practices for optimal performance
Presentation db2 best practices for optimal performance
 
DB2 10 Webcast #1 Overview And Migration Planning
DB2 10 Webcast #1   Overview And Migration PlanningDB2 10 Webcast #1   Overview And Migration Planning
DB2 10 Webcast #1 Overview And Migration Planning
 
DB2 10 Webcast #1 - Overview And Migration Planning
DB2 10 Webcast #1 - Overview And Migration PlanningDB2 10 Webcast #1 - Overview And Migration Planning
DB2 10 Webcast #1 - Overview And Migration Planning
 
Tempdb, More permanent than you think
Tempdb, More permanent than you thinkTempdb, More permanent than you think
Tempdb, More permanent than you think
 
#DNUG45 - IBM Notes and Domino Performance Boost - Reloaded
 #DNUG45 - IBM Notes and Domino Performance Boost - Reloaded #DNUG45 - IBM Notes and Domino Performance Boost - Reloaded
#DNUG45 - IBM Notes and Domino Performance Boost - Reloaded
 

More from Laura Hood

Top 10 DB2 Support Nightmares #10
Top 10 DB2 Support Nightmares  #10Top 10 DB2 Support Nightmares  #10
Top 10 DB2 Support Nightmares #10
Laura Hood
 
Top 10 DB2 Support Nightmares #9
Top 10 DB2 Support Nightmares  #9Top 10 DB2 Support Nightmares  #9
Top 10 DB2 Support Nightmares #9
Laura Hood
 
Top 10 DB2 Support Nightmares #8
Top 10 DB2 Support Nightmares  #8Top 10 DB2 Support Nightmares  #8
Top 10 DB2 Support Nightmares #8
Laura Hood
 
Top 10 DB2 Support Nightmares #7
Top 10 DB2 Support Nightmares  #7 Top 10 DB2 Support Nightmares  #7
Top 10 DB2 Support Nightmares #7
Laura Hood
 
Top 10 db2 support nightmares #6
Top 10 db2 support nightmares #6Top 10 db2 support nightmares #6
Top 10 db2 support nightmares #6
Laura Hood
 
Consultancy on Demand - Infographic
Consultancy on Demand - InfographicConsultancy on Demand - Infographic
Consultancy on Demand - Infographic
Laura Hood
 
A Time Traveller's Guide to DB2: Technology Themes for 2014 and Beyond
A Time Traveller's Guide to DB2: Technology Themes for 2014 and BeyondA Time Traveller's Guide to DB2: Technology Themes for 2014 and Beyond
A Time Traveller's Guide to DB2: Technology Themes for 2014 and Beyond
Laura Hood
 
Top 10 DB2 Support Nightmares #1
Top 10 DB2 Support Nightmares  #1Top 10 DB2 Support Nightmares  #1
Top 10 DB2 Support Nightmares #1
Laura Hood
 
Db2 10 memory management uk db2 user group june 2013 [read-only]
Db2 10 memory management   uk db2 user group june 2013 [read-only]Db2 10 memory management   uk db2 user group june 2013 [read-only]
Db2 10 memory management uk db2 user group june 2013 [read-only]
Laura Hood
 
DB2 10 Security Enhancements
DB2 10 Security EnhancementsDB2 10 Security Enhancements
DB2 10 Security Enhancements
Laura Hood
 
DbB 10 Webcast #3 The Secrets Of Scalability
DbB 10 Webcast #3   The Secrets Of ScalabilityDbB 10 Webcast #3   The Secrets Of Scalability
DbB 10 Webcast #3 The Secrets Of Scalability
Laura Hood
 
DB2 10 Webcast #2 - Justifying The Upgrade
DB2 10 Webcast #2  - Justifying The UpgradeDB2 10 Webcast #2  - Justifying The Upgrade
DB2 10 Webcast #2 - Justifying The Upgrade
Laura Hood
 
Time Travelling With DB2 10 For zOS
Time Travelling With DB2 10 For zOSTime Travelling With DB2 10 For zOS
Time Travelling With DB2 10 For zOS
Laura Hood
 
DB2 z/OS &amp; Java - What\'s New?
DB2 z/OS &amp; Java - What\'s New?DB2 z/OS &amp; Java - What\'s New?
DB2 z/OS &amp; Java - What\'s New?
Laura Hood
 
Temporal And Other DB2 10 For Z Os Highlights
Temporal And Other DB2 10 For Z Os HighlightsTemporal And Other DB2 10 For Z Os Highlights
Temporal And Other DB2 10 For Z Os Highlights
Laura Hood
 
DB210 Smarter Database IBM Tech Forum 2011
DB210 Smarter Database   IBM Tech Forum 2011DB210 Smarter Database   IBM Tech Forum 2011
DB210 Smarter Database IBM Tech Forum 2011
Laura Hood
 
UKGSE DB2 pureScale
UKGSE DB2 pureScaleUKGSE DB2 pureScale
UKGSE DB2 pureScale
Laura Hood
 
UKCMG DB2 pureScale
UKCMG DB2 pureScaleUKCMG DB2 pureScale
UKCMG DB2 pureScale
Laura Hood
 
Episode 4 DB2 pureScale Performance Webinar Oct 2010
Episode 4 DB2 pureScale Performance Webinar Oct 2010Episode 4 DB2 pureScale Performance Webinar Oct 2010
Episode 4 DB2 pureScale Performance Webinar Oct 2010
Laura Hood
 
Episode 3 DB2 pureScale Availability And Recovery [Read Only] [Compatibility...
Episode 3  DB2 pureScale Availability And Recovery [Read Only] [Compatibility...Episode 3  DB2 pureScale Availability And Recovery [Read Only] [Compatibility...
Episode 3 DB2 pureScale Availability And Recovery [Read Only] [Compatibility...
Laura Hood
 

More from Laura Hood (20)

Top 10 DB2 Support Nightmares #10
Top 10 DB2 Support Nightmares  #10Top 10 DB2 Support Nightmares  #10
Top 10 DB2 Support Nightmares #10
 
Top 10 DB2 Support Nightmares #9
Top 10 DB2 Support Nightmares  #9Top 10 DB2 Support Nightmares  #9
Top 10 DB2 Support Nightmares #9
 
Top 10 DB2 Support Nightmares #8
Top 10 DB2 Support Nightmares  #8Top 10 DB2 Support Nightmares  #8
Top 10 DB2 Support Nightmares #8
 
Top 10 DB2 Support Nightmares #7
Top 10 DB2 Support Nightmares  #7 Top 10 DB2 Support Nightmares  #7
Top 10 DB2 Support Nightmares #7
 
Top 10 db2 support nightmares #6
Top 10 db2 support nightmares #6Top 10 db2 support nightmares #6
Top 10 db2 support nightmares #6
 
Consultancy on Demand - Infographic
Consultancy on Demand - InfographicConsultancy on Demand - Infographic
Consultancy on Demand - Infographic
 
A Time Traveller's Guide to DB2: Technology Themes for 2014 and Beyond
A Time Traveller's Guide to DB2: Technology Themes for 2014 and BeyondA Time Traveller's Guide to DB2: Technology Themes for 2014 and Beyond
A Time Traveller's Guide to DB2: Technology Themes for 2014 and Beyond
 
Top 10 DB2 Support Nightmares #1
Top 10 DB2 Support Nightmares  #1Top 10 DB2 Support Nightmares  #1
Top 10 DB2 Support Nightmares #1
 
Db2 10 memory management uk db2 user group june 2013 [read-only]
Db2 10 memory management   uk db2 user group june 2013 [read-only]Db2 10 memory management   uk db2 user group june 2013 [read-only]
Db2 10 memory management uk db2 user group june 2013 [read-only]
 
DB2 10 Security Enhancements
DB2 10 Security EnhancementsDB2 10 Security Enhancements
DB2 10 Security Enhancements
 
DbB 10 Webcast #3 The Secrets Of Scalability
DbB 10 Webcast #3   The Secrets Of ScalabilityDbB 10 Webcast #3   The Secrets Of Scalability
DbB 10 Webcast #3 The Secrets Of Scalability
 
DB2 10 Webcast #2 - Justifying The Upgrade
DB2 10 Webcast #2  - Justifying The UpgradeDB2 10 Webcast #2  - Justifying The Upgrade
DB2 10 Webcast #2 - Justifying The Upgrade
 
Time Travelling With DB2 10 For zOS
Time Travelling With DB2 10 For zOSTime Travelling With DB2 10 For zOS
Time Travelling With DB2 10 For zOS
 
DB2 z/OS &amp; Java - What\'s New?
DB2 z/OS &amp; Java - What\'s New?DB2 z/OS &amp; Java - What\'s New?
DB2 z/OS &amp; Java - What\'s New?
 
Temporal And Other DB2 10 For Z Os Highlights
Temporal And Other DB2 10 For Z Os HighlightsTemporal And Other DB2 10 For Z Os Highlights
Temporal And Other DB2 10 For Z Os Highlights
 
DB210 Smarter Database IBM Tech Forum 2011
DB210 Smarter Database   IBM Tech Forum 2011DB210 Smarter Database   IBM Tech Forum 2011
DB210 Smarter Database IBM Tech Forum 2011
 
UKGSE DB2 pureScale
UKGSE DB2 pureScaleUKGSE DB2 pureScale
UKGSE DB2 pureScale
 
UKCMG DB2 pureScale
UKCMG DB2 pureScaleUKCMG DB2 pureScale
UKCMG DB2 pureScale
 
Episode 4 DB2 pureScale Performance Webinar Oct 2010
Episode 4 DB2 pureScale Performance Webinar Oct 2010Episode 4 DB2 pureScale Performance Webinar Oct 2010
Episode 4 DB2 pureScale Performance Webinar Oct 2010
 
Episode 3 DB2 pureScale Availability And Recovery [Read Only] [Compatibility...
Episode 3  DB2 pureScale Availability And Recovery [Read Only] [Compatibility...Episode 3  DB2 pureScale Availability And Recovery [Read Only] [Compatibility...
Episode 3 DB2 pureScale Availability And Recovery [Read Only] [Compatibility...
 

DB2DART - DB2Night Show October 2011

  • 1. DB2DART DART Iqbal Goralwalla DB2Night Show October 14, 2011 The Information Management Specialists
  • 2. About Triton • Formed in 1996 • IBM Premier Business Partner • Largest independent DB2 Consultancy in the UK • Strong team of highly experienced and certified DB2 specialists • Work with customers across a range of sectors providing them with DB2 consultancy and support for both DB2 LUW and DB2 z/OS • Preferred DB2 services supplier to IBM UK and others The Information Management Specialists
  • 3. About Me • Head of Midrange (DB2 on LUW) at Triton Consulting • Principal Consultant on DB2 LUW • Experience of DB2 LUW since DB2 Common Server • IBM Champion for Data Management • Tendency to talk too much The Information Management Specialists
  • 4. DB2DART • DB2DART – An Overview • My 3 Key DB2DARTs • My bonus DB2DART • Anything on DB2DART and DPF? • What about INSPECT? • GOTCHAS The Information Management Specialists
  • 5. DB2DART – An Overview db2top • One of the less used db2pd performance reporting db2exfmt tools db2diag • Historically used with db2support IBM support db2trc • DBAs can use the tool – db2dart increases productivity Why am I here? The Information Management Specialists
  • 6. DB2DART – An Overview • Database Analysis and Reporting Tool • “Offline” tool for checking the architectural correctness of a database Checks validity of meta-data structures, page headers, row headers, etc. • Critical for investigating problems involving data corruption • Runs against the data on disk Not aware of what’s in the buffer pool May show false errors if users are connected to the database The Information Management Specialists
  • 7. DB2DART – An Overview • Granularity Database: db2dart <db> /DB Tablespace: db2dart <db> /TS Table: db2dart <db> /T /TSI /OI • Options for inspecting, formatting, and repairing data • Run db2dart /H to see all of the supported options The Information Management Specialists
  • 8. DB2DART – Inspecting data Examples: db2dart <db> /DB db2dart <db> /TS /TSI 2 db2dart <db> /T /TSI 2 /OI 6 The Information Management Specialists
  • 9. DB2DART – Formatting data Example: db2dart <db> /DD /TSI 2 /OI 6 The Information Management Specialists
  • 10. DB2DART – Repairing data The Information Management Specialists
  • 11. DB2DART – My 3 Key DB2DARTs DARTs 1. Storage Reclamation and High Water Mark 2. Index Corruption 3. Extracting Data The Information Management Specialists
  • 12. Storage Reclamation – the DBA dilemma Why is the space not being Deleted thousands of released? rows Dropped a BIG table Reorged the table The Information Management Specialists
  • 13. Storage Reclamation – HWM for DMS tablespaces • High Water Mark (HWM) is the highest numbered page that is currently allocated in a DMS tablespace • HWM can be much higher than the number of pages currently in use due to: Dropped tables or delete activity Offline table reorg using same tablespace Index reorg using “allow read or write access” • Makes it difficult to release unused disk space for reuse • HWM can be seen using LIST TABLESPACES SHOW DETAIL or GET SNAPSHOT FOR TABLESPACES The Information Management Specialists
  • 14. Storage Reclamation – HWM for DMS tablespaces • LIST TABLESPACES SHOW DETAIL The Information Management Specialists
  • 15. HWM – Dropped table (1) DMS TABLESPACE DMS TABLESPACE T1 T1 5 pages 5 pages Drop table T2 T2 Free 3 pages 3 pages T1 T1 2 pages 2 pages Table Space HWM Used pages = 10 Used pages = 8 does NOT change HWM = 10 HWM = 10 The Information Management Specialists
  • 16. HWM – Dropped table (2) DMS TABLESPACE DMS TABLESPACE T1 Free 5 pages 5 pages Drop table T1 T2 T2 3 pages 3 pages T1 Free 2 pages 2 pages Table Space HWM Used pages = 10 Used pages = 3 DOES change HWM = 10 HWM = 8 The Information Management Specialists
  • 17. HWM – Offline Table Reorg (1) REORG TABLE T1 DMS TABLESPACE INTERMEDIATE STATE DMS TABLESPACE T1 T1 Free 5 pages 7 pages T1 Free T1 4 pages Shadow 6 pages Copy Used pages = 5 Used pages = 4 HWM = 5 Table Space HWM HWM = 11 INCREASES The Information Management Specialists
  • 18. HWM – Offline Table Reorg (2) REORG TABLE T1 DMS TABLESPACE INTERMEDIATE STATE DMS TABLESPACE T1 Free Shadow T1 7 pages Copy 4 pages Free T1 T1 7 pages 4 pages Used pages = 4 Used pages = 4 HWM = 11 Table Space HWM HWM = 4 DECREASES The Information Management Specialists
  • 19. HWM headaches • Space not released even though free extents available • Redirected RESTORE needs space equal to or greater than the HWM All extents in DMS table spaces up to the HWM copied to the backup image. Tablespaces containers cannot be reduced below HWM • ALTER TABLESPACE <drop container/reduce containers size> only affects extents above the HWM The Information Management Specialists
  • 20. Storage Reclamation – the DBA dilemma (DB2 9.1/9.5) Shall I call IBM DB2DART Support? Not when I’m around! The Information Management Specialists
  • 21. Storage Reclamation – DB2DART 1 DART • db2dart /DHWM – display table space and high- water mark information A map of the extents in the table space, showing objects owning them The ID and type of the object holding the high-water mark extent Amount of free extents and in-use extents below the high-water mark TIP: If online, use db2pdcfg –flushbp first (V9.1FP5, V9.5FP1) The Information Management Specialists
  • 22. db2dart /DHWM LIST TABLESPACES SHOW DETAIL The Information Management Specialists
  • 23. db2dart /DHWM – Drop table ID 5 LIST TABLESPACES SHOW DETAIL The Information Management Specialists
  • 24. Storage Reclamation – DB2DART • db2dart /LHWM – Assists in lowering the high-water mark Table space ID and desired high-water mark are required May not be possible to actually lower it to the desired level Use "0" for the desired high-water mark to go as low as possible Result is a list of operations to execute (EXPORT/LOAD, REORG, etc.) Estimate of resulting in use and free extents below the high-water mark is displayed for each step The Information Management Specialists
  • 25. db2dart /LHWM The Information Management Specialists
  • 26. db2dart /LHWM – after REORG The Information Management Specialists
  • 27. Storage Reclamation – DB2DART • db2dart /RHWM – Removes empty SMP extents holding up the high-water mark DB2 9.5 – ALTER TABLESPACE <tbsp> REDUCE/DROP ► Drops/reduces containers to the table space’s high- water mark ► First removes empty SMP extents ► No need for db2dart /RHWM The Information Management Specialists
  • 28. Storage Reclamation – DB2DART enhancements • V9.1 FP4 – db2dart /DHWM and /LHWM can be run against active/inconsistent database IZ04647 http://www- 01.ibm.com/support/docview.wss?uid=swg1IZ04647 • V9.1 FP5 – db2dart /DHWM is not correct when an empty SMP extent is holding the HWM IZ07663 http://www- 01.ibm.com/support/docview.wss?uid=swg1IZ07663 The Information Management Specialists
  • 29. Storage Reclamation – DB2 9.7 • For a DMS or Automatic Storage table space created in DB2 9.7, you can use reclaimable storage to return unused storage to the system for reuse. • For Automatic Storage table spaces, the REDUCE MAX option of ALTER TABLESPACE can be used to release all unused spaced • For DMS, two steps are required to release the unused extents The High Water can be reduced to match the number of used extents with the LOWER HIGH WATER MARK option The REDUCE, RESIZE or DROP options then be used • Reclaiming storage is an online operation The Information Management Specialists
  • 30. Index Corruption • Possible causes Hardware or software failure Killing an executing process (e.g., LOAD) After migration from one system to another • Symptoms Bad page errors SQL0980C during a backup database command SQL0902C – database marked bad The Information Management Specialists
  • 31. Index Corruption – the DBA dilemma Restore from backup? Shall I call IBM Support? DB2DART Not when I’m around! The Information Management Specialists
  • 32. Index Corruption – DB2DART 2 DART • Find out which indexes are problematic db2dart <db> /DD /TSI <pool id> /OI <object id> db2dart <db> /DI /TSI <pool id> /OI <object id> • Mark indexes as invalid db2dart <db> /MI /TSI <pool id> /OI <object id> • Indexes recreated based on INDEXREC (database configuration parameter) ► RESTART ► ACCCESS ► Monitor using db2diag.log The Information Management Specialists
  • 33. Index Corruption – DB2DART • Indexes recreated: First access of invalid index RESTART DATABASE LOAD – Build phase Classic offline table reorg • To prevent access to problematic index LOCK TABLE IN EXCLUSIVE MODE The Information Management Specialists
  • 34. Index Corruption – DB2DART – Partitioned tables/indexes • db2dart /MI requires table space ID and index object ID. For partitioned indexes, use INDPARTITIONOBJECTID and INDPARTITIONTBSPACEID from SYSCAT.INDEXPARTITIONS. The Information Management Specialists
  • 35. Extracting Data • Table space or database is corrupt or inaccessible • Access to “bad/damaged” data causes an instance crash • Need to salvage data Cannot use SQL to select data Cannot use Export Restore from backup image ► Does one exist? ► Circular logging? The Information Management Specialists
  • 36. Extracting Data – the DBA dilemma Shall I call IBM DB2DART Support? Not when I’m around! The Information Management Specialists
  • 37. Extracting Data – DB2 DART 3 • db2dart <db> /DDEL • Dumped in delimited ASCII format • Prompted for table name (or ID), table space ID, starting page, number of pages, and output file name • LONG VARCHAR or LOB data will not be dumped The Information Management Specialists
  • 38. Extracting Data – DB2DART • May require multiple invocations Dump up to “bad/damaged” page using /DDEL option ► Aborts on reaching corruption Dump “bad/damaged” page using /DD option ► Incorrupt data can be viewed Dump rest of pages after “bad/damaged” page using /DDEL option and appropriate start page • Some data loss inevitable The Information Management Specialists
  • 39. Backup Pending State (aka “Forced backup”) • LOAD with COPY NO (default) • Logging strategy changed (circular to archival) • LOGARCHIVE enabled • LOGFILSIZ changed while using raw device for logging The Information Management Specialists
  • 40. Backup Pending State – the DBA dilemma Do I really need DB2DART to do a backup? Not when I’m around! The Information Management Specialists
  • 41. Backup Pending State – bonus DB2DART DART • db2dart <db> /CHST /WHAT DBBP OFF The Information Management Specialists
  • 42. DB2DART – Does it work with DPF? • Yes! • Run db2dart on desired partition or on all partitions • Use db2_all to run db2dart on all partitions in a single invocation • Default destination of report file is in diagnostic directory The Information Management Specialists
  • 43. DB2DART – IBM service options • /ETS – extends the table limit in a 4 KB table space (DMS only), if possible • /MT – marks table with drop-pending state Needs password – supplied by IBM • /IP – initializes the data page of a table as empty Needs password – supplied by IBM The Information Management Specialists
  • 44. What about INSPECT? • Online “equivalent” of DB2DART • Integrated into runtime engine resulting in performance gains Makes use of prefetchers and buffer pools • Runs on all logical nodes in a partitioned system Can be directed to run on specific nodes • Can estimate row compression results for table, dictionary based on sample The Information Management Specialists
  • 45. What about INSPECT? • Granular: inspection can be on database, tablespace, or a table • Results (unformatted) are written to the specified file (placed in diagnostic directory path). Use db2inspf to format results The Information Management Specialists
  • 46. DB2DART vs. INSPECT • INSPECT does not provide any of the formatting or repair options that db2dart provides • Unlike DB2DART, INSPECT of a tablespace will only process objects that reside in that tablespace. It will not inspect: Corresponding index objects residing in a different tablespace LOB objects residing in a different tablespace Note: running DB2DART on an INDEX tablespace would not seek out the parent data The Information Management Specialists
  • 47. DB2DART – Gotchas • Security – user with authority to run the db2dart tool or with access to the db2dart output can gain access to information that they might not be authorized for • LOAD – ALLOW READ ACCESS option not supported if indexes marked invalid The Information Management Specialists
  • 48. Summary & Conclusions • DB2DART is a very powerful tool • Can be used by DBAs to deal with: Storage Reclamation Index Corruption Extracting Data Database backup pending state • Increases productivity The Information Management Specialists