DB2 分区 [英] DB2 Partitioning

查看:29
本文介绍了DB2 分区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 DB2 中的分区是如何工作的,但我不知道该分区值的确切存储位置.编写创建分区查询后,例如:

I know how partitioning in DB2 works but I am unaware about where this partition values exactly get stored. After writing a create partition query, for example:

CREATE TABLE orders(id INT, shipdate DATE, …)
  PARTITION BY RANGE(shipdate)
    (
    STARTING '1/1/2006' ENDING '12/31/2006' 
     EVERY 3 MONTHS
    )  

运行上述查询后,我们知道每 3 个月按订单创建分区,但是当我们运行选择查询时,查询引擎会引用此分区.我很想知道这实际上存储在哪里,无论是在同一个表中还是 DB2 有一个不同的表,每个表的分区值都存储在其中.

after running the above query we know that partitions are created on order for every 3 month but when we run a select query the query engine refers this partitions. I am curious to know where this actually get stored, whether in the same table or DB2 has a different table where partition value for every table get stored.

谢谢,

推荐答案

经过一番研究,我终于弄明白了,想把这个信息分享给大家,希望对大家有用.

After a bit of research I finally figure it out and want to share this information with others, I hope it may come useful to others.

如何查看这个键值?=> 对于 LUW (Linux/Unix/Windows),您可以在 Table Object Editor 或 Object Viewer Script 选项卡中看到键.对于 z/OS,有一个名为限制键"的对象查看器选项卡.我已打开问题 TDB-885 为 LUW 表创建对象查看器选项卡.

How to see this key values ? => For LUW (Linux/Unix/Windows) you can see the keys in the Table Object Editor or the Object Viewer Script tab. For z/OS there is an Object Viewer tab called "Limit Keys". I've opened issue TDB-885 to create an Object Viewer tab for LUW tables.

检查这些值的简单查询:

A simple query to check this values:

从 SYSCAT.DATAPARTITIONS 中选择 *

SELECT * FROM SYSCAT.DATAPARTITIONS

哪里的选项卡 = ?AND TABNAME = ?

WHERE TABSCHEMA = ? AND TABNAME = ?

按顺序排列

参考:http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0021353.html?lang=zh

这篇关于DB2 分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆