If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > List Table Parititions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-09, 14:29
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
List Table Parititions

I have a table partitioned in DB2 V9.5 with something similar to the following:

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

Once the table is created and data has been loaded, how do I see what partitions exist so they can be detached, dropped, etc?
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #2 (permalink)  
Old 01-15-09, 15:02
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
syscat.datapartitions?
Reply With Quote
  #3 (permalink)  
Old 01-19-09, 04:43
JAYANTA_DATTA JAYANTA_DATTA is offline
Registered User
 
Join Date: Oct 2004
Location: DELHI INDIA
Posts: 336
Thats correct Nick.

To see on which filed you have your range partition defined, you can use SYSCAT.DATAPARTITIONEXPRESSION.

And to see the definition for each partitions so that you can detach some of them, you need to use "select datapartitionname,lowvalue,highvalue from syscat.DATAPARTITIONS where tabname = 'TB_TEST' with ur"
__________________

Jayanta Datta
DB2 UDB DBA
IBM India, Global Delivery
New Delhi
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On