Range partiotion using interval partitioning

Hi all,
I am trying to create a partitioned table so that a number (which date converted to number ) partition is created on inserting a new row for release_date column.
But please note that release_date column is having number data type (as per design) and people want to create an interval based partition on this.
Any work around for this?
They want data type NOT to be altered.
create table product(
prod_id number,
prod_code varchar2(3),
release_date number)
partition by range(release_date)
interval(NUMTOYMINTERVAL (1,'MONTH'))
(partition p0 values less than (20120101))
Thanks in advance

>
I am trying to create a partitioned table so that a number (which date converted to number ) partition is created on inserting a new row for release_date column.
But please note that release_date column is having number data type (as per design) and people want to create an interval based partition on this.
>
You can't use interval partitioning on the NUMBER column but you can add a VIRTUAL column based on it that uses DATE datatype.
create table product(
prod_id number,
prod_code varchar2(3),
release_date number,
rel_date DATE as (to_date(to_char(release_date), 'yyyymmdd')) VIRTUAL
partition by range(rel_date)
interval(NUMTOYMINTERVAL (1,'MONTH'))
   partition p0 values less than (to_date('20120101', 'yyyymmdd'))
)The virtual column is a metadata only column (i.e. no data is stored for it).
NOTE: you will need to modify your queries to use the 'REL_DATE' column in order to get partition pruning:
insert into product (prod_id, prod_code, release_date) values (1,'abc', 20110502)
insert into product (prod_id, prod_code, release_date) values (1,'abc', 20120502)
-- this query does NOT prune
select * from product where release_date < 20120101
|   0 | SELECT STATEMENT    |         |     1 |    38 |     4   (0)| 00:00:01 |       |       |
|   1 |  PARTITION RANGE ALL|         |     1 |    38 |     4   (0)| 00:00:01 |    1 |1048575|
|*  2 |   TABLE ACCESS FULL | PRODUCT |     1 |    38 |     4   (0)| 00:00:01 |    1 |1048575|
-- this query DOES prune
select * from product where rel_date < to_date('20120101', 'yyyymmdd')
|   0 | SELECT STATEMENT       |         |     1 |    38 |     3   (0)| 00:00:01 |       |       |
|   1 |  PARTITION RANGE SINGLE|         |     1 |    38 |     3   (0)| 00:00:01 |     1 |     1 |
|*  2 |   TABLE ACCESS FULL    | PRODUCT |     1 |    38 |     3   (0)| 00:00:01 |     1 |     1 |

Similar Messages

  • Using INTERVAL partition with Informatica

    Curious to know if anyone has attempted using Oracle's INTERVAL partitioning method in conjunction with Informatica. My attempts have all resulted in an ORA-14400 error. However, slightly modifying the source qualifier SQL and executing in SQLPlus dynamically creates the partitions as expected. When standard RANGE partitions are created (without the INTERVAL option), Informatica will load the target table as expected.

    Hence you just want to add a number of hours to a date?
    select LOCATION_DATE + LOCATION_TIMEZONE/24 NEW_TIME from tablexMax
    http://oracleitalia.wordpress.com
    Edited by: Massimo Ruocchio on Feb 19, 2010 12:21 AM

  • Possible to use interval partitions to drop old partitions?

    Interval partitions can add new partitions and I can do a range by date. This is helpful. However, lets say I have alot of tables in my database and I need to keep data for different lengths of time in different tables. Can I set something in the intervals to drop older partitions?
    I don't think I can, but I thought I would ask. I can do this with code. However, if oracle does it for me, I don't want to do it myself.

    Can not be done but you can use the HIGH_VALUE column, or the PARTITION_POSITION columns to make decisions.
    Just remember that you can never drop the root partition so build the initial partition such that it is very small and not used.

  • Use securefile for new partitions made by interval partitioning

    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production.
    I have a range partitioned table having lobs as basicfile. Due to storage issue and other business constraints , it is determined not to change existing lobs to securefile.
    However ,we want new lobs to be in securefile and alter table to have  interval partition+.
    While researching, I found sql to change lob in range partition to securefile by using
    alter table t1 add partition t1_p2 value less than (10000) lob (col3) store as securefile (tablespace tbs_sf1)Please advise me to do similar  in case of interval partition.
    Many thanks for assistance.

    >
    Can we modify default attribute of lob to store as securefile for partition table.
    >
    Yes - that is what I meant in my reply. But it seems I may have been wrong since after further testing I was able to find syntax that would appear to work for you. Please test this and post the results.
    The line
    LOB(CLOB_DATA) store as securefileshould store intervals as securefile. But it accepted syntax to store the predefined partitions as basicfile
      PARTITION P0 VALUES LESS THAN
      (TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
      LOB(CLOB_DATA) store as basicfile,I don't have time to test with data until next week. But if this works you could predefine all of your partitions that you want to use basicfile for and then use interval partitions for the ones you want securefile for. That sounded like what you were trying to do.
    DROP TABLE INTERVAL_SALES1 CASCADE CONSTRAINTS;
    CREATE TABLE INTERVAL_SALES1
      PROD_ID        NUMBER(6),
      CUST_ID        NUMBER,
      TIME_ID        DATE,
      CHANNEL_ID     CHAR(1 BYTE),
      PROMO_ID       NUMBER(6),
      QUANTITY_SOLD  NUMBER(3),
      AMOUNT_SOLD    NUMBER(10,2),
      CLOB_DATA      CLOB
    LOB(CLOB_DATA) store as securefile
    PARTITION BY RANGE (TIME_ID)
    INTERVAL( NUMTOYMINTERVAL(1,'MONTH'))
      PARTITION P0 VALUES LESS THAN
      (TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
      LOB(CLOB_DATA) store as basicfile,
      PARTITION P1 VALUES LESS THAN (TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')), 
      PARTITION P2 VALUES LESS THAN (TO_DATE(' 2009-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
      PARTITION P3 VALUES LESS THAN (TO_DATE(' 2010-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    )Post the results of any testing you do.

  • Creating DOMAIN INDEX on INTERVAL PARTITIONING

    Hi !
    I hava a problem, and I hope someone can help me!
    Two questions are asked below:
    1. Main question: HOW CAN I SOLVE THIS PROBLEM, ARE THERE OTHER WAYS DOING THE SAME JOB (MAYBE FASTER) ?
    2. Additionally: Is there a way to accelerate the deletion process
    Step 1: Creating the table* For Information how I create the table:
    CREATE TABLE LOC_EXAMPLE
    COLUMN1 NUMBER
    COLUMN2 NUMBER
    COLUMN3 NUMBER
    COLUMN4 NUMBER
    START_TIME TIMESTAMP
    GEOLOC MDSYS.SDO_GEOMETRY,
    TABLESPACE DB_DATA
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOLOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING
    PARTITION BY RANGE (START_TIME)
    INTERVAL (NUMTODSINTERVAL(1,'DAY'))
         PARTITION PART_LOC_EXAMPLE VALUES LESS THAN (TO_DATE('01-01-2008','dd-MM-yyyy'))
    ALTER TABLE LOC_EXAMPLE
    ADD CONSTRAINT PK_LOC_EXAMPLE PRIMARY KEY (COLUMN2,COLUMN4)
    DELETE FROM USER_SDO_GEOM_METADATA VALUE WHERE TABLE_NAME = 'LOC_EXAMPLE'
    INSERT INTO USER_SDO_GEOM_METADATA VALUES ('LOC_EXAMPLE','GEOLOC', MDSYS.SDO_DIM_ARRAY( MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.001111949), MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.001111949) ), 8307)
    STEP 2: I TRY TO CREATE SPATIAL INDEX (ITS A DOMAIN INDEX IF I'M NOT WRONG) ON PARTITIONED TABLE*
    (PARTITIONED TABLE is an extension of range partitioning)
    CREATE INDEX LOC_EXAMPLE_idx ON LOC_EXAMPLE'(GEOLOC)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX LOCAL;
    THE SECOND STEP IS NOT POSSIBLE AS THE ORACLE DOCUMENTATION SAYS:
    When using interval partitioning, consider the following restrictions:
    -You can only specify one partitioning key column, and it must be of NUMBER or DATE type.
    -Interval partitioning is not supported for index-organized tables.
    -You cannot create a domain index on an interval-partitioned table.
    1) I THINK IT IS IMPOSSIBLE FOR ME TO PASS ON INTERVAL PARTITIONING (AMOUNT OF DATA IS REALY BIG).
    This partitioning is also used to delete datas from database once a mounth (scheduled on the basis of the partitions).
    Is there a way to accelerate the deletion process?
    2) I NEED A SPATIAL INDEX! NO WAY TO PASS ON IT!
    HOW CAN I SOLVE THIS PROBLEM, ARE THERE OTHER WAYS DOING THE SAME JOB (MAYBE FASTER) ?
    Why is it not possible to create a domain index on interval partitioning, any reason?
    Will this be possible anytime?
    I would be grateful to read any advise ...!
    Thanking you in anticipation,
    Ali

    There is a forum here at OTN for spatial. Please delete the contents of this post and ask your question there. Thanks.

  • Creating DOMAIN INDEX (SPATIAL) on INTERVAL PARTITIONING

    Hi !
    I hava a problem, and I hope someone can help me!
    Two questions are asked below:
    1. Main question: HOW CAN I SOLVE THIS PROBLEM, ARE THERE OTHER WAYS DOING THE SAME JOB (MAYBE FASTER) ?
    2. Additionally: Is there a way to accelerate the deletion process
    Step 1: Creating the table For Information how I create the table:
    CREATE TABLE LOC_EXAMPLE
    COLUMN1 NUMBER
    COLUMN2 NUMBER
    COLUMN3 NUMBER
    COLUMN4 NUMBER
    START_TIME TIMESTAMP
    GEOLOC MDSYS.SDO_GEOMETRY,
    TABLESPACE DB_DATA
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOLOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING
    PARTITION BY RANGE (START_TIME)
    INTERVAL (NUMTODSINTERVAL(1,'DAY'))
    PARTITION PART_LOC_EXAMPLE VALUES LESS THAN (TO_DATE('01-01-2008','dd-MM-yyyy'))
    ALTER TABLE LOC_EXAMPLE
    ADD CONSTRAINT PK_LOC_EXAMPLE PRIMARY KEY (COLUMN2,COLUMN4)
    DELETE FROM USER_SDO_GEOM_METADATA VALUE WHERE TABLE_NAME = 'LOC_EXAMPLE'
    INSERT INTO USER_SDO_GEOM_METADATA VALUES ('LOC_EXAMPLE','GEOLOC', MDSYS.SDO_DIM_ARRAY( MDSYS.SDO_DIM_ELEMENT('X',-180,180,0.001111949), MDSYS.SDO_DIM_ELEMENT('Y',-90,90,0.001111949) ), 8307)
    STEP 2: I TRY TO CREATE SPATIAL INDEX (ITS A DOMAIN INDEX IF I'M NOT WRONG) ON PARTITIONED TABLE
    (PARTITIONED TABLE is an extension of range partitioning)
    CREATE INDEX LOC_EXAMPLE_idx ON LOC_EXAMPLE'(GEOLOC)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX LOCAL;
    THE SECOND STEP IS NOT POSSIBLE AS THE ORACLE DOCUMENTATION SAYS:
    When using interval partitioning, consider the following restrictions:
    -You can only specify one partitioning key column, and it must be of NUMBER or DATE type.
    -Interval partitioning is not supported for index-organized tables.
    -You cannot create a domain index on an interval-partitioned table.
    1) I THINK IT IS IMPOSSIBLE FOR ME TO PASS ON INTERVAL PARTITIONING (AMOUNT OF DATA IS REALY BIG).
    This partitioning is also used to delete datas from database once a mounth (scheduled on the basis of the partitions).
    Is there a way to accelerate the deletion process?
    2) I NEED A SPATIAL INDEX! NO WAY TO PASS ON IT!
    HOW CAN I SOLVE THIS PROBLEM, ARE THERE OTHER WAYS DOING THE SAME JOB (MAYBE FASTER) ?
    Why is it not possible to create a domain index on interval partitioning, any reason?
    Will this be possible anytime?
    I would be grateful to read any advise ...!
    Thanking you in anticipation,
    Ali

    Is it possible to just use a normal range-partitioned table?
    CREATE TABLE LOC_EXAMPLE
    START_TIME TIMESTAMP
    GEOLOC MDSYS.SDO_GEOMETRY,
    PARTITION BY RANGE (START_TIME)
    PARTITION P1 VALUES LESS THAN (TO_DATE('01-01-2008','dd-MM-yyyy'))
    alter table loc_example add partition p2 VALUES LESS THAN (TO_DATE('02-01-2008','dd-MM-yyyy'));
    alter table loc_example drop partition p1;
    I understand it is not as perfect as interval partitioning, since
    you have to drop an old partition/add a new one either manually
    or by some script. But you should be able to create a spatial domain index
    on it.

  • Interval Partition naming Issue (Oracle 11g R2 )

    I need help on identifying latest partition:
    I am using Interval Partition for my table,which creates partition every month end based on inserted data.
    When oracle creates partition assigning its own name but users have automated reports using partition names like Table_name_YYYYMM.
    I tested following ways to identify partition then renamed,worked fine but in long run do i get any problems ?
    or any other way to identify the latest partition ?
    1)Using max partition position :
    select partition_name from dba_tab_partitions a where partition_position = (select max(partition_position)
    from user_tab_partitions b where a.table_name=b.table_name
    and b.table_name = 'INTRVL_PARTITION');
    2)Using Sub Object max creation date :
    SELECT SUBOBJECT_NAME FROM dba_objects
    WHERE OBJECT_TYPE='TABLE PARTITION'
    AND OWNER='ABCD'
    AND OBJECT_NAME='INTRVL_PARTITION'
    AND CREATED=(SELECt MAX(CREATED) FROM DBA_OBJECTS
    WHERE OBJECT_TYPE='TABLE PARTITION'
    AND OWNER='ABCD'
    AND OBJECT_NAME='INTRVL_PARTITION');
    Thanks in advance .
    Edited by: user607128 on Mar 2, 2012 7:09 AM

    Your initial question said you were already using interval partitioning.
    >
    I am using Interval Partition for my table
    now users asking to convert Range to Interval Partition and keeping existing partitions same name.
    >
    So is your issue that you want to use interval partitining for a table now is now using range partitioning? Why are your users driving this change? That should be a decision made by the DBA and technical management since the difference is mainly on of management.
    Though there is one BIG difference that is data related. With interval partitioning if data (even erroneous data) is inserted for a partition that does not exist Oracle will create one. So if you have an insert statement that inserts 12 records for the year '2038' you will get 12 new partitions even though the data may be bogus.
    Now your management problem is detecting the problem, deleting the data (or fixing the date to move it to the right partition) and then dropping the partitions and storage.
    With 'interval' partitioning you had better be absolutely sure your data is clean in terms of the partitioning key values.
    That said, you can use table redefinition or just create a new interval partitioned table and do partition exchanges with the existing partitions to move the data.

  • Interval Partitioning

    Hi everyone,
    I've got a question about interval partitioning. I've got a fact table, W_GL_BALANCE_F that is fairly massive and I want to use interval partitioning on the BALANCE_DT_WID field. The values in the field are of the form YYYYMMDD || '000', i.e. 20100820000 would be today, 20100821000 would be tomorrow, etc.
    I create the table with interval partitioning with an interval of 1000, and then when I go to insert the data, I get the error "Partition does not exist". I was a little confused because I thought interval partitions created partitions for any new value.
    I ran some tests on a test table part_test(part_key number) partition range interval (1) ( partition "zero" less than 1). Then I inserted a few test records
    INSERT INTO part_test (part_key) values (1);
    INSERT INTO part_test (part_key) values (2);
    INSERT INTO part_test (part_key) values (10);
    INSERT INTO part_test (part_key) values (1000000); --- This causes error "Partition does not exist"
    Obviously there are some additional rules to go along with using the intervals. I was under the impression that it would just create a range for any new value but it seems more complicated than that.
    Can someone explain to me why the final record isn't able to have a new partition created for it?
    I apologize if this is a dumb question, but I'm a little new to the different partitioning options.
    Best regards and thanks for the help!
    -Joe

    Joe Bertram wrote:
    Hi Tubby,
    Just to give you a little more background, I am working with the Oracle BI Applications prepackaged data warehouse and ETLs. Because it's all prepackaged ETLs, I don't have too much flexibility to change the data being loaded, otherwise, I totally agree that using this date format is kind of strange. Thanks for the information, helps to know :)
    Joe Bertram wrote:
    I looked at other fields on the table for a potential partition key, and this field was the only one that was remotely uniformly distributed. That really isn't the first consideration you should have for partitioning. What are you trying to accomplish with partitioning? Are you looking to make data archival easier (dropping old partitions is the easiest way to go), or are you looking to enhance querying? Partitioning is a tool you implement for a given purpose ... so what's yours?
    Joe Bertram wrote:>
    You are correct, my test case was a little simplistic. I went back to the data the see why your case succeeded and mine failed. It turns out I missed one part in the date format. In addition to the date format as I laid it out, they also append the calendar ID which refers to the fiscal calender to which the date belongs. the actual format is <4-digit-cal_id>YYYYMMDD<000> i.e. 100120100820000 is today on calendar 1001, but there could also be a calendar 1007 which could have today's date i.e. 100720100820000.
    drop table part_test;
    create table part_test
    part_key number
    partition by range (part_key)
    interval (1000)
    partition zero_1 values less than (100120100820000)
    INSERT INTO part_test (part_key) values (100120100820000);
    INSERT INTO part_test (part_key) values (100720100820000); -- same day on calendar 1007, causes an errorIt pretty much seems to me that there would be too many potential partitions, so the DB gives up. Is that correct?That indeed seems to be the case, you could perhaps raise a service request with Oracle, but i'm not sure how eager they'd be to enhance the interval partitioning for this case. This data doesn't seem like it would be a good candidate for range partitioning. Again, we need to know what you're goal is from partitioning.
    If housekeeping is paramount (keeping X days of data and purging old data) then i would suggest the following.
    create table part_test
       part_key       number,
       magic_column   generated always as ( to_date(substr (part_key, 5, 8), 'yyyymmdd') ) virtual
       partition by range (magic_column)
       INTERVAL ( INTERVAL '1' DAY)
       partition zero_1 values less than ( to_date('20100820', 'yyyymmdd') )
    );Partitioning by a virtual column, the date in this case.
    It's possibly you have a more logical key to partition off of, but a RANGE partition scheme on your part_key doesn't sound good at all.

  • Oracle 11g interval partitioning - meaningfull partition-names

    Hello,
    On 11g, when creating interval partitions, the partitions get automatically created just fine. Very nice feature. But is it possible to supply meaningfull names to them?
    Now they get names SYS_nnn, but I would like to name them for instance SALES_2007.
    Here is one example on how to use interval partitioning:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b32024/part_admin.htm#BAJHFFBE
    And here is the syntax guide:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_7002.htm#sthref7644
    I don't see how to accomplish meaningfull names (automatically!). Do you?

    No I don't think it is possible. This is what is written in Oracle documentation..
    http://download.oracle.com/docs/cd/B28359_01/server.111/b32024/partition.htm#CACHFHHF
    >
    The range partitioning key value determines the high value of the range partitions, which is called the transition point, and the database creates interval partitions for data beyond that transition point.
    >

  • 11g interval partitioning and global index maintenance

    hi gurus,
    in 11g interval partitioning system can automatically manage the creation of new partitions based on data.
    in this case do we need to manage global indexes?
    in earlier versions, we have to update global indexes whenever there is a partition maintenance operation.
    please suggest.
    thanks,
    charles

    user570138 wrote:
    in earlier versions, we have to update global indexes whenever there is a partition maintenance operation.In 10gR2 you don't need to update/rebuild a global index after adding a partition to the base table.
    So it should be the same when using interval partitioning.
    Regards
    Maurice

  • How to achieve Interval partition by Weekly ?

    Hi All,
    How to use interval partition by weekly wise?
    please share some examples.

    after the above link read http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:549370300346187664

  • Existing Range partition to Interval Partition

    I have an Range and list partition tables on Oracle 11g with some records and have to move the
    range and List partition tables to interval partitions. I tried for the range partition
    table with following query,
    SQL> alter table F_PTP_PAYMENTS set interval (numtoyminterval(3,'MONTH'));
    alter table F_PTP_PAYMENTS set interval (numtoyminterval(3,'MONTH'))
    ERROR at line 1:
    ORA-14759: SET INTERVAL is not legal on this table.
    it doesnt worked out.
    Can you please help me to create the interval partitions.

    ORA-14759: SET INTERVAL is not legal on this table.
    Cause: ALTER TABLE SET INTERVAL is only legal on a range partitioned table with a single partitioning column. Additionally this table cannot have a maxvalue partition.
    Action: Use SET INTERVAL only on a valid table
    mark answered post as helpful / correct*

  • Range interval partitioning

    Hi,
    Using Oracle 11.20.3
    We wish to have a range-hash composite partitioned table, one partition for each month.
    However, want to esnure are always a partition tehrfore would like to use range interval partitioning.
    Have a few questions, if have partition say 201301 to 201312 but get somew rosw which have value in date in June 2014 would it create
    a new partition for each month i.e 201401, 201402 etc or just one for 201406?
    Wanyt esnure system can cope automatically with following scenario
    Daty1 have partitions 201301 to 201312
    Day2 get record for 201406 (June 2014)
    Day 3 get record for 201403 (March 2014)
    We have no control of the range of dates we could get but don't want tpo have to manually create partitions fro all tehse dates in advance - want system to handled it automatically.
    Also can you simply rename the system generated partition names to something more meaningful later.

    >
    Using Oracle 11.20.3
    We wish to have a range-hash composite partitioned table, one partition for each month.
    However, want to esnure are always a partition tehrfore would like to use range interval partitioning.
    Have a few questions, if have partition say 201301 to 201312 but get somew rosw which have value in date in June 2014 would it create
    a new partition for each month i.e 201401, 201402 etc or just one for 201406?
    Wanyt esnure system can cope automatically with following scenario
    Daty1 have partitions 201301 to 201312
    Day2 get record for 201406 (June 2014)
    Day 3 get record for 201403 (March 2014)
    We have no control of the range of dates we could get but don't want tpo have to manually create partitions fro all tehse dates in advance - want system to handled it automatically.
    >
    Do NOT be afraid of breaking Oracle by actually trying things yourself.
    DROP TABLE emp_part
    CREATE TABLE emp_part (empno number(4), ename varchar2(10),
    deptno number(2), created_date DATE default sysdate)
      partition by range (created_date)
         SUBPARTITION BY HASH(deptno) subpartitions 4
    ( partition p_prior_to_2014 values less than (to_date('01-01-2014', 'mm-dd-yyyy')));Add some data for 2014 and see for yourself what happens.
    >
    Also can you simply rename the system generated partition names to something more meaningful later.
    >
    Yes - assuming you mean more meaninful to a human. Oracle doesn't care what the name is.
    And you can just as easily manipulate the partition (delete, insert, drop truncate) regardless of the name since you don't need to use the name to do those things.
    You either know the date for the partition you want to work with or you don't. If you know then just tell Oracle and it will work with the correct partition. If you don't believe me try it with the sample code I gave you. Add some data to get a couple of interval partitions created and then drop one of them using Oracle's extended partition syntax. See this example in the 'Dropping Interval Partitions in the VLDB and Partitioning Guide
    http://docs.oracle.com/cd/B28359_01/server.111/b32024/part_admin.htm#i1007479
    >
    The following example drops the September 2007 interval partition from the sales table. There are only local indexes so no indexes will be invalidated.
    ALTER TABLE sales DROP PARTITION FOR(TO_DATE('01-SEP-2007','dd-MON-yyyy'));
    >
    That code doesn't require the partition name. You just need to specify a date that falls IN the partition that you want to drop. You have to do that whether you know the name of the partition or not. Don't 'gunk up' your system with code to rename things unless there is some real need to.

  • Range interval partitioning - ability to set tablespace?

    Hi,
    We have a range partitioned table, considering making it a range-interval partitioned one.
    I know can query/identify partitions by using syntax to the range to which the partition relates.
    If set to range interval, wht tablespace are new ones created in, is it the default tablespace of the database or can you ensure they are automatcially created in specific tablespace.
    Is there any way of setting name to be something more meaninful automatically rather than having to write sql to query data dictionary to do this?
    Many Thanks

    There are no undocumented features in Oracle.
    What did the documentation tell, apart from it isn't possible?
    Sybrand Bakker
    Senior Oracle DBA

  • Trying to convert Interval Partitioned Table to Range..Exchange Partition..

    Requirement:
    Replace Interval partitioned Table by Range Partitioned Table
    DROP TABLE A;
    CREATE TABLE A
       a              NUMBER,
       CreationDate   DATE
    PARTITION BY RANGE (CreationDate)
       INTERVAL ( NUMTODSINTERVAL (30, 'DAY') )
       (PARTITION P_FIRST
           VALUES LESS THAN (TIMESTAMP ' 2001-01-01 00:00:00'));
    INSERT INTO A
         VALUES (1, SYSDATE);
    INSERT INTO A
         VALUES (1, SYSDATE - 30);
    INSERT INTO A
         VALUES (1, SYSDATE - 60);I need to change this Interval Partitioned Table to a Range Partitioned Table. Can I do it using EXCHANGE PARTITION. As if I use the conventional way of creating another Range Partitioned table and then :
    DROP TABLE A_Range
    CREATE TABLE A_Range
    a NUMBER,
    CreationDate DATE
    PARTITION BY RANGE (CreationDate)
       (partition MAX values less than (MAXVALUE));
    Insert  /*+ append */  into A_Range Select * from A; --This Step takes very very long..Trying to cut it short using Exchange Partition.Problems:
    I can't do
    ALTER TABLE A_Range
      EXCHANGE PARTITION MAX
      WITH TABLE A
      WITHOUT VALIDATION;
    ORA-14095: ALTER TABLE EXCHANGE requires a non-partitioned, non-clustered table
    This is because both the tables are partitioned. So it does not allow me.
    If I do instead :
    create a non partitioned table for exchanging the data through partition.
      Create Table A_Temp as Select * from A;
       ALTER TABLE A_Range
      EXCHANGE PARTITION MAX
      WITH TABLE A_TEMP
      WITHOUT VALIDATION;
      select count(*) from A_Range partition(MAX);
    -Problem is that all the data goes into MAX Partition.
    Even after creating a lot of partitions by Splitting Partitions, still the data is in MAX Partition only.
    So:
    -- Is it that we can't Replace an Interval Partitioned Table by Range Partitioned Table using EXCHANGE PARTITION. i.e. We will have to do Insert into..
    -- We can do it but I am missing something over here.
    -- If all the data is in MAX Partition because of "WITHOUT VALIDATION" , can we make it be redistributed in the right kind of range partitions.

    You will need to pre-create the partitions in a_range, then exchange them one by one from a to a tmp then then to arange. Using your sample (thanks for proviing the code by the way).
    SQL> CREATE TABLE A
      2  (
      3     a              NUMBER,
      4     CreationDate   DATE
      5  )
      6  PARTITION BY RANGE (CreationDate)
      7     INTERVAL ( NUMTODSINTERVAL (30, 'DAY') )
      8     (PARTITION P_FIRST
      9         VALUES LESS THAN (TIMESTAMP ' 2001-01-01 00:00:00'));
    Table created.
    SQL> INSERT INTO A VALUES (1, SYSDATE);
    1 row created.
    SQL> INSERT INTO A VALUES (1, SYSDATE - 30);
    1 row created.
    SQL> INSERT INTO A VALUES (1, SYSDATE - 60);
    1 row created.
    SQL> commit;
    Commit complete.You can find the existing partitions form a using:
    SQL> select table_name, partition_name, high_value
      2  from user_tab_partitions
      3  where table_name = 'A';
    TABLE_NAME PARTITION_NAME HIGH_VALUE
    A          P_FIRST        TO_DATE(' 2001-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
    A          SYS_P44        TO_DATE(' 2013-01-28 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
    A          SYS_P45        TO_DATE(' 2012-12-29 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
    A          SYS_P46        TO_DATE(' 2012-11-29 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAYou can then create table a_range with the apporopriate partitions. Note that you may need to create additional partitions in a_range because interval partitioning does not create partitions that it has no data for, even if that leaves "holes" in the partitioning scheme. So, based on the above:
    SQL> CREATE TABLE A_Range (
      2     a NUMBER,
      3     CreationDate DATE)
      4  PARTITION BY RANGE (CreationDate)
      5     (partition Nov_2012 values less than (to_date('30-nov-2012', 'dd-mon-yyyy')),
      6      partition Dec_2012 values less than (to_date('31-dec-2012', 'dd-mon-yyyy')),
      7      partition Jan_2013 values less than (to_date('31-jan-2013', 'dd-mon-yyyy')),
      8      partition MAX values less than (MAXVALUE));
    Table created.Now, create a plain table to use in the exchanges:
    SQL> CREATE TABLE A_tmp (
      2     a              NUMBER,
      3     CreationDate   DATE);
    Table created.and exchange all of the partitions:
    SQL> ALTER TABLE A
      2    EXCHANGE PARTITION sys_p44
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> ALTER TABLE A_Range
      2    EXCHANGE PARTITION jan_2013
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> ALTER TABLE A
      2    EXCHANGE PARTITION sys_p45
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> ALTER TABLE A_Range
      2    EXCHANGE PARTITION dec_2012
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> ALTER TABLE A
      2    EXCHANGE PARTITION sys_p46
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> ALTER TABLE A_Range
      2    EXCHANGE PARTITION nov_2012
      3    WITH TABLE A_tmp;
    Table altered.
    SQL> select * from a;
    no rows selected
    SQL> select * from a_range;
             A CREATIOND
             1 23-NOV-12
             1 23-DEC-12
             1 22-JAN-13John

Maybe you are looking for