Re: Questions about DB2 range partition On Mar 14, 11:39*am, Serge Rielau <srie...@ca.ibm.com> wrote:
> Challenge wrote:
> > Hi,
>
> > I have some questions about DB2 range parition and I cannot find the
> > answer from the document.
>
> > 1. Can I name the partition name for every partition in a range
> > partition? For example, p2008jan for data of Jan, 2008?
>
> Yes. The clause is PARTITION <partitionname> see CREATE TABLE.
>
> > 2. Can I select data from a particular partition? Such as, select
> > count(*) from <owner>.<table_name>.<partition1>
>
> Absolutely not. And that is by design.
> Partitioning is part of physical design it does not belong into SQL.
> Use a range query to get the data you want.
> The effect shoule be the same.
>
> > 3. Which catalog tables provide information about range partition
> > tables?
>
> SYSCAT.DATAPARTITIONS, SYSCAT.DATAPARTITIONEXPRESSION
>
> Cheers
> Serge
> --
> Serge Rielau
> DB2 Solutions Development
> IBM Toronto Lab
Thanks, Serge. For the Q no. 1, I finially created a table with
partition names. I made a syntax error before.
For Q no. 2, I can select data from a partition in Oracle. So I tried
to find a similar thing in DB2. Yes, I can select data by a range
query. But how can I know that data are distributed in the right
partition?
For Q no. 3, it seems that I couldn't find the some information I want
to know from the catalog tables. Such as, data distribution in
different partitions, etc. |