Range partition the table ( containing huge data ) by month

There ia a table with huge data ard 9GB.This needs to range patitioned by month
to improve performance.
Can any one suggest me the best option to implement partitioning in this.

I have a lot of tables like this. My main tip is to never assign 'MAXVALUE' for your last partition, because it will give you major headaches when you need to add a partition for a future month.
Here is an example of one of my tables. Lots of columns are omitted, but this is enough to illustrate the partitioning.
CREATE TABLE "TSER"."TERM_DEPOSITS"
( "IDENTITY_CODE" NUMBER(10), "ID_NUMBER" NUMBER(25),
"GL_ACCOUNT_ID" NUMBER(14) NOT NULL ,
"ORG_UNIT_ID" NUMBER(14) NOT NULL ,
"COMMON_COA_ID" NUMBER(14) NOT NULL ,
"AS_OF_DATE" DATE,
"ISO_CURRENCY_CD" VARCHAR2(15) DEFAULT 'USD' NOT NULL ,
"IDENTITY_CODE_CHG" NUMBER(10)
CONSTRAINT "TERM_DEPOSITS"
PRIMARY KEY ("IDENTITY_CODE", "ID_NUMBER", "AS_OF_DATE") VALIDATE )
TABLESPACE "DATA_TS" PCTFREE 10 INITRANS 1 MAXTRANS 255
STORAGE ( INITIAL 0K BUFFER_POOL DEFAULT)
LOGGING PARTITION BY RANGE ("AS_OF_DATE")
(PARTITION "P2008_06" VALUES LESS THAN (TO_DATE(' 2008-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
TABLESPACE "DATA_TS_PART1" PCTFREE 10 INITRANS 1
MAXTRANS 255 STORAGE ( INITIAL 1024K BUFFER_POOL DEFAULT)
LOGGING NOCOMPRESS , PARTITION "P2008_07" VALUES LESS THAN (TO_DATE(' 2008-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS',
'NLS_CALENDAR=GREGORIAN'))
TABLESPACE "DATA_TS_PART2" PCTFREE 10 INITRANS 1 MAXTRANS 255
STORAGE ( INITIAL 1024K BUFFER_POOL DEFAULT) LOGGING NOCOMPRESS )
PARALLEL 3

Similar Messages

  • TS4605 Hi, I was working in WORD on a file containing huge data. My machine just hung up one day while working and now I seem to have lost the file how do I get it back.  Please HELP me.

    Hi, I was working in WORD on a file containing huge data. My machine just hung up one day while working and now I seem to have lost the file how do I get it back.  Please HELP me.

    Well, iCloud has nothing to do with this.
    Do you have the built-in backup function Time Machine running on your Mac?
    See: http://support.apple.com/kb/ht1427

  • How to retrieve data from domain(Value Range)  of the table

    hi
    how to retrieve data from domain(Value Range)  of the table
    thanks

    Hello,
    You can try using the FM: DOMAIN_VALUE_GET TB_DOMAINVALUES_GET.
    BR,
    Suhas
    Edited by: Suhas Saha on Mar 24, 2009 10:08 AM

  • Partitioning the table ...

    I have procedure which inserts the data based on sysdate (everyday). I have partitioned the table using partition by list i have created 31 partitions on this table.
    say for example if tis 8th of sep then the partition will be xyz_08 and tommorow will be xyz_09 similarly i have 31 partitions.
    I was trying to insert manually by changing sys dates for example like sysdate -1, sysdate -2, sysdate -3 and so on. And it worked absolutely fine
    My requirement :- is once its reaches to 31st partition then it has to drop the 1st partition and so on it continues by droping old partitions everyday once its inserted with the latest partition.
    my questions
    - how do incorporate a logic of adding partitions everyday ?
    - how to drop the oldest partition(1st partition ) when it reaches the 31 partition ?
    - do i need to use cursors and for loop to archive this both above tasks ?
    Any logic with example would be great. Sample code will be wonderful ??
    Thank you so much i appreciate it. !!!

    user642297 wrote:
    let me share my code how i am implementing the partition by list ...Please use the *\* tag before and after a sample code block (or database output) that you post. This formats the code properly (as predefined text output) and is a lot easier on the eye to read. (yes - copy the tag exactly as you see it here and paste it into your posting).
    In my previous posting i mentioned about the droping the partition. But thats not the right way i guess. Because if i drop the partition then the data will not be loaded in the same partition next time since that partition will be dropped.
    The best way would be truncating the partition i guess. so next time we can load the data in the same partition ....
    Correct. You can simply truncate the partition to empty it and ready if for a new data set. However, as already mentioned, a range partition and not a list partition may be more suitable.
    One of the great features of partitioning is called +partition pruning+. This means Oracle, at run-time, figures out what partitions to use, and what partitions to ignore, for a specific SQL query. As the data is date based. it makes more sense to use a date range partition - this allows pruning to happen when you look for data for a specific date or date range. With a list partition, you need to use the list column as is as a predicate... and it will be unusual to construct queries that only look at the day number and not as the date as a whole.
    few more questions
    - if i drop the table, will partitions will also be dropped automatically ? or do i need to explicitly drop the partitions before dropping the table ?
    Yes. Partitions is part of the table (these are physical storage containers for the data). Drop the table. Partitions gone.
    - how would i drop all the partitions at once ???
    By dropping the table. You cannot drop all partitions either - at least one partition must remain behind as a table needs a "+storage container+". It cannot be a table without a means of storing the data inserted into the table somewhere.
    i know i can use ALTER TABLE TABLE_NAME DROP PARTITION PARTITION_NAME. This only drops the particular partition but not all the partitions right????
    Correct.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Partitioning A table on a data column

    Hi,
    My requirement is to partition a table using a column with DATE datatype.
    Example:
    CREATE TABLE parttab
    STATUS CHAR(1) DEFAULT 'a' NOT NULL,
    UPDATER VARCHAR2(55) NOT NULL,
    UPDTIME DATE DEFAULT SYSDATE NOT NULL
    TABLESPACE part_tbs
    Now i want to RANGE partition the above table on the "UPDTIME" column, so that it will look like:
    Partition Value from Value till
    P1 01-Jan 31-Mar
    P2 01-Apr 30-Jun
    P3 01-Jul 30-Sep
    P4 MAXVALUE
    I tried using the below syntax, but failed with error.
    CREATE TABLE parttab
    STATUS CHAR(1) DEFAULT 'a' NOT NULL,
    UPDATER VARCHAR2(55) NOT NULL,
    UPDTIME DATE DEFAULT SYSDATE NOT NULL
    TABLESPACE part_tbs
    LOGGING
    PARTITION BY RANGE (UPDTIME)
    PARTITION P1 VALUES LESS THAN (to_date('04','MM')) LOGGING COMPRESS TABLESPACE part_tbs_P1,
    PARTITION P2 VALUES LESS THAN (to_date('07','DD-MM')) LOGGING COMPRESS TABLESPACE part_tbs_P2,
    PARTITION P3 VALUES LESS THAN (to_date('10','DD-MM')) LOGGING COMPRESS TABLESPACE part_tbs_P3,
    PARTITION P4 VALUES LESS THAN (MAXVALUE) LOGGING COMPRESS TABLESPACE part_tbs_P4
    COMPRESS
    NOCACHE
    PARALLEL ( DEGREE 2 INSTANCES Default )
    ROWDEPENDENCIES
    NOMONITORING
    ENABLE ROW MOVEMENT;
    Please suggest.
    Thanks in advance for the suggestions.

    what is the error message and your Oracle version? this sample may assist I guess -
    CREATE TABLE range_part (
    prof_history_id NUMBER(10),
    person_id       NUMBER(10) NOT NULL,
    organization_id NUMBER(10) NOT NULL,
    record_date     DATE NOT NULL,
    ph_comments     VARCHAR2(200))
    PARTITION BY RANGE (record_date) (
    PARTITION yr0 VALUES LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY'))
    TABLESPACE part1,
    PARTITION yr1 VALUES LESS THAN (TO_DATE('01-JAN-2001','DD-MON-YYYY'))
    TABLESPACE part2,
    PARTITION yr2 VALUES LESS THAN (TO_DATE('01-JAN-2002','DD-MON-YYYY'))
    TABLESPACE part3,
    PARTITION yr9 VALUES LESS THAN (MAXVALUE) TABLESPACE part4);for more examples you may visit - http://psoug.org/reference/partitions.html

  • Range Partitioning Existing table

    Hi,
    I have a table with numeric field. I want to range partition the existing table. I used the following query
    alter table dept add partition by range(deptno) (
    partition p1 values less than (20),
    partition p1 values less than (40))
    It gives me ORA-00902: invalid datatype.
    What am I doing wrong? Is it possible to partition an existing table?
    Regards,
    Subbu S.

    Hi,
    You cannot partition an existing table with an ALTER TABLE command. There are couple of techinques with which you can partition an existing table, like:
    1) Rename existing table, create a new partitoned table and move data.
    2) Using DBMS_REDEFINITION package.
    Have a look at the following links for details:
    http://www.oracle-base.com/articles/misc/PartitioningAnExistingTable.php
    http://www.dba-oracle.com/oracle_news/2004_3_9_rittman.htm
    Regards
    Asif Momen
    http://momendba.blogspot.com

  • Table containing Model Data Information

    Hi Gurus,
    I need your urgent assistance in identifying a specific table in SAP.  What table contains Model Data Information?  Our users are entering vehicle related data in Model Text 2 field in the Model Data screen and I need to extract it in a report.
    Many thanks

    Hai,
          Thanks.... I have used the same tables and have got all data except GRN Quantity.
    Many fields are therefor quantity in table MSEG like.... 'MENGE' , 'LSFMG' , 'BAMNG' , 'ERFMG'  etc.
    But no field is giving the perfect data.
    Pls help me if u have any idea on this.

  • Partitioning the tables

    i have a table that logs an actigtivity
    it has activity date time
    its a very large table...which i havnt partitioned.
    because i havnt got the archiving requirements.
    my questions is .. should i blindly create a monthly partition based on date key or should i wait for the archiving requirements?
    what is the criteria to partition the table?
    is it the amount of data ... or the archiving strategy. which one of these two should i take as the deciding factor to create partitions
    regards
    raj

    my problem is that
    i have two tables A and B
    A has a column called activity date time and B is the child table for A.
    i did not create partitions on both the tables because... i did not know the online data requirement.
    now for a code move people are complaining that i did not create monthly partitions before...
    my quesitioon is that...
    shouldnt we wait for the online data requirement to come then think of partitioning the table?
    or rather than waiting
    should we blindly create the monthly partitions on activity date time?
    regards
    raj

  • Error Message - "could not complete your request because the preset contains invalid data"

    I am trying to open a file, and every time I do it comes up with the following error message:
    "Could not complete your request because the preset contains invalid data"
    I am using Photoshop CS4 on a Macbook Pro running Snow Leopard 10.6.2.
    I have tried:
    - restarting my mac
    - opening different files created at different times
    - deleting photoshop from my app folder and the app support folder from my /username/library/application support/adobe/ folder and copied them back from a Time Machine backup from a few days ago.
    I was using Photoshop all day today with absolutely no problems. I have searched Google and this forum and have come up short. No one has this exact error anywhere.
    Any help? Thanks so much in advance!
    Pat Dryburgh

    The one thing you didn't do is reset your Photoshop preferences.
    Most likely the preferences got corrupted, and reference a corrupt preset.

  • Remove the contents of the table container in workflow

    hi,
    i want remove the contents of the table container in a method in workflow.
      how can i doit. anyone pls send me the syntax.
    after removing the old contents then i want to insert new values to that table.
    Thanks
    Sankar

    hi,
    i want to refresh the container in workflow.
    anyone pls tell me.
    Thanksin advance.
    sankar.

  • The table for storing data for infocube and ODS

    Hi all:
        could you please tell me how to find the table for storing data for infocube and ODS?
    thank you very much!

    Hi Jingying Sony,
    To find tables for any infoprvider go to SE11.
    In database table field enter the following
    Cube -
    Has fact table and dimension table
    For customized cube - ie cube names not starting with ' 0 '
    Uncompressed Fact table - /BIC/F<infocubename>
    Compressed fact table - /BIC/E<infocubename>
    Dimension table - /BIC/D<infocubename>
    For standard cube - ie cube names  starting with ' 0 '
    Uncompressed Fact table - /BI0/F<infocubename>
    Compressed fact table - /BI0/E<infocubename>
    Dimension table - /BI0/D<infocubename>
    Click on display.
    For DSO,
    For standard DSO active table- /BI0/A<DSO name>00.
    You use 40 for new table.
    Click on display.
    For customized DSO use- /BIC/A<DSO name>00.
    An easier way is in the database table field, write the name of the cube/DSO preceeded and followed by ' * ' sign. Then press F4 . It shall give you the names of the available table for that info provider.
    Double click on the name and choose display.
    Hope this helps,
    Best regards,
    Sunmit.

  • Why should we create index on  the table after inserting data ?

    Please tell me the Reason, why should we create index on the table after inserting data .
    while we can also create index on the table before insertion of the data.

    The choice depends on a number of factors, the main being how many rows are going to be inserted in the table as a percentage of the existing rows, or the percentage growth.
    Creating index after a table has been populated works better when the tables are large or the inserts are large for the following reasons
    1. The sort and creation of index is more efficient when done in batch and written in bulk. So works faster.
    2. When the index is being written blocks get acquired as more data gets written. So, when a large number of rows get inserted in a table that already has an index , the index data blocks start splitting / chaining. This increases the "depth" of the inverted b-tree makes and that makes the index less efficient on I/O. Creating index after data has been inserted allows Orale to create optical block distribution/ reduce splitting / chaining
    3. If an index exists then it too is routed through the undo / redo processes. Thats an overhead which is avoided when you create index after populating the table.
    Regards

  • How to dump table to the flat file, if the table has NVARCHAR data type fie

    I need to dump the table to the text file. The table has NVARCHAR data type field and simple select * from table_name does not work. What do I have to do? Do I need convert NVARCHAR to VARCHAR and if yes, then how?
    Thanks,
    Oleg

    I need to dump the table to the text file. The table has NVARCHAR data type field and simple select * from table_name does not work. What do I have to do? Do I need convert NVARCHAR to VARCHAR and if yes, then how?
    Thanks,
    Oleg

  • What is the table contains Function module include program name

    Hi,
    What is the table contains Function module include program name
    Regards,
    Raja

    Try this FUNCTION_INCLUDE_INFO to get the include number to which function module belongs to.From this u ll get only the particular include name.
    or
    if u need the all the includes used in the function group u have use INNER JOIN on TFDIR and D010INC table
    <b>Select binclude into itab from trdir as a inner join d010inc as b on apname = bmaster where apname = fmodname.</b>
    I hope this will help u.
    Thanks & Regards
    Santhosh
    Message was edited by:
            santhosh ds

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

Maybe you are looking for

  • Need quick help...

    pruchased a hard drive for my hp EliteBook 8540w. Drive died on it..put new drive in booted several times but any OS i try to install says it cant find disk...is there a way to tell FOR SURE if the drive is being seen in the BIOS. I see under boot op

  • Itunes app will not load on iphone 4s since update

    Since I downloaded newest version ios 7.0.2, on my iphone 4s, the itunes app will not load.  Starts to open up then closes. I have tried: method to double click home button and swipe to close app holding home and power button down to shut down and re

  • C 6.0 ovi ...my position ,,,thinks i'm 1.8km fro...

    can anyone tell me how you can correct the position , both myself and my other half have just got c 6's  mainly for the maps and  sat nav,,,its bloody useless so far as when we are sat at home it hinks we are at the other side of town 1.8km away  fro

  • Multi system scenario - ERP ECC 5.0 (or lower) - FSCM 6.0 Ehp4

    Dear colleagues, If you are dealing with a multisystem scenario, where ERP ECC is in versión (5.0 or lower) and your FSCM system is in 6.0 with Ehp4, can you take advantajes of the new functionalities released in Ehp2, Ehp3 and Ehp4? or is it mandato

  • Anyone Experience WebCenter Suite 11g ins tall with UCM on Linux?

    I have been installing and facing several issues with this. It is extremely slow on weblogic server. starting weblogic server takes around 30 minutes. The deployer keeps deploying for ever. Not sure if I am doing something wrong. Here are the steps I