Extremely pureXML in DB2 10 for z/OS

Book description

The DB2® pureXML® feature offers sophisticated capabilities to store, process and manage XML data in its native hierarchical format. By integrating XML data intact into a relational database structure, users can take full advantage of DB2's relational data management features.

In this IBM® Redbooks® publication, we document the steps for the implementation of a simple but meaningful XML application scenario. We have chosen to provide samples in COBOL and Java™ language. The purpose is to provide an easy path to follow to integrate the XML data type for the traditional DB2 for z/OS® user.

We also add considerations for the data administrator and suggest best practices for ease of use and better performance.

Table of contents

  1. Figures
  2. Tables
  3. Examples
  4. Notices
    1. Trademarks
  5. Preface
    1. The team who wrote this book
    2. Now you can become a published author, too!
    3. Comments welcome
    4. Stay connected to IBM Redbooks
  6. Chapter 1: Introduction
    1. Importance of XML data
      1. Growth of XML
      2. The value of XML data
    2. XML introduction
      1. XML definitions
      2. Document validity and well-formedness
      3. XML Schema
      4. Extensible Stylesheet Language
      5. XPath
      6. XQuery
      7. XHTML
      8. XSL, XSLT, Xpath, and XHTML examples
    3. What is in this book
  7. Chapter 2: XML and DB2 for z/OS
    1. XML capabilities provided by DB2
      1. Native XML data type
      2. SQL/XML language (1/2)
      3. SQL/XML language (2/2)
      4. Hybrid data access
      5. XML update
      6. XML indexes
      7. XML schema repository and schema validation
    2. Supporting infrastructure
      1. XSR installation steps
      2. XSR installation validation
      3. XSR setup troubleshooting
      4. z/OS XML system services
    3. Choice of tools
      1. 3270 based tools
      2. GUI-based tools
  8. Chapter 3: Application scenario
    1. Requirement for XML event logging and auditing
    2. Application scenario
    3. Application code samples
      1. DB2 SQL/XML programming pureXML
      2. Using Java with DB2 pureXML
      3. Using COBOL with DB2 pureXML
  9. Chapter 4: Creating and adding XML data
    1. Creation of tables with XML columns
    2. Storage structure for XML data
    3. Multiple version concurrency control for XML
      1. Example of improved concurrency with XML versions
      2. Example of improved storage usage with XML versions
      3. Storage structure for XML data with versions
    4. Catalog queries to gather information
    5. Display database command
    6. Ingesting XML data
    7. XML indexes
  10. Chapter 5: Validating XML data
    1. XML schema validation
    2. XML type modifier
    3. Automatic validation
    4. User-controlled validation
    5. Determining whether an XML document has been validated
  11. Chapter 6: DB2 SQL/XML programming
    1. Native SQL stored procedures and XML
      1. Native SQL stored procedure example
      2. XML error handling in native SQL procedures
      3. Stored procedures development tools
    2. Receiving XML messages from MQ
      1. WebSphere MQ functions
      2. DB2 stored procedure reading from MQ
      3. DB2 MQ listener automation
    3. Audit queries (against logged XML messages)
      1. Simple SQL/XML search examples
      2. Choosing XML indexes
      3. Verifying XML index usage
    4. SQL/XML query techniques
      1. Manipulating XML data with XPath functions
      2. Filtering the rows returned with XMLEXISTS
      3. Creating documents with publishing functions
      4. Aggregating documents with XMLAGG
      5. Enumerating all occurrences using XMLTABLE
      6. Grouping data with XMLTABLE
    5. User-defined functions with XML
      1. UDFs for reading from XML documents
      2. UDFs for writing updates to XML documents
    6. Triggers with XML
    7. XML joins
      1. XML to relational join
      2. XML to XML join
    8. XML with change data capture tools
      1. Change data capture tools background
      2. Using DB2 pureXML to receive CDC messages (1/2)
      3. Using DB2 pureXML to receive CDC messages (2/2)
      4. XML history objects
  12. Chapter 7: Using XML with Java
    1. XML in Java
      1. XML support in JDBC 3.0
      2. XML support in JDBC 4.0
      3. Constructing XML document in Java
      4. Binary XML format in Java applications
    2. The BankStmt application in Java
      1. Setting up the environment
      2. Insertion of rows with XML column values
      3. Updates of XML columns
      4. Retrieving XML data
      5. Call stored procedure to shred XML
      6. XSLT to transform XML document
      7. Java interface to MQ
  13. Chapter 8: Using XML with COBOL
    1. XML representation in COBOL
      1. XML host variables in COBOL
      2. Using non-XML variables for XML data
      3. Using file reference variables for efficient insert and retrieval
    2. The BankStmt application in COBOL
      1. Setting up the environment
      2. Inserting XML documents
      3. Updating XML documents
      4. Querying XML documents
      5. Designing indexes
      6. Schema evolution
    3. COBOL functions for manipulating XML
      1. Generation of XML documents in COBOL
      2. Shredding XML documents in COBOL
      3. Validation of XML documents in COBOL
  14. Chapter 9: Utilities with XML
    1. CHECK DATA
    2. CHECK INDEX
    3. COPY
    4. COPYTOCOPY
    5. EXEC SQL
    6. LISTDEF
    7. LOAD (1/2)
    8. LOAD (2/2)
    9. MERGECOPY
    10. QUIESCE
    11. REBUILD INDEX
    12. RECOVER INDEX and RECOVER TABLESPACE (1/2)
    13. RECOVER INDEX and RECOVER TABLESPACE (2/2)
    14. REORG INDEX and REORG TABLESPACE
    15. REPAIR
    16. REPORT
    17. RUNSTATS
    18. UNLOAD
    19. DSNTIAUL
    20. DSN1COPY
  15. Chapter 10: XML-related tasks for the DBA
    1. Tasks regarding system setup
      1. Setting up the XSR
      2. Buffer pool for XML
      3. Sizing XMLVALA and XMLVALS
      4. Be up to date with maintenance
    2. Tasks regarding object creation
      1. Creation of table with XML columns
      2. Alteration of implicitly created XML objects
      3. Sizing table spaces
      4. Compression
      5. Registration of schemas
      6. Creation of XML indexes
      7. Grants and authorizations required
    3. Housekeeping
    4. Backup and recovery
    5. Diagnostics
      1. Identification of XML related objects
      2. Investigating XML specific errors
      3. Correcting XML data
  16. Chapter 11: Performance considerations
    1. Choice of relational or XML storage
      1. XML only storage
      2. Hybrid storage
      3. Natural fit for XML storage
    2. XML schema validation
    3. Managing access path selection with XML
      1. Differences between XML and relational indexes
      2. XML index design
    4. Encourage use of native SQL DB2 routines
    5. External language programming
    6. DBA considerations
    7. SQL/XML coding techniques
      1. XMLTABLE to minimize database calls
      2. XMLEXISTS for index access
      3. Simple XPath expressions
  17. Appendix A: Application scenario documents
    1. Schema
    2. XML message
  18. Appendix B: Additional material
    1. Locating the web material
    2. Using the web material
      1. System requirements for downloading the web material
      2. Downloading and extracting the web material
  19. Glossary (1/3)
  20. Glossary (2/3)
  21. Glossary (3/3)
  22. Related publications
    1. IBM Redbooks
    2. Other publications
    3. Online resources
    4. How to get Redbooks
    5. Help from IBM
  23. Index (1/3)
  24. Index (2/3)
  25. Index (3/3)
  26. Back cover

Product information

  • Title: Extremely pureXML in DB2 10 for z/OS
  • Author(s): Paolo Bruni, Neale Armstrong, Ravi Kumar, Kirsten Ann Larsen, Tink Tysor, Hao Zhang
  • Release date: January 2011
  • Publisher(s): IBM Redbooks
  • ISBN: None