?????. DB2 ? XpertMon ??? ???!
? ????????? DB ??????.
?? ?? XpertMon ????? ????? ???? ???? ? ? ????
????? ??? ?? ??? ?? ???, ? ? ??? ?? ?????
? ? ?? ??? ???? history ??? ???? ????.
??? ???? ???? ???? ????? ??? ???? ??????
?????.
?? ?? ???? ? ?? 2006? 7?? ??? DB2 V9? ??? ??? ??
????? ?????.
???? ?? ????? ???, ?? ?????? ?? ????
(
www.iteg.co.kr)
???? ????? ?? ? ????.
???? ?? ?? ???? ??? ??? ??? ??????. ???? ?????
?????.
0. ??
Data server? ? ??? ??? IBM DB2 9(??? ‘Viper’)? ???????. IBM?
????? ??? ?? ???? ??? ??? ???????.
1960?? IMS(Infromation Management System)? ????
1970?? ?? ?????? ??? SQL?
1980???? ????? DB2? ??? ?? DB2 9??,
???? ???? ????? ??? ?? ??? ?? ???? ??? data server
??? ?? ?? ???? ????.
DB2 9?? ?? ?? ?? :
- SOA ????? data service? ?? pureXML
- ???? cost? ?????? data compression
- ?? ????? ??? ?? ?? Self-tuning memory
- ???? ???? ?? Label access security
- ???? ???? ??? ?? table partitioning
- ??? ??? ?? Applications development agility
- powering SAP solutions
?? ?????.
DB2 9? ?? ???? ??? ?? ??? ?? ? ?? ?? ???
????? ?????.
1. pureXML AND HYBRID DATA SERVICES
XML ??? ??? ???? ??? ??, ??????, ?? ?? ??? ?????
??? ??? ????? ?? ?? ??? ???? ????. ? ??? ??? ??,
???? ????, SOA ????? ???, ?? ??, ??, ??? ???? ?? ??
?? ???? XML ???? WEB ?? ?? ?? ???? ????.
?? XML ???? ?? ??? ??? ???, ????, ??, ?? ?? ????
???? ?? XML ???? ??, ??, ?? ???? ??? ??? ??? ?????.
1.1. XML ???? ???? ?? ???? ??
DB2 9 ?? XML ???? ??? ?? ??? ??? ????.
- ?? ???? XML d0cument? ??
- ?? ??????? ???? ?? ???? XML ??? ??? ??
- ?? ??????? CLOB? BLOB?? XML ??? ??
- XML-only ?????? ??? ?? ??? ??
?? ???? ??? ??? ???? ??? ? ?? ? ??? ? ????? ?? ????.
???, ??, ?? ? ???? ????? ???? ?? ????.
XML ???? ?? RDBMS - ???? ?? - ? ??? ????. XML ??? ???
??? ??? ?? ????? ??? ??? ??? ???? ?? XML? ??? ??
?? ??? ??? ??? ???? ???? ?? ???? ???? ???? ????.
(?. ??? ??) LOB ??? XML? ??? XML ??? ??? ?? ??? ?????
???? ??? ????? ?????. ????? XML-only DBMS? ??? ?? ???
?? IT ??????? ??, ??? ?? ???, ?? ??, ? ?? ??? ?? ???
?? ?? ?? ?????.
1.2. DB2 9??? XML ??? ??
DB2 9?? IBM? ??? ??? ? ??? ?????. DB2 9? “pure” XML ??? ??? ???????.
pureXML ??? ??? ??? ??? ?????? ?? ?? ??? DB2 ??? ?? ??? ???????.
DB2 9??? XML? ?? ???? ???? ?? pureXML? relational hybrid ??? ??? ???????.
DB2 9?? pureXML ??? ?? ??? ?????.
- “pure”XML ??? ??? XML ??? ????? ?? ?? ??? ??? ???? ?? ?? ??
- XML ??? ???? ??? ???? ?? “pure”XML ??? ??
- ??? ??? ??? ?? ?? ??(XQuery ? SQL/XML)? ??? ?? ??? ??
- XML ??? ??, ??? ??, ??? ??
- ???? ?? ??, ???? ?????? ???? ?? ??
- APIs(Applications programming interfaces) ?? ?? ??
- XML ???? ?? ??? ??? ??? ?? ?? ??
- ?????? ??? ??? ???, ???, ???, ??, ?? ? ???? DB2?? ??? ? ????.
1.3. XML ?? ?? ?????? ??
DB2 9?? XML ???? ???? ?? ??????? ??? ?? ?? ??????? ??? ??
??? ??? ?? ??????? ??? ???? ??? ? ????. ??? XML ????
????? ????? ????? ???? ??????? ??? ??? ???.
CREATE DATABASE test USING CODESET utf-8 TERRITORY …
|
1.4. XML ???? ???? XML ??? ??
XML ???? ????? ??? ?? ?? ??? ??? ?? ??? ???? ?????.
DB2 9??? ??? XML ??? ??? ???? ?? ??? ??? ??? ???? XML ??? ??
???. ?? RDBMS?? ?? ??? XML ??? ??? ?????. DB2 ?? ???? XML
??? ??? XML ??? ???? ???? ???? XML ???? ??? ??? node-level?
????? ?????. DB2 ??“pure”XML ??? ??? ?? ??? ??? XML ????
????? ????? ?? overhead ??? ???? XML ???? ??? ??? ???.
?? ??? ??? XML ??? ??? ?? ??? ? ????.
CREATE TABLE orders (ordierid INT, orderinfo XML)
|
??? ?? ? ??? ?? ??? ??? ??? ?? ??? ???, ?? ?? XML ????
?? ??? ??? ??? ? ? ????.
CREATE TABLE o2 (oid INT, otype CHAR(2), ocust XML, oinfo XML)
|
1.5. ??????? XML ??? ????
XML ???? XML ??? ??? ??? ??? ?? INSERT ??? ???? ??? ? ????.
??? ??? IMPORT ??? ?? ?? ?? XML ??? ??????? ??? ? ????.
DB2 ?? ???? GUI ??? ???? ??? ?? ????.
INSERT INTO orders (ordered, orderinfo) VALUES (5,
XMLPARSE
( d0cument
‘
2006-07-07
XYZ
12345
. . .
Fragile Contents
’
STRIP WHITESPACE)
);
|
1.6. XML ??? ????
DB2 9??? ?? ???? ???? SQL? XML ???? ???? XQuery? ????
???? ??? ? ? ??? ???. ? ?? ??? ??? ???? ?????.
???????? ??? ?? ??? ???? ??? ? ??? ?? ?? ???
SQL? XQuery? ?? ??? ? ??. ??? ?? ??? ?? ???? XML ??
?? ? ??? ??? ??? ???? ??? ? ????.
? ?? ??? ????, ?? ?? ???? XML ???? SQL? ??
SELECT * FROM orders WHERE ordered=5
SELECT orderinfo FROM orders
|
XQuery ??? ???? ??? ????.
xquery db2-fn:xmlcolumn(‘ORDERS.ORDERINFO’)
//retrieve the orderdate from XML d0cuments in the orders table:
xquery for $d in db2-
fn:xmlcolumn(‘ORDERS.ORDERINFO’)/order/orderdate
return $d
//the above query returns: 2006-07-07
|
????? SQL? XQuery? ??? ??? ??, ?? ??? SQL/XML ????
??? ??? ?? XQuery? SQL? ???? ?????.
//retrieve the ordered of orders for a specific custormer ‘XYZ’
SELECT ordered FROM orders
WHERE xmlexists(‘$o[order/customer/name=”XYZ”]’
PASSING orderinfo AS “o”)
//retrieve info for orders matching specified criteria
XQUERY db2-fn:sqlquery(
“SELECT orderinfo FROM orders WHERE ordered >3”
)/order/custormer[zip = “12345”]
|
?? ??? ???
Which way to query your XML data:? ??????.
http://www.ibm.com/developerworks/db2/library/techarticle/dm-0606nicola/
1.7. ?? ???? XML ??? ???
DB2? ? ??? ?? ??? ??? ????(XQuery? SQL). ??????? ? ??
??? ???? ??? ???? ?????. ??? ?? ??? ??? ???
???? DB2? cost-base ?? ??? ??? ?? ??? ?? ? ??? ????.
DB2? ??? ??? ?? ?? ? ???, ?? ? ?? ?????? ?? XML ???
???? ??? ?? ??? ?? ? ????.
XML? ?? ??? ??? ???? ??? ?? DB2 9? XML ???? ?? ????
???? ?? ??? ??? ??? ? ?????.
XML ???? ??? ?? SQL DDL ?? CREATE INDEX? ?????. ???? ????
“xmlpattern”? ?? XPath ??? ?? ?? XML ??? subset? index ?? ???? ?????.
CREATE INDEX odindex ON orders(orderinfo) GENERATE
KEY USING XMLPATTERN ‘/order/orderdate’as DATE
|
1.8. XML ??? repository ? ??
DB2??? ??? ???? ? XML ??? ??? ??? XML ??? repository?
?????. XML ???? ???? ???, ?? ??? ??? ??? ????
XML ??? ??? ??? ?????.
XML? ???? ???? ?? DB2 9? XML ??? ??? ?? ??? ??? ?????.
??? ???? ??????? ???? ?? ???? ?? XML? ??? ? ????.
? ??? ?? XML ??? ?? ???? ???? ??? ? ????.
??? ???? ??? ??? ???? ?? ??? ??? DB2? ??? ????
???? ??? ??? ? ????. ??? ??? XML ??? ?? ??? ???
???? ?? ?? ????. ? ??? ???? ?????? ??? ?? ???
???? ??? ??? ? ????.
INSERT INTO orders(orderinfo) VALUES XMLVALIDATE (?
ACCORDING TO XMLSCHEMA ID order.ordschema)
|
1.9. XML ?? ??
?? ??? ?? ??? XML ??????? ???? ???? DB2? ??? XML
??? ???? ?? ??? text ?? ??? ??????. Full-text ????
??? XML ?? ?? ??? ?? DB2 v9? ?? XML ?? ??? ?? ? ? ????.
XML ???? ??? ??? ??? ???? ???? ??? ? ????. text ??
???? ??? ??? ??? ??? ?? ????.
? ? ??? ??? ?? URL? ????
XML full-text search in DB2? ??????.
http://www.ibm.com/developerworks/db2/library/techarticle/dm-0606seubert/
1.10. DB2 pureXML ??? ??
??? ?? ?? - ?? ???? ?? ???????? XML-relational ??? ??
?Increase agility - ??? XML ??? ??? ?? ??? ???? ?? ?? ????
????? ?? ?? ?? ???? ??? ??????? ??
?Improve insight - ??? ???? ?? XML ???? ?????? ??? XML?
???? ???? ? ???? ?? ? ?? ?? ??? ??
??? ? ?? ??? ??? Storebrand Group? SOA ???? ???? ?? DB2 9
pureXML ??? ???? ??? ??? ???????. ??? ???????? 2-8??
??? ????? DB2 pureXML??? 30?? ??? ?? ??? ????? ???
?? ??? ??? ??? ??? ??? DB2 9? ??? ???? ?? ????.
??? ??? XML ???? ?? ? ?? ??? pureXML? ??? ?? ?? ??? ?????.
IBM DB2 9?? pure XML support? ?????? ???? ???? ???? ???
????? ? ?? ? ??? ??? ? ?? ??? ???. IBM DB2 9? ???????
??? ?? ?? ??? ???? ??? ?? ??? ?? ? ????.
-Thore Thomassen, Senior Enterprise Architect, Stroebrand Group
|
XpertMon for DB2 UDB V2
DB ???
Tel : 02-2108-1458
Fax : 02-2108-1459
Mobile : 011-896-6545
E-mail :
hjlee@iteg.co.kr
URL :
http://iteg.co.kr