Regarding Partition

Can we do a range partition on the field which has varchar2
When I run the script i am getting an error
CREATE TABLE invoices
(invoice_no NUMBER NOT NULL,
invoice_date VARCHAR2(8 BYTE) NOT NULL,
comments VARCHAR2(500))
PARTITION BY RANGE (invoice_date)
(PARTITION invoices_q1 VALUES LESS THAN (TO_CHAR(ADD_MONTHS(TRUNC(SYSDATE, 'MONTH'), -24), 'YYYYMMDD') TABLESPACE user),
PARTITION invoices_q2 VALUES LESS THAN (TO_CHAR(ADD_MONTHS(TRUNC(SYSDATE, 'MONTH'), -60), 'YYYYMMDD') TABLESPACE user);
Can you please tell me what is the error
Thanks

Actually i need two partitions
one partition for 2 years data
second partition for next 3 years data
and all together This table should contain 5 years data.
Can you suggest some way do it

Similar Messages

  • Query regarding Partition table Explain plan

    Hello,
    We are amidst a tuning activity, wherein a large table has been partitioned for better administration. During testing, I was analyzing the explain plans for long running sql's and found a piece that I was unable to understand. The PSTART and PSTOP columns show ROWID as its value, which in normal partition pruning scenario be the Partition number or the KEY. I tried to look around for this issue but did not get enough information. Can anybody help me of what it means? Also, if there is a good explanation of the same, it will be extremely helpful.
    The snippet from explain plan looks like:
    | Id  | Operation                                | Name                          | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |
    7 |        TABLE ACCESS BY GLOBAL INDEX ROWID| XXXXXXXXXXXXXXXXXXXX             | 43874 |  9083K|       |  1386   (1)| 00:00:17 | ROWID | ROWID |
    On another similar query it looks like:
    | Id  | Operation                             | Name                         | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |
    |   6 |     TABLE ACCESS BY GLOBAL INDEX ROWID| XXXXXXXXXXXXXX               | 22455 |  4648K|       |   456   (1)| 00:00:06 |     9 |     9 |
    I have another query with regards to the Partition tables. Does it, require/benefit if, the Indexes to be in partitioned mode? I tried to read about it but did not get a conclusive evidence. I am trying to test it and post here the outcome, but if anybody has experience of working with it, it would be great to have some advice.
    Oracle Version:- 10.2.0.4
    Regards,
    Purvesh.

    Hi Purvesh.
    Great explanation and example on this this topic...
    Ask Tom "explain plan on range-partitioned table"
    Hope this help.

  • Assistance regarding partitioning my lapi's hard disk

    model no. - hp pavilion g6 2005ax
    operating system- win 7 home basic 64bit
    hello everyone,
    i bought this laptop but it came with only 1 partition ie c:
    i want to partition the hard disk physically so that incase i want to format and re install windows only the system c: drives gets formatted and my data in other drives is always safe and secure from getting erased. i reviewed a lot of question-answers here but most of them are regarding logical partitions which obviously will erase all data when system is restored that i dont want. i dont know the abcd of partitioning my hard drive ...please help me out.
    i want to know in detail all the steps that i will have to follow starting from beginning till end. i knw nothing abt how to create back up of recovery drive, what about system drive and hp tools... please can somebody patiently explain the whole process to me...

    Hi..I too had same sort of problem.Got it solved nw.
    U can refer this link:
    http://h30434.www3.hp.com/t5/Other-Notebook-PC-Questions/How-to-repartition-HDD-of-HP-notebook-with-...

  • Regarding Partitioning and Remodeling

    Hi Friends,
    I have some doubts on above two topics .
    1) Remodeling can be done on both ods and infocube .
    2) Partitioning can be done on both ods and infocube.
    3) Repartitioning can be done on above both.
    Please tell me , i am in little bit confusion.
    Thanks in advance .
    Thanks & Regards,
    ramnaresh.

    Hi ramnaresh,
    1)Earlier, remodeling was available for only infocubes.
    But now in the 7.1 release we have implemented it for ODS
    also.
    2)Also, Partitioning can be done on both ods and infocube.
    3)Repartitioning can be done for infocubes.
    But I am not sure about Repartitioning of ODS.
    Thanks & Regards,
    Akshay

  • Regarding partition table..pls help

    I am creating a table
    as
    CREATE TABLE T3
    PARTITION BY RANGE(CREATED)
    (PARTITION T1 VALUES LESS THAN (TO_DATE('01-APR-2006','DD-MON-YYYY')),
    PARTITION T2 VALUES LESS THAN (TO_DATE('01-JUN-2006','DD-MON-YYYY')))
    AS SELECT * FROM T1
    am getting error :
    ORA-14400: inserted partition key does not map to any partition
    since am new to the partitioning concepts, pls help.
    Thanks.

    Oups :-)
    I referenced the source table name (T1) instead on the newly partitionned table (T3) fromyour original post, sory :)
    The select should read:
    SELECT *
    FROM T3 PARTITION (T3);
    Thinking of that, you should give another name to the partition in order to avoid confusion!
    Yoann.

  • Doubts regarding partition table.

    hi friends,
    i'm using oracle 10g (10.2.0.1) on windows server 2003
    i've a table, contains more than 2 million records, and it is range partition with quarterly by year.
    like values less than('01-05-2008')
    values less than('01-09-2008')
    selecting multiple partition in single query without union is not possible.
    so i fire the query like.
    select col1,col2,col3 from table where r_date between ('01-01-2008','25-06-2008');
    i would like to know that with this query, it will scan full table or it will scan only those two partitions...?
    thanks,

    i did that..
    when i fire the following query...
    select /*+ first_rows(1000) */ col1,col2,col3
    from table
    where r_date between to_date('01-01-2008','dd-mm-yyyy') and to_date('01-03-2008','dd-mm-yyyy');
    explain plan:
    SELECT STATEMENT, GOAL = HINT: FIRST_ROWS               11     1001     50050     640279     0     1     161
    PARTITION RANGE ITERATOR               11     1001     50050     640279     1     1     161
    TABLE ACCESS FULL     DBO     KEY_HISTORY_PART     11     1001     50050     640279     2     1     161
    it shows table access full and partition range iterator..
    because of that i'm asking..
    thanks..

  • Regarding Partition Table:Spilt Partition

    Hi ,
         I have create one partition table. I did range partitioned on this .original table has 1035 Millions records.
         table has data from Jan 2008 to till May.I have create one partition of Jan-2008 to March 2009.
         Name is PS_INTRIMDETAIL_TILL_MAR2009 .This Partition has one table space
         Which has Five datafile of 20 GB.
         Next Onwards Partitions are Apr2009,May2009 this partitons are Monthwise.
         Now I want to split this PS_INTRIMDETAIL_TILL_MAR2009 partition on quaterly basis.
         Kindly suggest me how can I split this partiton.
         I also want to know the appropriate tablespace size for split partition.

    Hello,
    Here;s how you can split your partition by quartely
    ALTER TABLE TBLMEDRATINTRIM_DETAIL_ROAM_01
    SPLIT PARTITION PS_INTROAM_TILL_MAR2009 AT
    (TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    INTO (PARTITION PS_INTROAM_TILL_Q4
           TABLESPACE TABLESPACE TS_INTROAM_TILL_MAR2009
           PARTITION PS_INTROAM_TILL_MAR2009);
    ALTER TABLE KLONDIKE.TBLMEDRATINTRIM_DETAIL_ROAM_01
    SPLIT PARTITION PS_INTROAM_TILL_Q4 AT
    (TO_DATE(' 2008-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    INTO (PARTITION PS_INTROAM_TILL_Q3
           PARTITION PS_INTROAM_TILL_Q4);
    ALTER TABLE KLONDIKE.TBLMEDRATINTRIM_DETAIL_ROAM_01
    SPLIT PARTITION PS_INTROAM_TILL_Q3 AT
    (TO_DATE(' 2008-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    INTO (PARTITION PS_INTROAM_TILL_Q2
           PARTITION PS_INTROAM_TILL_Q3);
    ALTER TABLE TBLMEDRATINTRIM_DETAIL_ROAM_01
    SPLIT PARTITION PS_INTROAM_TILL_Q2 AT
    (TO_DATE(' 2008-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    INTO (PARTITION PS_INTROAM_TILL_Q1
           PARTITION PS_INTROAM_TILL_Q2);To compress old partitions;
    You can create one temp compressed for one quaretly partiton, you can repeat this process
    1. create table Q1_cmp tablespace <ts_name> compress as select * from TBLMEDRATINTRIM_DETAIL_ROAM_01 where CALLEND between to_date('20080101,'YYYYMMDD') and to_date('20080331','YYYYMMDD');
    2. Then exchange Q1 uncompressed partition with Q1_cmp
    ALTER TABLE TBLMEDRATINTRIM_DETAIL_ROAM_01
      EXCHANGE PARTITION PS_INTROAM_TILL_Q1
      WITH TABLE Q1_CMP
      EXCLUDING INDEXES
      WITHOUT VALIDATION;
    3. Then just rename partition back to original nameyou are in telecom and are you saving CDRs or MSUs, so tablespace size depends upon the volume. I suggest to go with the default value of 32 gig and I think it will grow upto 20 G
    create tablespace q1_ts datafile '/location/q1_ts/q1_tsdat01.dbf'  size 512M autoextend on next 256M maxsize unlimited.Hope this helps
    Regards

  • Problem regarding partitioning of tables

    hi all....good afternoon
    I have a table of huge number of records and thats why I want to do partitioning of that table.
    The column upon which I have to make the partition is of varchar2(7) type which contains the data in the format '2009APR', '2010JAN' etc etc..
    Now I have to fetch out the first 4 characters of the datas (i.e only the year) and then I can partition the table based on the years.
    How can I do that....plss help.
    create table test123
    (name varchar2(10),
    age number,
    DOB varchar2(7),
    gender varchar2(1)
    Edited by: user12780416 on Dec 24, 2010 2:48 AM

    Just partition by DOB column:
    SQL> create table test123(
      2                       name varchar2(10),
      3                       age number,
      4                       DOB varchar2(7),
      5                       gender varchar2(1)
      6                      )
      7    partition by range(DOB)
      8      (
      9       partition DOB_past values less than('2009'),
    10       partition DOB_2009 values less than('2010'),
    11       partition DOB_2010 values less than('2011'),
    12       partition DOB_maxvalue values less than(maxvalue)
    13      )
    14  /
    Table created.
    SQL> insert into test123 values('X',0,'2010APR','M')
      2  /
    1 row created.
    SQL> select count(*) from test123 partition(DOB_2010)
      2  /
      COUNT(*)
             1
    SQL> insert into test123 values('Y',0,'2009JAN','M')
      2  /
    1 row created.
    SQL> select count(*) from test123 partition(DOB_2009)
      2  /
      COUNT(*)
             1
    SQL> SY.

  • Problem regarding partitioning tables

    hi all....good afternoon
    I have a table of huge number of records and thats why I want to do partitioning of that table.
    The column upon which I have to make the partition is of varchar2(7) type which contains the data in the format '2009APR', '2010JAN' etc etc..
    Now I have to fetch out the first 4 characters of the datas (i.e only the year) and then I can partition the table based on the years.
    How can I do that....plss help.
    The database is in 10g..
    create table test123
    (name varchar2(10),
    age number,
    DOB varchar2(7),
    gender varchar2(1)
    );

    user12780416 wrote:
    hi all....good afternoon
    I have a table of huge number of records and thats why I want to do partitioning of that table.
    The column upon which I have to make the partition is of varchar2(7) type which contains the data in the format '2009APR', '2010JAN' etc etc..
    Now I have to fetch out the first 4 characters of the datas (i.e only the year) and then I can partition the table based on the years.
    How can I do that....plss help.
    The database is in 10g..
    create table test123
    (name varchar2(10),
    age number,
    DOB varchar2(7),
    gender varchar2(1)
    );I suggest you instead of this varchar column with date column like dat.And use this column as partition key.For example.
    create table test123
    (name varchar2(10),
    age number,
    DOB varchar2(7),
    gender varchar2(1),
    dat date
    partition by  range (dat)
      partition part1 values LESS THAN (TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
      partition part2 values LESS THAN (TO_DATE(' 2009-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
      partition part3 values LESS THAN (TO_DATE(' 2009-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
      partition part4 values LESS THAN (TO_DATE(' 2009-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
      partition part5 values LESS THAN (TO_DATE(' 2010-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
      )

  • Regarding Partitioning of table

    Guys,
    I have a table with 2 years worth of daily data and would like to partition it on monthly basis. Thus the table will have 24 partitions. When a select on this table is encountered based on the date column in the table, will Oracle automatically find the partition to which this date belongs or does the query explicitly need to state which partition to use?
    Thanks,
    Saff

    Oracle should automatically choose the right partitions as described in this partition pruning example.

  • Regarding partitioning the hard drive

    Hello,
    I purchased a t430 recently with 320gb hard disk,So may i knoiw how to create partitions in the hard drive like what if i want to make 3 drives instead of one c drive.
    Regards

    Hi harshjainabes,
    Here is some info I found from Windows on creating partitions:
    Create and format a hard disk partition
    Create a partition or logical drive
    Hope this helps.
    Be AWESOME Everyday!
    Donate KUDOS and Click "Accepted Solution"
    Did someone help you today?
    Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"
    This will help the rest of the Community with similar issues identify the verified solution and benefit from it.

  • Regarding Partitioning

    Hi Experts,
    I have a question
    if data in cube is not compressed and there is no data at all in E fact table
    can we do partitioning on the cube (3.x Version)
    Thanks in Advance,
    Nitya

    http://help.sap.com/saphelp_nw2004s/helpdata/en/33/dc2038aa3bcd23e10000009b38f8cf/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b9/60c041a2236a24e10000000a1550b0/content.htm
    rgds, Ghuru

  • 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 know  Whether Partition is done for Cube or not

    Hi All,
    I need information regarding Partition of a cube.
    a)How do i know the Partition is done or not for Cube
    b)On what basis we should make parttion of Cube.
    Thanks and Regards,
    C.V.

    There are several threads on partitioning, so it would be a good start for this question (as with any question) to search the BI forums on "Partitioning" and review thsoe first.
    Some basic considerations on partitioning -
    - Your DB must support Range partitioning to permit partitioning your InfoCube. The option will be greyed out if it is not available.
    - InfoCube must be empty to be partitioned.
    - InfoCube can only be partitioned on 0FISCPER or 0CALMONTH.  You can define it so that you have a partition for each month/fiscper, or so that each partition will hold a few or several months of data.
    - Generally, you would not partition small cubes.
    - Thru BW 3.5 Aggregates automatically get partitioned the sme way the InfoCube is partitioned as long as the partitioning characteristic is in the aggregate.  In 2004s, I believe you have options as to whether an aggregate gets partitioned or not.
    - Partitioning may be done for query performance reasons and data administration.  If the queries on the InfoCube regularly run with restrictions/filters on the partitioning characteristic (FISCPER or CALMONTH), the database will "prune" any partitions that do not contain the FISCPER/CALMONTH value(s), so that it does not need to consider them , e.g. most of your users only run a sales query for the current and previous month, but your cube contains 3 years of data.  By partitioning on CALMONTH (we'll assume 1 partition / month), the database will exclude all but the two partitions from consideration.  This could help query performance a lot. or maybe only a little, depending on a variety of other factors.
    Again - it is important that the queries restrict onthe partitioning characteristic to be of any value on query performance.  So don't partition on FISCPER if all the queries use CALMONTH for restrictions.
    The data adminsitration reason you might partition is to improve selective deletion or archiving time.  These processes are capable of using a DB function to Drop the partition, which quickly removes the data from the cube, rather than having to run a resource intensive Delete query.  This only happens if you deletion/archiving criteria is set to remove an entire partition of data.
    Again - review the other threads on the BI forums on Partitioning.  Most questions you have will already have been asked and answered before, and post again on SDN if there is something you still have a question about.

  • Need help in deciding type of partition for tables

    Hi,
    I have few tables which have millions of record. In some of the tables, we have data of previous years, which we dont use now. Can we create a partition table for such type of tables.
    On other tables, How to decide if we have to use range/list/hash partitioning on our tables.
    Do i need to recreate indexes for this tables after creating partition tables.
    Please guide me.
    Best Regards,

    Partitioning decisions are based upon how you will access the data.
    If you access by date then partition by date.
    If you access by means of a list of values then use list.
    If you there is no pattern and you just need to break the data up into smaller buckets use hash.
    I see no reason why, based on what you have written, range partitioning by date would not be worthy of consideration.

Maybe you are looking for

  • SAP ECC 6.0 on Fedora

    Hi, Please let me know, can i install sap ecc 6.0 on fedora 10.0 or 11.0.

  • Sites gone from DW

    Hi, I was working in DW 8 when for whatever reason it decided to wig out and the spinning beach ball started. After awhile I decided to Force Quite DW. Upon restart, I was horrified to find that all of my sites were no longer in DW (about 25 of them)

  • HT1918 my billing method is declined

    Ok so basically I can't update or purchase anything because it says my "billing method" is declined. There is nothing wrong with my details I have all the right ID required to use my card but it still says decline. My games and apps are suffering or

  • Changing my ipod to a diff. gen.

    I got a 3rd generation Ipod, it old, scratch, and everything but it still good and there's nothing wrong with it. I believed the warranty for that Ipod is out. I just want to trade (plus some money) that Ipod to Apple and get a new generation (4th, o

  • SAP documentation for working with BExRepositorySheet?

    Can someone point me to where I can find some documentation for programmatically working with the BExRepositorySheet, in particular reading from and writing to the embedded XML script within that sheet. As I wrote in an earlier thread (BEx 7.0 -- SAP