Partitioning the OKL_STRM_ELEMENTS table

I am looking for someone with experience with partitioning the OKL_STRM_ELEMENTS table. I would like to know what you partitioned on and if you had any problems once you implemented the partitions. Besides the OKL_STRM_ELEMENTS table are there any other Lease Management table that should be partitioned.
BLC

This is documentation of the Partitioning the OKL_STRM_ELEMENTS table
You should made a proposal to partition the table based on STREAM_ELEMENT_DATE Performance team however suggested creating a larger number of partitions using a smaller range (MMYYYY vs YYYY) rather than using a subpartition by hash(ID).
Performance benefits may be seen in SQL statements that take advantage of the partioning scheme resulting in partition elimination (i.e. the sqls actually scan less data), this happens for sqls that have the partition key in the WHERE clause.
Partitioning a table can actually degrade overall performance if the SQL statements referencing this table do not include the partition key in the WHERE clause as a filter. The performance degradation is caused by the fact that the query has to scan several partitions as opposed to a single segment in the non-partitioned case.
The majority of select statements on OKL_STRM_ELEMENTS in OKL do include STREAM_ELEMENT_DATE in the where clause, so overall benefit should be positive.
Moreover, ranges should be based on analysis of your data distribution

Similar Messages

  • Partitioning the fact table

    Hi Gurus,
    I have a question regarding partitioning the cube. When you partition the cube from the Extras menu, will it partition the F table or is it the E table or both.
    Second question: After partitioning, how will i know the newly created table names.
    Thanks,
    ANU

    Hi Anu,
    Partition Need and its definition
    Infocube contains huge amount of data n the table size of the cube increases regularly. so
    when a query is executed on cube then it has to check entire table to get the records for
    example Sales in Jan08.
    Advantage of Partition
    so we can partition the cube so that smaller tables are formed .so that report performance
    will increase bcoz the query hits that particular partition.
    Steps for Partition
    1.To partiotion a cube, it must not contain data.
    2. Partition can be done using time characteristics 0CALMONTH and fiscalperiod.
    steps:
    1. in change of the cube, select extras menu and Partioning option.
    2. select calmonth time characteristic.
    3. it will ask for the time period to partiotion and no. of partiotions. give them
    4. activate the cube.
    In BI 7 we can partition the cube even if it contains data.
    select the cube, right click , select repartitioning.
    1. we can delete existing partitions
    2. create new ones
    3. merge partitions.
    Partitioning of the Cube
    http://help.sap.com/saphelp_nw04s/helpdata/en/0a/cd6e3a30aac013e10000000a114084/frameset.htm
    Partitioning Fields and Values
    partition of Infocube
    Partitioning of cube using Fiscal period
    Infocube Partition
    After Partition
    You can find the Partition in the following tables in SE11 >
    E tables /BIC/E* or /BIC/E(cube name)
    Please also go through the following links
    Partioning of Cube
    partioning
    Partioning of ODS object
    /thread/733456 [original link is broken]
    Hope i had answered your question
    Assign points if helpful,
    Thanks and regards
    Bala

  • Is partitioning the ra_customer_trx_lines_all table by time as well as safe

    Hi We're using Oracle Applications 11.5.10.2
    Is partitioning the ra_customer_trx_lines_all table by time as well as its indexes safe?
    It's getting huge and we wanted to cut down on query time. Someone here told me that partitioning it could be bad because Applications doesn't expect that table or its indexes to be partitioned and had queries tuned to query that table as a non-partitioned table with non-partitioned indexes.
    Is this true?

    Hi,
    Please also see this related thread.
    Partitioning GL_BALANCES
    Partitioning GL_BALANCES
    Please note that using partitioning requires extra license.
    Thanks,
    Hussein

  • Partitioning a fact table

    I am curious to hear techniques for partitioning a fact table with OWB. I know HOW to setup the partitioning for the table, but what I am curious about is what type of partitioning everyone is suggesting. Take the following example...Lets say we have a sales transaction fact table. It has dimensions of Date, Product, and Store. An immediate partitioning idea is to partition the table by month. But my curiosity arises in the method used to partition the fact table. There is no longer a true date field in the fact table to do range partitioning on. And hash partitioning will not distribute the records by month.
    One example I found was to "code" the surrogate key in the date dimension so that it was created in the following manner "YYYYMMDD". Then you could use the range partitioning based on values of the key in the fact table less than 20040200 for Jan. 2004, less than 20040300 for Feb. 2004, and so on.
    Is this a good idea?

    Jason,
    In general, obviously, query performance and scaleability benefit from partitioning. Rather than hitting the entire table upon retrieving data, you would only hit a part of the table. There are two main strategies to identify what partitioning strategy to choose:
    1) Users always query specific parts of the data (e.g. data from a particular month) in which case it makes sense for the part to be the size of the partition. If your end users often query by month or compare data on a month-by-month basis, then partitioning by month may well be the right strategy.
    2) Improve data loading speed by creating partitions. The database supports partion exchange loading, supported by Warehouse Builder as well, which enables you to swap out a temporary table and a partition at once. In general, your load frequency then decides your partitioning strategy: if you load on a daily basis, perhaps you want daily partions. Beware that for Warehouse Builder to use the partition exchange loading feature you will have to have a date field in the fact table, so you would change the time dimension.
    In general, your suggestion for the generated surrogate key would work.
    Thanks,
    Mark.

  • Partitioning on a table on the field TIMESTAMP WITH TIME ZONE

    Hi I have a very large size table which has grown to a size that we are not able to query it efficiently. We have decided to partition the table. But the issue is the table has a TIMESTAMP WITH TIME ZONE field and not DATE. I have found some links on the web which state this might cause an error. I am planning to create a temp table with the partition rules and at the same time copy data from the original one.
    using CREATE TABLE XYZ PARTITION BY RANGE (ABC) ( ---- Partition rules ------) NOLOGGING AS SELECT * FROM XYZ_ACTUAL where 1 = 2;
    Then if it works fine, I would rename the table with partitions to the actual name.
    Should all this be fine?
    The database is very critical. Hence the dilemma.

    Have you tried converting the timestamp with time zone to a character string as a partition key, possibly using an edit mask to control the timestamp components used?
    Your plan sounds OK to me - if you can get the partitioned table created - but I would test in a development first o see where the lLw of Unintended Consequences might decide to manifest itself.
    Edited by: riedelme on Dec 8, 2009 9:13 AM

  • How to choose the partition in oracle tables?

    Dear all,
    i m in need to create the partitions on prod.db tables since i m not aware of creating partitions?i just go through some theroy concepts and understood the range and list partitions (i.e)Range is normally used for values less than like jan,feb,march or values less than 50,000 values less than 1,00,000 like that each partition is having separate tablespaces to increase the performance. and for list is used to denoting the directions like west,east,north,south like that.
    Now what i want to know is ?
    1.)when will i can go ahead with partitions?
    2.)before creating partitions is it advise to create index or not needed?
    3.)if i started to create partition what is the leading column have to create partition and which partition has to choose?
    pls let me know and pardon me if i did any mistakes.
    thanks in advance..

    I had to research on same topic. One of my teammates suggested few points that might help you also.
    Advantages of partitioning:
    1) Partitioning enables data management operations such data loads, index creation and rebuilding, and backup/recovery at the partition level, rather than on the entire table. This results in significantly reduced times for these operations.
    2) Partitioning improves query performance. In some cases, the results of a query can be achieved by accessing a subset of partitions, rather than the entire table. Parallel queries/DML and Partition-wise Joins are also got benefited much.
    3) Partitioning increases the availability of mission-critical databases if critical tables and indexes are divided into partitions to reduce the maintenance windows, recovery times, and impact of failures. (Each partition can have separate physical attributes such as pctfree, pctused, and tablespaces.)
    Partitioning can be implemented without requiring any modifications to your applications. For example, you could convert a nonpartitioned table to a partitioned table without needing to modify any of the SELECT statements or DML statements which access that table. You do not need to rewrite your application code to take advantage of partitioning.
    Disadvantages of partitioning:-
    1) Advantages of partition nullified when you use bind variables.
    Additional administration tasks to manage partitions viz. If situation arises for rebuilding of index then rebuilding should to be done for each individual partition.
    2) Need more space to implement partitioning objects.
    3) More time for some tasks, such as create non-partitioning indexes, collection of “global" statistics (dbms_stat’s granularity parameter to be set to GLOBAL. if sub partition are used then we have to set it to ALL).
    4) Partition would implies a modification (of explain plan) for ALL the queries against the partitioned tables. So, if some queries use the choosing partition key and may greatly improve, some other queries not use the partition key and are dramatically bad impact by the partitioning.
    5) To get the full advantage of partitioning (partition pruning, partition-wise joins, and so on), you must use the Cost Based Optimizer (CBO). If you use the RBO, and a table in the query is partitioned, Oracle kicks in the CBO while optimizing it. But because the statistics are not present, the CBO makes up the statistics, and this could lead to severely expensive optimization plans and extremely poor performance.
    Message was edited by:
    Abou

  • A partition tab is needed in the schema-table browser and it's missing

    After a first sight with the product, I couldn't find a partition tab in the schema-table browser.
    For those having partitions it is absolutely essential.

    It's easy to add,
    create a file that has the following content
    <?xml version="1.0" encoding="UTF-8"?>
    <items>
    <item type="sharedQuery" id="PartSubPartkeys">
    <query minversion="9">
         <sql>
         <![CDATA[ select 'PARTITION KEYS' PARTITION_LEVEL,substr(sys_connect_by_path(column_name,','),2) "PARTITION KEYS"
                   from (select column_name, column_position
                   from all_part_key_columns
                   where owner = :OBJECT_OWNER
                   and name = :OBJECT_NAME
                   and object_type='TABLE' )
                   start with column_position=1
                   connect by column_position=prior column_position+1
                   union all
                   select 'SUBPARTITION KEYS' ,substr(sys_connect_by_path(column_name,','),2)
                   from (select column_name, column_position
                   from all_subpart_key_columns
                   where owner = :OBJECT_OWNER
                   and name = :OBJECT_NAME
                   and object_type='TABLE' )
                   start with column_position=1
                   connect by column_position=prior column_position+1]]></sql>
         </query>
         </item>
    <item type="sharedQuery" id="PartSubPartkeysFI">
    <query minversion="9">
         <sql>
         <![CDATA[ select 'PARTITION KEYS' PARTITION_LEVEL,substr(sys_connect_by_path(column_name,','),2) "PARTITION KEYS"
                   from (select column_name, column_position
                   from all_part_key_columns
                   where owner = :OBJECT_OWNER
                   and name = (select table_name
                             from all_indexes
                             where index_name=:OBJECT_NAME
                             and owner=:OBJECT_OWNER)
                   and object_type='TABLE' )
                   start with column_position=1
                   connect by column_position=prior column_position+1
                   union all
                   select 'SUBPARTITION KEYS' ,substr(sys_connect_by_path(column_name,','),2)
                   from (select column_name, column_position
                   from all_subpart_key_columns
                   where owner = :OBJECT_OWNER
                   and name =(select table_name
                             from all_indexes
                             where index_name=:OBJECT_NAME
                             and owner=:OBJECT_OWNER)
                   and object_type='TABLE' )
                   start with column_position=1
                   connect by column_position=prior column_position+1]]></sql>
         </query>
         </item>
    <item type="sharedQuery" id="Partitions">
    <query minversion="9">
         <sql>
         <![CDATA[ select partition_name,  num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED from all_tab_partitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME order by partition_position]]></sql>
         </query>
         </item>
    <item type="sharedQuery" id="SubPartitions">
    <query minversion="9">
         <sql>
         <![CDATA[ select subpartition_name, partition_name,  num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED from all_tab_subpartitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME order by partition_name,subpartition_position]]></sql>
         </query>
         </item>
    <item type="editor" node="TableNode" >
    <title><![CDATA[Partitions/SubPartitions]]></title>
    <query id="PartSubPartkeys" />
    <subquery>
    <title>Partitions/SubPartition</title>
    <query>
    <sql><![CDATA[select partition_position, partition_name "Partition/Subpartition",  tablespace_name,high_value,compression,num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED from all_tab_partitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and 'PARTITION KEYS'=:PARTITION_LEVEL
             union all
             select subpartition_position, partition_name||'/'||subpartition_name, tablespace_name,high_value,compression,num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED from all_tab_subpartitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and 'SUBPARTITION KEYS' =:PARTITION_LEVEL
             order by 2]]></sql>
    </query>
    </subquery>
    </item>
    <item type="editor" node="MViewNode" >
    <title><![CDATA[Partitions/SubPartitions]]></title>
    <query id="PartSubPartkeys" />
    <subquery>
    <title>Partitions/SubPArtition</title>
    <query>
    <sql><![CDATA[select partition_position, partition_name "Partition/Subpartition",  tablespace_name,
             high_value,compression,num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED
             from all_tab_partitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and 'PARTITION KEYS'=:PARTITION_LEVEL
             union all
             select subpartition_position, partition_name||'/'||subpartition_name, tablespace_name,high_value,
             compression,num_rows,AVG_ROW_LEN, blocks ,LAST_ANALYZED
             from all_tab_subpartitions where table_owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and 'SUBPARTITION KEYS' =:PARTITION_LEVEL
             order by 2]]></sql>
    </query>
    </subquery>
    </item>
    <item type="editor" node="IndexNode" >
    <title><![CDATA[Partitions/SubPartitions]]></title>
    <query id="PartSubPartkeysFI" />
    <subquery>
    <title>Partitions/SubPArtition</title>
    <query>
    <sql><![CDATA[select partition_position, partition_name "Partition/Subpartition",  tablespace_name,high_value,compression,
             Leaf_Blocks, Distinct_Keys, clustering_factor ,LAST_ANALYZED
             from all_ind_partitions where index_owner = :OBJECT_OWNER and index_name = :OBJECT_NAME
             and 'PARTITION KEYS'=:PARTITION_LEVEL
             union all
             select subpartition_position, partition_name||'/'||subpartition_name, tablespace_name,high_value,compression,
             Leaf_Blocks, Distinct_Keys, clustering_factor ,LAST_ANALYZED
             from all_ind_subpartitions
             where index_owner = :OBJECT_OWNER
             and index_name = :OBJECT_NAME
             and 'SUBPARTITION KEYS'=:PARTITION_LEVEL
             order by 2]]></sql>
    </query>
    </subquery>
    </item>
    <item type="editor" node="TableNode">
    <title><![CDATA[Unabridged SQL]]></title>
    <query>
    <sql><![CDATA[select :OBJECT_OWNER OOWNER, :OBJECT_NAME ONAME, 'TABLE' OTYPE from dual union all select owner,index_name,'INDEX' from all_indexes where table_owner= :OBJECT_OWNER and table_name=:OBJECT_NAME ]]></sql>
    </query>
    <subquery type="code">
    <query>
    <sql><![CDATA[select dbms_metadata.get_ddl(:OTYPE,:ONAME, :OOWNER) "SQL Statements" from dual]]></sql>
    </query>
    </subquery>
    </item>
    <item type="editor" node="TableNode">
    <title><![CDATA[Partition Columns Statistics]]></title>
    <query id="Partitions" />
    <subquery>
    <query>
         <sql>
         <![CDATA[ select COLUMN_NAME, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE, DENSITY, NUM_NULLS
             from all_part_col_statistics where owner = :OBJECT_OWNER
             and table_name = :OBJECT_NAME
             and partition_name= :PARTITION_NAME
             order by column_name]]></sql>
    </query>
    </subquery>
    </item>
    <item type="editor" node="TableNode">
    <title><![CDATA[SUBPartition Columns Statistics]]></title>
    <query id="SubPartitions" />
    <subquery>
    <query>
         <sql>
         <![CDATA[ select COLUMN_NAME, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE, DENSITY, NUM_NULLS from all_subpart_col_statistics where owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and subpartition_name=:SUBPARTITION_NAME order by column_name]]></sql>
         </query>
    </subquery>
    </item>
    <item type="editor" node="MViewNode">
    <title><![CDATA[Partition Columns Statistics]]></title>
    <query id="Partitions" />
    <subquery>
    <query>
         <sql>
         <![CDATA[ select COLUMN_NAME, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE, DENSITY, NUM_NULLS
             from all_part_col_statistics where owner = :OBJECT_OWNER
             and table_name = :OBJECT_NAME
             and partition_name= :PARTITION_NAME
             order by column_name]]></sql>
    </query>
    </subquery>
    </item>
    <item type="editor" node="MViewNode">
    <title><![CDATA[SUBPartition Columns Statistics]]></title>
    <query id="SubPartitions" />
    <subquery>
    <query>
         <sql>
         <![CDATA[ select COLUMN_NAME, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE, DENSITY, NUM_NULLS from all_subpart_col_statistics where owner = :OBJECT_OWNER and table_name = :OBJECT_NAME and subpartition_name=:SUBPARTITION_NAME order by column_name]]></sql>
         </query>
    </subquery>
    </item>
    <item type="editor" node="SchemaFolder" minversion="10.1">
    <title><![CDATA[Sessions]]></title>
    <query>
    <sql><![CDATA[select sid,serial#,program,last_call_et,machine, status, sql_hash_value shv,sql_child_number scn
             from v$session
             order by 1]]></sql>
    </query>
    <subquery>
    <query>
    <sql><![CDATA[select * from table(dbms_xplan.display_cursor(:SHV,:SCN))]]></sql>
    </query>
    </subquery>
    </item>
    </items>
    and add the following line to your ide.conf file (in jdev/bin directory in the sqldev install dir)
    AddVMOption -Draptor.user.editors=fullpathofthefile(dir and name)
    and restart, you'll get several additional tabs to the ones displayed for tables.
    enjoy

  • 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

  • Can we addnew partition and sub partition in the existing table in one shor

    can we addnew partition and sub partition in the existing table in one short

    nav wrote:
    can we addnew partition and sub partition in the existing table in one shortYes,
    You can and below is the example for Range-List partition
    ALTER TABLE <table_name>
       ADD PARTITION <partition_name> VALUES LESS THAN (<value>
          STORAGE (INITIAL 20K NEXT 20K) TABLESPACE <TS name> NOLOGGING
              SUBPARTITION Clause
              SUBPARTITION Clause
              SUBPARTITION Clause
              SUBPARTITION Clause
               );

  • What's the best practice to partition an existing table?

    We are using Oracle 11g EE 11.2.0.3.0. We want to partition an existing table. I found some information from this link [http://www.oracle-base.com/articles/misc/partitioning-an-existing-table.php], but I am not sure whether that's the best way. Could anyone share the best practice of partitioning an existing table?
    Thanks.
    Jun

    >
    We want to partition a few related tables. A couple of tables have about 30 million rows, and a couple of other tables have about 10 million rows. The data for those tables is for ~2000 accounts, each of them is identified by a column named "account_id". We want to partition the tables by using the "account_id" as the partition key to gain better performance for queries, so we would probably use hash partition. Please advise.
    >
    1. What evidence do you have that your performance will be any better if you partition those tables?
    2. What evidence do you have that there is anything wrong with the performance of your current queries?
    3. Have you reviewed the actual execution plans for your most important queries to see if there is even any room for improvement?
    If your query uses account_id as a predicate but only pulls a few records from a 'master' table for that key value your performance may actually be worse if you partition that table. That is because using an index range scan Oracle can easily find the ROWIDs of the rows that need to be selected and then easily retrieve them regardless of their physical location.
    If you have queries that do NOT use account_id but currently use indexes the performance of those queries may also be worse if you partition that table. Those indexes will be GLOBAL.
    There are two major implications when you use hash partitioning:
    1. Any query that does NOT include the partitioning key (account_id for your case) will, of necessity, have to use a full table scan if an appropriate index is not available.
    2. You will get NO management benefits such as being able to add/remove partitions that include old data.
    Before you decide to partition a table you should conduct tests and examine the execution plans for your important queries.

  • 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

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

  • Best way of partitioning the huge size table in oracle 11gr2

    hi,
    OS: linux
    DB: oracle 11gR2
    table size is about 2T and single table space with multiple dbf files in ASM,
    table partition with dbms.redefinition is running past 2 days (range partition).. its running but not that fast..
    note: exchange partition is too slow.. hence not used..
    what is the best way of doing the huge size table partition. please suggest, thanks.

    >
    what is the best way of doing the huge size table partition
    >
    A few questions
    1. Is that an OLTP or OLAP table?
    2. Is all of the data still needed online or is some of it archivable?
    3. What type of partitiioning are you doing? RANGE? LIST? COMPOSITE?
    4. Why do you you say 'exchange partition is too slow' - did you do a test?
    For example if data will be partitioned by create date then one stragety is to initially put all existing data into the root partition of a range partitioned table. Then you can start using new partitions for new incoming data and take your time to partition the current data.

  • The guide to bootcamp assistant states that bootcamp can only be installed on a drive with a single partition. New Macs with Lion preinstalled have two partitions - the second is a recovery partition.  How do I install Bootcamp?

    Late in August 2011 I took delivery of a new 27" iMac with Lion preinstalled.  I need to run Windows as well. Following Apple's written suggestion, I printed off the then current 12 pages of the document "Bootcamp Installation & Setup Guide" which clearly stated that the hard drive you were going to install on had to have on it, before install, a maximum of one partition.  Using finder and disk utility I determined that there was only one partition.  Unbeknownst to me, there was (is) an additional hidden (from those two pieces of software) partition on the disk.  As of machines delivered new with Lion preinstalled, Apple has begun to include a "recovery partition".  In that partition there is a copy of the software necessary to reinstall Lion via a download from the Apple App Store.  Not knowing the partition was there, I cranked up  "Bootcamp Assistant" which nicely offered to repartition my hard drive creating a "Bootcamp Partition" in addition to the existing.  I told it how big to make each and hit the do it button, subsequently destroying my operating system.  Oh, it very nicely told me, after the damage was done, how many partitions were REALLY on the disk and that I could not install Bootcamp cause there were too many partitions.
    Luckily the the Recovery Partition, which at that point I knew existed, was not harmed and after doing some research on another compter, I used it to once again download Lion from the App Store and reinstall. So, I have recovered but am still stuck with the problem:  how do I install Bootcamp in this new environment?

    First you need to seriously back up your Mac.
    A clone is an exact duplicate of your existing Mac HDD. Merely copying and pasting a drive will not make a bootable backup. In case of problems you can boot from an Ext HDD clone and use the utilities to repair, reformat, or clone the Ext HDD back to the internal Mac HDD.  While Time machine back ups are easy you can not boot from it. The best thing to have for any kind of problem is a bootable clone backup on an external drive. Some even have two external backup drives in case one fails. There are two good apps for cloning named SuperDuper and Carbon Copy Cloner.
    In dealing with the recovery partition a simple approach is to clone the Mac partition to an external disk then re-partition the Mac to a single partition (GUID partition table) . Then clone the external disk clone back to the Mac. You will now have only one Partition and Boot Camp assistant sould not object.
    Some have recommended getting rid of the recovery partition while others have advised not to do this. If you have the Lion USB Thumb Drive you do not need a recovery partition so can discard it without concern. There is another way to get rid of the recovery partition if you decide to do it but first be sure to have a backup of your Mac ( I know I sound like a nagging mom but many dead computers have been saved by this simple precaution).
    Use Disk Utility.
    1) Make the Recovery visible in Disk Utility by using a program like Secrets:http://www.macupdate.com/app/mac/27025/secrets or MacPilot:http://www.koingosw.com/products/macpilot.php (15 day free trial).
    2) Highlite the Recovery partition and Control click it and select Mount the partition.
    3) With the Recovery partition highlited, erase the partition, you'll get an error message, ignore it.
    4) Now highlite the top identity of the hard drive and select the partition tab.
    5) Highlite the Recovery partition and press the minus sign.
    6) Click and hold on the bottom edge of the partition above and drag it to the bottom, if it doesn't go there automatically, the press apply.

  • To Partition a 4NF table or convert to 2NF?

    Hi,
    In one of our Applications we have a fairly simple table that holds details about users. To keep things simple this is created as a simple triple of userid,propertyname,propertyvalue.
    So...
    4th normal form
    CREATE OR REPLACE TABLE user_metadata
    user_id VARCHAR2(20 CHAR) NOT NULL ,
    parameter_name VARCHAR2(5 CHAR) NOT NULL ,
    parameter_value VARCHAR2(20 CHAR) NOT NULL
    This has worked well for the typically small number of users and properties.
    We now have a larger proposition with 20-50 million users and 15-50 properties; not all properties are known yet; and for those properties that are known we do not know the distribution of values within a key.
    So the question we have is do we change to use 2NF and make use of (lots of) bitmapped indexes. e.g.
    CREATE OR REPLACE TABLE user_metadata
    (user_id VARCHAR2(20 CHAR) NOT NULL ,
    zone_name VARCHAR2(50 CHAR) ,
    age NUMBER(3,0) ,
    gender CHAR(1) ,
    profession_description ...
    ,town_name
    ,etc
    Or do we stick with 4NF and make use of partitioning based on the value of the parameter_name column?
    From a product viewpoint we would prefer to keep with 4NF as it means no application changes for us to make, but we need to advise the client as to the best way to structure the table for performance.
    I am not a practicing DBA, but I am the person who will be put on a plane to the client if this solution does not perform ;-) so I have some, possibly rtfm questions:
    * Can we index within a partition?
    ** For example if one partition_name is "City" then we would have a partition that contains all rows which represent City. Can I then index on the parameter_value column of the City partition? Does finding all users in NY involve scanning the City partition?
    * Is the additional storage required for 4NF likely to have a significant impact on performance; there is considerable duplication of storage with the 4NF table.
    * Which will perform better?
    * Which will be more complex to manage as the users grow from 20M to 50M?
    Thanks in advance,
    Karl.

    Thinking about this some more I think you really have two separate requirements. One is an operational requirement to store this User Metadata or Attributes, and let this be edited or added for new users easily. The other is for analytical queries that combine these Attributes in different combinations:
    * send a message to all users in NY over 40 who favorite sport is Football
    * offer a discount to a user whos birthday is this week.
    The exact list of requirements is not detailed by the client yet, but will be along the lines of "use any of the parameters to create a set of users".You seem to have a working solution to the operational side using the 4 NF triples - any set of attributes of a user can be easily represented and stored. What you do not have is a solution to the analytical query side. As already mentioned querying this metadata table directly involves some horrendous SQL and will probably perform poorly due to lack of indexes etc.
    I think the best solution is to have two separate sets of tables in the database. I cannot see why the analytical queries have to run against the current, up to date data. Surely these analytical queries would be just as valid against yesterdays data, or even the day before that or the week before. The change in a very small percentage of the metadata should not materially affect the kind of queries you are on about.
    If I am right, then you can also have your flattened out 2 NF table, with each attribute as a named data column, of the correct data type. And as you say, you can have Bit Mapped indexes on each of the columns, which will work well in the analytical type queries you have described - lots of 'and's of separate conditions.
    What you need is a way of propagating the data from the 4 NF table to the 2 NF table once a day, or at whatever frequency you want. The crudest option is to always recreate the data, copying it all across. Of course performance will be slow, and get worse as the data set grows. So you really want a way of tracking the changes to the 4 NF metadata, and then only propagating the changes over to the 2 NF copy. There are several ways you could achieve this.
    Materialized Views would be worth exploring, as they seem to do most of this already. You could also create your own staging tables for the changes, and use a trigger on the 4 NF table to populate the staging table on any change. Then use the staging table to update the 2NF data set at your desired frequency, and clear the staging table (delete records). Of course you would have to write your own SQL for this, but your table structures are relatively simple and straightforward.
    I think there are several benefits to this approach:
    * Separate data structures optimized to each type of requirement
    * Good indexing on 2 NF data for good query performance - Bit Mapped Indexes
    * Updates to 2 NF done separately from OLTP updates to 4 NF data - no contention on locking of Bit Mapped Indexes
    * No performance impact on 4 NF data sets and the OLTP updates to these
    * Minimal if any changes to your existing code on the 4 NF tables
    I think you might have some data consistency and integrity issues though, which you need to be careful of. Do you have any logic that enforces the rule that all metadata attributes must be present for each user? Do you somehow enforce that each user has an 'age' or 'city' or 'birth date'. The reason is that when you take the separate rows of triples and merge them together to form one wide row of many columns you might end up missing some of the data attributes for some of the users. This would result in a NULL being stored in the 2 NF table. Is this what you want?
    Unfortunately this lack of data integrity is really inherent in the 4 NF form of separate triples. You cannot have a data integrity constraint on individual rows that will enforce that each user must have a value for all parameter names. And you can only check that a user has values for all parameters after the data rows have been stored for the other parameters. Normal data integrity constraints can be checked and enforced before a data row is stored i.e. a single new data row can have all its columns checked for NULLs, and all foreign keys can be checked, during the INSERT before Oracle physically adds the row to the table. Your type of data integrity is across a set of data rows, which you would have to handle somehow else.
    Just some more thoughts,
    John

Maybe you are looking for