11-06-15, 06:12 #1Registered User
- Join Date
- Nov 2015
Unanswered: How partition of table space works in DB2?
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;
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;
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.
11-10-15, 04:20 #2Registered User
Provided Answers: 11
- Join Date
- Apr 2006
wrong entry : sorry
Last edited by przytula_guy; 11-10-15 at 04:21. Reason: wrong entryBest 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
11-10-15, 04:57 #3Registered User
Provided Answers: 55
- Join Date
- Jul 2013
- Moscow, Russia
Is this so hard to try?
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,