the return of the db2 top ten lists

Upload: venkatareddy-bandi-b

Post on 06-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    1/30

    2010 SoftwareOnZ

    2010 SoftwareOnZ

    The Return of

    The DB2 Top Ten Lists

    Craig S. [email protected]

    [email protected]

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    2/30

    2010 SoftwareOnZ

    2010 SoftwareOnZ

    The Top Ten Lists

    And now, from the home office inSugar Land, Texas a series ofDB2 Top Ten lists about varioustopics ranging across thefollowing subjects:

    Performance Coding Design Administration Management Features Tools

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    3/30

    2010 SoftwareOnZ

    2010 SoftwareOnZ

    The Ten Database Management Commandments

    1. Thou shalt always design databases from a logical data model.

    2. Thou shalt always document thy database design.3. (There are many important aspects of database administration,

    but of them all,) data integrity shalt always remain the most important.4. Thou shalt encrypt personal and sensitive information, both at rest and in transit.5. Thou shalt implement appropriate security within thy database and between thy

    DBMS and thy operating systems.

    6. Thou shalt always maintain the recoverability of thy databases with sufficientbackups to meet the availability requirements of the business supported by the data.

    7. Thou shalt implement a consistent and documented workflow process forimplementing database change that assures data integrity while minimizingdowntime.

    8. Thou shalt always consider transaction performance and data availability in thy

    database design.9. Thou shalt also work with application developers to ensure efficient code is writtento access thy databases.

    10. Thou shalt not download thy database to thy laptop.

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    4/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten DB2 Database Design Guidelines

    1. Always start with a logical data model2. Follow relational database design rules - normalization3. Create and follow consistent naming standards for all DB2

    objects (including columns)4. Favor declarative referential integrity (RI)5. Dont forget the free space

    6. Always fully document the database design including allimplementation decisions

    7. Plan for data purging and archiving8. Design for sharing data instead of copying it all over the

    place!9. Plan for performance (or availability) at design time10. Plan for backup and recovery before implementation

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    5/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Benefits of Using DB2 CDC for DW/ETL

    1. Why move all of your data every night when just a fraction of the data actually changed?

    2. Near-real-time data delivery vs. daily extracts- downstream users have access to most current information

    3. Significant reduction in CPU cycles by eliminating costly ETL processes

    4. Identify certain business events as soon as they occur(i.e. claim submitted over $1M)

    5. High availability with active/active replication between data centers

    6. Optimize existing ETL processes by supplying only the data that has changed

    7. Real-time integration with newer applications(i.e. send a text message if account balance goes negative)

    8. No need to modify existing applications to track data changes or publish specificbusiness events

    9. Extend the life of your legacy DB2 applications by integrating data changes with newer

    applications

    10. Allows for auditing by tracking all data changes to important tables

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    6/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Development Best Practices

    1. Minimize network calls

    2. Minimize passes through the data3. Put the work into the SQL, not the program4. Unlearn the flat file mentality5. Be sure data type and length match in predicates

    6. Know your Stage 1, Stage 2, and Indexable predicates7. Document your code8. Always check the SQLCODE or SQLSTATE9. Analyze your access paths

    (and tune your SQL in test)

    10. Avoid Bachelor Programming Syndrome

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    7/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Common SQL Mistakes

    1. Assuming an ORDER BY is not necessary for ordered results

    2. Forgetting the NULL indicator3. Incorrect expectations when using the NOT IN predicate withNULLs*

    4. Coding predicates appropriately in Outer Joins5. Not coding a cursor for a multi-row result

    6. Recompiling but not rebinding7. Forgetting to use single quotes around strings (instead of double

    quotes)8. Trying to modify a Primary Key column

    9. Forcing dynamic SQL into static SQL (sometimes hundreds ofstatic SQL statements)10. Asking for more data than you need (columns and/or rows)

    SELECT C.color

    FROM Colors AS C

    WHERE C.color NOT IN (SELECT P.color

    FROM Products AS P);

    *

    Sometimes (erroneously) referred to as the SELECT * problem

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    8/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Compliance Concerns

    1. Data Quality Poor data quality costs the typical company at least ten percent (10%)

    of revenue; twenty percent (20%) is probably a better estimate.

    2. Data Retention

    3. Database Security Authentication (Who is it?) Authorization (Who can do it?) Encryption (Who can see it?) Audit (Who did it?)

    4. Data Masking and Obfuscation5. Database and Data Access Auditing6. DBA Procedures (e.g. change management)

    Unauthorized change is one of the best (and worst) ways to get yourauditors attention.

    7. Data Movement Tracking8. Master Data Management9. Data Definition and Categorization10. Metadata Management

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    9/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Biggest Data Breaches

    1. Jan. 20, 2009 Heartland Payment Systems ~130 million

    2. Oct. 2, 2009 U.S. Military Veterans 76 million3. Jan. 17, 2007 TJ stores (TJX) 45.7 million4. June 16, 2005 CardSystems over 40 million5. Dec. 15, 2009 RockYou 32 million (SQL injection)

    6. May 22, 2006 U.S. Dept. of Veteran's Affairs 28.6 million7. Mar. 8, 2006 iBill 17,781,4628. Mar. 26, 2008 Bank of New York Mellon 12.5 million9. July 3, 2007 Fidelity National Information Services (Certegy

    Check Services Inc.) 8.5 million10. Sept. 14, 2007 TD Ameritrade Holding Corp. 6.3 million

    http://www.privacyrights.org/ar/ChronDataBreaches.htm

    As of Feb 17, 2010, total records breached: 345,724,373 (since January 2005)

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    10/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Non-Technical Security Steps

    1. Buy and use a good shredder2. Dont wear your ID badge outside of the office3. Be vigilant when using your laptop in public4. Buy and use a screen shade5. Dont put identification on your laptop (e.g. ID tags)

    6. Company should invest in an anonymous PO box7. Be careful about company logo clothing8. Dont leave unencrypted disks/USB sticks/etc. laying

    around

    9. Invest in a laptop lock and use it whenever possible10. Never put any disk you do not know into yourcomputer (salaries)

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    11/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Under-Utilized Features

    1. Table Expressions

    2. CASE statements3. REOPT (other than NONE)4. Triggers5. Auto expand buffer pools

    6. Real Time Stats7. User-Defined Functions8. DISTINCT Types9. LOBs

    10. Date/Time Arithmetic

    XML?

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    12/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Specialty Processor Workloads

    1. IFL: Linux stuff2. zIIP: distributed SQL requests3. zIIP: parallel SQL requests4. zIIP: data warehousing/star schema5. zIIP: native SQL stored procedures run via DDF (V9)

    6. zIIP: index maintenance during LOAD, REORG, andREBUILD7. zAAP: Java8. zAAP: XML

    9. (zAAP on) zIIP: Java and XML10. zIIP: non-DB2 stuff including: z/OS Communcation Server encryption, z/OS XML System Services, and System Data

    Mover processing associated with zGM/XRC (z/OS Global Mirror)

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    13/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten A-Ha! Moments

    1. Changing the SQL terminator for triggers2. Truly understanding locking

    3. When you can predict access paths by looking at SQL (andstatistics)4. Being a human compiler (or JCL checker)5. When your first reaction is to look it up in the manual instead of

    asking the DBA

    6. When you take responsibility for your professional development7. When you start thinking about the business problems your

    programs and database solve before thinking about a neattechnical issue

    8. When you stop thinking of fetching from a cursor like reading from

    a file9. When you stop blaming DB2 before your own code10. When you look at this list and say that all makes sense

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    14/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten DB2 Myths

    1. Use Views to Insulate Programs from Change2. Locking Problems Indicate a Database Problem3. Primary Key is Usually a Good Choice for Clustering4. Just Using the Defaults Should Work Out Well5. Programmers Dont Need to Know How to Tune SQL

    6. Black Boxes Work Well for Performance7. Using NULLs Can Save Space8. RUNSTATS Arent That Important9. DB2 is a Hog

    10. It Depends!

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    15/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Outdated Standards

    1. Limiting indexes per table to 3 or 5 or2. Requring base table views3. Forbidding dynamic SQL4. Limiting number of tables per join (typically for online

    txns)

    5. Avoiding NULLs6. Arcane table naming standards (e.g. TXR0031)7. Just about any buffer pool standard (e.g. BP0 only)8. Almost any standard using the words always or

    never9. Fear of REBINDing10. Putting standards in a binder instead of online

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    16/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Things to Do Before You Visit the DBA

    1. Try to Figure It Out Yourself, Please2. RTFM3. Figure out what you are going to say to him/her4. Be sure it is the truth!5. Dont assume you (or your code) are innocent

    6. Have a drink (coffee?)7. Bring the DBA a drink (your choice!)8. Never say But IBM said it should work this way.9. Never say But it worked that way yesterday.

    10. Always say Thank you.

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    17/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Ten Eleven Rules of the Road for DBAs

    1. Write Down Everything2. Keep Everything3. Automate4. Share Your Knowledge5. Focus Your Efforts

    6. Dont Panic!7. Measure Twice, Cut Once8. Understand the Business9. Dont Be a Hermit

    10. Use All of the Resources at Your Disposal11. Keep Up-to-Date

    From zJournal article available at: http://www.craigsmullins.com/zjdp_042.htm

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    18/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Weasel-Speak Interpretations (Part 1)

    1. We will look into it(We will forget all about it the moment you leave)

    2. It is in process(The bureaucracy involved has rendered it hopeless)

    3. I didnt get your e-mail

    (I was too busy updating my Facebook status to readyour e-mail)

    4. The entire project is being abandoned [or reorganized](The only guy who understood it just left or retired)

    5. A number of different approaches are being tried(We are all just guessing at this point)

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    19/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Weasel-Speak Interpretations (Part 2)

    6. Preliminary tests were inconclusive(We cant get the dang thing to run)

    7. Test results are very promising(Amazing, it actually works)

    8. What do you think about this

    (I only want your opinion so you can share the blamelater)

    9. Robust(We want you to buy this thing but have no Earthly ideahow to convince you, so we call it robust)*

    10. Low maintenance(Almost impossible to fix)

    * See also, Best of Breed

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    20/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten, err, Twelve DB2-Related

    SG24-7330 DB2 9 for z/OS Technical Overview SG24-6763 The Business Value of DB2

    SG24-6300 DB2 for z/OS Application Programming Topics SG24-6289 DB2 9 for z/OS: Using the Utilities Suite

    SG24-7322 DB2 for z/OS: Data Sharing in a Nutshell SG24-7720 Securing and Auditing Data on DB2 for z/OS

    SG24-7688 DB2 9 for z/OS: Packages Revisited

    SG24-7473 DB2 9 for z/OS Performance Topics SG24-7134 DB2 UDB for z/OS: Design Guidelines for High Performance and Availability

    SG24-7604 DB2 9 for z/OS Stored Procedures: Through the CALL and Beyond SG24-7663 DB2 9 for z/OS: Deploying SOA Solutions SG24-6319 DB2 for z/OS and WebSphere: The Perfect Couple

    http://www.redbooks.ibm.com/

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    21/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten DB2 Twitter-ers

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    22/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten LUW vs. z/OS Differences

    1. Memory: EDM Pool, RID Pool, Sort Pool, Buffer Pools versus Catalog Cache,

    Package Cache, Sort Heap, Buffer Pool, Locklist

    2. Table Spaces: Simple (obsolete), Segmented, Partitioned, Universal (V9), LOBversus Regular, Temporary, Large, Automatic (V9.5)

    3. Optimizer: 7 levels of optimization in LUW (0,1,2,3,5,7,8)

    4. Monitoring: Traces and Instrumentation Facility versus Event Monitor, Snapshot

    Monitor

    5. XML: XPath versus XPath, XQuery

    6. Index Compression: z/OS only

    7. Oracle syntax suport: LUW only

    8. Multi-row INSERT, FETCH & multi-row cursor UPDATE: z/OS only

    9. SET CURRENT ISOLATION: LUW only

    10. Bottom Line: amazingly similar but different enough to make transitioning from

    one to the other non-trivial

    z/OS

    LUW

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    23/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten DB2 9 for z/OSApplication Developer Features

    1. Plan Management: Package Stability

    2. MERGE3. SELECT FROM UPDATE, DELETE, & MERGE4. Index on Expressions5. Native SQL Procedure Language6. FETCH FIRST and ORDER BY in subselect

    and fullselect7. INTERSECT and EXCEPT8. INSTEAD OF TRIGGER9. TRUNCATE10. LOB Improvements

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    24/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten DB2 9 for z/OS DBA Features

    1. Universal Table Spaces- PBG and range-partitioned

    2. Reordered Row Format

    3. Index Compression4. CLONE Tables

    5. BUILD2 Phase Eliminated in Online REORG

    6. APPEND YES

    ignoring clustering during INSERT and LOAD7. The promise of REOPT(AUTO)

    8. IMPLICITLY HIDDEN columns

    9. New Data Types: BIGINT, DECFLOAT,

    BINARY/VARBINARY10. Database Definition on Demand

    - renaming a tables column; renaming an index

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    25/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten DB2 10 Features

    1. best reduction in CPU for transactions, queries, and batch since V2.1most customers to reduce CPU times between 5% and 10% as soon as

    DB2 10 is out of the box.2. Improved Security(e.g. data masking, smaller granularity for admin privileges)

    3. Index Include Columns4. Temporal (Versioned) Data5. Hashing6. Buffer Pool Improvements

    (e.g.use of the System z10 1 megabyte, page size, buffer pools inmemory)

    7. 80% to 90% of Virtual Storage Moved Above the Bar8. No More Links in the DB2 Catalog

    9. Efficient Caching of Dynamic SQL Statements That Use Literals10. LOB Improvements

    (e.g. inline LOBS, improved large object streaming)

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    26/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Trends

    1. Industry Consolidation

    2. Cloud Computing3. SaaS4. Virtualization5. Server Consolidation

    6. Open Source7. Social Media8. Complexity9. Autonomic, Self-Managing Databases

    10. Commoditization

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    27/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Best Practicesfor DB2 Professional Development

    1. Join your local DB2 user group (and participate!)

    2. Join IDUG and attend the annual conference in your geography3. Lobby for relevant annual training4. Purchase and read DB2 and database books5. Subscribe to relevant magazines and read them regularly (e.g. IBM

    Database Magazine, Database Trends & Applications, zJournal)

    6. Subscribe to RSS feeds for DB2-related blogs (mine [DB2 Portal andData Technology Today], Willie Favero, Troy Coleman, Dave Beulke,Robert Catterall, etc.)

    7. Subscribe to the DB2 mailing list (daily DIGEST perhaps)8. Visit IBM DeveloperWorks frequently

    (http://www.ibm.com/developerworks/data/)9. Download the DB2 manuals in PDF form10. Be business savvy, not just tech savvy! Learn about your business.

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    28/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten DB2 Related Blogs

    1. Start with: Planet DB2 (DB2 blog aggregator) http://www.planetdb2.com

    2. DB2 Portal Blog - http://www.db2portal.com/blog.html3. Getting the Most Out of DB2 for z/OS (Willie Favero) -http://it.toolbox.com/blogs/db2zos

    4. DB2 News & Tips - http://db2news.blogspot.com/

    5. DB2 USA - http://db2usa.blogspot.com/

    6. Dave Beulkes Blog - http://davebeulke.com/

    7. DB2utor (Troy Coleman) -http://ibmsystemsmag.blogs.com/db2utor/

    8. Thoughts on DB2 (Triton) - http://www.triton.co.uk/blog/

    9. SAP on DB2 for z/OS (Omer Brandeis) -http://it.toolbox.com/blogs/sap-on-db2

    10. Robert Catterrall - http://catterallconsulting.blogspot.com/

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    29/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    Top Ten Books forDB2 Professionals

    1. DB2 Developers Guide2. DB2 Developers Guide3. DB2 Developers Guide4. DB2 Developers Guide

    5. DB2 Developers Guide6. DB2 Developers Guide7. DB2 Developers Guide8. DB2 Developers Guide

    9. DB2 Developers Guide10. DB2 Developers Guide

  • 8/3/2019 The Return of the DB2 Top Ten Lists

    30/30

    2010 SoftwareOnZ2010 SoftwareOnZ

    The Return of the DB2 Top Ten Lists

    Craig S. Mullins

    [email protected]

    http://www.CraigSMullins.com

    [email protected]

    http://www.softwareonz.com