Your SlideShare is downloading. ×
Developing and Deploying Reliable DB2 Applications
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Developing and Deploying Reliable DB2 Applications

219

Published on

SoftBase is committed to driving a better DB2 development experience. Combining decades of DB2 expertise, innovative testing and DB2 performance-tuning tools and an unmatched customer support and …

SoftBase is committed to driving a better DB2 development experience. Combining decades of DB2 expertise, innovative testing and DB2 performance-tuning tools and an unmatched customer support and service team, SoftBase helps application developers and DB2 administrators deliver more reliable DB2 applications and create higher performing DB2 software.

Visit www.softbase.com/products_overview.php for more information!

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
219
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • In this scenario, two applications have become deadlocked. The hr monthly application begins updating the project table, prior to updating the employee table, which is being updated by hr daily. When hr monthly attempts to update the employee table, it must wait for hr daily to finish. While hr monthly waits, it keeps the project table locked.Hr daily then attempts to update the project table, which is of course still locked by hr monthly. The monthly application has deadlocked the daily application. Normally in this situation, only the daily application would receive a 911 sequel code, and neither application would receive a message. To understand why this deadlock occurred, a DBA would have to spend considerable time searching DB2 logs and other data sources. Deadlock advisor saves time by placing an easy to understand, English like message in the joblog of both applications.
  • The offended application, hr daily, receives a message identifying the offending application, or the application that caused the deadlock. In this case, the offending application is hr monthly.
  • The offended application, hr daily, receives a message identifying the offending application, or the application that caused the deadlock. In this case, the offending application is hr monthly.
  • The offending application also receives a message, identifying the application that it deadlocked.
  • The offending application also receives a message, identifying the application that it deadlocked.
  • The offending application also receives a message, identifying the application that it deadlocked.
  • The offending application also receives a message, identifying the application that it deadlocked.
  • The offending application also receives a message, identifying the application that it deadlocked.
  • Your most expensive batch job will be at the top of the list of all jobs that ran in the past 24 hour interval.SELECT that job.
  • Your most expensive Step of the batch job you selected will be at the top of the list.SELECT that Step.
  • Transcript

    • 1. Developing and DeployingReliable Applications
    • 2. 20 Fall Pippin Lane, Suite 202Asheville, NC USA 28803sales@softbase.comsupport@softbase.com800-669-7076Development SalesJim Spires (jspires@softbase.com) Scott Garrett (sgarrett@softbase.com)Neal Lozins (nlozins@softbase.com) Dean Blair (dblair@softbase.com)Chip Scardo (cscardo@softbase.com)Mike Arnold (ma@softbase.com)
    • 3. Who we helpFocused on helping application developers and DBAs eliminateperformance and reliability problems with DB2 for z/OS applicationsApplication Developers and DBAs typically need help duringthree stages of development:  Coding  Testing  DeploymentToday’s environment has created new challenges fordevelopers and DBAs  Living with reduced resources and timeframes  Developing apps that meet both user requirements and batch windows  Meeting increasing user demands  Dealing with increased privacy regulations
    • 4. How we help Code DB2 for z/OS SQL statements to workCode properly and perform optimally Test all DB2 applicationsTest as quickly and thoroughly as possible Deploy DB2 applications without painful performance orDeploy application surprises (or 2:00 am phone call surprises)
    • 5. ProductsBatch HealthCare DeadLock Advisor Attach Checkpoint Batch AnalyzerTestBase DB2 Database Population DB2 Data Edit DB2 Slice & CompareDBIQSoftDate
    • 6. DB2 Application Lifecycle CODE TEST DEPLOY DB2 Development Bottlenecks TestBase Slice SoftDate DB/IQ-QA Batch Healthcare
    • 7. Business FocusSoftBase focuses on: Programmer Performance Ease of Implementation Ease of Use Real-Time Support
    • 8. Deploy
    • 9. Batch HealthCare
    • 10. Batch HealthCareSoftBase DeadLock Advisor Real-Time Instantly Available to the Programmer Easy to Use
    • 11. SoftBase DeadLock AdvisorDeadLock Advisor Identify the source of deadlock timeouts and resource unavailable conditions Present deadlock information on the offending and offended batch jobs log Programmers can quickly identify the cause of deadlocks by examining the job log of the affected application No need to search DB2 Syslog output
    • 12. SoftBase DeadLock AdvisorDeadlock Situation HRMNTHLY HRDAILY Application Application EMP_PROJ EMPLOYEE Update Update Table Table EMP_PROJ EMPLOYEE Locked Locked Update by HRM by HRD EMPLOYEE Update EMP_PROJ Wait for HRDAILY Deadlock Code -911
    • 13. SoftBase DeadLock AdvisorDB2 MSTRDSNT375I -DB8G PLAN=HRDAILY WITH CORRELATION-ID=HRDAILY CONNECTION-ID=BATCH LUW-ID=USASDV02.LINK8.C60928D8323F=129 THREAD-INFO=CSB4:*:*:* IS DEADLOCKED WITH PLAN=HRMNTHLY WITH CORRELATION-ID=HRMNTHLY CONNECTION-ID=BATCH LUW-ID=USASDV02.LINK8.C60928D27151=128 THREAD-INFO=CSB4:*:*:* ON MEMBER DB8GDSNT501I -DB8G DSNILMCL RESOURCE UNAVAILABLE CORRELATION-ID=HRDAILY CONNECTION-ID=BATCH LUW-ID=USASDV02.LINK8.C60928D8323F=129 REASON 00C90088 TYPE 00000302 NAME DGFDB008.DGFTS081.X00007A Deadlock
    • 14. SoftBase DeadLock AdvisorHRDAILYSBST375I SOFTBASE DeadLock Advisor************************************************************************ Job: HRDAILY. DB2 Subsystem DB8G. Plan HRDAILY is deadlocked by ** HRMNTHLY (BATCH). Deadlocking plan is HRMNTHLY. ** This job (HRDAILY)will receive a negativeSQLCODE. ************************************************************************SBST501I SOFTBASE DeadLock Advisor************************************************************************ Job: HRDAILY. DB2 Subsystem DB8G. Tablespace Page ** DGFDB008.DGFTS081.X00007A is involved in a deadlock condition. ************************************************************************ Deadlock
    • 15. SoftBase DeadLock AdvisorHRMNTHLY SBST375I SOFTBASE DeadLock Advisor *********************************************************************** * Job: HRMNTHLY. DB2 Subsystem DB8G. Plan HRMNTHLY has deadlocked * * plan HRDAILY in HRDAILY (BATCH). This job (HRMNTHLY) is *NOT* * * affected, but has caused HRDAILY to receive a deadlock condition. * *********************************************************************** Deadlock
    • 16. SoftBase DeadLock AdvisorTimeOut HRMNTHLY HRDAILY Application Application EMP_PROJ Update Update Table EMP_PROJ EMP_PROJ Locked by HRM Wait for HRMNTHLY Timeout Deadlock -911
    • 17. SoftBase DeadLock AdvisorDB2 MSTR DSNT376I -DB8G PLAN=HRDAILY WITH CORRELATION-ID=HRDAILY CONNECTION-ID=BATCH LUW-ID=USASDV02.LINK8.C60948488CC4=134 THREAD-INFO=CSB4:*:*:* IS TIMED OUT. ONE HOLDER OF THE RESOURCE IS PLAN=HRMNTHLY WITH CORRELATION-ID=HRMNTHLY CONNECTION-ID=BATCH LUW-ID=USASDV02.LINK8.C609482050BF=133 THREAD-INFO=CSB4:*:*:* ON MEMBER DB8G DSNT501I -DB8G DSNILMCL RESOURCE UNAVAILABLE CORRELATION-ID=HRDAILY CONNECTION-ID=BATCH LUW-ID=USASDV02.LINK8.C60948488CC4=134 REASON 00C9008E TYPE 00000302 NAME DGFDB008.DGFTS081.X00007A Deadlock
    • 18. SoftBase DeadLock AdvisorHRDAILY SBST376I SOFTBASE DeadLock Advisor *********************************************************************** * Job: HRDAILY. DB2 Subsystem DB8G. Plan HRDAILY is timed out due to * * HRMNTHLY (BATCH). Requested resource is being held by plan * * HRMNTHLY. This job (HRDAILY) will receive a negative SQLCODE. * *********************************************************************** SBST501I SOFTBASE DeadLock Advisor *********************************************************************** * Job: HRDAILY. DB2 Subsystem DB8G. A lock request for Tablespace * * Page DGFDB008.DGFTS081.X00007A could not be granted, and the * * request waited for a period longer than the maximum specified by * * the installation. * *********************************************************************** Deadlock
    • 19. SoftBase DeadLock AdvisorHRMNTHLY SBST376I SOFTBASE DeadLock Advisor *********************************************************************** * Job: HRMNTHLY. DB2 Subsystem DB8G. Plan HRMNTHLY has timed out plan * * HRDAILY in HRDAILY (BATCH). This job (HRMNTHLY) is *NOT* affected, * * but has caused HRDAILY to receive a timeout condition. * *********************************************************************** Deadlock
    • 20. Batch HealthCareSoftBase Attach Call Attach Auto-Commit Variable Commit Frequency ENQ Serialization SQL Monitoring
    • 21. Batch HealthCareAttach Variable Commit Frequency Dynamically Varies Commit Frequency Based on Time or Frequency Executes via JCL or Operator command Can Save Significant CPU & Elapsed Time Without Source Code Changes
    • 22. SoftBase Attach FacilityUnique Competitive Advantages Patented ENQ Serialization Patent-pending Variable Commit Frequency SQL Monitor Most widely used CAF on the market LOGRBA for recovery
    • 23. SoftBase CheckpointSoftBase Checkpoint Allows abended jobs to restart at last COMMIT point Restores critical Working storage areas Repositions sequential input and output files Optional VSAM component backs out KSDS updates to last COMMIT point Pre-compiler automatically makes the few coding changes required
    • 24. SoftBase Batch HealthcareCheckpoint Facility Restart DB2 batch applications at or near point of failure Modify frequency of Commits and Checkpoints on the fly Easiest deployment of restart code in the industry
    • 25. SoftBase Batch HealthcareCheckpoint Facility – How? Capturing restart data and storing it in a DB2 table so it is recoverable Requires no JCL modification to restart, just a resubmit Notifying the program that a restart is in progress, and then Reopening and repositioning all input and output sequential files and restoring working storage
    • 26. SoftBase Batch HealthcareCheckpoint Facility – ISPF Monitor Active Job Waiting on Restart Storage Usage Frequency Type Logical Unit of Work Count Checkpoint Count
    • 27. SoftBase Batch HealthcareCheckpoint Facility DeploymentProgram function calls can be inserted by 2 differentmethods. Running Precompiler  Taking the defaults, or  Customize via control file parameters Hand-coding  Customize placement by hard-coding into source code
    • 28. SoftBase Batch HealthcareCheckpoint Facility DeploymentWorking Storage. DBCC-WS-START ~~~~~~~ - - - - - > User defined WS data, including ~~~~~ Open Cursor host variables DBCC-WS-END DBR-VariablesProcedure Division. INIS - - - - -> loads job/step name key in CKPT_TABLE & location of WS areas to be savedLU CKPT - - - - -> saves contents of WS to CKPT_TABLEW & status listing of all active files TERM - - - - -> deletes completed job/stepname row from CKPT_TABLE
    • 29. Batch HealthCareSoftBase Batch Analyzer Focused on quick, easy navigation to problem areas Data available within a minute Extremely lightweight – no traces required Typically left running 24x7 No DB2 traces used No JCL changes Can analyze a single job, a group of jobs or all jobs Developers & DBAs can use product to monitor jobs Fast, easy installation
    • 30. Batch Analzyer
    • 31. Batch Analzyer
    • 32. Batch AnalzyerSelect the Most Expensive Step The most expensive steps are listed first. Step HRBKUPDL used 82.4% of the DB2 CPU.
    • 33. Batch Analzyer
    • 34. Batch AnalzyerIdentifies Potential Rollbacks The Recovery Impact Analysis Report provides an estimate of how long each DB2 batch program will require to ROLLBACK any changes it has made since the last COMMIT statement.
    • 35. Batch AnalzyerIdentifies Potential Rollbacks The Recovery Impact Analysis Report provides an estimate of how long each DB2 batch program will require to ROLLBACK any changes it has made since the last COMMIT statement.
    • 36. Batch Analzyer The Recovery Impact Analysis Report provides an estimate of how long each DB2 batch program will require to ROLLBACK any changes it has made since the last COMMIT statement.
    • 37. Batch Analzyer
    • 38. Batch HealthCareSoftBase Batch Analyzer Job-centric view of DB2 usage Extremely lightweight Easy install No DB2 traces used No JCL changes Easy to Use
    • 39. Code
    • 40. SoftBase Coding Solutions CodeDB/IQ-QA Test Deploy Creates a deep database of proper SQL coding rules Eliminates need for DBA intervention Enables creation and monitoring of SQL standards
    • 41. Test
    • 42. Building a great DB2 test experience CodeApplication Testing Challenges Test DeployTest Data Testing with full production data is impossible Developers cannot retrieve their own test data when they need it Access to referentially intact subsets of DB2, VSAM and sequential test data Inability to de-identify sensitive dataTest Methodology Painful, single-threaded testing procedures slow everyone down Building and maintaining multiple DB2 test beds, DB2 Subsystems, DB2 Databases, CICS or IMS regions takes excessive time & resources Inability to retest DB2 application programs with identical data at a later time
    • 43. TestBase – Faster, Better, Safer DB2 testing CodeTestBase is better – Testcomplete testing workbench that enables users to: Deploy Test with their own copy, or “Slice”, of data or against the same slice (independently or together) using patented Slice technology Quickly validate that changes worked correctly or that regression test was Slice successful using the TestBase Compare Report Use fewer DB2 subsystems, CICS regions, DB2 databases and less resources Build new slice in seconds vs. days or weeks to create new test databases, CICS regions, etc.
    • 44. TestBase – Faster, Better, Safer DB2 testing CodeTestBase is safer – Testremoves and replaces ALL confidential and sensitive Deploytest data from testing environments DBAs and Corporate Security Officers can QSAM carefully plan out and Test Production then deploy a Data Employee Table Employee Table Employee Table Privacy solution SSN Salary SSN Salary 349445555 24,800 123456789 99,9999 DB2 Audit TestBase Auditor z/OS Report reports confirm that IT has done its job successfully VSAM
    • 45. TestBase – Faster, Better, Safer DB2 testingTestBaseData Population Extract referentially intact subsets of data and load them to test environment(s)Edit Modify / Add / Delete Test dataSlice Unload, inventory, load, purge data for a slice or an entire environmentFully integrated – Data Population can be used to extract subsets of datain a slice and load them to another slice. Edit knows the primary key ofthe slice view …
    • 46. TestBase Data PopulationGetting Test DataData population is used to extract a subset of referentially in tact data,mask it if necessary, and load it to test environment(s). CustomerSuppose we have the following data model:We want to extract test data forevery 100th customer and put it in Product Account Customer_Notesa test environment. First we have to define the data model to TestBase. It Price Invoice can be done with DB2 RI or user defined relationships. Then we need to tell TestBase where to start - customer Line_Item
    • 47. TestBase Data PopulationFinal Extract of Test DataFrom a database of approximately 12 million rows, we extracted: DATE: 2011-04-05 12.51.59 TESTBASE OUTPUT REPORT JOB : CSBIX JOB05907 RISPEC CREATOR: CSBI SOURCE SQLID: SLICE NA RISPEC NAME. .: CUSTOMER OBJECT RECORDS TYPE NAME UNLOADED - ------------------------------------------------------ ---------- T SOURCE: DB9GLOC.VOLUME1.ACCOUNT 1710 T SOURCE: DB9GLOC.VOLUME1.CUSTOMER 855 T SOURCE: DB9GLOC.VOLUME1.INVOICE 17100 T SOURCE: DB9GLOC.VOLUME1.LINE_ITEM 34500 T SOURCE: DB9GLOC.VOLUME1.PRICE 2946 T SOURCE: DB9GLOC.VOLUME1.PRODUCT 973 TOTALS 58084
    • 48. TestBase Edit
    • 49. TestBase SliceSlice solves the problem of:Too Many Application Testing Environments! DBAs must build many separate testing environments for different Test Bed #1 = Test Bed #2 = Test Bed #3    testing needs within their company Synchronization Procedure Synchronizing these multiple DB2 1. 2. Synchronize all physical DBMS & file structures Synchronize all programs & common modules 3. Resolve all compile errors application test beds takes a great 4. Verify all 3rd party software is current 5. Configure CICS and other software deal of time and effort 6. 7. BIND/REBIND all DBRMs / Packages Resolve BIND errors a. Column not found b. Column not proper data type Developers or QA Personnel c. Column not proper NULL characteristics d. -805 Errors 8. Ensure all proper test data is loaded into appropriate cannot load or refresh their test test bed 9. Run RUNSTATS, Reset CHECK PENDING flags data without affecting other testers 10. Re-test everything
    • 50. TestBase SliceSlice also solves the problem of:Can’t Run Enough Tests – Always Fighting For Test Data After purchasing expensive vendor TESTER 1 TESTER 2 TESTER 3 TESTER 4 solutions, Application Developers 9:00AM 10:00AM 10:30AM 12:00PM still run single-threaded tests Test data is often corrupted within    minutes of loading test beds - this affects all other testing results X X Developers or QA Personnel APPLICATION TEST DATA cannot load or refresh their test data without affecting other testers
    • 51. TestBase SliceWith Slice:Everyone Tests Together At The Same Time Developers and QA Personnel can TEST LOAD now run tests concurrently with their own Slice of test data TEST REFRESH Developers and QA Personnel can Slice now load and refresh test data whenever they like – no DBA required LOAD TEST Sliced test data can be maintained DBA DBA DBA and utilized for extended lengths of time - without affecting others
    • 52. TestBase SliceSlice solves the problem of:Inability To Retest Application Programs QA Personnel often find problems 1 2 when testing applications turned APPLICATION ACCEPTANCE over by Application Developers DEVELOPER TESTER 2 or 3 days pass… By the time QA Personnel send Turnover to QA issues back to Developers, test Return to Developer data has already been destroyed UNIT | SYSTEM | ACCEPTANCE Testing Personnel cannot retain historical versions of test data
    • 53. TestBase SliceRetest DB2 Applications WithHistorical Test Data Developers can now return to any Application Acceptance previous point in time and rerun critical Developer Tester DB2 application tests Turnover to QA Return to Developer Development and QA staffs can now review historical test data to determine Unit Test 7/2/2011 when problems actually began 7/3/2011 7/1/2011 Libraries of test data can be saved and 1a 1b 1c 3 reused for future DB2 application 2 projects and enhancements
    • 54. TestBase ArchiveData ArchivingExtracts can be used to load data or to purge it.Suppose we wanted to archive customers who hadn’t ordered anything in thelast 12 months. We could change the start spec to an SQL statement: SELECT * FROM CUSTOMER C WHERE DAYS(CURRENT DATE) - DAYS(CUST_START_DATE) > 365 AND NOT EXISTS (SELECT * FROM INVOICE I WHERE C.CUST_N = I.CUST_N AND DAYS(CURRENT DATE) - DAYS(INVOICE_DATE) <= 365)
    • 55. TestBase ArchiveData Archiving Customer 100,000Extracts can be used to load data 80,000or to purge it. Product Account Customer_Notes 1,000 200,000 20,000Suppose we wanted to archive 1,000 160,000 16,000customers who hadn’t orderedanything in the last 12 months. We Beforecould change the start spec to an Price Invoice Purge 10,000 2,000,000SQL statement: 10,000 1,600,000 After PurgeSELECT *FROM CUSTOMER CWHERE DAYS(CURRENT DATE) - DAYS(CUST_START_DATE) > 365 Line_Item AND NOT EXISTS 10,000,000 (SELECT * 8,000,000 FROM INVOICE I WHERE C.CUST_N = I.CUST_N AND DAYS(CURRENT DATE) - DAYS(INVOICE_DATE) <= 365)
    • 56. TestBase ArchiveArchive Restore ArchiveOnce archived, the data can berestored to the ProductionDatabase or moved to another Customer Productdatabase from the archive Production DB2 Database Customer Price NoteJust because old customers usedproducts and prices, doesn’t meanwe want to get rid of them. We Invoicedo, however, want the way theylooked at the time in our archive. We Shadowcan remove tables such as product DB2 Line Itemand price from the purge list. Database
    • 57. SoftBase Testing Solutions CodeSoftDate Test Deploy Allows users to test z/OS-based applications with a simulated past or future system date Enables developers to test application date-dependent logic with minimum system impact Allows users to re-run failed applications on same apparent system date Simulates different time zones for users
    • 58. SoftbaseProven Technology + a better DB2Proven Tools = development experience +Proven Partner

    ×