Before you start
This tutorial will take you step-by-step through the implementation of document-level security using DB2 9. Document-level security is a data protection solution that is achieved by bringing together two of DB2's newest features:
- Native XML storage: pureXML
- Label-based Access Control
Combining these two features produces a native XML data store that is capable of protecting XML documents and controlling access to them on a document-by-document basis.
The objective of this tutorial is to provide the basis of a solution for XML document-level security. The implementation in this tutorial is more focused on a federal government scenario; however, the solution can be tailored to any industry's needs. This tutorial is broken up into the following lessons:
- Lesson 1: Use case and setup - Creates users, the LBAC policy, and the protected table containing XML.
- Lesson 2: Stored procedure load - Creates a stored procedure to demonstrate the first of two methods for loading XML documents.
- Lesson 3: XML decomposition load - Uses an annotated schema and decomposition to demonstrate the second method for loading XML documents.
- Lesson 4: Query examples - Provide examples of querying the protected data using SQL/XML and XQuery.
In addition to providing a solution for document-level security, this tutorial provides examples of new concepts in DB2 9. These include:
- The new security administrator authority
- Creating an LBAC security policy
- Creating tables with XML columns
- Creating tables protected by an LBAC security policy
- Using native XML data type as a parameter to stored procedures
- Using XQuery to extract information from the XML parameters or variables
- Inserting XML data with an LBAC security label
- Using the new XML decomposition feature, including the <db2-xdb:expression> annotation
This tutorial is written for DB2 database developers and DB2 database administrators. You should have a basic understanding of DB2's new pureXML and LBAC features. For links to other developerworks articles introducing these features, please see the Resources section of this tutorial.
DB2 9 for Linux®, UNIX®, and Windows® installed.


