SlideShare a Scribd company logo
Revamp the Tablespace REORG process
with IBM DB2 Automation Tool for z/OS
Bharath Nunepalli
Senior Database Administrator
Hospital Corporation of America
Session Code: A09
8 AM, 05/03/2017 | Platform: DB2 for z/OS
Contents
• HCA Inc. – Some details about us
• Our ERP Environment
• Why we need to change our REORG strategy?
• Previous Tablespace REORG setup
• Issues with previous Tablespace REORG setup
• Requirements for new Tablespace REORG setup
• How we changed our REORG strategy?
2
3
HCA Inc. – Some details about us:
- 250 Hospitals & surgery centers
- Ranked 63rd in Fortune 500.
- 233,000 employees
37,000 active physicians
79,000 nurses
5,000 IT employees
- 26 million patient encounters
8.1 million emergency visits per year
4
ERP
System
Financials
Customer
Relations
Supply
Chain
Resource
Planning
Human
Resource
ERP Environment:
- 120+ DBs supporting
ERP package.
In Prod:
- 1000+ Tablespaces
- 2,800 Tables & 7,500
IX per DB
- Largest table has 1.5+
billion rows and 7
Indexes.
Previous Tablespace REORG setup
Basic approach of executing REORGs for Tablespaces on
monthly basis.
5
Issues/limitations with previous Tablespace
REORG setup
1. REORG process for all (1000+) Tablespaces ran long (more than
8 hours sometimes, if no errors).
2. REORG not needed for all TS every time.
3. Using only 2 parameters to decide whether REORG is needed or
not.
OFFPOSLIMIT
INDREFLIMIT
Requirements for new strategy
1. Shorten overall REORG execution time.
2. More parameters to decide the need for REORG for a TS.
6
DB2 Automation Tool for z/OS v4.2
Phase 1: Create Object Profile
Phase 2: Create Utility Profile
Phase 3: Create Exception Profile
Phase 4: Create Job Profile
Phase 5: Build REORG JCLs
7
Phase 1: Create Object Profile
8
Option 1 to add
Objects to a Profile
9
Option 2 to add
Objects to a Profile
Phase 2: Create Utility Profile
10
11
12
13
14
Revamp the tablespace reorg process with ibm db2 automation tool
Phase 3: Create Exception Profile
16
Exception criteria
17
AND/
OR
Statistics
Type
Column Cond
Exception
Value
Comments
OR
REALTIME
REORG TS
INS_UPD_DEL_PCT > 30
The number of inserts, updates, and deletes as a
percentage of the total number of rows
RELOCATED_ROWS_PCT > 20
Total number of relocated rows as a percentage of
the total
number of rows
AND
REALTIME
REORG TS
UNCLUST_INS_PCT > 15
The number of inserted rows placed greater than 16
pages away from target page, as a percentage of the
total number of rows
CLUSTERSENS > 1000000
The number of times data has been read by SQL
sensitive to clustering sequence of data since last
REORG or LOAD REPLACE
OR
MVS
CATALOG
PERCENT_USED > 90
The percentage of space used for each individual
object partition
OR
DB2
DISPLAY
STATUS
STATUS_AREOR = YES
The object is in the advisory REORG-pending status
and needs reorganization to apply pending
definition changes
STATUS_AREO* = YES The object is in the advisory REORG-pending status
Phase 4: Create Job Profile
18
19
20
Combination not allowed.
One of these fields must be 0
and the other field greater
than zero.
With ‘Y’, dummy jobs will
be generated. Helpful to
maintain the consistent
job count.
21
22
Phase 5: Build REORG JCLs
23
24
25
Special Thanks to
John Casey (Tech Sales Specialist)
Richard Schaufuss (DB2 for z/OS Tools Advocate)
26
27
Questions
Bharath Nunepalli
Senior Database Administrator
Hospital Corporation of America
Bharath.nunepalli@hcahealthcare.com
bharathstechblog.blogspot.com
A09
Revamp the Tablespace REORG process with IBM DB2 Automation Tool for z/OS
Please fill out your session
evaluation before leaving!

More Related Content

Revamp the tablespace reorg process with ibm db2 automation tool

  • 1. Revamp the Tablespace REORG process with IBM DB2 Automation Tool for z/OS Bharath Nunepalli Senior Database Administrator Hospital Corporation of America Session Code: A09 8 AM, 05/03/2017 | Platform: DB2 for z/OS
  • 2. Contents • HCA Inc. – Some details about us • Our ERP Environment • Why we need to change our REORG strategy? • Previous Tablespace REORG setup • Issues with previous Tablespace REORG setup • Requirements for new Tablespace REORG setup • How we changed our REORG strategy? 2
  • 3. 3 HCA Inc. – Some details about us: - 250 Hospitals & surgery centers - Ranked 63rd in Fortune 500. - 233,000 employees 37,000 active physicians 79,000 nurses 5,000 IT employees - 26 million patient encounters 8.1 million emergency visits per year
  • 4. 4 ERP System Financials Customer Relations Supply Chain Resource Planning Human Resource ERP Environment: - 120+ DBs supporting ERP package. In Prod: - 1000+ Tablespaces - 2,800 Tables & 7,500 IX per DB - Largest table has 1.5+ billion rows and 7 Indexes.
  • 5. Previous Tablespace REORG setup Basic approach of executing REORGs for Tablespaces on monthly basis. 5
  • 6. Issues/limitations with previous Tablespace REORG setup 1. REORG process for all (1000+) Tablespaces ran long (more than 8 hours sometimes, if no errors). 2. REORG not needed for all TS every time. 3. Using only 2 parameters to decide whether REORG is needed or not. OFFPOSLIMIT INDREFLIMIT Requirements for new strategy 1. Shorten overall REORG execution time. 2. More parameters to decide the need for REORG for a TS. 6
  • 7. DB2 Automation Tool for z/OS v4.2 Phase 1: Create Object Profile Phase 2: Create Utility Profile Phase 3: Create Exception Profile Phase 4: Create Job Profile Phase 5: Build REORG JCLs 7
  • 8. Phase 1: Create Object Profile 8 Option 1 to add Objects to a Profile
  • 9. 9 Option 2 to add Objects to a Profile
  • 10. Phase 2: Create Utility Profile 10
  • 11. 11
  • 12. 12
  • 13. 13
  • 14. 14
  • 16. Phase 3: Create Exception Profile 16
  • 17. Exception criteria 17 AND/ OR Statistics Type Column Cond Exception Value Comments OR REALTIME REORG TS INS_UPD_DEL_PCT > 30 The number of inserts, updates, and deletes as a percentage of the total number of rows RELOCATED_ROWS_PCT > 20 Total number of relocated rows as a percentage of the total number of rows AND REALTIME REORG TS UNCLUST_INS_PCT > 15 The number of inserted rows placed greater than 16 pages away from target page, as a percentage of the total number of rows CLUSTERSENS > 1000000 The number of times data has been read by SQL sensitive to clustering sequence of data since last REORG or LOAD REPLACE OR MVS CATALOG PERCENT_USED > 90 The percentage of space used for each individual object partition OR DB2 DISPLAY STATUS STATUS_AREOR = YES The object is in the advisory REORG-pending status and needs reorganization to apply pending definition changes STATUS_AREO* = YES The object is in the advisory REORG-pending status
  • 18. Phase 4: Create Job Profile 18
  • 19. 19
  • 20. 20 Combination not allowed. One of these fields must be 0 and the other field greater than zero. With ‘Y’, dummy jobs will be generated. Helpful to maintain the consistent job count.
  • 21. 21
  • 22. 22
  • 23. Phase 5: Build REORG JCLs 23
  • 24. 24
  • 25. 25
  • 26. Special Thanks to John Casey (Tech Sales Specialist) Richard Schaufuss (DB2 for z/OS Tools Advocate) 26
  • 28. Bharath Nunepalli Senior Database Administrator Hospital Corporation of America [email protected] bharathstechblog.blogspot.com A09 Revamp the Tablespace REORG process with IBM DB2 Automation Tool for z/OS Please fill out your session evaluation before leaving!