DB2 for z/OS V8 迁移到 DB2 9

DB2 for z/OS Version 8 中的 XML 支持基于 DB2 的关系基础结构。在 DB2 9 之前,XML 数据要么作为字符大对象(CLOB)按原样存储,要么分解到关系表中。与此相反,DB2 9 为 XML 数据提供了真正的本机支持。XML 现在被当作新的数据类型处理,XML 数据存储在经过解析的带注释的树中,独立于关系数据存储。基于 XML 模式的 XML 索引已经引入,同时还引入了对用于查询和发布 XML 数据的 XQuery 和 SQL/XML 语言的支持。为了理解这些新的 XML 特性对迁移的影响,需要将 DB2 V8 中用于存储和查询 XML 数据的不同技术与 DB2 9 中可用的类似功能或新的 XML 功能相比较。

本文是关于将 XML 应用程序从 DB2 V8 迁移到 DB2 9 的三篇系列文章中的第一篇。本系列首先描述一个基于 Java™ 的存储过程,可以使用这个存储过程对 XML 数据执行子文档更新。可以下载 update 存储过程的源代码和 JAR 文件,并根据说明安装它(参见 下载)。

第二篇文章比较 DB2 V8 和 DB2 9 中的 XML 特性。然后简要讨论 DB2 9 中引入的新 XML 特性,并详细介绍新的 XML 支持对于迁移现有 XML 的应用程序的影响。这篇文章还包括一个基于 Java 的实用工具的源代码,这个工具用于帮助生成迁移数据库对象所需的脚本。

本系列的最后一篇文章分步介绍一个示例迁移场景。它包括示例场景的源代码。

Update 存储过程

对于本机存储在 DB2 中的 XML 文档,没有用于执行子文档更新的开箱即用的功能。这个问题的一种解决方案是,将文档交给客户机,修改它,然后再将其保存回数据库中。这种方法受到客户机环境的 XML 功能的限制,还需要编写基于文档对象模型(DOM)的客户机的专业技能。通过创建 update 存储过程,可以更新数据库中的 XML 文档而无需将其交给客户机。这个存储过程支持对本机存储在数据库中的 XML 文档进行部分更新。

这个存储过程允许:

  • 更改目标 XML 文档中任何文本或属性节点的值
  • 使用另一个 XML 元素替换 XML 文档中的元素节点(及其所有子节点)
  • 删除 XML 文档中的节点
  • 插入新元素
  • 多次更新源文档
  • 更新多个源文档
  • 使用修改的 XML 文档替换另一个 XML 文档
  • 将修改后的文档插入新记录

更新信息可以:

  • 静态地嵌入更新调用中
  • 使用 SQL 在运行时动态地创建
  • 使用算术表达式基于初始文本或属性值进行计算


本文转自IBM Developerworks中国

      请点击此处查看全文


 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
DB2® 9 for z/OS® is an exciting new version, with many improvements in performance and little regression. DB2 V9 improves availability and security, as well as adds greatly to SQL and XML functions. Optimization improvements include more SQL functions to optimize, improved statistics for the optimizer, better optimization techniques, and a new approach to providing information for tuning. V8 SQL procedures were not eligible to run on the IBM® System z9® Integrated Information Processor (zIIP), but changing to use the native SQL procedures on DB2 9 makes the work eligible for zIIP processing. The performance of varying length data can improve substantially if there are large numbers of varying length columns. Several improvements in disk access can reduce the time for sequential disk access and improve data rates. The key DB2 9 for z/OS performance improvements include reduced CPU time in many utilities, deep synergy with IBM System z® hardware and z/OS software, improved performance and scalability for inserts and LOBs, improved SQL optimization, zIIP processing for remote native SQL procedures, index compression, reduced CPU time for data with varying lengths, and better sequential access. Virtual storage use below the 2 GB bar is also improved. This IBM Redbooks® publication provides an overview of the performance impact of DB2 9 for z/OS, especially performance scalability for transactions, CPU, and elapsed time for queries and utilities. We discuss the overall performance and possible impacts when moving from version to version. We include performance measurements that were made in the laboratory and provide some estimates. Keep in mind that your results are likely to vary, as the conditions and work will differ. In this book, we assume that you are somewhat familiar with DB2 V9. See DB2 9 for z/OS Technical Overview, SG24-7330, for an introduction to the new functions. In this book we have used the new official DB2 9 for z/OS abbreviated name for IBM Database 2 Version 9.1 for z/OS as often as possible. However, we have used the old DB2 V9 notation for consistency when directly comparing DB2 V9 to DB2 V8 or previous versions.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值