Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2015
    Posts
    1

    Unanswered: How partition of table space works in DB2?

    Hi All,

    I want to know how the keys in the partition of a table works.

    I have 6 keys and all are used for partition, i have around 30 partitions based of different criteria.
    All partitions have ending at (key values), it does not have starting at (key values).

    For example CASE1;
    key1,Key2,key3
    partition 1 ending at (ABC,ABCB,25-10-2015)
    partition 2 ending at (ABC,ABCD,25-10-2015)
    partition 3 ending at (ABC,ABCD,20-11-2015)
    partition 4 ending at (ABC,ABCF,25-12-2015)

    i am inserting data of (ABC,ABCC,28-10-2015) TO WHICH PARTITION WILL THIS GO?

    For example CASE2;
    key1,Key2,key3
    partition 1 ending at (ABC,ABCB,25-10-2013)
    partition 2 ending at (ABC,ABCD,25-10-2014)
    partition 3 ending at (ABC,ABCF,20-11-2015)
    partition 4 ending at (ABC,ABCH,25-12-2015)

    i am inserting data of (ABC,ABCC,28-11-2015) TO WHICH PARTITION WILL THIS GO?

    Please explain me to understand the hierarchy and how key depends on inserting values to specific partition.

    Thank you

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    wrong entry : sorry
    Last edited by przytula_guy; 11-10-15 at 04:21. Reason: wrong entry
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    Is this so hard to try?
    Code:
    create table test_part (key1 varchar(10), key2 varchar(10), key3 date)
    partition by range (key1, key2, key3) (
      part p1 starting (minvalue, minvalue, minvalue)
              ending ('ABC','ABCB','2015-10-25')
    , part p2 ending ('ABC','ABCD','2015-10-25')
    , part p3 ending ('ABC','ABCD','2015-11-20')
    , part p4 ending ('ABC','ABCF','2015-12-25')
    )
    in userspace1;
    
    insert into test_part values ('ABC', 'ABCC', '2015-10-28');
    
    select d.datapartitionname, p.*
    from test_part p, syscat.datapartitions d
    where d.tabschema=user and d.tabname='TEST_PART'
    and d.seqno=datapartitionnum(p.key1);
    Regards,
    Mark.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •