DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: getting partition name for a value

  1. #1
    Join Date
    Jul 2006
    Posts
    195

    getting partition name for a value

    Is the a query I can issue that will return me the partition name based on
    a specific value of the column that is being paritioned/

    Assume I have the following table definition (see below). What query
    can I use to find the parition name for dt=20101231
    In the example below I would expect to see "part1"

    CREATE TABLE t
    (
    dt date,
    x int,
    y char(2000)
    )
    PARTITION BY RANGE (dt)
    (
    PARTITION part1 VALUES LESS THAN (to_date('05-jan-2011','dd-mon-yyyy')) ,
    PARTITION part2 VALUES LESS THAN (to_date('06-jan-2011','dd-mon-yyyy')) ,
    PARTITION junk VALUES LESS THAN (MAXVALUE)
    ) storage ( initial 10m ) tablespace users

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Sure - just query dba_tab_partitions.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

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


Click Here to Expand Forum to Full Width