Personal tools
You are here: Home DB2 DB2 UDB v9 How to know the number of partitons and ranges from partitioned tables
Navigation
Log in


Forgot your password?
 
Document Actions

How to know the number of partitons and ranges from partitioned tables

SYSCAT.DATAPARTITIONS

Apply the command below to find out the partitions from partitioned tables:

 

db2 "SELECT SUBSTR(tabname, 1,16) tabname, \
SUBSTR(datapartitionname, 1, 12) datapartitionname, \
seqno, SUBSTR(lowvalue, 1, 12) as lowvalue, LOWINCLUSIVE, \
SUBSTR(highvalue, 1, 12) as highvalue,HIGHINCLUSIVE \
FROM SYSCAT.DATAPARTITIONS WHERE TABNAME='SALDOCONTABIL' ORDER BY seqno" 


Output:

TABNAME   DATAPARTITIONNAME SEQNO       LOWVALUE   LOWINCLUSIVE  HIGHVALUE  HIGHINCLUSIVE
---------------- --------------------------------  --------------  ------------------  ----------------------  --------------------- -------------
SALDO        PARTIMIN                           0                  MINVALUE     Y                             '2003-01-01'           N           
SALDO        HISTORICO                        1                  '2003-01-01'   Y                             '2007-12-31'           Y           
SALDO        PART1                                 2                  '2008-01-01'   Y                             '2008-02-01'           N           
SALDO        PART2                                 3                  '2008-02-01'   Y                             '2008-03-01'           N           
SALDO       PART3                                  4                  '2008-03-01'   Y                             '2008-04-01'           N           
SALDO       PART4                                  5                  '2008-04-01'   Y                             '2008-05-01'           N           

 



Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls