Front cover DB2 9 pureXML Guide Learning SQL/XML, XQuery, XPath with working examples Developing XML applications with DB2 pureXML Managing XML for maximum return Whei-Jen Chen Art Sammartino Dobromir Goutev Felicity Hendricks Ippei Komi Ming-Pang Wei Rav Ahuja ibm.com/redbooks International Technical Support Organization DB2 9 pureXML Guide January 2007 SG24-7315-01 Note: Before using this information and the product it supports, read the information in “Notices” on page ix. First Edition (January 2007) This edition applies to DB2 9 for Linux, UNIX, and Windows. © Copyright International Business Machines Corporation 2007. All rights reserved. Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Notices . ix Trademarks . x Preface . xi The team that wrote this redbook. xii Acknowledgements . xiii Become a published author . xiv Comments welcome. xv Chapter 1. Introducing DB2 9: pureXML . 1 1.1 Growing importance of XML data . 2 1.1.1 Growth of XML . 2 1.1.2 The value of XML data . 4 1.2 pureXML overview. 4 1.2.1 Traditional methods for managing XML data . 5 1.2.2 XML data management with DB2 9 . 6 1.2.3 Setting up databases for XML. 7 1.2.4 XML optimized storage and XML data type . 7 1.2.5 Getting XML data into the database . 8 1.2.6 Querying XML data . 8 1.2.7 Query optimization and indexes for XML . 10 1.2.8 XML schema repository and validation . 10 1.2.9 Full text search for XML . 11 1.2.10 Annotated schema decomposition . 11 1.2.11 Application development support . 11 1.2.12 Tools and utilities . 12 1.2.13 Benefits of DB2 pureXML technology . 13 1.3 pureXML usage scenarios. 13 1.3.1 Integration of diverse data sources . 14 1.3.2 Forms and their processing. 15 1.3.3 Document storage and querying . 16 1.3.4 XML for transactions . 17 1.3.5 Syndication and XML feeds . 18 1.3.6 XML as a better data model . 19 1.4 Summary . 19 1.5 References . 20 Chapter 2. Sample scenario description. 21 2.1 Business requirements . 22 © Copyright IBM Corp. 2007. All rights reserved. iii 2.1.1 Data modeling . 23 2.2 Application description . 25 2.2.1 Loan application . 26 2.2.2 Loan processing . 31 2.2.3 Loan management . 34 2.3 Application setup . 36 Chapter 3. XML database design . 39 3.1 Architecture overview . 40 3.2 Logical database design . 43 3.2.1 XML data type . 43 3.2.2 Relational structure versus XML structure . 44 3.2.3 XML indexes . 47 3.2.4 Views. 48 3.2.5 XML schema . 49 3.2.6 XML schema design . 51 3.2.7 Industry standards and XML schemas . 56 3.2.8 XML data validation. 60 3.3 Physical database design . 66 3.4 Creating a database . 70 Chapter 4. Working with XML. 73 4.1 XPath. 74 4.1.1 XQuery/XPath data model . 75 4.1.2 Location paths. 78 4.1.3 Using location paths to retrieve nodes of an XML document . 80 4.1.4 Predicates . 86 4.2 XQuery . 87 4.2.1 Types, expressions, and functions . 88 4.2.2 FLWOR and selecting XML data. 103 4.2.3 Updating XML data . 120 4.3 XQuery and SQL/XML. 126 4.3.1 XQuery with embedded SQL . 126 4.3.2 SQL/XML. 127 4.3.3 When to use what . 133 4.4 When and how to use namespaces . 136 4.5 Getting XML data in and out of database . 142 4.6 XML full-text search. 154 4.6.1 DB2 Net Search Extender. 154 4.6.2 Preparing the instance for text search . 155 4.6.3 Full-text searching using DB2 NSE. 159 4.6.4 Taking advantage of Net Search Extender text search features. 162 4.6.5 Full-text search considerations . 164 iv DB2 9 pureXML Guide 4.6.6 The NSE document model . 167 Chapter 5. Managing XML data . 173 5.1 XML indexes . 174 5.1.1 XML index types . 174 5.1.2 Creating XML indexes. 176 5.1.3 How to look up information for XML indexes. 181 5.1.4 Access plan. 186 5.1.5 Best practices . 195 5.2 Schema management . 198 5.2.1 XML Schema Repository . ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages410 Page
-
File Size-