Change partition by range column

Hi,
is it possible (oracel 11g) to change partition by range column for a table without recreating the whole table ?
now i have it : partition by range (COLUMN_A)
i need it : partition by range (COLUMN_B)
Thanks

Yes
Demos: http://www.morganslibrary.org/reference/partitions.html#rp
Look at the section titled: "Alter Table For Partitions"

Similar Messages

  • Change partitioned column range in range partioning in 11g

    Hi All,
    First of all , i am thankful to all of you for your help and suggestions in past. I have one new issue. I am using Oracle 11. There is one new functionality in 11g to do range paritioning while table creation and do daily partitioning.
    CREATE TABLE TEST(
    DUE_DAY DATE,
    ID VARCHAR2(10 BYTE),
    NAME VARCHAR2(25 BYTE)
    PARTITION BY RANGE (DUE_DAY)
    INTERVAL( NUMTODSINTERVAL(1,'DAY'))
    PARTITION FIRST VALUES LESS THAN (TO_DATE('2012-02-05 12:00:00', 'SYYYY-MM-DD HH24:MI:SS')));
    Now I found i create the partition range wrong so each partition has data from previous day 12:00 afternoon to today 12:00 afternoon instead of daily data from 00:00 am to 11:59 pm because i mentioned wrong range in partition.
    I supposed to do like this:
    CREATE TABLE TEST(
    DUE_DAY DATE,
    ID VARCHAR2(10 BYTE),
    NAME VARCHAR2(25 BYTE)
    PARTITION BY RANGE (DUE_DAY)
    INTERVAL( NUMTODSINTERVAL(1,'DAY'))
    PARTITION FIRST VALUES LESS THAN (TO_DATE('2012-02-05 00:00:00', 'SYYYY-MM-DD HH24:MI:SS')));
    My question is: Is there any way i can change it now as table already has huge data in it, so i cant go with creation of another partitioned table with correct partition range? Please let me know your suggestions and comments to resolve this issue.
    Regards
    Dev
    Edited by: Keen2Learn on Feb 10, 2012 9:12 AM

    Keen2Learn wrote:
    My question is: Is there any way i can change it now as table already has huge data in it, so i cant go with creation of another partitioned table with correct partition range? Please let me know your suggestions and comments to resolve this issue.Nope.
    I don't think it is possible to achieve this without creating a new/an intermediate table.
    If you can afford down-time, you should create new table, load data into it (in parallel with nologging), drop original table and rename new table.
    If you want this switchover as online operation, you can use DBMS_REDEFINITION as follows:
    SQL> select * from v$version ;
    BANNER                                                                                                                                                                    
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production                                                                                                    
    PL/SQL Release 11.2.0.2.0 - Production                                                                                                                                    
    CORE     11.2.0.2.0     Production                                                                                                                                                
    TNS for Linux: Version 11.2.0.2.0 - Production                                                                                                                            
    NLSRTL Version 11.2.0.2.0 - Production                                                                                                                                    
    SQL> CREATE TABLE TEST(
      2  DUE_DAY DATE,
      3  ID VARCHAR2(10 BYTE),
      4  NAME VARCHAR2(25 BYTE)
      5  )
      6  PARTITION BY RANGE (DUE_DAY)
      7  INTERVAL( NUMTODSINTERVAL(1,'DAY'))
      8  (
      9  PARTITION FIRST VALUES LESS THAN (TO_DATE('2012-02-01 12:00:00', 'SYYYY-MM-DD HH24:MI:SS')));
    Table created.
    SQL> insert into test(due_day, id) select (trunc(sysdate, 'MM')+(10/24)) + ((5*level)/24), level from dual connect by level <= 12 ;
    12 rows created.
    SQL> commit ;
    Commit complete.
    SQL> exec dbms_stats.gather_table_stats(user, 'TEST');
    PL/SQL procedure successfully completed.
    SQL> select partition_name, num_rows from user_tab_partitions where table_name = 'TEST' ;
    PARTITION_NAME                   NUM_ROWS                                                                                                                                 
    FIRST                                   0                                                                                                                                 
    SYS_P115                                5                                                                                                                                 
    SYS_P116                                4                                                                                                                                 
    SYS_P117                                3                                                                                                                                 
    SQL> SELECT * FROM TEST PARTITION (FIRST) ;
    no rows selected
    SQL> SELECT * FROM TEST PARTITION (SYS_P115) ;
    DUE_DAY              ID         NAME                                                                                                                                      
    01-FEB-2012 15:00:00 1                                                                                                                                                    
    01-FEB-2012 20:00:00 2                                                                                                                                                    
    02-FEB-2012 01:00:00 3                                                                                                                                                    
    02-FEB-2012 06:00:00 4                                                                                                                                                    
    02-FEB-2012 11:00:00 5                                                                                                                                                    
    SQL> SELECT * FROM TEST PARTITION (SYS_P116);
    DUE_DAY              ID         NAME                                                                                                                                      
    02-FEB-2012 16:00:00 6                                                                                                                                                    
    02-FEB-2012 21:00:00 7                                                                                                                                                    
    03-FEB-2012 02:00:00 8                                                                                                                                                    
    03-FEB-2012 07:00:00 9                                                                                                                                                    
    SQL> SELECT * FROM TEST PARTITION (SYS_P117);
    DUE_DAY              ID         NAME                                                                                                                                      
    03-FEB-2012 12:00:00 10                                                                                                                                                   
    03-FEB-2012 17:00:00 11                                                                                                                                                   
    03-FEB-2012 22:00:00 12                                                                                                                                                   
    SQL> exec DBMS_REDEFINITION.CAN_REDEF_TABLE('hr','TEST',DBMS_REDEFINITION.CONS_USE_ROWID);
    PL/SQL procedure successfully completed.
    SQL> CREATE TABLE INTR_TEST(
      2  DUE_DAY DATE,
      3  ID VARCHAR2(10 BYTE),
      4  NAME VARCHAR2(25 BYTE)
      5  )
      6  PARTITION BY RANGE (DUE_DAY)
      7  INTERVAL( NUMTODSINTERVAL(1,'DAY'))
      8  (
      9  PARTITION FIRST VALUES LESS THAN (TO_DATE('2012-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS')));
    Table created.
    SQL> exec DBMS_REDEFINITION.START_REDEF_TABLE('hr', 'TEST', 'INTR_TEST', 'due_day due_day, id id, name name', dbms_redefinition.cons_use_rowid);
    PL/SQL procedure successfully completed.
    SQL> exec DBMS_REDEFINITION.SYNC_INTERIM_TABLE('hr', 'TEST', 'INTR_TEST');
    PL/SQL procedure successfully completed.
    SQL> exec DBMS_REDEFINITION.FINISH_REDEF_TABLE('hr', 'TEST', 'INTR_TEST');
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_table_stats(user, 'TEST');
    PL/SQL procedure successfully completed.
    SQL> select partition_name, num_rows from user_tab_partitions where table_name = 'TEST' ;
    PARTITION_NAME                   NUM_ROWS                                                                                                                                 
    FIRST                                   0                                                                                                                                 
    SYS_P118                                2                                                                                                                                 
    SYS_P119                                5                                                                                                                                 
    SYS_P120                                5                                                                                                                                 
    SQL> SELECT * FROM TEST PARTITION (FIRST) ;
    no rows selected
    SQL> SELECT * FROM TEST PARTITION (SYS_P118) ;
    DUE_DAY              ID         NAME                                                                                                                                      
    01-FEB-2012 15:00:00 1                                                                                                                                                    
    01-FEB-2012 20:00:00 2                                                                                                                                                    
    SQL> SELECT * FROM TEST PARTITION (SYS_P119);
    DUE_DAY              ID         NAME                                                                                                                                      
    02-FEB-2012 01:00:00 3                                                                                                                                                    
    02-FEB-2012 06:00:00 4                                                                                                                                                    
    02-FEB-2012 11:00:00 5                                                                                                                                                    
    02-FEB-2012 16:00:00 6                                                                                                                                                    
    02-FEB-2012 21:00:00 7                                                                                                                                                    
    SQL> SELECT * FROM TEST PARTITION (SYS_P120);
    DUE_DAY              ID         NAME                                                                                                                                      
    03-FEB-2012 02:00:00 8                                                                                                                                                    
    03-FEB-2012 07:00:00 9                                                                                                                                                    
    03-FEB-2012 12:00:00 10                                                                                                                                                   
    03-FEB-2012 17:00:00 11                                                                                                                                                   
    03-FEB-2012 22:00:00 12                                                                                                                                                   
    SQL> select dbms_metadata.get_ddl('TABLE','TEST') from dual ;
    DBMS_METADATA.GET_DDL('TABLE','TEST')                                                                                                                                     
      CREATE TABLE "HR"."TEST"                                                                                                                                                
       (     "DUE_DAY" DATE,                                                                                                                                                      
         "ID" VARCHAR2(10),                                                                                                                                                       
         "NAME" VARCHAR2(25)                                                                                                                                                      
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255                                                                                                                        
      STORAGE(                                                                                                                                                                
      BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)                                                                                                       
      TABLESPACE "USERS"                                                                                                                                                      
      PARTITION BY RANGE ("DUE_DAY") INTERVAL (NUMTODSINTERVAL(1,'DAY'))                                                                                                      
    (PARTITION "FIRST"  VALUES LESS THAN (TO_DATE(' 2012-02-01 00:00:00', 'SYYYY-MM                                                                                          
    -DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) SEGMENT CREATION DEFERRED                                                                                                     
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING                                                                                                        
      STORAGE( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)                                                                                              
      TABLESPACE "USERS" )                                                                                                                                                    
    SQL> drop table intr_test purge ;
    Table dropped.
    SQL> drop table test purge ;
    Table dropped.
    SQL> spool offHope this helps.

  • Range partitioning on virtual column based on binary xmltype column

    Alright, our DBA finally got around to upgrading to 11.2.0.2. Now I'm running into another issue:
    CREATE TABLE USER.DI_D2
        ID NUMBER(19, 0) NOT NULL ,
        XML SYS.XMLTYPE ,
        PRIMARY KEY ( ID )
      XMLTYPE XML STORE AS SECUREFILE BINARY XML
      VIRTUAL COLUMNS
        ts AS (TO_TIMESTAMP(extractvalue(xml,'/d:d/c:dHeader/c:creationTime',
            'xmlns:d="http://www.example.com/m/d/schema/di"
             xmlns:c="http://www.example.com/m/schema/common"'),'YYYY-MM-DD"T"HH24:MI:SS'))
      PARTITION BY RANGE (ts)
        PARTITION d_p2012_07 VALUES LESS THAN (TO_DATE('1-8-2012','DD-MM-YYYY')),
        PARTITION d_px VALUES LESS THAN (MAXVALUE)
      );On our old 11.2.0.1 install this command works fine (tho due to other issues 11.2.0.1 doesn't work for our search queries)
    On our 11.2.0.2 install, I get the following error:
    Error at Command Line:10 Column:37
    Error report:
    SQL Error: ORA-14513: Partitiekolom mag niet van het gegevenstype object zijn.
    14513. 00000 -  "partitioning column may not be of object datatype"
    *Cause:    Partitioning column specified by the user was an object datatype
               (object, REF, nested table, array) which is illegal.
    *Action:   Ensure that no partitioning column is an object datatype.Anyone know what's up with that? What changed between the 2 DB versions that could cause this to fail?

    Alright, seems that's just a display issue then.
    Looking in user_lobs like suggested above gives
    TABLE_NAME COLUMN_NAME SECUREFILE
    DI_D       XMLDATA     YES        I was opening the table in SQL Developer and then looking in the tab SQL (12th tab); with a XmlType table it seems to always show Basicfile even if it's actually a Securefile.
    I'd like to use the suggested xmlcast/xmlquery solution, however it doesn't seem to play well with our custom timestamp format.
    "CREATION_TIME" AS (XMLCAST(XMLQUERY('declare default element namespace "http://www.example.com/m/d/schema/i";declare namespace c="http://www.example.com/m/schema/common";/d/c:dHeader/c:creationTime' PASSING OBJECT_VALUE RETURNING CONTENT) AS TIMESTAMP))
    Error at Command Line:1 Column:0
    Error report:
    SQL Error: ORA-54002: In de uitdrukking van een virtuele kolom kunnen alleen zuivere functies worden opgegeven.
    "CREATION_TIME" AS (TO_TIMESTAMP(XMLQUERY('declare default element namespace "http://www.example.com/m/d/schema/i";declare namespace c="http://www.example.com/m/schema/common";/d/c:dHeader/c:creationTime' PASSING OBJECT_VALUE RETURNING CONTENT),'YYYY-MM-DD"T"HH24:MI:SS'))
    Error at Command Line:9 Column:45
    Error report:
    SQL Error: ORA-00932: inconsistente gegevenstypen: - verwacht, - gekregen
    00932. 00000 -  "inconsistent datatypes: expected %s got %s"
    *Cause:   
    *Action:
    "CREATION_TIME" AS (TO_TIMESTAMP(EXTRACTVALUE("OBJECT_VALUE",'/di:d/c:dHeader/c:creationTime','xmlns:di="http://www.example.com/m/d/schema/i" xmlns:c="http://www.example.com/m/schema/common"'),'YYYY-MM-DD"T"HH24:MI:SS'))
    table "USER"."DI_D" created.

  • Range Partitioning on Varchar2 column???

    We hava table and it has a date column and its type is varchar2.
    This column's format is '16021013' ('ddmmyyyy').
    We want to make range partition on this column. What will be the best way?
    do you think virtal column partitioning will be efficient?

    >
    I'm not a new DBA:-) You can be sure. I asked only about range partitioning trick with varchar2 column because we did our examination about this table. We will need to archive this table quarter by quarter to the other archive database. Then, off course, nearly all queries are coming firstly by using this date column and they can have different filtering inside "where" conditions. Already, this table has index on this column but with huge number of data, index performance is not enough for us. This is a 7x24 banking system and we are lately joined to this project. Because of this, we cant change everything like changing data type of that column after this moment.
    >
    You are taking things way too personally. No one said anything about whether you were, or were not, a DBA or made any other comments about your skill or abilities.
    What we ask was for you to tell us WHAT the problem was that you were trying to solve and WHY you thought partitioning would solve it.
    And now, after several generic posts, you have finally provided that information. We can only comment based on the information that you post. We can't guess as to what types of queries you use or what kinds of predicates you use in those queries. But we need to know that information in order to provide the best advice.
    Next time you post put the important information in your original question:
    1. A table column is VARCHAR2 but contains a date value. We are unable to change the datatype of this column.
    2. We need to archive data quarterly based on this date value
    3. Nearly all queries use this date value and then also may have additional filter conditions
    4. This date column is indexed but we would like to improve the performance beyond what this index can give us.
    The above is a summary that includes all important information that is needed to know how best to help you.
    And I made a pretty good guess since two replies ago I provided you with example code that shows just how to partition the table.
    >
    Now, our only aim is how to make range partitioning this varchar2 date column.
    >
    As I showed you in my example code earlier you can add a virtual column to the table and partition on it. My example code creates a monthly partitioned table that allows you to archive by month or archive every three months to archive by quarter.
    You can modify that example to use quarterly partitions if you want but I would recommend that you use standard monthly partitions since they will satisfy the widest range of predicates.

  • How to Implement 30 days Range Partitioning with Date column. Not Interval

    Hi,
    I am using the db:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit
    Current table structure is:
    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'))
    How can I define virtual column based partitioning with RANGE partitioning without using INTERVAL partitioning.
    And that is with Intervals of 30 days.
    For monthly I am trying as
    CREATE TABLE A
    a NUMBER,
    CreationDate DATE,
    monthly_interval date as (to_char(CreationDate,'MM-YYYY')) VIRTUAL
    PARTITION BY RANGE (monthly_interval)
    partition p_AUG12 values less than (to_date('08-2012','mm-yyyy')),
    partition p_SEP12 values less than (to_date('09-2012','mm-yyyy')),
    partition p_OCT12 values less than (to_date('10-2012','mm-yyyy'))
    Enable ROw Movement
    BUT CAN'T INSERT the data even for that:
    Insert into a (a, CreationDate)
    Values (1, '12-10-2012')
    Insert into a (a, CreationDate)
    Values (1, '12-10-2012')
    Please suggest..

    Hi rp,
    Interval Partitioned to Range. Created Daily Partitions from Monthly Part. got complicated so I am posting here.
    Basically,
    I know Interval Partitioning is a kind of Range partitioning. But explicitly for Interval Partitioned tables XML Indexes are not allowed as discussed here:
    XMLIndexes on an Interval Partitioned Table??
    I can do monthly partitions as :
    CREATE TABLE A
    a NUMBER,
    CreationDate DATE,
    monthly_interval varchar2(8) as (to_char(CreationDate,'MM-YYYY')) VIRTUAL
    PARTITION BY RANGE (monthly_interval)
    partition p_AUG12 values less than ('09-2012'),
    partition p_SEP12 values less than ('10-2012'),
    partition p_OCT12 values less than ('11-2012')
    ) Enable ROw Movement
    Insert into a (a, CreationDate)
    Values (1, '12-SEP-2012')
    Insert into a (a, CreationDate)
    Values (1, '14-SEP-2012')
    Select * from A partition (p_SEP12)
    Select * from A partition (p_AUG12)
    Select * from A partition (p_OCT12)
    Can we do it for 30 days partitions, instead of the monthly partitions. ANY suggestions..
    Thanks..

  • Range partitioning of 3 columns

    Hello!
    I use Oracle 10g with SH schema.
    Now I want to create a new table SALES_SH that have range partition of 3 columns:
    create table SH.SALES_SH (PROD_ID NUMBER, CUST_ID NUMBER, TIME_ID DATE, CHANNEL_ID NUMBER, PROMO_ID NUMBER, QUANTITY_SOLD NUMBER(10,2), AMOUNT_SOLD NUMBER(10,2), COUNTRY_ID NUMBER, PROD_CATEGORY_ID NUMBER, FISCAL_YEAR NUMBER(4))
    PARTITION BY RANGE (FISCAL_YEAR, COUNTRY_ID, PROD_CATEGORY_ID)
    (PARTITION S_2000_GM_EL VALUES LESS THAN (2001,52789,203),
    PARTITION S_2000_GM_PA VALUES LESS THAN (2001,52789,205),
    PARTITION S_2000_GM_SO VALUES LESS THAN (2001,52789,206),
    PARTITION S_2000_UK_EL VALUES LESS THAN (2001,52790,203),
    PARTITION S_2000_UK_PA VALUES LESS THAN (2001,52790,205),
    PARTITION S_2000_UK_SO VALUES LESS THAN (2001,52790,206),
    PARTITION S_2000_US_EL VALUES LESS THAN (2001,52791,203),
    PARTITION S_2000_US_PA VALUES LESS THAN (2001,52791,205),
    PARTITION S_2000_US_SO VALUES LESS THAN (2001,52791,206),
    PARTITION S_2001_GM_EL VALUES LESS THAN (2002,52789,203),
    PARTITION S_2001_GM_PA VALUES LESS THAN (2002,52789,205),
    PARTITION S_2001_GM_SO VALUES LESS THAN (2002,52789,206),
    PARTITION S_2001_UK_EL VALUES LESS THAN (2002,52790,203),
    PARTITION S_2001_UK_PA VALUES LESS THAN (2002,52790,205),
    PARTITION S_2001_UK_SO VALUES LESS THAN (2002,52790,206),
    PARTITION S_2001_US_EL VALUES LESS THAN (2002,52791,203),
    PARTITION S_2001_US_PA VALUES LESS THAN (2002,52791,205),
    PARTITION S_2001_US_SO VALUES LESS THAN (2002,52791,206),
    PARTITION S_2002_GM_EL VALUES LESS THAN (2003,52789,203),
    PARTITION S_2002_GM_PA VALUES LESS THAN (2003,52789,205),
    PARTITION S_2002_GM_SO VALUES LESS THAN (2003,52789,206),
    PARTITION S_2002_UK_EL VALUES LESS THAN (2003,52790,203),
    PARTITION S_2002_UK_PA VALUES LESS THAN (2003,52790,205),
    PARTITION S_2002_UK_SO VALUES LESS THAN (2003,52790,206),
    PARTITION S_2002_US_EL VALUES LESS THAN (2003,52791,203),
    PARTITION S_2002_US_PA VALUES LESS THAN (2003,52791,205),
    PARTITION S_2002_US_SO VALUES LESS THAN (2003,52791,206));
    Here is the Data:
    INSERT INTO SH.SALES_SH
    SELECT SALES.PROD_ID, SALES.CUST_ID, SALES.TIME_ID, CHANNEL_ID, PROMO_ID, QUANTITY_SOLD, AMOUNT_SOLD, COUNTRY_ID, PROD_CATEGORY_ID, FISCAL_YEAR
    FROM SALES, CUSTOMERS, TIMES, PRODUCTS
    WHERE SALES.PROD_ID=PRODUCTS.PROD_ID AND SALES.CUST_ID=CUSTOMERS.CUST_ID AND SALES.TIME_ID=TIMES.TIME_ID
    AND (COUNTRY_ID=52790 OR COUNTRY_ID=52789 OR COUNTRY_ID=52776)
    AND (PROD_CATEGORY_ID=201 OR PROD_CATEGORY_ID=203 OR PROD_CATEGORY_ID=205)
    AND (FISCAL_YEAR=2000 OR FISCAL_YEAR=2001 OR FISCAL_YEAR=2002)
    ORDER BY FISCAL_YEAR, COUNTRY_ID, PROD_CATEGORY_ID;
    Note that, in Create table script, I use some "virtual value" (2003,52791,206) instead of MAXVALUE (because it get error)
    It run. But the partitions with "virtual value" have no data, and the others data is wrong!
    Please, help me! Thanks
    TRAN MAI

    OK. Here is the real data:
    SELECT distinct fiscal_year, country_id, prod_category_id from sales_sh partition(s_2000_gm_el) order by fiscal_year, country_id, prod_category_id;
    FISCAL_YEAR COUNTRY_ID PROD_CATEGORY_ID
    2000 52776 201
    2000 52776 203
    2000 52776 205
    2000 52789 201
    2000 52789 203
    2000 52789 205
    2000 52790 201
    2000 52790 203
    2000 52790 205
    2001 52776 201
    2001 52776 203
    FISCAL_YEAR COUNTRY_ID PROD_CATEGORY_ID
    2001 52776 205
    2001 52789 201
    13 rows selected.
    That mean, the PARTITION S_2000_GM_EL VALUES LESS THAN (2001,52789,203) get nearly all data.
    That mean, VALUES LESS THAN (2001,52789,203) <=> Fiscal_year<2001 OR Country_id<52789 OR Prod_category_id<203 (the "OR" condition), while I want the "AND" condition.
    Please, give me an advise! Thanks!
    TRAN MAI

  • [ask] change value partition by range

    hi
    i create table partition by range
    CREATE TABLE EQU_PARAM_MONITORINGRANGE
      SERIAL_NO         VARCHAR2(32 BYTE),
      ID_EQU_PARAMETER  INTEGER,
      TIME_STAMP        DATE,
      VALUE             FLOAT(126)
    PARTITION BY RANGE (ID_EQU_PARAMETER)
      PARTITION PARAM_RANGE1 VALUES LESS THAN (18)
      PARTITION PARAM_RANGE2 VALUES LESS THAN (36)
      PARTITION PARAM_RANGE3 VALUES LESS THAN (MAXVALUE)
    )and i want to change partition_range1 under 16,how to change it??

    You do it like this:
    SQL> select PARTITION_NAME, HIGH_VALUE from user_tab_partitions where table_name = 'EQU_PARAM_MONITORINGRANGE';
    PARTITION_NAME                 HIGH_VALUE
    PARAM_RANGE1                   18
    PARAM_RANGE2                   36
    PARAM_RANGE3                   MAXVALUE
    SQL> alter table EQU_PARAM_MONITORINGRANGE split partition PARAM_RANGE1 at (16) into (partition PARAM_RANGE1a, partition PARAM_RANGE1b);
    Table altered.
    SQL> select PARTITION_NAME, HIGH_VALUE from user_tab_partitions where table_name = 'EQU_PARAM_MONITORINGRANGE';
    PARTITION_NAME                 HIGH_VALUE
    PARAM_RANGE2                   36
    PARAM_RANGE3                   MAXVALUE
    PARAM_RANGE1A                  16
    PARAM_RANGE1B                  18
    SQL> alter table EQU_PARAM_MONITORINGRANGE drop partition PARAM_RANGE1B;
    Table altered.
    SQL> select PARTITION_NAME, HIGH_VALUE from user_tab_partitions where table_name = 'EQU_PARAM_MONITORINGRANGE';
    PARTITION_NAME                 HIGH_VALUE
    PARAM_RANGE2                   36
    PARAM_RANGE3                   MAXVALUE
    PARAM_RANGE1A                  16
    SQL>Make sure to rebuild all global indexes.
    Asif Momen
    http://momendba.blogspot.com

  • Create table interval partition on a column timestamp with local time zone

    Hi
    Does anyone have an example for 11g on how to create a table with interval partitioning on a column defined as timestamp with local time zone. I know it's possible. the following does not work.
    CREATE TABLE KOMODO_EXPIRED_RESULTS
    TEST_EVENT_KEY NUMBER NOT NULL,
    HPS_DEVICE_KEY NUMBER NOT NULL,
    RCS_DEVICE_KEY NUMBER,
    EVENT_START_TIMESTAMP TIMESTAMP(6) with local time zone NOT NULL,
    BOOTROMVERSION NUMBER,
    CHANNELNUMBER NUMBER,
    CLIENTVERSION VARCHAR2(4000 BYTE),
    ETHERNET_CRC_ERROR_COUNT NUMBER,
    ETHERNET_DROPPED_PACKETS NUMBER,
    ETHERNET_THROUGHPUT NUMBER,
    ETHERNET_TRAFFIC_IN NUMBER,
    ETHERNET_TRAFFIC_OUT NUMBER,
    IPADDRESS VARCHAR2(4000 BYTE),
    KOMODO_ID VARCHAR2(4000 BYTE),
    LASTREBOOTTIME VARCHAR2(4000 BYTE),
    OSVERSION VARCHAR2(4000 BYTE),
    RECEIVER_AUDIOACCESSCONTROLER NUMBER,
    RECEIVER_AUDIOBUFFEROVERFLOWS NUMBER,
    RECEIVER_AUDIOBUFFERUNDERRUNS NUMBER,
    RECEIVER_AUDIOCODEC VARCHAR2(4000 BYTE),
    RECEIVER_AUDIODATADROPPED NUMBER,
    RECEIVER_AUDIODATATHROUGHPUT NUMBER,
    RECEIVER_AUDIODECODERERRORS NUMBER,
    RECEIVER_AUDIODESCBUFFERUNDER NUMBER,
    RECEIVER_AUDIODESCCRYPTOERROR NUMBER,
    RECEIVER_AUDIODESCDATADROPPED NUMBER,
    RECEIVER_AUDIODESCDATATHROUGH NUMBER,
    RECEIVER_AUDIODESCDECODERERRO NUMBER,
    RECEIVER_AUDIODESCDRMERRORS NUMBER,
    RECEIVER_AUDIODESCPTSDELTA NUMBER,
    RECEIVER_AUDIODESCPTSDELTAHAL NUMBER,
    RECEIVER_AUDIODESCSAMPLESDROP NUMBER,
    RECEIVER_AUDIODSPCRASHES VARCHAR2(4000 BYTE),
    RECEIVER_AUDIOPTSDELTAHAL NUMBER,
    RECEIVER_AUDIOSAMPLESDECODED NUMBER,
    RECEIVER_AUDIOSAMPLESDROPPED NUMBER,
    RECEIVER_AUDIOUNDERRUN NUMBER,
    RECEIVER_BITRATE NUMBER,
    RECEIVER_BUFFEROVERRUN NUMBER,
    RECEIVER_BYTESCCRECEIVED NUMBER,
    RECEIVER_BYTESRECEIVED NUMBER,
    RECEIVER_CHANNEL NUMBER,
    RECEIVER_DECODERSTALL NUMBER,
    RECEIVER_DISCONTINUITIES NUMBER,
    RECEIVER_DISCONTINUITIESPACKE NUMBER,
    RECEIVER_DRIFT NUMBER,
    RECEIVER_DROPPEDPACKETSUNTILR NUMBER,
    RECEIVER_ECMLOOKUPERROR NUMBER,
    RECEIVER_ECMPARSEERRORS NUMBER,
    RECEIVER_PMTCHANGED NUMBER,
    RECEIVER_REBUFFER NUMBER,
    RECEIVER_SELECTCOMPONENTAUDIO NUMBER,
    RECEIVER_TIMELINEDISCONTINUIT NUMBER,
    RECEIVER_VIDEOACCESSCONTROLER NUMBER,
    RECEIVER_VIDEOACCESSCONTROLUN NUMBER,
    RECEIVER_VIDEOBUFFEROVERFLOWS NUMBER,
    RECEIVER_VIDEOBUFFERUNDERRUNS NUMBER,
    RECEIVER_VIDEOCODEC VARCHAR2(4000 BYTE),
    RECEIVER_VIDEOCRYPTOERROR NUMBER,
    RECEIVER_VIDEODATADROPPED NUMBER,
    RECEIVER_VIDEODATATHROUGHPUT NUMBER,
    RECEIVER_VIDEODECODERERRORS NUMBER,
    RECEIVER_VIDEODRMERRORS NUMBER,
    RECEIVER_VIDEODSPCRASHES VARCHAR2(4000 BYTE),
    RECEIVER_VIDEOFIFORD NUMBER,
    RECEIVER_VIDEOFIFOSIZE NUMBER,
    RECEIVER_VIDEOFRAMESDECODED NUMBER,
    RECEIVER_VIDEOFRAMESDROPPED NUMBER,
    RECEIVER_VIDEOPTSDELTA NUMBER,
    RECEIVER_VIDEOPTSDELTAHAL NUMBER,
    RECEIVER_VIDEOUNDERRUN NUMBER,
    SUBNETMASK VARCHAR2(4000 BYTE),
    TUNER_BITRATE NUMBER,
    TUNER_BUFFERFAILURE NUMBER,
    TUNER_CCPACKETSRECEIVED NUMBER,
    TUNER_CHANNEL NUMBER,
    TUNER_DATATIMEOUTS NUMBER,
    TUNER_DELIVERYMODE VARCHAR2(4000 BYTE),
    TUNER_DROPPAST NUMBER,
    TUNER_FILL NUMBER,
    TUNER_HOLE NUMBER,
    TUNER_HOLEDURINGBURST NUMBER,
    TUNER_HOLEDURINGBURSTPACKETS NUMBER,
    TUNER_HOLETOOLARGEPACKETS NUMBER,
    TUNER_MAXIMUMHOLESIZE NUMBER,
    TUNER_MULTICASTADDRESS VARCHAR2(4000 BYTE),
    TUNER_MULTICASTJOINDELAY NUMBER,
    TUNER_OUTOFORDER NUMBER,
    TUNER_OVERFLOWRESET NUMBER,
    TUNER_OVERFLOWRESETTIMES NUMBER,
    TUNER_PACKETSEXPIRED NUMBER,
    TUNER_PACKETSPROCESSED NUMBER,
    TUNER_PACKETSRECEIVED NUMBER,
    TUNER_PACKETSWITHOUTSESSION NUMBER,
    TUNER_PARSEERRORS NUMBER,
    TUNER_SRCUNAVAILABLERECEIVED NUMBER,
    TUNER_TOTALHOLEPACKETS NUMBER,
    TUNER_TOTALPACKETSEXPIRED NUMBER,
    TUNER_TOTALPACKETSRECEIVED NUMBER,
    TUNER_UNICASTADDRESS VARCHAR2(4000 BYTE),
    RECEIVER_TUNEDFOR NUMBER,
    MACADDRESS VARCHAR2(4000 BYTE),
    RECEIVER_TOTALAVUNDERRUNS NUMBER,
    RECEIVER_TOTALDISCONTINUITIES NUMBER,
    SERVICEID VARCHAR2(4000 BYTE),
    DRIVEPRESENT VARCHAR2(4000 BYTE),
    STB_STATE VARCHAR2(32 BYTE),
    PREV_EXPIRED NUMBER,
    PREV_HOLES NUMBER,
    PREV_RECEIVED NUMBER,
    PREV_TIMESTAMP TIMESTAMP(6),
    PREV_REBOOT VARCHAR2(4000 BYTE),
    TOTALPACKETSEXPIRED_RATE NUMBER,
    TOTALHOLEPACKETS_RATE NUMBER,
    TOTALPACKETSRECEIVED_RATE NUMBER,
    CONSTRAINT KOMODO_EXPIRED_RESULTS_PK
    PRIMARY KEY
    (HPS_DEVICE_KEY, EVENT_START_TIMESTAMP)
    USING INDEX
    TABLESPACE HPS_SUMMARY_INDEX
    TABLESPACE HPS_SUMMARY_DATA
    PARTITION BY RANGE (EVENT_START_TIMESTAMP)
    INTERVAL( NUMTODSINTERVAL(1,'DAY'))
    PARTITION DEFAULT_TIME_PART_01 VALUES LESS THAN (TIMESTAMP' 2010-08-01 00:00:00.000000000 +00:00')
    LOGGING
    COMPRESS FOR ALL OPERATIONS
    TABLESPACE HPS_SUMMARY_DATA
    NOCACHE
    PARALLEL ( DEGREE DEFAULT INSTANCES DEFAULT )
    MONITORING
    /

    I am not sure it can be done.
    SQL> create table sales
      2  (
      3  sales_id number,
      4  sales_dt TIMESTAMP(6) with local time zone NOT NULL
      5  )
      6  partition by range (sales_dt)
      7  interval (numtoyminterval(1,'MONTH'))
      8  ( partition p0901 values less than (to_date('2009-02-01','yyyy-mm-dd')) );
    create table sales
    ERROR at line 1:
    ORA-14751: Invalid data type for partitioning column of an interval partitioned
    table
    SQL> ed
    Wrote file afiedt.buf
      1  create table sales
      2  (
      3  sales_id number,
      4  sales_dt TIMESTAMP(6)
      5  )
      6  partition by range (sales_dt)
      7  interval (numtoyminterval(1,'MONTH'))
      8* ( partition p0901 values less than (to_date('2009-02-01','yyyy-mm-dd')) )
    SQL> /
    Table created.

  • Add sub partition on another column in oracle

    I have a table which has two partitions (by range): first_half and second_half based on a column "INSERT_DAY".
    I need to add subpartitions "SUCCESS" and "NONSUCCESS" based on the values of another column "STATUS" (subpartition by list) i.e. I need to transform my range partition to composite (range-list) partition.
    I do not wish to drop existing tables or partitions. What is the ALTER query for this?
    PS: The database is Oracle 9i

    Ok, my bad. The project is about charging GPRS customers for data usage.
    Here is the real DDL:
    CREATE TABLE CDR_EVENT_RCD_FILE_MOB_AGG
       (    "MOBILE_NO" VARCHAR2(16 BYTE),
        "DATA_VOLUME" NUMBER(*,0),
        "CHARGE" NUMBER(*,0),
        "RECORD_COUNT" NUMBER(*,0),
        "COUNTER" NUMBER(*,0) DEFAULT 0,
        "INSERT_DAY" NUMBER(*,0),
        "MAX_FILE_SEQ_NO" NUMBER(*,0),
        "MIN_FILE_SEQ_NO" NUMBER(*,0),
        "REQUEST_ID" VARCHAR2(21 BYTE),
        "TRANSACTION_ID" VARCHAR2(21 BYTE),
        "RESPONSE_TIME" TIMESTAMP (6),
        "RETURN_CODE" CHAR(2 BYTE),
        "FAILURE_REASON" VARCHAR2(1024 BYTE),
        "CHARGED_AMOUNT" NUMBER(*,2)
      PARTITION BY RANGE ("INSERT_DAY")
    (PARTITION "FIRST_HALF"  VALUES LESS THAN (16)  ,
    PARTITION "SECOND_HALF"  VALUES LESS THAN (MAXVALUE) ) ;
      CREATE INDEX "CDRDEVTBS"."MAX_FILE_SEQ_NO_INDEX" ON "CDRDEVTBS"."CDR_EVENT_RCD_FILE_MOB_AGG" ("MAX_FILE_SEQ_NO") ;
      CREATE INDEX "CDRDEVTBS"."MOBILE_NO_INDEX" ON "CDRDEVTBS"."CDR_EVENT_RCD_FILE_MOB_AGG" ("MOBILE_NO") ;
    As you can see, it is partitioned by range on "Insert_day".
    The requirement is to delete all the records having counter=3 (which means successful charging) for the records which are older than 15 days.
    So I thought, why not create sub partitions with counter so that final DDL would be something like the following. I would then avoid writing a DELETE query, which would take a lot of time to execute.
    CREATE TABLE CDR_EVENT_RCD_FILE_MOB_AGG (
        insert_day INT,
        counter INT,
    --other columns
    PARTITION BY RANGE (insert_day)
    SUBPARTITION BY LIST(counter)
    SUBPARTITION TEMPLATE
        SUBPARTITION SUCCESS VALUES(3),
        SUBPARTITION NONSUCCESS VALUES(DEFAULT)
        PARTITION first_half VALUES LESS THAN (16),
        PARTITION second_half VALUES LESS THAN (maxvalue)
    So that I could execute queries:
    alter table CDR_EVENT_RCD_FILE_MOB_AGG  truncate subpartition first_half_success; --execute on last day of every month
    alter table CDR_EVENT_RCD_FILE_MOB_AGG  truncate subpartition second_half_success; -- execute on 16th day of every month
    to remove unnecessary records.
    I would like to create subpartitions without dropping the existing table.

  • Partition by virtual column, select - sinlgle partition on two columns

    Pls, I have a question - we have table with COLUMNs:
    -- TIME_KEY - julian - date value (to_char(sysdate, 'J')) - we would like to have virtual date value:
    -- TIME_ID - virtual column with interval partitioning (great!)
    CREATE TABLE lsd_cntr_pokus
    ( time_key NUMBER not NULL
    , time_ID AS (to_date(time_key,'J'))
    , cntr_key NUMBER not NULL
    ---...etc
    PARTITION BY RANGE (time_ID) INTERVAL (NUMTOYMINTERVAL(1,'MONTH'))
    (PARTITION part_2007 VALUES LESS THAN
    (TO_DATE('01-JAN-2007','dd-MON-yyyy'))
    But then - is it possible to somehow define this table,
    so both selects:
    SELECT * FROM lsd_cntr_pokus
    WHERE time_key = to_char(TO_DATE('01.01.2007', 'DD.MM.YYYY'),'j') ;
    SELECT * FROM lsd_cntr_pokus
    WHERE time_id = TO_DATE('01.01.2007', 'DD.MM.YYYY') ;
    use PARTITION RANGE SINGLE?
    Thanks for any help,
    Regards
    Edited by: vrbcik on Dec 10, 2012 3:39 PM

    vrbcik wrote:
    Pls, I have a question - we have table with COLUMNs:
    -- TIME_KEY - julian - date value (to_char(sysdate, 'J')) - we would like to have virtual date value:
    -- TIME_ID - virtual column with interval partitioning (great!)
    CREATE TABLE lsd_cntr_pokus
    ( time_key NUMBER not NULL
    , time_ID AS (to_date(time_key,'J'))
    , cntr_key NUMBER not NULL
    ---...etc
    PARTITION BY RANGE (time_ID) INTERVAL (NUMTOYMINTERVAL(1,'MONTH'))
    (PARTITION part_2007 VALUES LESS THAN
    (TO_DATE('01-JAN-2007','dd-MON-yyyy'))
    But then - is it possible to somehow define this table,
    so both selects:
    SELECT * FROM lsd_cntr_pokus
    WHERE time_key = to_char(TO_DATE('01.01.2007', 'DD.MM.YYYY'),'j') ;
    SELECT * FROM lsd_cntr_pokus
    WHERE time_id = TO_DATE('01.01.2007', 'DD.MM.YYYY') ;
    use PARTITION RANGE SINGLE?
    Thanks for any help,
    Regards
    Edited by: vrbcik on Dec 10, 2012 3:39 PMHi,
    I'm afraid that, with this partition definition, partition pruning is working only when you use your virtual column time_id in your query.
    According to documentation Information That Can Be Used for Partition Pruning:
    Virtual column-based partitioned tables benefit from partition pruning for statements that use the virtual column-defining expression in the SQL statement.Maybe some tuning expert can confirm this or give another advice.
    Regards.
    Al

  • Best way to change partition key on existing table

    Hi,
    Using Oracle 11.20.3 on AIX.
    We have a table about 800 million rows and 120gb in size.
    Want to try copies oif this table to evalaute different partitiong strategies.
    What is the quickest way to do this?
    Would have liked say datapump table 1 tro disk and datapumo import the data to new table but do the tables need to be of the same format.
    Thanks

    >
    Using Oracle 11.20.3 on AIX.
    We have a table about 800 million rows and 120gb in size.
    Want to try copies oif this table to evalaute different partitiong strategies.
    What is the quickest way to do this?
    Would have liked say datapump table 1 tro disk and datapumo import the data to new table but do the tables need to be of the same format.
    >
    First your subject asks a different question that the text you posted: Best way to change partition key on existing table. The answer to that question is YOU CAN'T. All data has to be moved to change the partition key since each partition/subpartition is in its own segment. You either create a new table or use DBMS_REDEFINITION to redefine the table online.
    Why do you want to export all data to a file first? That just adds to the time and cost of doing the op.
    What problem are you trying to use partitioning to solve? Performance? Data maintenance? For performance the appropriate partitioning key and whether to use subpartitions depends on the types of queries and the query predicates you typically use as well as the columns that may be suitable for partition keys.
    For maintenance a common method is to partition on a date by year/month/day so you can more easily load new daily/weekly/monthly data into its own partition or drop old data that no longer needs to be kept online.
    You should use a small subset of the data when testing your partitionings strategies.
    Can you do the partitioning offline in an outage window? If not then using the DBMS_REDEFINITION is your only option.
    Without knowing what you are trying to accomplish only general advice can be given. You even mentioned that you might want to use a different set of columns than the curren table has.
    A standard heap table uses ONE segment for its data (ignoring possible LOB segments). A partitioned/subpartitioned table uses ONE segment for each partition/subpartition. This means that ALL data must be moved to partition the table (unless you are only creating one partition).
    This means that every partitioning scheme that uses a different partition key requires ALL data to be moved again for that test.
    Provide some information about what problem you are trying to solve.
    >
    Is this quicker than datapump?
    >
    Yes - exporting the data simplying moves it all an additional time. Ok to export if you need a backup before you start.
    >
    Found artcle which talks about using merge option on datapump import to convert partitioned table to non-partitioned table.
    >
    How would that apply to you? That isn't what you said you wanted to do.

  • Partition by Range(c1,c2) and have c1 to be MAXVALUE for a specific c2

    I have a table where two of the columns are used for PARTITION BY RANGE(C1,C2). Is it possible to have a partition scheme where for a specific c2, c1 can be MAXVALUE? The number of records of for a specific C2 are very few and I would like to have just one partition for all C1 values.

    >
    I have a table where two of the columns are used for PARTITION BY RANGE(C1,C2). Is it possible to have a partition scheme where for a specific c2, c1 can be MAXVALUE? The number of records of for a specific C2 are very few and I would like to have just one partition for all C1 values.
    >
    If you want one partition for all C1 values for a particular C2 then you need to reverse the order of the partition keys and use PARTITION BY RANGE(C2, C1).
    drop table myTable cascade constraints;
    CREATE TABLE myTable (c1 number, c2 number, description varchar2(30))
    PARTITION BY RANGE (C2, C1)
      (PARTITION p_before3_5 VALUES LESS THAN (3, 5),
       PARTITION p3_5_to_4_5  VALUES LESS THAN (4,5),
       PARTITION p4_5_to_5  VALUES LESS THAN (5,maxvalue),
       PARTITION p_special_6  VALUES LESS THAN (7,0),
       PARTITION future     VALUES LESS THAN (MAXVALUE,0));
    insert into myTable (c2, c1) values (5, 3);
    insert into myTable (c2, c1) values (6, 3);
    insert into myTable (c2, c1) values (6, 8);
    insert into myTable (c2, c1) values (7, 3);
    select * from mytable partition (p_special_6);
    C1,C2,DESCRIPTION
    3,6,
    8,6,The 'p_special_6' partition captures everything for C2 = 6 assuming that the min value of c1 is 0. Note that the previous partition has to be defined as '(5, maxvalue)' to capture everything less than C2 = 6.
    See Example 4-21 Creating a multicolumn range-partitioned table in the doc link already provided for other examples.

  • TIMESTAMP(6) Partitioned Key -   Range partitioned table ddl needed

    What is DDL syntax for TIMESTAMP(6) Partitioned Key, Range partitioned table
    Edited by: oracletune on Jan 11, 2013 10:26 AM

    >
    What is DDL syntax for TIMESTAMP(6) Partitioned Key, Range partitioned table
    >
    Not sure what you are asking. Are you asking how to create a partitioned table using a TIMESTAMP(6) column for the key?
    CREATE TABLE TEST1
        USERID                 NUMBER,
        ENTRYCREATEDDATE     TIMESTAMP(6)
    PARTITION BY RANGE (ENTRYCREATEDDATE) INTERVAL(NUMTOYMINTERVAL(1, 'MONTH'))
        PARTITION P0 VALUES LESS THAN (TO_DATE('1-1-2013', 'DD-MM-YYYY'))
    )See my reply Posted: Jan 10, 2013 9:56 PM if you need to do it on a TIMESTAMP with TIME ZONE column. You need to add a virtual column.
    Creating range paritions automatically

  • Convert range partition to range-hash composite partition

    Hi,
    I have several tables that are range partitioned on date and each table has several partitions as they are partitioned for each day. Is there anyway I con convet these table using alter statements to make them a composite? Thanks.

    No, You can't with alter command change partitioning type.
    http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10739/partiti.htm
    Create a new table with needed one partitioning type and insert there all data.

  • Problem exchanging partitions using range partitioning

    I have a range-partitioned table. Here's a cut down version....
    CREATE TABLE MY_TABLE
       (     VALUE           NUMBER,
         PARTITION_KEY      NUMBER
      PARTITION BY RANGE ("PARTITION_KEY")
    (PARTITION "P1"  VALUES LESS THAN (2),
      PARTITION "P2"  VALUES LESS THAN (3),
      PARTITION "P3"  VALUES LESS THAN (4),
      PARTITION "P4"  VALUES LESS THAN (5),
      PARTITION "P5"  VALUES LESS THAN (6),
      PARTITION "P6"  VALUES LESS THAN (7),
      PARTITION "P7"  VALUES LESS THAN (8));For the process I'm working on, I want to be able to:
    - create a table as a copy of one of the partitions
    - do some processing on that table
    - exchange the updated table back into the partitioned table
    I can achieve this as follows....
    CREATE TABLE MY_TABLE_COPY_P7 AS (SELECT * FROM MY_TABLE WHERE PARTITION_KEY = 7);
    ... do processing ...
    ALTER TABLE MY_TABLE DROP PARTITION P7;
    ALTER TABLE MY_TABLE ADD PARTITION P7 VALUES LESS THAN (8);
    ALTER TABLE MY_TABLE EXCHANGE PARTITION P7 WITH TABLE MY_TABLE_COPY INCLUDING INDEXES;However, this only works if the partition I'm adding back in is the highest partition.
    If I try do take out one of the middle partitions, then add it back I get an error:
    SQL] ALTER TABLE MY_TABLE ADD PARTITION P5 VALUES LESS THAN (6);
    ALTER TABLE MY_TABLE ADD PARTITION P5 VALUES LESS THAN (6)
    ERROR at line 1:
    ORA-14074: partition bound must collate higher than that of the last partitionAny ideas on how I can exchange one of the middle partitions with having to first drop the higher ones?
    Btw, I have to use range partitioning as we're using spatial, which only supports range partitioning.
    Cheers,

    Actually, you can do the exchange partition thing with 8i and over. After creating my_table from your script, I did:
    SQL> INSERT INTO my_table VALUES (1,7.5);
    1 row created.
    SQL> INSERT INTO my_table VALUES (2, 7.2);
    1 row created.
    SQL> INSERT INTO my_table VALUES (3,7.7);
    1 row created.
    SQL> CREATE TABLE my_tab_tmp AS
      2  SELECT * FROM my_table
      3  WHERE 1=2;
    Table created.
    SQL> ALTER TABLE my_table EXCHANGE PARTITION P7 WITH TABLE my_tab_tmp;
    Table altered.
    SQL> SELECT * FROM my_tab_tmp;
         VALUE PARTITION_KEY
             1           7.5
             2           7.2
             3           7.7
    SQL> SELECT * FROM my_table;
    no rows selected
    SQL> UPDATE my_tab_tmp
      2  set value = value * 20;
    3 rows updated.
    SQL> COMMIT;
    Commit complete.
    SQL> ALTER TABLE my_table EXCHANGE PARTITION P7 WITH TABLE my_tab_tmp;
    Table altered.
    SQL> SELECT * FROM my_tab_tmp;
    no rows selected
    SQL> SELECT * FROM my_table;
         VALUE PARTITION_KEY
            20           7.5
            40           7.2
            60           7.7You will, of course, need to re-build any global indexes on my_table.
    When you first create my_tab_tmp, you should also create indexes to match any local indexes on the partitions, then do the exchange partition using the INCLUDING INDEXES clause. You could also skip creating the indexes and then re-create them after exchanging the updated table with the partition.
    Note that none of this will work if you are changing values of partition_key so thatthey fall out of the range for the partition.
    HTH
    John

Maybe you are looking for

  • When will be released downloadable version of APEX 4.1??

    Hello to everyone! Anybody knows when APEX 4.1 will be released for download? Want to use it in my current project. Thank you :)

  • Flex app with bidirectional languages

    I saw a posting from Adobe that Flash does not support bidirectional languages - http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=a767a478 Does it mean that I cannot create a Flex application displaying and inputting bidirectional langauges su

  • How to add a action to a button?

    I been trying to add a action to thing in my flash but every action i do doesn't work but works for everyone else. I noticed my action screen looks different then all the others i see so i'm sure i'm doing something wrong or something here is what i

  • Loop or recursion in VC?

    Hi all, is it possible to simulate a "while" loop or a recursion in VC. Obviously VC has no official tools or components for it. So I guess I will need a workaround. But I don't know how. What e.g. I want to achieve is an independent floating progres

  • You HAVE to be kidding me!!!

    I purchased an iphone 4 on Friday the 30th of July. On the 31st, it completely DIED when sending a text message, and would not boot up. So I returned it. Picked up my replacement one today. That worked just fine until about an hour ago, and it tried