11g: hash subpartition

Hi expert,
a suggest on hash subpartition on 11g
I have a table

MSGID TIME_STAMP NAME ATTRIBUTE
01/10/2010 1, AA1 BBB
01/10/2010 2 AA2 BBB
3 01/10/2010 CCC AA3
01/11/2010 4, AA4 CCC
01/11/2010 5, AA5 DDD
01/11/2010 6, AA6 DDD


For example I want to do: range-Hash
create table
...
PARTITION BY RANGE(TIME_STAMP)
INTERVAL( NUMTODSINTERVAL(7,'DAY'))
SUBPARTITION BY HASH(MSGID)
SUBPARTITIONS 10 STORE IN (USR_DATA) 
   ( PARTITION P_FIRST_01092010 VALUES LESS THAN
        (TO_DATE('01/09/2010','MM/DD/YYYY')))
...
Partition on beach is ok. I have not quite undestand, which hash subpartition

Oracle BLOG:
"Hash secondary partitions do not need statistical, because the optimizer can derive all necessary statistics to the partition level statistics accurately, because hash partitions are all approximately the same size because of the linear hashing algorithm."

I undestand that this partition uses the algoritm hash to store data on a different partition, in my case 10 subpartition, for each partition of the range (date).

That's the problem?

Another question. I can't drop the P_FIRST_01092010, because it is the first (and start by) partition. If I want to delete it, I'll create an another 'first partition Right?

Thank you very much as usual.

See you soon,.
Lain

I can truncate the first partition, well. But I can bring the next partition?

Yes. You can delete all other partitions except the initial one. An attempt to drop the initial parition will cause "ORA-14758: last partition in the beach section cannot be deleted.

I have something like that in my code:

EXECUTE IMMEDIATE 'ALTER TABLE mytab '||CASE WHEN partition_position = 1 THEN 'TRUNCATE' ELSE 'DROP' END||' PARTITION '||parition_name;

Also, the mytab table is partitioned by range (interval) and Sub partitioned by hash, as in your case.

Tags: Database

Similar Questions

  • Subpartition Hash will be outdated in the era of the Exadata?

    PARTITION OF SUBPARTITION RANGE (SALES_DAY) OF the HASH (PRODUCT_ID) was a fairly common way to organize facts in ORACLE tables.

    Since Exadata automatically distributes data on storage server depending on the block size of 4MB, should we still subpartition table based on the hash value of a column of high cardinality? Join partition-wise will be discharged to the storage without hash subpartition Server? Please inform and explain.


    Another question: since both OF HASH PARTITION and SUBPARTITION OF HASH are the same algorithm in the form of ORA_HASH() or ORA_HASH() function, what kind of hash function Exadata uses?

    Thank you.

    Even with any database without sharing the distribution of hash key must be specified. Some yo column default or random, but generally you will want to check this for optimal performance.

    I don't know the future of the Exadata holds a lot of good things... :)
    --
    Kind regards
    Greg Rahn
    http://structureddata.org

  • Why not REMOVE SUBPARTITION?

    Using Oracle 10 g RAC + ASM (10.2.0.3) 2 on SUSE Enterprise Linux Server 9 (x86_64).

    I did the following:

    DELETE TRACK. TBA SUBPARTITION (YEAR_2007_MONTH_1);
    DELETE TRACK. TBA SUBPARTITION (YEAR_2007_MONTH_2);
    DELETE TRACK. TBA SUBPARTITION (YEAR_2007_MONTH_3);
    DELETE TRACK. TBA SUBPARTITION (YEAR_2007_MONTH_4);
    DELETE TRACK. TBA SUBPARTITION (YEAR_2007_MONTH_5);
    DELETE TRACK. TBA SUBPARTITION (YEAR_2007_MONTH_6);
    DELETE TRACK. TBA SUBPARTITION (YEAR_2007_MONTH_7);
    DELETE TRACK. TBA SUBPARTITION (YEAR_2007_MONTH_8);
    DELETE TRACK. TBA SUBPARTITION (YEAR_2007_MONTH_9);
    DELETE TRACK. TBA SUBPARTITION (YEAR_2007_MONTH_10);

    COMMIT;

    SELECT COUNT (1) IN THE TRACE. TBA T WHERE T.YEAR = 2007 AND T.PERIOD = 4;

    With the following results (shown similar results):
    0 rows deleted.
    0 rows deleted.
    75556 deleted rows.
    77428 deleted rows.
    0 rows deleted.
    149160 deleted rows.
    156654 deleted rows.
    153182 deleted rows.
    158502 deleted rows.
    Validation complete.

    COUNT (1)
    ----------
    75343


    1 selected line.

    The problem is with SUBPARTITION (YEAR_2007_MONTH_4). This partition will not be clear.
    I also encountered this problem with the same table in another partition.

    What could be the problem? Oracle recount not errors.

    Thank you
    (BLL)

    Hello

    The problem is that you use hash subpartitions. I recommend you take a look at the Oracle documentation to understand what hash partitioning (void) is.

    In your case, you must use either multi-column Beach, beach-list, or scales of partitioning.
    Or you might be wondering why you're not simply range partitionig your table on the TIME_DIM column (I guess that's a FK to a time dimension).

    Concerning
    Maurice

  • Merge tables

    Hello

    I have two partitioned tables.
    Table 1 has 15 partitions and each partition has about 3 million documents.
    Table 2 has 20 partitions and each partition has about 3 million documents.
    I want to merge these two tables into a single table so that the new table has all the partitions with respective storage spaces.
    All suggestions and what would be the best way to do it?

    Thanks in advance.

    >
    Can I swap partitions between two partitioned tables?
    >
    Yes - but not the way you try. You need to RTFM! I pointed out the exact section of the document that applies to your use case. You must make the Exchange, the way in which the documentation said: via a hash partitioned work table.

    Here's a solution that people may want to add to their Toolbox.

    This code example moves actually 4 partitions of the table EMP_PART to the same, but empty, scores of the EMP_PART_NEW table by using the table of work EMP_PART_HASH.

    -- EMP_PART table has 4 range partitions with data in each partition
    -- this data will be moved (via partition exchange) to the EMP_PART_NEW table
    DROP TABLE EMP_PART;
    
    CREATE TABLE emp_part (empno number(4), ename varchar2(10),
     deptno number(2), created_date DATE default sysdate)
      partition by range (created_date)
         SUBPARTITION BY HASH(deptno) subpartitions 4
    ( partition p1 values less than (to_date('01-01-2013', 'mm-dd-yyyy')),
     partition p2 values less than (to_date('01-02-2013', 'mm-dd-yyyy')),
     partition p3 values less than (to_date('01-03-2013', 'mm-dd-yyyy')),
     partition p4 values less than (to_date('01-04-2013', 'mm-dd-yyyy')));
    
    INSERT INTO EMP_PART VALUES (1, 'EMP1', 1, SYSDATE - 7);
    
    INSERT INTO EMP_PART VALUES (1, 'EMP1', 1, SYSDATE - 6);
    
    INSERT INTO EMP_PART VALUES (1, 'EMP1', 1, SYSDATE - 5);
    
    INSERT INTO EMP_PART VALUES (1, 'EMP1', 1, SYSDATE - 4);
    
    -- EMP_PART_NEW table has 7 range partitions - only partitions p5, p6 and p7 have data
    -- Partitions p1, p2, p3 and p4 will receive data from the emp_part table via the emp_part_hash
    -- work table
    DROP TABLE EMP_PART_NEW;
    
    CREATE TABLE emp_part_new (empno number(4), ename varchar2(10),
     deptno number(2), created_date DATE default sysdate)
      partition by range (created_date)
         SUBPARTITION BY HASH(deptno) subpartitions 4
    ( partition p1 values less than (to_date('01-01-2013', 'mm-dd-yyyy')),
     partition p2 values less than (to_date('01-02-2013', 'mm-dd-yyyy')),
     partition p3 values less than (to_date('01-03-2013', 'mm-dd-yyyy')),
     partition p4 values less than (to_date('01-04-2013', 'mm-dd-yyyy')),
     partition p5 values less than (to_date('01-05-2013', 'mm-dd-yyyy')),
     partition p6 values less than (to_date('01-06-2013', 'mm-dd-yyyy')),
     partition p7 values less than (to_date('01-07-2013', 'mm-dd-yyyy')));
    
    INSERT INTO EMP_PART_NEW VALUES (1, 'EMP1', 1, SYSDATE - 3);
    
    INSERT INTO EMP_PART_NEW VALUES (1, 'EMP1', 1, SYSDATE - 2);
    
    INSERT INTO EMP_PART_NEW VALUES (1, 'EMP1', 1, SYSDATE - 1);
    
    -- work table for the exchange
    DROP TABLE EMP_PART_HASH;
    
    CREATE TABLE emp_part_hash (empno number(4), ename varchar2(10),
     deptno number(2), created_date DATE default sysdate)
      partition by hash (deptno) partitions 4;
    
    SELECT * FROM EMP_PART PARTITION (P2);
    
    EMPNO     ENAME     DEPTNO     CREATED_DATE
    1     EMP1     1     1/1/2013 6:52:54 PM
    
    select * from emp_part order by created_date;
    
    EMPNO     ENAME     DEPTNO     CREATED_DATE
    1     EMP1     1     12/31/2012 6:52:52 PM
    1     EMP1     1     1/1/2013 6:52:54 PM
    1     EMP1     1     1/2/2013 6:52:56 PM
    1     EMP1     1     1/3/2013 6:52:58 PM
    
    select * from emp_part_new partition (p6);
    
    EMPNO     ENAME     DEPTNO     CREATED_DATE
    1     EMP1     1     1/5/2013 6:53:21 PM
    
    select * from emp_part_new order by created_date;
    
    EMPNO     ENAME     DEPTNO     CREATED_DATE
    1     EMP1     1     1/4/2013 6:53:19 PM
    1     EMP1     1     1/5/2013 6:53:21 PM
    1     EMP1     1     1/6/2013 6:53:23 PM
    
    -- exchange each partition from emp_part with the work table
    -- and then exchange the work table with the same partition of the emp_part_new table
    alter table emp_part exchange partition p1
    with table emp_part_hash;
    
    alter table emp_part_new exchange partition p1
    with table emp_part_hash;
    
    alter table emp_part exchange partition p2
    with table emp_part_hash;
    
    alter table emp_part_new exchange partition p2
    with table emp_part_hash;
    
    alter table emp_part exchange partition p3
    with table emp_part_hash;
    
    alter table emp_part_new exchange partition p3
    with table emp_part_hash;
    
    alter table emp_part exchange partition p4
    with table emp_part_hash;
    
    alter table emp_part_new exchange partition p4
    with table emp_part_hash;
    
    select * from emp_part order by created_date;
    
    -- no data
    
    select * from emp_part_new order by created_date;
    
    EMPNO     ENAME     DEPTNO     CREATED_DATE
    1     EMP1     1     12/31/2012 6:52:52 PM
    1     EMP1     1     1/1/2013 6:52:54 PM
    1     EMP1     1     1/2/2013 6:52:56 PM
    1     EMP1     1     1/3/2013 6:52:58 PM
    1     EMP1     1     1/4/2013 6:53:19 PM
    1     EMP1     1     1/5/2013 6:53:21 PM
    1     EMP1     1     1/6/2013 6:53:23 PM
    

    Note that:

    1. all three tables have the same structure
    2. all three arrays have the same number of HASH partitions. For two actual tables, they are HASH subpartitions
    3. the working table has ONLY hash partitions: there is no range partitions.
    4. all exchanges are simply updates the data dictionary and finish in a fraction of second bit is important the amount of data in one of the actual scores.

  • 11g: global statistics, once done block statistics additional

    This is a follow-up question 11g: additional statistics - effects of bad implementation

    In a system, who should use additional statistics, global statistical imagined fault someone intentionally.

    These aggregate statistics seems to stop to move to additional statistics.

    As a special field table user_tab_col_statistics has to mean here.


    See this demo program:

    SET LINESIZE 130
    set serveroutput on
    
    call dbms_output.put_line('drop and re-create table ''T''...');
    
    -- clean up
    DROP TABLE t;
    
    -- create a table with partitions and subpartitions
    CREATE TABLE t (
      tracking_id       NUMBER(10),
      partition_key     DATE,
      subpartition_key  NUMBER(3),
      name              VARCHAR2(20 CHAR),
      status            NUMBER(1)
    )
    ENABLE ROW MOVEMENT
    PARTITION BY RANGE(partition_key) SUBPARTITION BY HASH(subpartition_key)
    SUBPARTITION TEMPLATE 4
    (
      PARTITION P_DATE_TO_20160101 VALUES LESS THAN (to_date('2016-01-01', 'YYYY-MM-DD')),
      PARTITION P_DATE_TO_20160108 VALUES LESS THAN (to_date('2016-01-08', 'YYYY-MM-DD')),
      PARTITION P_DATE_TO_20160115 VALUES LESS THAN (to_date('2016-01-15', 'YYYY-MM-DD')),
      PARTITION P_DATE_OTHER VALUES LESS THAN (MAXVALUE)
    );
    
    CREATE UNIQUE INDEX t_pk ON t(partition_key, subpartition_key, tracking_id);
    
    ALTER TABLE t ADD CONSTRAINT t_pk PRIMARY KEY(partition_key, subpartition_key, tracking_id);
    ALTER TABLE t ADD CONSTRAINT t_partition_key_nn check (partition_key IS NOT NULL);
    ALTER TABLE t ADD CONSTRAINT t_subpartition_key_nn check (subpartition_key IS NOT NULL);
    
    call dbms_output.put_line('populate table ''T''...'); 
    
    -- insert values into table (100 for first 2 partitions, last 2 remain empty)
    BEGIN
      FOR i IN 1..100
      LOOP
        INSERT INTO t VALUES(i,to_date('2015-12-31', 'YYYY-MM-DD'), i, 'test' || to_char(i), MOD(i,4) );
      END LOOP;
    
      FOR i IN 101..200
      LOOP
        INSERT INTO t VALUES(i,to_date('2016-01-07', 'YYYY-MM-DD'), i, 'test2' || to_char(i), MOD(i, 4));
      END LOOP;
      commit;
    END;
    /
    
    -- lock table stats, so that no automatic mechanism of Oracle can disturb us
    call dbms_output.put_line('lock statistics for table ''T''...');
    
    BEGIN
      dbms_stats.lock_table_stats(USER, 'T');
      commit;
    END;
    /
    
    call dbms_output.put_line('delete statistics for table ''T''...');
    
    -- make sure we have no table stats to begin with
    BEGIN
      dbms_stats.delete_table_stats(
        ownname => USER,
        tabname => 'T',
        partname => NULL,
        cascade_columns => TRUE,
        cascade_indexes => TRUE,
        force => TRUE);
      commit;
    END;
    /
    
    begin
      for rec in (select table_name, partition_name from user_tab_partitions where table_name = 'T')
      loop
        dbms_stats.delete_table_stats(
           ownname         => USER,
           tabname         => rec.table_name,
           partname        => rec.partition_name,
           cascade_columns => TRUE,
           cascade_indexes => TRUE,
           force           => TRUE);
     end loop;
     commit;
    end;
    /
    
    call dbms_output.put_line('verify no data avail in user_tab_col_statistics for table ''T''...');
    
    select table_name, column_name, to_char(last_analyzed, 'YYYY-MM-DD HH:MI:SS'), global_stats from user_tab_col_statistics where table_name = 'T';
    
    call dbms_output.put_line('verify no data avail in user_part_col_statistics for table ''T''...');
    
    -- not sure, if this is correct(?!):
    select * from user_part_col_statistics where table_name = 'T' and not (num_distinct is null and low_value is null and high_value is null);
    
    call dbms_output.put_line('''accidentally'' gather global stats in user_tab_col_statistics for table ''T''...');
    
    begin
        dbms_stats.gather_table_stats(
          ownname => USER,
          tabname => 'T',
          partname => null,
          estimate_percent => 1,
          degree => 5,
          block_sample => TRUE,
          granularity => 'GLOBAL',
          cascade => TRUE,
          force => TRUE,
          method_opt => 'FOR ALL COLUMNS SIZE 1'
        );
    end;
    /
    
    call dbms_output.put_line('verify global_stats in user_tab_col_statistics for table ''T''...');
    
    select table_name, column_name, to_char(last_analyzed, 'YYYY-MM-DD HH:MI:SS'), global_stats from user_tab_col_statistics where table_name = 'T';
    
    call dbms_output.put_line('wait 30 seconds...');
    
    call dbms_lock.sleep(30); -- might require to grant access
    
    call dbms_output.put_line('...done');
    
    call dbms_output.put_line('try to update global_stats in user_tab_col_statistics for table ''T'' by partition level statistic updates...');
    
    begin
      for rec in (select table_name, partition_name from user_tab_partitions where table_name = 'T')
      loop
        dbms_stats.gather_table_stats(
          ownname => USER,
          tabname => rec.table_name,
          partname => rec.partition_name,
          estimate_percent => 1,
          degree => 5,
          block_sample => TRUE,
          granularity => 'PARTITION',
          cascade => TRUE,
          force => TRUE,
          method_opt => 'FOR ALL COLUMNS SIZE 1'
        );
        dbms_stats.gather_table_stats(
          ownname => USER,
          tabname => rec.table_name,
          partname => rec.partition_name,
          estimate_percent => 1,
          degree => 5,
          block_sample => TRUE,
          granularity => 'SUBPARTITION',
          cascade => TRUE,
          force => TRUE,
          method_opt => 'FOR ALL COLUMNS SIZE 1');  
      end loop;
    end;
    /
    
    call dbms_output.put_line('re-verify global_stats in user_tab_col_statistics for table ''T'' (check for last_analyzed and global_stats)...');
    
    select table_name, column_name, to_char(last_analyzed, 'YYYY-MM-DD HH:MI:SS'), global_stats from user_tab_col_statistics where table_name = 'T';
    

    Output:

    Call completed.
    
    drop and re-create table 'T'...
    
    
    Table T dropped.
    
    
    Table T created.
    
    
    Unique index T_PK created.
    
    Table T altered.
    
    
    Table T altered.
    
    
    Table T altered.
    
    
    Call completed.
    
    populate table 'T'...
    
    
    PL/SQL procedure successfully completed.
    
    Call completed.
    
    lock statistics for table 'T'...
    
    
    PL/SQL procedure successfully completed.
    
    
    Call completed.
    
    delete statistics for table 'T'...
    
    
    PL/SQL procedure successfully completed.
    
    
    PL/SQL procedure successfully completed.
    
    
    Call completed.
    
    verify no data avail in user_tab_col_statistics for table 'T'...
    
    
    no rows selected
    
    
    
    Call completed.
    
    verify no data avail in user_part_col_statistics for table 'T'...
    
    
    no rows selected
    
    
    Call completed.
    
    'accidentally' gather global stats in user_tab_col_statistics for table 'T'...
    
    
    PL/SQL procedure successfully completed.
    
    
    Call completed.
    
    verify global_stats in user_tab_col_statistics for table 'T'...
    
    
    TABLE_NAME                     COLUMN_NAME                    TO_CHAR(LAST_ANALYZ GLO
    ------------------------------ ------------------------------ ------------------- ---
    T                              TRACKING_ID                    2016-01-28 02:09:31 YES
    T                              PARTITION_KEY                  2016-01-28 02:09:31 YES
    T                              SUBPARTITION_KEY               2016-01-28 02:09:31 YES
    T                              NAME                           2016-01-28 02:09:31 YES
    T                              STATUS                         2016-01-28 02:09:31 YES
    
    Call completed.
    
    wait 30 seconds...
    
    Call completed.
    
    
    Call completed.
    
    ...done
    
    
    Call completed.
    
    try to update global_stats in user_tab_col_statistics for table 'T' by partition level statistic updates...
    
    PL/SQL procedure successfully completed.
    
    
    Call completed.
    
    re-verify global_stats in user_tab_col_statistics for table 'T' (check for last_analyzed and global_stats)...
    
    
    TABLE_NAME                     COLUMN_NAME                    TO_CHAR(LAST_ANALYZ GLO
    ------------------------------ ------------------------------ ------------------- ---
    T                              TRACKING_ID                    2016-01-28 02:09:31 YES
    T                              PARTITION_KEY                  2016-01-28 02:09:31 YES
    T                              SUBPARTITION_KEY               2016-01-28 02:09:31 YES
    T                              NAME                           2016-01-28 02:09:31 YES
    T                              STATUS                         2016-01-28 02:09:31 YES
    
    

    seems that the solution is to use the parameter cascade_parts-the online of FALSE:

    begin
      dbms_stats.delete_table_stats(
        ownname => USER,
        tabname => 'T',
        partname => NULL,
        cascade_parts => FALSE, -- this is important
        cascade_columns => TRUE,
        cascade_indexes => TRUE,
        force => TRUE);
    end;
    
  • Help create the subpartitions

    Hello

    I get the error while creating a SUBPARTITION to my table.

    CREATE TABLE Tab1
    (
    col1 NUMBER (12).
    col2 CHAR (1 BYTE),
    COL3 CHAR (1 BYTE),
    COL4 NUMBER (12)
    )
    LIST BY SCORE (col1)
    SUBPARTITION BY HASH (col4)
    SUBPARTITION TEMPLATE)
    SUBPARTITION SP_1 TABLESPACE C_D
    )
    (
    PAR_0 PARTITION VALUES (0)
    )
    C_D TABLESPACE

    Error

    SUBPARTITION BY HASH (col4)
    *
    ERROR on line 9:
    ORA-00922: missing or not valid option


    The syntax is everything is correct... I do not understand where I am going wrong. Can someone tell me my mistake.

    Thank you
    Saami

    Words Hoek is correct, at least for 10.2.

    11.2 media list/hash and your code works as expected (after changing the tablespace for users):

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    
    SQL> CREATE TABLE Tab1
      2  (
      3  col1 NUMBER(12),
      4  col2 CHAR(1 BYTE),
      5  col3 CHAR(1 BYTE),
      6  col4 NUMBER(12)
      7  )
      8  PARTITION BY LIST (col1 )
      9  SUBPARTITION BY HASH (col4)
     10  SUBPARTITION TEMPLATE(
     11  SUBPARTITION SP_1 TABLESPACE users
     12  )
     13  (
     14  PARTITION PAR_0 VALUES (0)
     15  )
     16  TABLESPACE users;
    
    Table created.
    SQL>
    

    But you don't tell us your Oracle version so...

  • Need to take stats twice for partitions and subpartitions?

    Hello world

    I'm taking a new approach for making statistics.

    First my system:

    Oracle 10.2.0.1
    3 instance RAC running on Linux RH AS 3, 64-bit

    I'm currently my stats using dbms_stats.gather_schema_stats with the option "rally car", it's good because only the data tables with stale and empty tables are being analyzed, but the process takes 3 to 4 days...

    Now I want to spread the statistical processes on nodes in the cluster using gather_table_stats (stale tables and empty tables only), while I was doing my procedure, I discovered the following, and here's where I need your help.

    If I run the following command:

    exec dbms_stats.gather_table_stats (ownname = > 'CACOSTA', tabname = > 'subpart_date', granularity = > 'SUBPARTITION', partname = > 'P200901')

    I can see the stats from my server BUT no stats have been taken for the partition.

    If I change the granularity on the "PARTITION": gather_table_stats

    exec dbms_stats.gather_table_stats (ownname = > 'CACOSTA', tabname = > 'subpart_date', granularity = > 'PARTITION', partname = > 'P200901')

    It will take the stats ONLY for the partition, but not for subparts.

    If I take the stats twice for 'PARTITION' and 'SUBPARTITION', I'll get all stats but it will take twice as long to complete.

    Is someone can you please tell me if I'm on the wrong approach? is it possible to understand that when I use the granularity of the "PARTITION", it can take the opportunity to use this same information it is collecting and provide statistics for subparts too to the RDBMS?

    Thank you and sorry for the long post.

    Carlos Acosta

    Carlos Acosta wrote:
    I'm taking a new approach for making statistics.

    First my system:

    Oracle 10.2.0.1
    3 instance RAC running on Linux RH AS 3, 64-bit

    exec dbms_stats.gather_table_stats(ownname=>'CACOSTA',tabname=>'subpart_date',granularity=>'SUBPARTITION',partname=>'P200901')

    I can see the stats from my server BUT no stats have been taken for the partition.

    If I change the granularity on the "PARTITION": gather_table_stats

    exec dbms_stats.gather_table_stats(ownname=>'CACOSTA',tabname=>'subpart_date',granularity=>'PARTITION',partname=>'P200901')

    It will take the stats ONLY for the partition, but not for subparts.

    If I take the stats twice for 'PARTITION' and 'SUBPARTITION', I'll get all stats but it will take twice as long to complete.

    Is someone can you please tell me if I'm on the wrong approach? is it possible to understand that when I use the granularity of the "PARTITION", it can take the opportunity to use this same information it is collecting and provide statistics for subparts too to the RDBMS?

    Carlos,

    This composite partitioning (range-list, range-hash) do you use?

    First of all I think it's important to understand that statistical subpartition will actually not to be used by the cost based optimizer in previous versions 10.2.0.4 (but in 10.2.0.4 only with bugs without patch installed, see the link to the message below) and 11.1.0.6:

    http://Oracle-Randolf.blogspot.com/2007/03/subpartitions-and-optimizer-statistics.html

    http://Oracle-Randolf.blogspot.com/2008/04/revisiting-subpartition-pruning-and.html

    http://Oracle-Randolf.blogspot.com/2009/03/partition-oddities-part-1-severe-bug-in.html

    So, I'd be interested to see a case in the database pre - 10.2.0.4 where the optimizer actually using subpartition level statistics; I have not yet found one.

    Second, he must be aware of what Oracle offers several ways how to maintain the different level of statistics:

    -Less consumption of resources, but less quality: collection of statistics on the lowest level (e.g. subpartition) only. I hope all subparts of the partition have statistics, the higher levels (partition / global) will be inspired by the aggregation. This way, you get the low quality statistics on levels higher (e.g. no histograms will be generated by aggregation, number of distinct values potentially quite inaccurate), but you do not need to collect statistics on these levels. Note that if once you have collected statistics on the higher levels (indicated by the "GLOBAL_STATS = YES" column in the DBA_\ * views STATISTICS) will not perform this statistical aggregation. You must first remove the statistics of higher level using DELETE\ * _STATS have enabled new aggregation (next time gather you statistics on low levels and all partitions (sub-) have statistics)

    For more information about this approach, see for example here: http://oracle-randolf.blogspot.com/2008/04/exchange-partition-and-aggregated.html

    -Consumption of resources, but of better quality most: separate statistics on all levels

    - And the new modes supported by 10.2.0.4 and especially 11.1.0.6: APPROX_GLOBAL AND PARTITION (10.2.0.4), true incremental global statistics in 11.1.0.6 and the new algorithm for estimating AUTO_SAMPLE_SIZE introduced in 11g:

    http://structureddata.org/2008/07/16/Oracle-11g-incremental-global-statistics-on-partitioned-tables/

    http://structureddata.org/2007/09/17/Oracle-11g-enhancements-to-DBMS_STATS/

    http://optimizermagic.blogspot.com/2009/02/maintaining-statistics-on-large.html

    Another very good synthesis about the management of statistics has recently been published by Karen Morton: http://karenmorton.blogspot.com/2009/02/new-paper-and-cj-date-advert.html

    So in your case a database pre - 10.2.0.4 you should not bother with subpartition statistics at all (or you can show me otherwise I would be interested), and you can then try to find out if you could live with the above statistical approach of "sum" by simply collecting statistics on the level of partition, or if you need to collect statistics on the partition and the global level separately (you did not mention your current strategy to the global level statistics).

    If you install the 10.2.0.4 patch game you have several options and statistics subpartition can be used by the optimizer (but only in the case of beach-list composite partitioning, as far as I know), for example by using the option of PARTITION AND APPROX_GLOBAL introduced in this version. Note that you must install the unique patches to get this working properly as described by my post and the optimizer of blog post for the development group.

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676 /.
    http://sourceforge.NET/projects/SQLT-pp/

  • Interval question partition and subpartition - range

    11.2.0.4

    (separate issue than my other storage)

    You can partition a table by day apart and subpartition and then by a field ID, a sequential ID in single digits?  I want a subpartition for each code.  something lije

    CREATE TABLE detail_tab

    (prod_id NUMBER (6))

    date of create_ts

    )

    PARTITION OF RANGE (create_ts) INTERVAL (NUMTODSINTERVAL(1,'DAY'))

    SUBPARTITION BY RANGE (prod_id) interval (1)

    Ive read the docs http://docs.oracle.com/cd/E18283_01/server.112/e16541/part_admin001.htm#insertedID5 but you see is not the one I want.  IM thinking the closest, I can get to it is a hash range



    OK - so FYI stock, you should have a LIMITED identity series: your "id" is probably in the ticker.

    Oracle can manage thousands of partitions.

    For example, to create a partitioned table range-list with each list being one, or several, stock ID. Just hardcode the IDs. Or generate the DDL from a table with a game master of ID.

    Creation of segment use deferred for segments are not created until there are at least a lines for the subpartition.

    Remember, however, you must handle everything by SEGMENT. This means the subpartitions. So all this rollilng off be for hundreds of ID stock.

    You should analyze your processes to determine the "roll-off" exact criteria you need. Group stocks into the partition even if they can get out.

    Also - you can use 'tricks' as the creation of CUSTOM symbols that truly represent AGGREGATE data from stocks of one or more.

    We used to store weekly data by using a value DATE when markets aren't open yet. Activity on these dates were given aggregate rather than granular data.

  • Subpartition change a table of scales

    I'm on Oracle 11 g.  I have a table that t partitioned SCALES (top level is put on the account id, nested is carried on the transaction date). Nested level has 3 SP1, SP2, SP3 subparts for each range of high-level account id. I want to load daily data in this table and try to use the EXCHANGE partition function to only change the first of the 3 subpartitions SP1, because it is the only newcomer partition data will in...

    Q1.  Am I correct that I can't share in the target T table in the upper level (account level)?

    Q2. So if I'm right then I have Exchange subpartition level.  My question is what should the DOF look like to WORK W table that will be exchanged? If the work W DDL table must be identical to the target T table (i.e., having the two scales) OR must the work table W be partitioned only on the beach on the date of the transaction? At the end for all this I want the target table to be partitioned as it was before the Exchange i.e. scales.

    Q3. I am told that I can't share all the first subparts at once i.e. I have to loop through and taking sub partition exchange both. Is this fair?

    Q3.  Is it the right way, I'm on the creation of the table of work W I have an outer loop through the beaches of account id. For each account id range:

    1 remove the index on W and truncate the work table W

    2. Insert as Select * void target partition SP1 for this account is carried in W

    3 insert the daily records newly arrived in W (now W has the fusion of old and new)

    4. create the index the w

    5 Exchange W with the sub specific partition name i., e name of SP1 for this range of account id

    Q4. Help, please. with any other suggestions for making the most efficient possible. I am told that I have to make a partition of void at a time. Is this fair?

    Sincerely

    I have a table that t partitioned SCALES (top level is put on the account id, nested is carried on the transaction date).

    Why - tell us the business reason for partitioning the table ID account first, and then the TRANSACTION DATE second.

    This suggests that your queries are primarily by account id or account ID range, rather than the date of the transaction. Is this correct?

    I want to load daily data in this table and try to use the EXCHANGE partition function to only change the first of the 3 subpartitions SP1, because it is the only newcomer partition data will in...

    OK - then you load data into MULTIPLE processes.

    Q1.  Am I correct that I can't share in the target T table in the upper level (account level)?

    Yes and no yes - you can exchange at the partition level. But no - your new data are NOT at the level of the score, that's ONE of the subpartitions.

    Q2. So if I'm right then I have Exchange subpartition level.  My question is what should the DOF look like to WORK W table that will be exchanged? If the work W DDL table must be identical to the target T table (i.e., having the two scales)

    For subpartitions work table must correspond to the structure and will be a partitioned table that is partitioned to match the subparts of the main table.

    See my example in this thread:

    https://community.Oracle.com/thread/2484090?TSTART=30

    The Oracle (VLDB and partitioning Guide) documentation has more examples:

    http://docs.Oracle.com/CD/B28359_01/server.111/b32024/part_admin.htm#i1107555

    Exchange a Subpartition of a *-range partitioned Table

    The semantics of the ALTER TABLE ... EXCHANGE SUBPARTITION are identical to those described previously in "Exchange a Subpartition of a *-Hash Partitioned Table '.

    See the examples in the doc

    Q3. I am told that I can't share all the first subparts at once i.e. I have to loop through and taking sub partition exchange both. Is this fair?

    Yes and no yes - it's true. No - you can do that.

    You can exchange an entire partition, even if it is sous-partitionnée, or you can swap a subpartition. But your new data being subpartition level you will need to make an exchange for each subpartition P1.

    If your table is partitioned by date (instead of ID), you can load your work table (partitioned by account id) and then exchange the partition of high level of the ENTIRE page.

    Q4. Help, please. with any other suggestions for making the most efficient possible. I am told that I have to make a partition of void at a time. Is this fair?

    Yes - but as I said before if your table has been partitioned by date and sous-partitionnée by id so you could do a single Exchange.

    Can't help with the indexes because you didn't post the DDL for the table and index, so we can see whether they are global or local. For some use cases you have Oracle automatically to update the index.

    Learn by doing. Create some examples of paintings and try things.

  • SUBPARTITION nonexistent stats

    Hello

    I created a table partitioned to 11.2.

    The partition clause is:

    PARTITION BY RANGE (RIFDATE)

    INTERVAL (NUMTODSINTERVAL(1,'DAY'))

    SUBPARTITION BY HASH (FIELDNAME)

    STORE 4 SUBPARTITIONS (USERS, USERS, USERS, USERS)

    I gathered his stats with:

    exec dbms_stats.gather_table_stats (OWNNAME = > 'SCOTT', TABNAME = > 'MY_TABLE_PART', ESTIMATE_PERCENT = > 100, DEGREE = > CASCADE 2, = > true, granularity = > 'auto');

    Now I see num_rows and analyse in dba_tab_partions but not in dba_tab_subpartition.

    Why?

    Thank you

    DBMS_STATS

  • Adding a Partition to a range-Hash partitioned Table

    Hello

    I created the composite partition table (RANGE-HASH).  Oracle: 11.2, OS: HP UX

    CREATE TABLE 'XYZ '. "" TABLE_XYZ.

    (

    ----

    VARCHAR2 (54) "PROFILE" DEFAULT "000000000000000000' ENABLE NON-NULL"

    NUMBER (21.7) "CREATED_ON" DEFAULT 0 ENABLE NOT NULL,.

    ----

    )

    PARTITION BY RANGE

    (

    CREATED_ON

    )

    SUBPARTITION BY HASH

    (

    VIEW PROFILE

    )

    SUBPARTITION TEMPLATE

    (

    SUBPARTITION SP1 TABLESPACE PSAPISU,

    SUBPARTITION TABLESPACE PSAPISU SP2,

    SUBPARTITION SP3 TABLESPACE PSAPISU,

    SUBPARTITION SP4 TABLESPACE PSAPISU,

    SUBPARTITION SP5 TABLESPACE PSAPISU,

    SUBPARTITION SP6 TABLESPACE PSAPISU,

    SUBPARTITION SP7 TABLESPACE PSAPISU,

    SUBPARTITION SP8 TABLESPACE PSAPISU,

    SUBPARTITION SP9 TABLESPACE PSAPISU,

    SUBPARTITION SP10 TABLESPACE PSAPISU,

    SUBPARTITION SP11 TABLESPACE PSAPISU,

    SUBPARTITION SP12 TABLESPACE PSAPISU,

    SUBPARTITION SP13 TABLESPACE PSAPISU,

    SUBPARTITION SP14 TABLESPACE PSAPISU,

    SUBPARTITION SP15 TABLESPACE PSAPISU,

    SUBPARTITION SP16 TABLESPACE PSAPISU,

    SUBPARTITION SP17 TABLESPACE PSAPISU,

    SUBPARTITION SP18 TABLESPACE PSAPISU,

    SUBPARTITION SP19 TABLESPACE PSAPISU,

    SUBPARTITION SP20 TABLESPACE PSAPISU,

    SUBPARTITION SP21 TABLESPACE PSAPISU,

    SUBPARTITION SP22 TABLESPACE PSAPISU,

    SUBPARTITION SP23 TABLESPACE PSAPISU,

    SUBPARTITION SP24 TABLESPACE PSAPISU,

    SUBPARTITION SP25 TABLESPACE PSAPISU

    )

    (

    CREATED_ON_OCP01 PARTITION VALUES LESS THAN (20090101000000).

    CREATED_ON_OCP02 PARTITION VALUES LESS THAN (20090401000000).

    CREATED_ON_OCP03 PARTITION VALUES LESS THAN (20090701000000).

    CREATED_ON_OCP04 PARTITION VALUES LESS THAN (20091001000000).

    CREATED_ON_OCP05 PARTITION VALUES LESS THAN (20100101000000).

    CREATED_ON_OCP06 PARTITION VALUES LESS THAN (20100401000000).

    CREATED_ON_OCP07 PARTITION VALUES LESS THAN (20100701000000).

    CREATED_ON_OCP08 PARTITION VALUES LESS THAN (20101001000000).

    CREATED_ON_OCP09 PARTITION VALUES LESS THAN (20110101000000).

    CREATED_ON_OCP10 PARTITION VALUES LESS THAN (20110401000000).

    CREATED_ON_OCP11 PARTITION VALUES LESS THAN (20110701000000).

    CREATED_ON_OCP12 PARTITION VALUES LESS THAN (20111001000000).

    CREATED_ON_OCP13 PARTITION VALUES LESS THAN (20120101000000).

    CREATED_ON_OCP14 PARTITION VALUES LESS THAN (20120401000000).

    CREATED_ON_OCP15 PARTITION VALUES LESS THAN (20120701000000).

    CREATED_ON_OCP16 PARTITION VALUES LESS THAN (20121001000000).

    CREATED_ON_OCP17 PARTITION VALUES LESS THAN (20130101000000).

    CREATED_ON_OCP18 PARTITION VALUES LESS THAN (20130401000000).

    CREATED_ON_OCP19 PARTITION VALUES LESS THAN (20130701000000).

    CREATED_ON_OCP20 PARTITION VALUES LESS THAN (20131001000000).

    CREATED_ON_OCP21 PARTITION VALUES LESS THAN (20140101000000).

    CREATED_ON_OCP22 PARTITION VALUES LESS THAN (20140401000000).

    CREATED_ON_OCP23 PARTITION VALUES LESS THAN (20140701000000).

    CREATED_ON_OCP24 PARTITION VALUES LESS THAN (20141001000000).

    CREATED_ON_OCP25 PARTITION VALUES LESS THAN (20150101000000).

    PARTITION CREATED_ON_OCPMAX VALUES LESS THAN (MAXVALUE)

    )

    TABLESPACE "PSAPISU" ENABLE LINE MOVEMENT;

    Now, I am trying to add the new partition but becomes under errors:

    ALTER TABLE SAPISU. ADD PARTITION VALUES LESS THAN (20150401000000) CREATED_ON_OCP26 ZTMD_300_VERS_MANAGE

    *

    ERROR on line 1:

    ORA-14074: partition bound must gather greater than that of the last partition

    ERROR on line 1:

    ORA-14018: partition bound list contains too few elements

    I tried the SYNTAX mentioned by Oracle DOC, still getting error. Partitioned table and index management

    Could if it you please let me know, what is the exact syntax that I should follow?

    See you soon

    Sameer

    CREATED_ON_OCPMAX PARTITION SPLIT THAN (MAXVALUE)

    That don't mean to 'divide' the MAXVALUE partition.

    You cannot split a partition that contains the values of A, B, C, D, MAXVALUE to MAXVALUE; that makes no sense. ERROR on line 1:

    ORA-14080: partition cannot be split along the specified high limit

    That exception is to say you can't use MAXVALUE upper limit. You must use a value that is actually IN the partition.

    Go back and look at the definition of your partitions:

    CREATED_ON_OCP25 PARTITION VALUES LESS THAN (20150101000000).

    PARTITION CREATED_ON_OCPMAX VALUES LESS THAN (MAXVALUE)

    See which ends with: "VALUES LESS THAN (MAXVALUE)? MAXVALUE is not IN the score; This is the upper limit of the partition.

    Divide certain value > '20150101000000' and LESS THAN MAXVALUE;

    So if you try to create a partition for OCP26 you can use '20160101000000'.

    CREATE TABLE PART_TEST2)
    VARCHAR2 (54) DEFAULT PROFILE "000000000000000000' ENABLE NOT NULL,
    CREATED_ON NUMBER (21.7) DEFAULT 0 ENABLE NOT NULL
    )
    PARTITION BY RANGE (CREATED_ON)
    (
    CREATED_ON_OCP24 PARTITION VALUES LESS THAN (20141001000000).
    CREATED_ON_OCP25 PARTITION VALUES LESS THAN (20150101000000).
    PARTITION CREATED_ON_OCPMAX VALUES LESS THAN (MAXVALUE)
    )

    ALTER table split partition created_on_ocpmax part_test2
    to (20160101000000) into (partition, partition CREATED_ON_OCPMAX created_on_ocp26)

  • Use name hash partitions?

    Oracle 11.2.0.3

    I saw models in the doc, but all examples have been around list partitions.

    Instead of using the names of system, I wanted to name under partitions in a model. It is more for convenience and is not an absolute requirement.

    Leave as I have 16 secondary hash partitions. I would like to see their name.

    1A
    1 B
    1 C

    ...

    Date in next function partition
    2A
    2B
    2 C

    and so on...

    I think that a few slices of Oracle names using a sequence, I can use a module to identify. That would just be a little more convenient.

    -I have no trouble finding an example at all.

    Just open the VLDB and partitioning Guide and sought a 'model' and he was there
    http://docs.Oracle.com/CD/B28359_01/server.111/b32024/part_admin.htm#i1106387

    >
    With the help of models Subpartition to describe Composite Tables partitioned
    . . .
    The following example creates a partitioned table using a subpartition by hash range model:

    CREATE TABLE emp_sub_template (NUMBER, empname varchar (32), rank NUMBER deptno)

    PARTITION OF RANGE (deptno) SUBPARTITION BY HASH (empname)

    SUBPARTITION TEMPLATE

    (SUBPARTITION a TABLESPACE ts1)

    SUBPARTITION b TABLESPACE ts2,

    SUBPARTITION c TABLESPACE ts3,

    SUBPARTITION d TABLESPACE ts4

    )

    (PARTITION p1 VALUES LESS THAN (1000))

    PARTITION p2 VALUES LESS THAN (2000).

    PARTITION p3 VALUES LESS THAN (MAXVALUE)

    );

  • NUM_ROWS showing not subpartitions

    I created the table that


    create table range2 (number, age number) partition by range (roll) subpartition of range (age) (partition p1 values less than (100) (subpartition p1sp1 values less than (30), subpartition p1sp2 lower values (60), subpartition p1sp3 values less than (90), subpartition p1sp4 values less than (maxvalue)), partition p2 lower (200) (subpartition p2sp1 values less than (30), p2sp2 lower values (60) subpartition subpartition p2sp3 values less than (90))) subpartition p2sp4 values less than (maxvalue)));

    insert into the select rownum range2, rownum of double connect by level < 1000;
    commit;
    exec dbms_stats.gather_table_stats ('VISHNU', 'RANGE2');
    Select the table table_name, nom_partition, num_rows in user_tab_partitions where table_name = "RANGE2";
    NUM_ROWS NOM_PARTITION TABLE_NAME
    ------------------------------ ------------------------------ ----------
    RANGE2 P2 100
    RANGE2 P1 99
    RANGE2 P3 800


    Select table_name, num_rows nom_partition, subpartition_name from user_tab_subpartitions where table_name = "RANGE2";
    TABLE_NAME NOM_PARTITION SUBPARTITION_NAME NUM_ROWS
    ------------------------------ ------------------------------ ------------------------------ ----------
    RANGE2 P2 P2SP1
    RANGE2 P2 P2SP2
    RANGE2 P2 P2SP3
    RANGE2 P2 P2SP4
    RANGE2 P1 P1SP1
    RANGE2 P1 P1SP2
    RANGE2 P1 P1SP3
    RANGE2 P1 P1SP4
    RANGE2 P3 SYS_SUBP101


    The num_rows column returns values from DBA_TAB_PARTITIONS but the DBA_TAB_SUBPARTITIONS is not... am I missing something here...

    Thank you
    Vishnu P

    You must specify the GRANULARITY setting:

    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    
    SQL> --
    SQL> create table range2 (roll number, age number)
      2  partition by range (roll)
      3  subpartition by range(age)
      4  (partition p1 values less than (100) (
      5  subpartition p1sp1 values less than (30),
      6  subpartition p1sp2 values less than (60),
      7  subpartition p1sp3 values less than (90),
      8  subpartition p1sp4 values less than (maxvalue)),
      9  partition p2 values less than (200) (
     10  subpartition p2sp1 values less than (30),
     11  subpartition p2sp2 values less than (60),
     12  subpartition p2sp3 values less than (90),
     13  subpartition p2sp4 values less than (maxvalue)),
     14  partition p3 values less than (maxvalue) (
     15  subpartition p3sp1 values less than (30),
     16  subpartition p3sp2 values less than (60),
     17  subpartition p3sp3 values less than (90),
     18  subpartition p3sp4 values less than (maxvalue))
     19  );
    
    Table created.
    
    SQL> insert into range2 select rownum,rownum from dual connect by level < 1000;
    
    999 rows created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> exec dbms_stats.gather_table_stats(user,'RANGE2');
    
    PL/SQL procedure successfully completed.
    
    SQL> select
      2  table_name,
      3  partition_name,
      4   num_rows
      5  from user_tab_partitions
      6  where table_name='RANGE2'
      7  order by 1,2,3;
    
    TABLE_NAME                     PARTITION_NAME                   NUM_ROWS
    ------------------------------ ------------------------------ ----------
    RANGE2                         P1                                     99
    RANGE2                         P2                                    100
    RANGE2                         P3                                    800
    
    SQL> select
      2  table_name,
      3  partition_name,
      4  subpartition_name,
      5  num_rows
      6  from user_tab_subpartitions
      7  order by 1,2,3;
    
    TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME                NUM_ROWS
    ------------------------------ ------------------------------ ------------------------------ ----------
    RANGE2                         P1                             P1SP1
    RANGE2                         P1                             P1SP2
    RANGE2                         P1                             P1SP3
    RANGE2                         P1                             P1SP4
    RANGE2                         P2                             P2SP1
    RANGE2                         P2                             P2SP2
    RANGE2                         P2                             P2SP3
    RANGE2                         P2                             P2SP4
    RANGE2                         P3                             P3SP1
    RANGE2                         P3                             P3SP2
    RANGE2                         P3                             P3SP3
    
    TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME                NUM_ROWS
    ------------------------------ ------------------------------ ------------------------------ ----------
    RANGE2                         P3                             P3SP4
    
    12 rows selected.
    
    SQL> --
    SQL> exec dbms_stats.gather_table_stats(ownname=> user, tabname => 'RANGE2', partname => 'P1');
    
    PL/SQL procedure successfully completed.
    
    SQL> select
      2  table_name,
      3  partition_name,
      4  subpartition_name,
      5  num_rows
      6  from user_tab_subpartitions
      7  order by 1,2,3;
    
    TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME                NUM_ROWS
    ------------------------------ ------------------------------ ------------------------------ ----------
    RANGE2                         P1                             P1SP1
    RANGE2                         P1                             P1SP2
    RANGE2                         P1                             P1SP3
    RANGE2                         P1                             P1SP4
    RANGE2                         P2                             P2SP1
    RANGE2                         P2                             P2SP2
    RANGE2                         P2                             P2SP3
    RANGE2                         P2                             P2SP4
    RANGE2                         P3                             P3SP1
    RANGE2                         P3                             P3SP2
    RANGE2                         P3                             P3SP3
    
    TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME                NUM_ROWS
    ------------------------------ ------------------------------ ------------------------------ ----------
    RANGE2                         P3                             P3SP4
    
    12 rows selected.
    
    SQL> --
    SQL> exec dbms_stats.gather_table_stats(ownname => user, tabname => 'RANGE2', granularity => 'SUBPARTITION');
    
    PL/SQL procedure successfully completed.
    
    SQL> select
      2  table_name,
      3  partition_name,
      4  subpartition_name,
      5  num_rows
      6  from user_tab_subpartitions
      7  where table_name='RANGE2'
      8  order by 1,2,3;
    
    TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME                NUM_ROWS
    ------------------------------ ------------------------------ ------------------------------ ----------
    RANGE2                         P1                             P1SP1                                  29
    RANGE2                         P1                             P1SP2                                  30
    RANGE2                         P1                             P1SP3                                  30
    RANGE2                         P1                             P1SP4                                  10
    RANGE2                         P2                             P2SP1                                   0
    RANGE2                         P2                             P2SP2                                   0
    RANGE2                         P2                             P2SP3                                   0
    RANGE2                         P2                             P2SP4                                 100
    RANGE2                         P3                             P3SP1                                   0
    RANGE2                         P3                             P3SP2                                   0
    RANGE2                         P3                             P3SP3                                   0
    
    TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME                NUM_ROWS
    ------------------------------ ------------------------------ ------------------------------ ----------
    RANGE2                         P3                             P3SP4                                 800
    
    12 rows selected.
    
  • Range-Hash verssu Hash Partitioning purely report performance

    Hello

    We evaluate different strategies and whereas hash and range-hash partitioning.

    While the range would give us additional cleaning options, is by far out up to priority for the reports to run as fast as possible.

    Central Oraxcle 11.2.0.3 in fact warehouse using large table estaimte will be 500 GB, surrogarte key star schema and the key to the substitution of the largest dimesnion partioned-hash with the surrogate key.

    According to your experience, the side purley perfomance queruy someone found the hash is significantly greater than parrtition by range of dates, then under hash partition.

    Queries do not use partition size.

    Greater hope of qwe benfit to win partitioning uses a parallel query + score-recognition of join between columns of hash-partitioedn (on the facts and the great dimesnion table.

    Thank you

    >
    We evaluate different strategies and whereas hash and range-hash partitioning.

    While the range would give us additional cleaning options, is by far out up to priority for the reports to run as fast as possible.

    Central Oraxcle 11.2.0.3 in fact warehouse using large table estaimte will be 500 GB, surrogarte key star schema and the key to the substitution of the largest dimesnion partioned-hash with the surrogate key.

    According to your experience, the side purley perfomance queruy someone found the hash is significantly greater than parrtition by range of dates, then under hash partition.

    Queries do not use partition size.

    Greater hope of qwe benfit to win partitioning uses a parallel query + score-recognition of join between columns of hash-partitioedn (on the facts and the great dimesnion table.
    >
    Objectives statements in this thread have some of the same problems and missing information that was your other thread.
    Re: Compress all the existing table ain dat

    So I would say the same thing, that I suggested it with minor changes.

    You give us your preferred solution instead of us giving that information about the PROBLEM you're trying to solve.

    You must first focus on the problem:

    1. define the problem - indicate the desired objectives
    2. identify the options and resources available to address the problem
    3. Select one or several small, these options for assessment earn and tests.
    4 testing of possible solutions
    5. Select and implement what you consider the "best" solution
    6. monitor the results
    >
    We evaluate different strategies and whereas hash and range-hash partitioning.
    >
    Why? 1. What is the problem that you are trying to address and what are your desired goals? Partitioning is a solution - what's the problem?
    >
    While the range would give us additional cleaning options, is by far out up to priority for the reports to run as fast as possible.
    >
    Great! Do you really need or even want options housekeeping? If so, which? Don't you bulk loads? Down periodically the data? How many times? Monthly? Every year?

    What is the relationship, in your analysis between partitioning and your reports running "as fast as possible? Give us some details. Why do you partitioning in general (range or range-hash in particular) will somehow make your reports run faster? What kind of reports? The amount of data they have access to produce? The amount of data returned in fact? How many times reports do work? How much of a problem reports are now? Generally meet their SLA? Or they RARELY meet their SLA?

    Partitioning is not a remedy of performance for badly written queries. Often the most effective way to improve the performance of reports is to resolve any issues the queries themselves may have or add appropriate indexes. You have exhausted these possibilities? Have you created and examined the execution plans for your key reports? That shows this analysis?
    >
    According to your experience, the side purley perfomance queruy someone found the hash is significantly greater than parrtition by range of dates, then under hash partition.
    >
    For a partitioned table, all data are stored in individual segments; a segment for each partition.

    For a partitioned table Sub all data are stored in the individual segments; a segment for each subpartition. There is NO data stored at the partition level.

    The type of partitioning (versus range-hash hash) and the type of data (partition versus subpartion) logic has no relevance in terms of performance.

    Performance of the queries are directly proportional the number of segments that should be available, the type of access (via the index or full scan) and the size of the segment (including the amount of data).

    The number of segments that should be available depends on the ability of the Oracle to prune partitions during the analysis statically or dynamically at run time.
    >
    Queries do not use partition size.
    >
    Partitioning then generally won't be valuable performance but only for maintenance operations.
    >
    Greater hope of qwe benfit to win partitioning uses a parallel query + score-recognition of join between columns of hash-partitioedn (on the facts and the great dimesnion table.
    >
    Please explain why you think that partitioning will provide this benefit.

    Oracle PARALLEL query very well on non-partitioned tables without using partition-wise joins. The latest version of Oracle also has a DBMS_PARALLEL_EXECUTE package that provides additional features for the realization of PARALLEL operations for many of the use cases more.

    Partitioning lends itself to a natural method of CHUNKing based on the scores/subparts, but that is not necessary to get the benefit of the PARALLEL use. The exception would be if provided partitioning segments that are on different axes or decrease disk IO conflicts.

    Another missing piece of key information are the number and the type of index that needs your reports. Will you be able to use mainly LOCAL partitioned indexes? Global index tend to destroy any maintenance performance that can be learned from partitioning.

  • Using PARTITION FOR / SUBPARTITION FOR the syntax to insert

    We try to use PARTITION syntax for (or, better, SUBPARTITION of syntax) to insert into a table subpartitioned.
    http://docs.Oracle.com/CD/E11882_01/server.112/e26088/sql_elements009.htm#i165979
    08:26:46 GM_CS_CDR@oradev02> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Solaris: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    
    5 rows selected.
    This table is interval partitions DATA_ORIGIN_ID and list subpartitions on TABLE_NAME.

    First of all, an insert in base without specifying the partitions:
    08:10:05 GM_CS_CDR@oradev02> insert into key_ids2 (
    08:11:51   2  DATA_ORIGIN_ID         ,
    08:11:51   3  TABLE_NAME             ,
    08:11:51   4  DUR_UK                 ,
    08:11:51   5  DUR_UK_ID              )
    08:11:51   6  select
    08:11:51   7  12         ,
    08:11:51   8  TABLE_NAME             ,
    08:11:51   9  DUR_UK                 ,
    08:11:51  10  DUR_UK_ID              
    08:11:51  11  from key_ids where table_name = 'PART' 
    08:11:51  12  and rownum <= 10;
    
    10 rows created.
    Check SUBPARTITION to a SELECT statement syntax:
    08:19:43 GM_CS_CDR@oradev02> 
    08:26:45 GM_CS_CDR@oradev02> 
    08:26:45 GM_CS_CDR@oradev02> 
    08:26:45 GM_CS_CDR@oradev02> 
    08:26:45 GM_CS_CDR@oradev02> select count(*) from key_ids2 
    08:26:45   2  subpartition for(12,'PART');
    
      COUNT(*)
    ----------
            10
    
    1 row selected.
    But if we add a subpartition specification (to limit the locking to a single subpartition), we get a syntax error:
    08:14:57 GM_CS_CDR@oradev02> insert into key_ids2 subpartition for(12,'PART') (
    08:14:57   2  DATA_ORIGIN_ID         ,
    08:14:57   3  TABLE_NAME             ,
    08:14:57   4  DUR_UK                 ,
    08:14:57   5  DUR_UK_ID              )
    08:14:57   6  select
    08:14:57   7  14         ,
    08:14:57   8  TABLE_NAME             ,
    08:14:57   9  DUR_UK||'!'                 ,
    08:14:57  10  DUR_UK_ID              
    08:14:57  11  from key_ids 
    08:14:57  12  where table_name = 'PART' 
    08:14:57  13  and rownum <= 10;
    insert into key_ids2 subpartition for(12,'PART') (
                                         *
    ERROR at line 1:
    ORA-14173: illegal subpartition-extended table name syntax
    Specify the partition level did not work either:
    08:14:58 GM_CS_CDR@oradev02> insert into key_ids2 partition for(14) (
    08:15:23   2  DATA_ORIGIN_ID         ,
    08:15:23   3  TABLE_NAME             ,
    08:15:23   4  DUR_UK                 ,
    08:15:23   5  DUR_UK_ID              )
    08:15:23   6  select
    08:15:23   7  14         ,
    08:15:23   8  TABLE_NAME             ,
    08:15:23   9  DUR_UK||'!'                 ,
    08:15:23  10  DUR_UK_ID              
    08:15:23  11  from key_ids 
    08:15:23  12  where table_name = 'PART' 
    08:15:23  13  and rownum <= 10;
    insert into key_ids2 partition for(14) (
                                      *
    ERROR at line 1:
    ORA-14108: illegal partition-extended table name syntax
    But by specifying explicit partition and subpartition works:
    08:17:45 GM_CS_CDR@oradev02> insert into key_ids2 partition (SYS_P15127) (
    08:18:23   2  DATA_ORIGIN_ID         ,
    08:18:23   3  TABLE_NAME             ,
    08:18:23   4  DUR_UK                 ,
    08:18:23   5  DUR_UK_ID              )
    08:18:23   6  select
    08:18:23   7  12         ,
    08:18:23   8  TABLE_NAME             ,
    08:18:23   9  DUR_UK||'!'                 ,
    08:18:23  10  DUR_UK_ID              
    08:18:23  11  from key_ids 
    08:18:23  12  where table_name = 'PART' 
    08:18:23  13  and rownum <= 10;
    
    10 rows created.
    
    08:18:24 GM_CS_CDR@oradev02> insert into key_ids2 subpartition (SYS_SUBP15126) (
    08:19:42   2  DATA_ORIGIN_ID         ,
    08:19:42   3  TABLE_NAME             ,
    08:19:42   4  DUR_UK                 ,
    08:19:42   5  DUR_UK_ID              )
    08:19:42   6  select
    08:19:42   7  12         ,
    08:19:42   8  TABLE_NAME             ,
    08:19:42   9  DUR_UK||'!#'                 ,
    08:19:42  10  DUR_UK_ID              
    08:19:42  11  from key_ids 
    08:19:42  12  where table_name = 'PART' 
    08:19:42  13  and rownum <= 10;
    
    10 rows created.
    We have succeeded by using the syntax of PARTITION for tables partitioned, but not sous-partitionnee.

    Any ideas?

    Thank you
    Mike

    Support of Oracle reproduced this issue. The resolution was to ensure cursor_sharing is set to "EXACT", we happened to use "SIMILAR" in this case due to a migration of 10 g and 11 g.

    Please visit 1481564.1 for more information.

Maybe you are looking for

  • Satellite C855 weird sounds coming from right under the keyboard

    I have Toshiba series Satellite C8559 months old and he almost made a noise weird one (right side under the keyboard). In summary: http://im31.gulfup.com/JJpFo.PNG

  • IMAQdx.ctl

    Hi all I am trying to load a labview program that use the library version I made sure I have IMAQdx install with my version Yet when the execution is not workeable (broking arrow) as it does not find IMAQdx.dll I serch for it in c or labview folder a

  • HP Pavilion G6: A broad check memory failed

    Hey all My HP Pavilion G6 has been giving me the BSOD (0x7A) recently so I ran some checks computer diagnostic provided from the HP recovery partition. HD and memory short tests came positive, but the failure of verification of the extended memory wi

  • W510 comes with the INFORMATION workers?

    Hi all I would ask you if w510 is provided with international warranty service. I don't know the type of the machine so I can't find it in the pages of iws.  http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=LOOK-IWS . I must point out,

  • Help! My Internet I am in Spain?

    I'm going nuts in the past month because my internet explore think that I live in Spain.  Web sites open in Spanish and I can't seem to fix it.  I do not have a virus and I reinstalled IE8 and it has yet to set it.  In my Windows 7 settings, I'm regi