Create range partition

hi ,
Oracle 10.2.0.1.0
I'm getting error while creating a range partition to already existing table (method employed : partition swap method ) .
PF screen shot of error
SQL> ed
Wrote file afiedt.buf
  1  create table employee_details_temp partition by range (eid) (
  2  partition eid_1r values less than (1000)
  3  partition eid_2r values less than (20000)
  4  partition eid_3r values less than (40000)
  5  partition eid_3r values less than (maxvalue)
  6* )
SQL> /
partition eid_2r values less than (20000)
ERROR at line 3:
ORA-14020: this physical attribute may not be specified for a table partitionalso ,
SQL> ed
Wrote file afiedt.buf
  1  create table employee_details_temp partition by range (eid) (
  2  partition eid_1r values less than (1000)
  3  partition eid_2r values less than (20000)
  4  partition eid_3r values less than (40000)
  5  partition eid_3r values less than (maxvalue)
  6  ) as select * from employee_details where 1=1;
  7* /
SQL> /
partition eid_2r values less than (20000)
ERROR at line 3:
ORA-14020: this physical attribute may not be specified for a table partition please help .

answered .

Similar Messages

  • Range Partition

    Iam getting problem while creating range partition. I have created a partitioned table as below
    CREATE TABLE ERROR_DETAILS_tst
    STG_TAB_COL_ID NUMBER NOT NULL,
    RECORD_ID NUMBER NOT NULL,
    ERROR_ID NUMBER NOT NULL,
    RECORD_CREATE_DT DATE NOT NULL,
    PROGRAM_NAME VARCHAR2(200 BYTE),
    ERROR_VALUE VARCHAR2(2000 BYTE),
    RECORD_LAST_UPDATE_DT DATE NOT NULL
    PARTITION BY RANGE (record_create_dt)
    PARTITION P07302007 VALUES LESS THAN (TO_DATE('30-jul-2007', 'dd-mon-yyyy')),
    PARTITION P07312007 VALUES LESS THAN (TO_DATE('31-jul-2007', 'dd-mon-yyyy')),
    PARTITION P08072007 VALUES LESS THAN (TO_DATE('07-aug-2007', 'dd-mon-yyyy'))
    record_create_dt is a timestamp.
    Iam trying to insert into this table using
    insert into ERROR_DETAILS_tst
    select * from error_details_test
    But getting ORA-14400: inserted partition key does not map to any partition error.
    Since record_create_dt is a timestamp its not getting matched with any of the partitions.
    Please suggest.

    Now all the records got inserted into 'Other' partition. I want the data to be moved into their respective partitions.
    For example I have records with record_create_dt as
    8/7/2007 1:45:41 PM
    8/7/2007 1:36:44 PM
    8/7/2007 1:45:43 PM
    8/7/2007 1:45:41 PM
    8/7/2007 1:45:42 PM
    I want these records to be moved into 'P08072007' partition. Since the record_create_dt is the timestamp these records are not considered for this partition. How can I get this.

  • Doubt on Range Partitions

    Hello everyone.
    Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
    18:44:45 161:tcs237427@EBPP> desc rs_ebpp.rs_mail_job
    Name Null? Type
    JOB_KEY NOT NULL VARCHAR2(50)
    MOF_KEY NOT NULL VARCHAR2(50)
    MOF_PATH VARCHAR2(255)
    REPORT_ID NOT NULL NUMBER(38)
    PROFILE_NAME VARCHAR2(25)
    FILE_PATH VARCHAR2(1024)
    JOB_DATE DATE
    JOB_FINISH_DATE DATE
    SCHEDULED NUMBER(38)
    USER_ID VARCHAR2(25)
    STATUS VARCHAR2(25)
    COMMENTS VARCHAR2(255)
    MAIL_FROM VARCHAR2(255)
    MAIL_TO VARCHAR2(255)
    MAIL_CC VARCHAR2(255)
    MAIL_BCC VARCHAR2(255)
    MAIL_SUBJECT VARCHAR2(255)
    MAIL_MESSAGE VARCHAR2(512)
    DATA7 VARCHAR2(50)
    DATA8 VARCHAR2(50)
    DATA9 VARCHAR2(50)
    DATA20 DATE
    DATA21 NUMBER
    DATA22 NUMBER
    DATA23 NUMBER
    DATA24 NUMBER
    DATA25 NUMBER
    DATA26 FLOAT(126)
    DATA27 FLOAT(126)
    DATA28 FLOAT(126)
    DATA29 FLOAT(126)
    DATA30 FLOAT(126)
    DATA10 VARCHAR2(50)
    DATA11 VARCHAR2(50)
    DATA12 VARCHAR2(50)
    DATA13 VARCHAR2(50)
    DATA14 VARCHAR2(50)
    DATA1 VARCHAR2(50)
    DATA15 VARCHAR2(50)
    DATA16 DATE
    DATA2 VARCHAR2(50)
    DATA17 DATE
    DATA3 VARCHAR2(50)
    DATA4 VARCHAR2(50)
    DATA18 DATE
    DATA5 VARCHAR2(50)
    DATA19 DATE
    DATA6 VARCHAR2(50)
    I tried to create range partition on table whose partitioning key (JOB_KEY) was a VARCHAR2. I was able to create the partitions till 30th Jan.
    16:56:32 SQL> SELECT PARTITION_NAME,TABLE_NAME,HIGH_VALUE FROM DBA_TAB_PARTITIONS WHERE TABLE_NAME='RS_MAIL_JOB_NEW' ORDER BY 1;
    Partition
    Name TABLE_NAME HIGH_VALUE
    P110101 RS_MAIL_JOB_NEW TO_DATE('2011-01-02 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110102 RS_MAIL_JOB_NEW TO_DATE('2011-01-03 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110103 RS_MAIL_JOB_NEW TO_DATE('2011-01-04 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110104 RS_MAIL_JOB_NEW TO_DATE('2011-01-05 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110105 RS_MAIL_JOB_NEW TO_DATE('2011-01-06 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110106 RS_MAIL_JOB_NEW TO_DATE('2011-01-07 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110107 RS_MAIL_JOB_NEW TO_DATE('2011-01-08 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110108 RS_MAIL_JOB_NEW TO_DATE('2011-01-09 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110109 RS_MAIL_JOB_NEW TO_DATE('2011-01-10 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110110 RS_MAIL_JOB_NEW TO_DATE('2011-01-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110111 RS_MAIL_JOB_NEW TO_DATE('2011-01-12 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110112 RS_MAIL_JOB_NEW TO_DATE('2011-01-13 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110113 RS_MAIL_JOB_NEW TO_DATE('2011-01-14 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110114 RS_MAIL_JOB_NEW TO_DATE('2011-01-15 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110115 RS_MAIL_JOB_NEW TO_DATE('2011-01-16 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110116 RS_MAIL_JOB_NEW TO_DATE('2011-01-17 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110117 RS_MAIL_JOB_NEW TO_DATE('2011-01-18 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110118 RS_MAIL_JOB_NEW TO_DATE('2011-01-19 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110119 RS_MAIL_JOB_NEW TO_DATE('2011-01-20 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110120 RS_MAIL_JOB_NEW TO_DATE('2011-01-21 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110121 RS_MAIL_JOB_NEW TO_DATE('2011-01-22 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110122 RS_MAIL_JOB_NEW TO_DATE('2011-01-23 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110123 RS_MAIL_JOB_NEW TO_DATE('2011-01-24 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110124 RS_MAIL_JOB_NEW TO_DATE('2011-01-25 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110125 RS_MAIL_JOB_NEW TO_DATE('2011-01-26 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110126 RS_MAIL_JOB_NEW TO_DATE('2011-01-27 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110127 RS_MAIL_JOB_NEW TO_DATE('2011-01-28 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110128 RS_MAIL_JOB_NEW TO_DATE('2011-01-29 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110129 RS_MAIL_JOB_NEW TO_DATE('2011-01-30 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    P110130 RS_MAIL_JOB_NEW TO_DATE('2011-01-31 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN
    But after that I started getting below error:
    16:56:40 SQL> alter table rs_ebpp.rs_mail_job_new add partition p110131 values less than (to_date('2011-02-01 00:00:00', 'SYYYY-mm-dd h
    h24:mi:ss', 'nls_calendar=GREGORIAN'));
    alter table rs_ebpp.rs_mail_job_new add partition p110131 values less than (to_date('2011-02-01 00:00:00', 'SYYYY-mm-dd hh24:mi:ss', 'n
    ls_calendar=GREGORIAN'))
    ERROR at line 1:
    ORA-14074: partition bound must collate higher than that of the last partition
    I checked the manual, but didn't find it written anywhere about restriction on column data type for Range partition or others.
    I doubt if creating range partitions on columns with varchar2 is allowed and if yes, not sure why I get that error

    Try to split first partition:
    alter table rs_ebpp.rs_mail_job_new 
    split partition p110201 at (to_date('2011-31-01 00:00:00', 'SYYYY-mm-dd hh24:mi:ss', 'nls_calendar=GREGORIAN'))
    into (partition p110131, partition p110201) ;

  • How to create list partition  Where value not equal

    Hi ,
    How to crate partition where i want to store all data what is not equal to ,priview values,(A,B,C,D,E) ?
    PARTITION PN001 VALUES (*is all values !=A,B,C,D,E*) TABLESPACE test_1Thanks !
    ID

    >
    In partition
    <partition_name> values (default) ? will be stored data where value is null too ?
    >
    See the VLDB partitioning guide
    http://docs.oracle.com/cd/E18283_01/server.112/e16541/part_admin001.htm#sthref247
    >
    Creating List-Partitioned Tables
    The semantics for creating list partitions are very similar to those for creating range partitions. However, to create list partitions, you specify a PARTITION BY LIST clause in the CREATE TABLE statement, and the PARTITION clauses specify lists of literal values, which are the discrete values of the partitioning columns that qualify rows to be included in the partition. For list partitioning, the partitioning key can only be a single column name from the table.
    Available only with list partitioning, you can use the keyword DEFAULT to describe the value list for a partition. This identifies a partition that accommodates rows that do not map into any of the other partitions.
    >
    Note the last two sentences above. The DEFAULT partition will contain data for values (including NULL) that do not map to other partitions.

  • Creating interval parition to existing range partition

    I have a table which has range partition on a number column.
    CREATE TABLE TEST(
    id INT NOT NULL,
    start INT NOT NULL
    PARTITION BY RANGE (start)
         PARTITION old_Data VALUES LESS THAN (1000000) TABLESPACE old,
         PARTITION new_Data VALUES LESS THAN (MAXVALUE) TABLESPACE new
    I would like to create monthly interval partition in old_data partition. Is this possible? Don't see any syntax for supporting this scenario.

    Welcome to the forum!
    Whenever you post provide your 4 digit Oracle version.
    >
    I have a table which has range partition on a number column.
    CREATE TABLE TEST(
    id INT NOT NULL,
    start INT NOT NULL
    PARTITION BY RANGE (start)
    PARTITION old_Data VALUES LESS THAN (1000000) TABLESPACE old,
    PARTITION new_Data VALUES LESS THAN (MAXVALUE) TABLESPACE new
    I would like to create monthly interval partition in old_data partition. Is this possible? Don't see any syntax for supporting this scenario.
    >
    No - it is not possible. There isn't any syntax for supporting that because integers do have have 'months' so how would Oracle partition an integer 'monthly'?
    If those integers are supposed to represent Unix 'epoch' date values then in 11g you can create a virtual column of DATE datatype and partition on that.
    But you will need to either recreate the table or, if you needed to do it online, use the DBMS_REDEFINITION package. Either approach results in a new table with the correct partitioning that includes the existing data.
    Here is a similar table to yours with a VIRTUAL column that is partitioned by day:
    drop table some_table_int
    create table some_table_int (
        column_1 nvarchar2(50),
        start_t number(38,0),
        column_n number,
        start_date DATE GENERATED ALWAYS AS (
        to_timestamp(to_char( to_date('01011970','ddmmyyyy') + 1/24/60/60 * start_t, 'DD-MON-YYYY HH24:MI:SS'),'DD-MON-YYYY HH24:MI:SS')
      ) VIRTUAL
    partition by range (start_date) interval (NUMTODSINTERVAL(7,'day'))
    (partition p_19700105 values less than (to_date('19700105', 'yyyymmdd'))
    /That VIRTUAL column is an ordinary DATE column and your ranges will be dates rather than numbers that have no meaning for anyone.
    The VIRTUAL column is only a data dictionary entry so it won't affect any actual data.

  • Create list-range partition table

    Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    I am trying to create a partition table with LIST-Range, and I am getting this following error, is oracle 10.2.0.4 database supports to create list-range partition(composite)
    SQL> CREATE TABLE tbp_list_range
    REPORT_DATE DATE,
    member_id_01 varchar2(2),
    DATE_SERVICE date,
    member_id varchar2(15)
    PARTITION BY LIST(member_id_01)
    SUBPARTITION BY RANGE (DATE_SERVICE)
    PARTITION SPTYR04M01_C VALUES('AA','aa')
    NOLOGGING
    COMPRESS (
    SUBPARTITION PTYR12M011 VALUES LESS THAN (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION PTYR12M021 VALUES LESS THAN (TO_DATE(' 2012-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION recent1 VALUES LESS THAN (MAXVALUE)
    PARTITION SPTYR04M01_Yo VALUES('BJ','bj')
    NOLOGGING
    COMPRESS (
    SUBPARTITION PTYR12M01 VALUES LESS THAN (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION PTYR12M02 VALUES LESS THAN (TO_DATE(' 2012-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION recent2 VALUES LESS THAN (MAXVALUE)
    SUBPARTITION BY RANGE (DATE_SERVICE)
    ERROR at line 9:
    ORA-00922: missing or invalid option
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    Any help would be greatly appreciated.
    Thanks,

    any possible work around for this scenario on 10.2.0.4
    --thanks                                                                                                                                                                                               

  • Creating Local partitioned index on Range-Partitioned table.

    Hi All,
    Database Version: Oracle 8i
    OS Platform: Solaris
    I need to create Local-Partitioned index on a column in Range-Partitioned table having 8 million records, is there any way to perform it in fastest way.
    I think we can use Nologging, Parallel, Unrecoverable options.
    But while considering Undo and Redo also mainly time required to perform this activity....Which is the best method ?
    Please guide me to perform it in fastest way and also online !!!
    -Yasser

    YasserRACDBA wrote:
    3. CREATE INDEX CSB_CLIENT_CODE ON CS_BILLING (CLIENT_CODE) LOCAL
    NOLOGGING PARALLEL (DEGREE 14) online;
    4. Analyze the table with cascade option.
    Do you think this is the only method to perform operation in fastest way? As table contain 8 million records and its production database.Yasser,
    if all partitions should go to the same tablespace then you don't need to specify it for each partition.
    In addition you could use the "COMPUTE STATISTICS" clause then you don't need to analyze, if you want to do it only because of the added index.
    If you want to do it separately, then analyze only the index. Of course, if you want to analyze the table, too, your approach is fine.
    So this is how the statement could look like:
    CREATE INDEX CSB_CLIENT_CODE ON CS_BILLING (CLIENT_CODE) TABLESPACE CS_BILLING LOCAL NOLOGGING PARALLEL (DEGREE 14) ONLINE COMPUTE STATISTICS;
    If this operation exceeds particular time window....can i kill the process?...What worst will happen if i kill this process?Killing an ONLINE operation is a bit of a mess... You're already quite on the edge (parallel, online, possibly compute statistics) with this statement. The ONLINE operation creates an IOT table to record the changes to the underlying table during the build operation. All these things need to be cleaned up if the operation fails or the process dies/gets killed. This cleanup is supposed to be performed by the SMON process if I remember correctly. I remember that I once ran into trouble in 8i after such an operation failed, may be I got even an ORA-00600 when I tried to access the table afterwards.
    It's not unlikely that your 8.1.7.2 makes your worries with this kind of statement, so be prepared.
    How much time it may take? (Just to be on safer side)The time it takes to scan the whole table (if the information can't read from another index), the sorting operation, plus writing the segment, plus any wait time due to concurrent DML / locks, plus the time to process the table that holds the changes that were done to the table while building the index.
    You can try to run an EXPLAIN PLAN on your create index statement which will give you a cost indication if you're using the cost based optimizer.
    Please suggest me if any other way exists to perform in fastest way.Since you will need to sort 8 million rows, if you have sufficient memory you could bump up the SORT_AREA_SIZE for your session temporarily to sort as much as possible in RAM.
    -- Use e.g. 100000000 to allow a 100M SORT_AREA_SIZE
    ALTER SESSION SET SORT_AREA_SIZE = <something_large>;
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • How to create a partition table on the basis of substring of column val

    Hi All,
    I have table
    Create table Mytable
    ( Col1 number,
    Col2 number,
    Col3 varchar2(20)
    insert into mytable values(11,2,'20110901');
    insert into mytable values(12,2,'20110902');
    insert into mytable values(13,2,'20110903');
    insert into mytable values(14,2,'20110904');
    insert into mytable values(15,2,'20110905');
    insert into mytable values(16,2,'20110906');
    Col3 data have the date value in the form of yyyymmdd format.
    I want to create a 30 partitions on the basis of day on col3.
    how can i achive this. i tried range partition but how can i get day of col3?
    any help appriciated.
    Edited by: P:) on Sep 28, 2011 5:56 PM

    Hi,
    the first point would be to use the correct data type for col3 and make it a date. Then I can see no reason why you couldn't range partition based on the date.
    Andre

  • Non-Partitioned Global Index on Range-Partitioned Table.

    Hi All,
    Is it possible to create Non-Partitioned Global Index on Range-Partitioned Table?
    We have 4 indexes on CS_BILLING range-partitioned table, in which one is CBS_CLIENT_CODE(*local partitioned index*) and others are unknown types of index to me??
    Means other 3 indexes are what type indexes ...either non-partitioned global index OR non-partitioned normal index??
    Also if we create index as :(create index i_name on t_name(c_name)) By default it will create Global index. Please correct me......
    Please help me in identifying other 3 indexes types by referring below ouputs!!!
    select INDEX_NAME,TABLE_NAME,PARTITIONING_TYPE,LOCALITY from dba_part_indexes where TABLE_NAME='CS_BILLING';
    INDEX_NAME TABLE_NAME PARTITI LOCALI
    CSB_CLIENT_CODE CS_BILLING RANGE LOCAL
    select index_name,index_type,table_name,table_type,PARTITIONED from dba_indexes where table_name='CS_BILLING';
    INDEX_NAME INDEX_TYPE TABLE_NAME TABLE_TYPE PAR
    CSB_CREATE_DATE NORMAL CS_BILLING TABLE NO
    CSB_SUBMIT_ORDER NORMAL CS_BILLING TABLE NO
    CSB_CLIENT_CODE NORMAL CS_BILLING TABLE YES
    CSB_ORDER_NBR NORMAL CS_BILLING TABLE NO
    select INDEX_OWNER,INDEX_NAME,TABLE_NAME,COLUMN_NAME from dba_ind_columns where TABLE_NAME='CS_BILLING';
    INDEX_OWNER INDEX_NAME TABLE_NAME COLUMN_NAME
    RPADMIN CSB_CREATE_DATE CS_BILLING CREATE_DATE
    RPADMIN CSB_SUBMIT_ORDER CS_BILLING SUBMIT_TO_INVOICE
    RPADMIN CSB_SUBMIT_ORDER CS_BILLING ORDER_NBR
    RPADMIN CSB_CLIENT_CODE CS_BILLING CLIENT_CODE
    RPADMIN CSB_ORDER_NBR CS_BILLING ORDER_NBR
    select dip.index_name, dpi.locality, dip.partition_name, dip.status
    from dba_part_indexes dpi, dba_ind_partitions dip
    where dpi.table_name ='CS_BILLING'
    and dpi.index_name = dip.index_name;
    INDEX_NAME LOCALI PARTITION_NAME STATUS
    CSB_CLIENT_CODE LOCAL CSB_2006_4Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2006_3Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2007_1Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2007_2Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2007_3Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2007_4Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2008_1Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2008_2Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2008_3Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2008_4Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2009_1Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2009_2Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2009_3Q USABLE
    CSB_CLIENT_CODE LOCAL CSB_2009_4Q USABLE
    select * from dba_part_indexes
    where table_name ='CS_BILLING'
    and locality = 'GLOBAL';
    no rows selected
    -Yasser
    Edited by: YasserRACDBA on Mar 5, 2009 11:45 PM

    Yaseer,
    Is it possible to create Non-Partitioned and Global Index on Range-Partitioned Table?
    Yes
    We have 4 indexes on CS_BILLING range-partitioned table, in which one is CBS_CLIENT_CODE(*local partitioned index*) and others are unknown types of index to me??
    Means other 3 indexes are what type indexes ...either non-partitioned global index OR non-partitioned normal index??
    You got local index and 3 non-partitioned "NORMAL" b-tree tyep indexes
    Also if we create index as :(create index i_name on t_name(c_name)) By default it will create Global index. Please correct me......
    Above staement will create non-partitioned index
    Here is an example of creating global partitioned indexes
    CREATE INDEX month_ix ON sales(sales_month)
       GLOBAL PARTITION BY RANGE(sales_month)
          (PARTITION pm1_ix VALUES LESS THAN (2)
           PARTITION pm2_ix VALUES LESS THAN (3)
           PARTITION pm3_ix VALUES LESS THAN (4)
            PARTITION pm12_ix VALUES LESS THAN (MAXVALUE));Regards

  • 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..

  • Is there any plan of allowing non-range partitioning of spatial indexes

    our application is really lacking the ability of spatial index being partitioned by list. We are binning information in our data warehouse by spatial locations, and when we query it (actually, MapViewer is generating a tile), entire geometry set is searched because table is list-partitioned and we cannot have local spatial index.

    Hi,
    I'm not in a position to answer the question about list partitioning, but would a pseudo-list partition implemented as a range partition work? For example, something like this:
    CREATE TABLE customers (
      first_name    VARCHAR2(20),
      last_name     VARCHAR2(20),
      address_1     VARCHAR2(20),
      address_2     VARCHAR2(20),
      city          VARCHAR2(20),
      state_abrv    VARCHAR2(3),
      postal_code   VARCHAR2(10),
      customer_id   NUMBER NOT NULL UNIQUE)
      PARTITION BY RANGE (state_abrv) 
       PARTITION ALASKA         VALUES LESS THAN ('AKz'),
       PARTITION ALABAMA        VALUES LESS THAN ('ALz'),
       PARTITION ARKANSAS       VALUES LESS THAN ('ARz'),
       PARTITION AMERICANSAMOA  VALUES LESS THAN ('ASz'),
       PARTITION ARIZONA        VALUES LESS THAN ('AZz'),
       PARTITION CALIFORNIA     VALUES LESS THAN ('CAz'),
       PARTITION WYOMING        VALUES LESS THAN ('WYz')
       );I've used this method in the past, although I agree a list partitioning solution is much preferred.
    Dan

  • Partition Pruning on Interval Range Partitioned Table not happening when SYSDATE used in Where Clause

    We have tables that are interval range partitioned on a DATE column, with a partition for each day - all very standard and straight out of Oracle doc.
    A 3rd party application queries the tables to find number of rows based on date range that is on the column used for the partition key.
    This application uses date range specified relative to current date - i.e. for last two days would be "..startdate > SYSDATE -2 " - but partition pruning does not take place and the explain plan shows that every partition is included.
    By presenting the query using the date in a variable partition pruning does table place, and query obviously performs much better.
    DB is 11.2.0.3 on RHEL6, and default parameters set - i.e. nothing changed that would influence optimizer behavior to something unusual.
    I can't work out why this would be so. It very easy to reproduce with simple test case below.
    I'd be very interested to hear any thoughts on why it is this way and whether anything can be done to permit the partition pruning to work with a query including SYSDATE as it would be difficult to get the application code changed.
    Furthermore to make a case to change the code I would need an explanation of why querying using SYSDATE is not good practice, and I don't know of any such information.
    1) Create simple partitioned table
    CREATETABLE part_test
       (id                      NUMBER NOT NULL,
        starttime               DATE NOT NULL,
        CONSTRAINT pk_part_test PRIMARY KEY (id))
    PARTITION BY RANGE (starttime) INTERVAL (NUMTODSINTERVAL(1,'day')) (PARTITION p0 VALUES LESS THAN (TO_DATE('01-01-2013','DD-MM-YYYY')));
    2) Populate table 1million rows spread between 10 partitions
    BEGIN
        FOR i IN 1..1000000
        LOOP
            INSERT INTO part_test (id, starttime) VALUES (i, SYSDATE - DBMS_RANDOM.value(low => 1, high => 10));
        END LOOP;
    END;
    EXEC dbms_stats.gather_table_stats('SUPER_CONF','PART_TEST');
    3) Query the Table for data from last 2 days using SYSDATE in clause
    EXPLAIN PLAN FOR
    SELECT  count(*)
    FROM    part_test
    WHERE   starttime >= SYSDATE - 2;
    | Id  | Operation                 | Name      | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT          |           |     1 |     8 |  7895  (1)| 00:00:01 |       |       |
    |   1 |  SORT AGGREGATE           |           |     1 |     8 |            |          |       |       |
    |   2 |   PARTITION RANGE ITERATOR|           |   111K|   867K|  7895   (1)| 00:00:01 |   KEY |1048575|
    |*  3 |    TABLE ACCESS FULL      | PART_TEST |   111K|   867K|  7895   (1)| 00:00:01 |   KEY |1048575|
    Predicate Information (identified by operation id):
       3 - filter("STARTTIME">=SYSDATE@!-2)
    4) Now do the same query but with SYSDATE - 2 presented as a literal value.
    This query returns the same answer but very different cost.
    EXPLAIN PLAN FOR
    SELECT count(*)
    FROM part_test
    WHERE starttime >= (to_date('23122013:0950','DDMMYYYY:HH24MI'))-2;
    | Id  | Operation                 | Name      | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT          |           |     1 |     8 |   131  (0)| 00:00:01 |       |       |
    |   1 |  SORT AGGREGATE           |           |     1 |     8 |            |          |       |       |
    |   2 |   PARTITION RANGE ITERATOR|           |   111K|   867K|   131   (0)| 00:00:01 |   356 |1048575|
    |*  3 |    TABLE ACCESS FULL      | PART_TEST |   111K|   867K|   131   (0)| 00:00:01 |   356 |1048575|
    Predicate Information (identified by operation id):
       3 - filter("STARTTIME">=TO_DATE(' 2013-12-21 09:50:00', 'syyyy-mm-dd hh24:mi:ss'))
    thanks in anticipation
    Jim

    As Jonathan has already pointed out there are situations where the CBO knows that partition pruning will occur but is unable to identify those partitions at parse time. The CBO will then use a dynamic pruning which means determine the partitions to eliminate dynamically at run time. This is why you see the KEY information instead of a known partition number. This is to occur mainly when you compare a function to your partition key i.e. where partition_key = function. And SYSDATE is a function. For the other bizarre PSTOP number (1048575) see this blog
    http://hourim.wordpress.com/2013/11/08/interval-partitioning-and-pstop-in-execution-plan/
    Best regards
    Mohamed Houri

  • Range Partitioning a table. Max value to be defined

    Hi,
    I am using a range partitioned table, range partitioned on date, and have defined max value as 6 months after the Creation Date.
    I have a proc which creates the partitions I want in advance by splitting up the max partition.
    - Now what do I do when max partition is reached after 6 months?
    - If I define max partition one year or two year after the current date instead of the currently defined 6 months after creation date. What are the negatives attached with it?
    I can't use Interval Partition and have to use Range only.
    Kindly suggest.
    Thanks..

    >
    I am using a range partitioned table, range partitioned on date, and have defined max value as 6 months after the Creation Date.
    I have a proc which creates the partitions I want in advance by splitting up the max partition.
    - Now what do I do when max partition is reached after 6 months?
    - If I define max partition one year or two year after the current date instead of the currently defined 6 months after creation date. What are the negatives attached with it?
    >
    Any data with a partition key that does NOT match any partition will cause your INSERT query to fail.
    Any partition that has no data to match it will simply remain empty.
    A common partitioning scheme is to define one partition for all old data, one partition with a high max value and then split the max value partition to get the partitions you want in the middle.
    Let's say you want monthly partitions but don't have that much data from before the current year, 2012.
    1. Create one partition for dates < 1/1/2012
    2. One partition each for the 12 months of 2012
    3. One max value partition to be 1/1/4000
    You would just split the max value partition to create each month of 2013. The split could be done ahead of time or a month at a time as you choose.
    The only negative is that any data inserted by mistake that has a super-high date will go into the max value partition. But that is going to happen anyway. If you accidentally enter a date of 3/23/3882 it won't be rejected.
    But it is easy to query periodically to see if you have any 'bad' data like that. And the alternative is that an INSERT would fail because of the one bad record and all of your good data would be rejected anyway so it's not really much of a negative.
    Remember - for best management performance each partition should have its own tablespace and the indexes should all be local if possible.

  • Oracle 11g  List - Range Partition - Help Needed

    Hi All,
    I want to create a composite partition (LIST-RANGE) but RANGE partition should using interval partition
    This is my query .
    CREATE TABLE "DMSDB"."DEVICE_UTILS"
    (     "ULID" VARCHAR2(100 CHAR),
         "IP_ADDRESS" VARCHAR2(24 CHAR),
         "PORT" VARCHAR2(8 CHAR),
         "SHUTDOWN" NUMBER(10,0),
         "LINE_TYPE" NUMBER(10,0) DEFAULT '0',
         "OCCUPIED" NUMBER(10,0),
         "UTILIZATION" NUMBER(10,0),
         "IDLE_TIME" VARCHAR2(32 CHAR),
         "ACTIVATION_TIME" VARCHAR2(32 CHAR),
         "PULLED_DATE" TIMESTAMP (6) DEFAULT SYSDATE,
         "ACCESS_TIME" TIMESTAMP (6) DEFAULT SYSDATE
    PARTITION BY LIST(ULID)
              PARTITION PART_DEVUTILS_ULID VALUES (DEFAULT)
         SUBPARTITION BY RANGE( PULLED_DATE)
         PARTITION PART_DEVUTILS_WEEK INTERVAL (NUMTOYMINTERVAL(1,'WEEK'))
    Somehow its not working. can you please suggest where i am making mistake?

    Interval partitioning is not supported at the subpartition level.
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_7002.htm#BABCDDIA
    Regards
    Girish Sharma

  • Unique key on range-partitioned table

    Hi,
    We are using a composite range-hash interval partitioned table
    Uses index - trying to make this have same tablespace as the partitions i.e. local but not liking it
    alter table RETAILER_TRANSACTION_COMP_POR
    add constraint RETAILER_TRANSACTION_COMP_PK primary key (DWH_NUM)
    using index
    LOCAL
    ora-14039: partitioning columns must form a subset of key columns of a unique index
    Without local then fine but doesn't have same tablespace as the partitions and don't want to make this part of partition key.
    Tbale range partitioned - this is just a UK to prevent duplicates

    [oracle@localhost ~]$ oerr ora 14039
    14039, 00000, "partitioning columns must form a subset of key columns of a UNIQUE index"
    // *Cause:  User attempted to create a UNIQUE partitioned index whose
    //          partitioning columns do not form a subset of its key columns
    //          which is illegal
    // *Action: If the user, indeed, desired to create an index whose
    //          partitioning columns do not form a subset of its key columns,
    //          it must be created as non-UNIQUE; otherwise, correct the
    //          list of key and/or partitioning columns to ensure that the index'
    //          partitioning columns form a subset of its key columns

Maybe you are looking for