About range partition

Dear Friends ,
I am using Oracle10g . I have to create a range partition like below :
CREATE TABLE EMP
EMPNO NUMBER(4),
ENAME VARCHAR2(10 BYTE),
JOB VARCHAR2(9 BYTE),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7,2),
COMM NUMBER(7,2),
DEPTNO NUMBER(2)
PARTITION BY RANGE(hiredate)
PARTITION emp_1980 VALUES LESS THAN(TO_DATE('31/12/1980','DD/MM/YYYY')) TABLESPACE USERS,
PARTITION emp_1981 VALUES LESS THAN(TO_DATE('31/12/1981','DD/MM/YYYY')) TABLESPACE USERS,
PARTITION emp_1982 VALUES LESS THAN(TO_DATE('31/12/1982','DD/MM/YYYY')) TABLESPACE USERS,
PARTITION emp_1987 VALUES LESS THAN(TO_DATE('31/12/1987','DD/MM/YYYY')) TABLESPACE USERS
But the problem is :
1) if any input data is not match with the above criteria then where it goes ? i mean , the data which dont follow the above rule which partition it goes ? is there any way to set DEFAULT partition option in the range partition ?
I only find the DEFAULT option in LIST partition
2) Barring this , when I add a new partition with the above then it shows the below error :
alter table emp add partition emp.emp_1988 VALUES LESS THAN(TO_DATE('31/12/1988','DD/MM/YYYY')) TABLESPACE USERS
Error :
"ORA-14020: this physical attribute may not be specified for a table partition" ,
Would anybody plz help me , How can I solve the above problems ?

Range Partitioning provides for a range of values. Therefore, any value higher than the maximum value provided in your partition definitions would fail. Thus, for example, 01/01/1988 and above would error. That is why Range Partitioning allows you to specify a "highest" values possible where you say "values less than (MAXVALUE)". Therefore, if you had included an "emp_maxvalue" partition with "values less than (MAXVALUE)" after the "emp_1987" partition, any value for 1988 or higher would go into the emp_maxvalue partition.
{ Since there is no minvalue specified, a value of, say, 01/06/1979 would go into the "emp_1980" partition as it is "less than (01/01/1980)" ! }
Again, as Partitioning is a Range of Dates, you cannot add a partition. You have to SPLIT a partition. For example, if you had an "emp_maxvalue" partition present, in order to create the emp_1988 partition, you would SPLIT "emp_maxvalue" into two partitions : emp_1988 and emp_maxvalue.
Please read the documentation on Partition Maintenance in the Administrator's Guide.
Hemant K Chitale
http://hemantoracledba.blogspot.com

Similar Messages

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

  • 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

  • Problem with a 2 columns Range Partitioning for a indexed organized table

    have an indexed organized table with a 2 column PK. the first field (datum) is a date field the second field (installatieid) is a number(2) field.
    Every minute a 7 records are inserted (installatieid 0-6).
    I like to partition this table with one partition per year per installatieid.
    I tried to do it with:
    partition by range(datum,installatieid)
    (partition P_2004_0 values less than (to_date('2004-01,'yyyy-mm'),1)
    ,partition P_2004_6 values less than (to_date('2004-01','yyyy-mm'),7)
    partition P_2005_0 values less than (to_date('2005-01','yyyy-mm'),1)
    ,partition P_2005_6 values less than (to_date('2005-01','yyyy-mm'),7)
    but now only the P_2004_0 and P_2005_0 are filled.
    I thought about to combine a range partition on datum with a list subpartition on installatieid, but I read this is not allowed with an index organized table.
    How can I solve this problem.

    partition by range(datum,installatieid)
    (partition P_2004_0 values less than
    (to_date('2004-01,'yyyy-mm'))
    ,partition P_2004_6 values less than
    (to_date('2004-07','yyyy-mm'))
    partition P_2005_0 values less than
    (to_date('2005-01','yyyy-mm'))
    ,partition P_2005_6 values less than
    (to_date('2005-07','yyyy-mm'))
    ? Sorry haven't got time to test it this morning ;0)

  • Regarding Range Partition

    Hi,
    Is it possible to add a partition which will only contain NULL values for RANGE PARTITIONING.
    Actually I cann't add a partition like "VALUES LESS THAN (MAXVALUE)"
    as dynamically we will drop and add partition in this table and if I add a partition like "VALUES LESS THAN (MAXVALUE)" then we cann't add a partition, as it will gives an error "ORA-14074: partition bound must collate higher than that of the last partition". Is there any way of adding only NULL partition for range partition.
    Thanks in advance,
    Koushik

    Hi,
    Yes, you won't be able to add a new partition.. but did you think about SPLIT partition instead of ADD ?
    Regards,
    Yoann.

  • Question about the partition index

    Hi, all, I have some questions about partitioned index.
    And I get from oracle documents that oracle's partition index can be clarified as local partition index and global partition index.
    And local partition index can be clarified as prefix local partition index and non-prefix local partition index. And I also the word "global prefix partition index".
    But, I can not get what the exact meaning after I consulted many documents and notes from website.
    Can anyone give me one example to cover these topic?
    You help is very thankful!
    Thanks and best regards!

    Hi,
    Local index search by partition.
    Local Indexes: A local index is an index on a partitioned table which is partitioned in the exact same manner as the underlying partitioned table. Each partition of a local index corresponds to one and only one partition of the underlying table.
    Global Partitioned Indexes: A global partitioned index is an index on a partitioned or non-partitioned table which is partitioned using a different partitioning-key from the table. Global-partitioned indexes can only be partitioned using range partitioning. For example, a table could be range-partitioned by month and have twelve partitions, while an index on that table could be range-partitioned using a different partitioning key and have a different number of partitions.
    Global Non-Partitioned Indexes: A global non-partitioned index is essentially identical to an index on a non-partitioned table. The index structure is not partitioned.
    Maybe this links help you:
    http://www.oracle.com/technology/products/oracle9i/datasheets/partitioning.html
    http://asktom.oracle.com/pls/ask/f?p=4950:8:12026637104196321871::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:678824574412
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1612281449571
    Cheers

  • 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) ;

  • Merge Adjacent Range Partitions

    I have found documentation about how the exchange partition command does not physically move any data, only updates the data dictionary which makes it almost instantaneous. Seems to me that merging adjacent range partitions might also have this behavior. Can anyone confirm this?
    Thanks in advance for your reply

    Hi! I've used the instructions before but can't remember the exact details. I think what it is talking about is the partition you are changing (ie the one being deleted) will be the one losing data and the space will be returned to the original volume from which it was created. I know this is the way it works using Diskstudio which I have used several times. But be sure you are confident with what you read and decide to do. Tom

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

  • How to find out the min & max partition_id in a range partition?

    Hi we have a table set up by range partition
    In the table creation script. It goes something like:
    PARTITION PARTD_CUST_3_1_NEW VALUES LESS THAN ('39500')
    so how we can find out this number '39500' from some of the data_dictionary view?
    What we want to do is to set up parallel processing (do-it-yourself) based on partition.
    So the number of parallel process will be based on this ID-range.
    I can find out how many partitions are there by using something like this:
    SELECT COUNT(*)
    FROM all_tab_partitions WHERE table_owner='OWNER_NAME' AND table_name='TABLE_NAME'
    We have 5 partitions now but the table structure can change in the near future even this table has moer than 130Million rows
    I do not want to hardcode this "39500" just in case the table structure changes (partition structure changes)
    Any idea ??

    vxwo0owxv wrote:
    Hi we have a table set up by range partition
    In the table creation script. It goes something like:
    PARTITION PARTD_CUST_3_1_NEW VALUES LESS THAN ('39500')
    so how we can find out this number '39500' from some of the data_dictionary view?
    What we want to do is to set up parallel processing (do-it-yourself) based on partition.
    So the number of parallel process will be based on this ID-range.
    I can find out how many partitions are there by using something like this:
    SELECT COUNT(*)
    FROM all_tab_partitions WHERE table_owner='OWNER_NAME' AND table_name='TABLE_NAME'
    We have 5 partitions now but the table structure can change in the near future even this table has moer than 130Million rows
    I do not want to hardcode this "39500" just in case the table structure changes (partition structure changes)
    Any idea ??query DBA_TAB_PARTITIONS.HIGH_VALUE

  • 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

  • NULL partition key in RANGE partition

    All,
    This is regarding partitioning a table using RANGE partition method. But the partition key contains null. How do I handle this situation? This is because there is no DEFAULT partition in RANGE partition though its present in LIST partition. Will rows with NULL partition key fall in MAXVALUE partition? Seeking your guidence.
    Thanks,
    ...

    NULLS would fit into the MAXVAL partition yes.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/partconc.htm#sthref2590
    Thanks
    Paul

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

  • Subpartition existing range partition in Oracle

    I have table xyz with following structure
    xyz ( vld_dte date,
    prd_typ varchar2(100),
    sales number
    table XYZ is partitioned by range on field vld_dte and partitions are monthly partitions like JAN-2009 , FEB-2009....DEC-2009 and so on.table is currently loaded with data.
    How can I modify existing range partition into composite range-list partition so that every partiton is subpartitioned on prd_typ , basically three sub-partitions for every partition 1- Grocery , 2-Home decoration,3-OTHERS

    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*

  • 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

Maybe you are looking for

  • How can I migrate from Outlook 2011 to iCal and Apple Address Book in Mavericks now that synching is no longer possible?

    Now that I am on Mavericks and no longer able to sync between my iPhone/iPad and Outlook 2011 on my MacBook Pro, I'm finally taking the leap (which I should have done long ago) and abandoning Outlook 2011 all together (doesn't help that Outlook now p

  • How do I set default font size?

    Some programs (most importantly for me, Thunderbird) use a default font size that is too small for my eye comfort. Some (such as Firefox) allow me to change the font size, but Thunderbird does not (though there is a menu item to change font size, whi

  • Patch 2930368

    After installing portal patch 2930368 I had numerous invalid objects in my portal schema in my infrastructure database. I attempted to compile these invalid objects with the utlrp.sql script and they would not compile. Now numerous portions of my por

  • 4s home screen functionality

    Several issues trying to set up my home screens have me stumped.  I'm looking for apps or settings to do some things and can't find them, nor can users (or Verizon support) offer suggestions: Can I change the number of columns and rows on the home sc

  • How can i connect iphone 4 with other mobile through bluetooth

    how can i connect iphone 4 with other mobile through bluetooth