I want to check partitioning key values of a table in DB2. I just now joined a new team and they are using DB2 partitioning on few tables(and I have to alter those partitions as data increasing and old partitions are not effective.) How can I see current partition key values of a table ?
Thanks,
Help will be appreciated.
For LUW 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.
Thanks.
Thanks Adam,
Just curious, where did this key values get stored ?
In the same table or DB2 maintains a separate table in a database to store key values for all the tables in a same DB.
Thanks again
SELECT * FROM SYSCAT.DATAPARTITIONS
WHERE TABSCHEMA = ? AND TABNAME = ?
ORDER BY SEQNO
Thanks [mention:ba78786bfdeb4563ac0935414b41acb9:e9ed411860ed4f2ba0265705b8793d05]
Table partitioning is a data organization scheme in which table data is divided across multiple storage objects called data partitions or ranges.
www.ibm.com/…/dm-0605ahuja2 copy this link and check it out.
thanks
The partitioning key is defined using the DISTRIBUTED BY HASH
clause in the CREATE TABLE
command. After the partition key is defined, it cannot be altered. The only way to change it is to recreate the table.