Hash-hash partition

hi,
what is the wrong in the bellow code
1 create table hash_hash
2 (
3 empno number(10),
4 ename varchar(20),
5 deptno number(5)
6 )
7 partition by hash(empno)
8 subpartition by hash(deptno)
9 subpartition template
10 (
11 subpartition sp1 tablespace user1,
12 subpartition sp2 tablespace tb1
13 )
14 (
15 partition h1 tablespace user1,
16 partition h2 tablespace tb1
17* )
SQL> /
subpartition by hash(deptno)
ERROR at line 8:
ORA-00922: missing or invalid option
plz give sugistions

Unless I read a white paper when refers to hash-hash partitions, in the oficial documentation of 11.2
http://download.oracle.com/docs/cd/E18283_01/server.112/e16541/part_admin001.htm#i1006565
http://download.oracle.com/docs/cd/E11882_01/server.112/e16541.pdf
do not show anything about it...
I think it is not allowed this composite partition type....

Similar Messages

  • Convert range partition to range-hash composite partition

    Hi,
    I have several tables that are range partitioned on date and each table has several partitions as they are partitioned for each day. Is there anyway I con convet these table using alter statements to make them a composite? Thanks.

    No, You can't with alter command change partitioning type.
    http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10739/partiti.htm
    Create a new table with needed one partitioning type and insert there all data.

  • Uneven distribution in Hash Partitioning

    Version :11.1.0.7.0 - 64bit Production
    OS :RHEL 5.3
    I have a range partitioning on ACCOUNTING_DATE column and have 24 monthly partitions.
    To get rid of buffer busy waits on index, i have created global partitioned index using below ddl
    DDL :
    CREATE INDEX IDX_GL_BATCH_ID ON SL_JOURNAL_ENTRY_LINES(GL_BATCH_ID)
    GLOBAL PARTITION BY HASH (GL_BATCH_ID) PARTITIONS 16 TABLESPACE OTC_IDX PARALLEL 8 INITRANS 8 MAXTRANS 8 PCTFREE 0 ONLINE;After index creation, i realized that only one index hash partition got all rows.
    select partition_name,num_rows from dba_ind_partitions where index_name='IDX_GL_BATCH_ID';
    PARTITION_NAME                   NUM_ROWS
    SYS_P77                                 0
    SYS_P79                                 0
    SYS_P80                                 0
    SYS_P81                                 0
    SYS_P83                                 0
    SYS_P84                                 0
    SYS_P85                                 0
    SYS_P87                                 0
    SYS_P88                                 0
    SYS_P89                                 0
    SYS_P91                                 0
    SYS_P92                                 0
    SYS_P78                                 0
    SYS_P82                                 0
    SYS_P86                                 0
    SYS_P90                         256905355As far as i understand, HASH partitioning will distribute evenly. By looking at above distribution, i think, i did not benefit of having multiple insert points using HASH partitioning as well.
    Here is index column statistics :
    select TABLE_NAME,COLUMN_NAME,NUM_DISTINCT,NUM_NULLS,LAST_ANALYZED,SAMPLE_SIZE,HISTOGRAM,AVG_COL_LEN from dba_tab_col_statistics where table_name='SL_JOURNAL_ENTRY_LINES'  and COLUMN_NAME='GL_BATCH_ID';
    TABLE_NAME                     COLUMN_NAME          NUM_DISTINCT  NUM_NULLS LAST_ANALYZED        SAMPLE_SIZE HISTOGRAM       AVG_COL_LEN
    SL_JOURNAL_ENTRY_LINES         GL_BATCH_ID                     1          0 2010/12/28 22:00:51    259218636 NONE                      4

    It looks like that inserted data has always the same value for the partitioning key: it is expected that in this case the same partition is used because
    >
    For optimal data distribution, the following requirements should be satisfied:
    Choose a column or combination of columns that is unique or almost unique.
    Create multiple partitions and subpartitions for each partition that is a power of two. For example, 2, 4, 8, 16, 32, 64, 128, and so on.
    >
    See http://download.oracle.com/docs/cd/E11882_01/server.112/e16541/part_avail.htm#VLDBG1270.
    Edited by: P. Forstmann on 29 déc. 2010 09:06

  • Optimizer=ALL_ROWS, PARTITION HASH, INDEX (RANGE SCAN) POOR PERFORMANCE?

    Our os is;
    SunOS 5.9
    and database is;
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit
    Our autotrace outputs are below also we have 10046 trace outputs;
    08:41:04 tcell_dev@SCME > set timing on
    08:41:19 tcell_dev@SCME > set autot on
    08:41:21 tcell_dev@SCME > SELECT lnpessv.PROFILE_ID FROM SCME.LNK_PROFILEENTITY_SUBSSERVVAR lnpessv
    08:41:25 2 WHERE lnpessv.SUBSCRIPTION_SERVICEVARIANT_ID = 1695083 ;
    PROFILE_ID
    1.400E+14
    1.600E+14
    Elapsed: 00:00:03.07
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=3 Card=3 Bytes=51)
    1 0 PARTITION HASH (ALL) (Cost=3 Card=3 Bytes=51)
    2 1 INDEX (RANGE SCAN) OF 'PK_PROFILEENTITY_SUBSSERVVAR' (INDEX (UNIQUE)) (Cost=
    3 Card=3 Bytes=51)
    Statistics
    1 recursive calls
    0 db block gets
    1539 consistent gets
    514 physical reads
    0 redo size
    258 bytes sent via SQL*Net to client
    273 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    2 rows processed
    08:41:32 tcell_dev@SCME > SELECT lnpessv.PROFILE_ID FROM SCME.LNK_PROFILEENTITY_SUBSSERVVAR lnpessv
    08:41:43 2 WHERE lnpessv.SUBSCRIPTION_SERVICEVARIANT_ID = 169508 ;
    PROFILE_ID
    1.400E+14
    1.600E+14
    Elapsed: 00:00:04.01
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=3 Card=3 Bytes=51)
    1 0 PARTITION HASH (ALL) (Cost=3 Card=3 Bytes=51)
    2 1 INDEX (RANGE SCAN) OF 'PK_PROFILEENTITY_SUBSSERVVAR' (INDEX (UNIQUE)) (Cost=
    3 Card=3 Bytes=51)
    Statistics
    1 recursive calls
    0 db block gets
    1537 consistent gets
    512 physical reads
    0 redo size
    258 bytes sent via SQL*Net to client
    273 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    2 rows processed
    Here we see 97% wait time, and responce time is unexceptable; These are the waits from 10046 trace file;
    WAIT #1: nam='gc cr grant 2-way' ela= 783 p1=341 p2=67065 p3=1 obj#=169530 tim=571610438395
    WAIT #1: nam='db file sequential read' ela= 6924 file#=341 block#=67065 blocks=1 obj#=169530 tim=571610445466
    WAIT #1: nam='gc cr grant 2-way' ela= 564 p1=294 p2=86263 p3=1 obj#=169531 tim=571610446493
    WAIT #1: nam='db file sequential read' ela= 6629 file#=294 block#=86263 blocks=1 obj#=169531 tim=571610453158
    INDEX RANGE SCAN PK_PROFILEENTITY_SUBSSERVVAR PARTITION: 1 512 (cr=1537 pr=512 pw=0 time=4272017 us)
    This is the related tables properties;
    OWNER     SCME
    TABLE_NAME     LNK_PROFILEENTITY_SUBSSERVVAR
    TABLESPACE_NAME     DATA01
    STATUS     VALID
    PCT_FREE     10
    INI_TRANS     10
    MAX_TRANS     255
    INITIAL_EXTENT     65536
    MIN_EXTENTS     1
    MAX_EXTENTS     2147483645
    LOGGING     NO
    BACKED_UP     N
    NUM_ROWS     239587420
    BLOCKS     1587288
    EMPTY_BLOCKS     0
    AVG_SPACE     0
    CHAIN_CNT     0
    AVG_ROW_LEN     41
    AVG_SPACE_FREELIST_BLOCKS     0
    NUM_FREELIST_BLOCKS     0
    DEGREE     1
    INSTANCES     1
    CACHE     N
    TABLE_LOCK     ENABLED
    SAMPLE_SIZE     71876226
    LAST_ANALYZED     29.05.2006 23:21:24
    PARTITIONED     NO
    TEMPORARY     N
    SECONDARY     N
    NESTED     NO
    BUFFER_POOL     DEFAULT
    ROW_MOVEMENT     DISABLED
    GLOBAL_STATS     YES
    USER_STATS     NO
    SKIP_CORRUPT     DISABLED
    MONITORING     YES
    DEPENDENCIES     DISABLED
    COMPRESSION     DISABLED
    DROPPED     NO
    We are suspecting rac configuration and hash partition and index usage with rac.
    Any comments will be welcomed,
    Thank you.
    Tonguç

    this is the output of dbms_metadata.get_ddl for the table;
    CREATE TABLE "SCME"."LNK_PROFILEENTITY_SUBSSERVVAR"
    (     "SUBSCRIPTION_SERVICEVARIANT_ID" NUMBER NOT NULL ENABLE NOVALIDATE,
         "PROFILE_ID" NUMBER NOT NULL ENABLE NOVALIDATE,
         "CREATED_BY_ID" NUMBER,
         "CREATED_DATE" DATE DEFAULT SYSDATE,
         "UPDATED_BY_ID" NUMBER,
         "UPDATED_DATE" DATE,
         CONSTRAINT "PK_PROFILEENTITY_SUBSSERVVAR" PRIMARY KEY ("SUBSCRIPTION_SERVICEVARIANT_ID", "PROFILE_ID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 NOLOGGING
    STORAGE(INITIAL 4194304
    BUFFER_POOL DEFAULT)
    TABLESPACE "INDX02" GLOBAL PARTITION BY HASH ("SUBSCRIPTION_SERVICEVARIANT_ID","PROFILE_ID")
    (PARTITION "SYS_P52989"
    TABLESPACE "INDX02",
    PARTITION "SYS_P52990"
    TABLESPACE "INDX02",
    PARTITION "SYS_P54010"
    TABLESPACE "INDX02",
    PARTITION "SYS_P54011"
    TABLESPACE "INDX02",
    PARTITION "SYS_P54012"
    TABLESPACE "INDX02") ;
    CREATE UNIQUE INDEX "SCME"."PK_PROFILEENTITY_SUBSSERVVAR" ON "SCME"."LNK_PROFILEENTITY_SUBSSERVVAR" ("SUBSCRIPTION_SERVICEVARIANT_ID", "PROFILE_ID")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 NOLOGGING
    STORAGE(INITIAL 4194304
    BUFFER_POOL DEFAULT)
    TABLESPACE "INDX02" GLOBAL PARTITION BY HASH ("SUBSCRIPTION_SERVICEVARIANT_ID","PROFILE_ID")
    (PARTITION "SYS_P52989"
    TABLESPACE "INDX02",
    PARTITION "SYS_P52990"
    TABLESPACE "INDX02",
    PARTITION "SYS_P53499"
    TABLESPACE "INDX02",
    PARTITION "SYS_P53500"
    TABLESPACE "INDX02") ENABLE NOVALIDATE,
         CONSTRAINT "FK_LNK_PROF_REFERENCE_SDP_SUBS" FOREIGN KEY ("SUBSCRIPTION_SERVICEVARIANT_ID")
         REFERENCES "SCME"."SDP_SUBSCRIPTIONSERVICEVARIANT" ("SUBSCRIPTION_SERVICEVARIANT_ID") DEFERRABLE INITIALLY DEFERRED ENABLE NOVALIDATE
    ) PCTFREE 10 PCTUSED 40 INITRANS 10 MAXTRANS 255 NOCOMPRESS NOLOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "DATA01" ;
    CREATE INDEX "SCME"."LNK_PROFILEENTITY_SUB_HNDX3" ON "SCME"."LNK_PROFILEENTITY_SUBSSERVVAR" ("SUBSCRIPTION_SERVICEVARIANT_ID")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 NOLOGGING
    STORAGE(INITIAL 2097152
    BUFFER_POOL DEFAULT)
    TABLESPACE "INDX02" GLOBAL PARTITION BY HASH ("SUBSCRIPTION_SERVICEVARIANT_ID")
    (PARTITION "SYS_P53501"
    TABLESPACE "INDX02",
    PARTITION "SYS_P53502"
    TABLESPACE "INDX02",
    PARTITION "SYS_P53499"
    TABLESPACE "INDX02",
    PARTITION "SYS_P53500"
    TABLESPACE "INDX02") ;
    CREATE INDEX "SCME"."PROFILE_ID_NDX43" ON "SCME"."LNK_PROFILEENTITY_SUBSSERVVAR" ("PROFILE_ID")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 NOLOGGING COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "INDX03" ;
    ALTER TABLE "SCME"."LNK_PROFILEENTITY_SUBSSERVVAR" ADD CONSTRAINT "PK_PROFILEENTITY_SUBSSERVVAR" PRIMARY KEY ("SUBSCRIPTION_SERVICEVARIANT_ID", "PROFILE_ID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 NOLOGGING
    STORAGE(INITIAL 4194304
    BUFFER_POOL DEFAULT)
    TABLESPACE "INDX02" GLOBAL PARTITION BY HASH ("SUBSCRIPTION_SERVICEVARIANT_ID","PROFILE_ID")
    (PARTITION "SYS_P52989"
    TABLESPACE "INDX02",
    PARTITION "SYS_P52990"
    PARTITION "SYS_P53498"
    TABLESPACE "INDX02",
    PARTITION "SYS_P53499"
    TABLESPACE "INDX02",
    PARTITION "SYS_P53500"
    TABLESPACE "INDX02") ENABLE NOVALIDATE;
    ALTER TABLE "SCME"."LNK_PROFILEENTITY_SUBSSERVVAR" MODIFY ("SUBSCRIPTION_SERVICEVARIANT_ID" NOT NULL ENABLE NOVALIDATE);
    ALTER TABLE "SCME"."LNK_PROFILEENTITY_SUBSSERVVAR" MODIFY ("PROFILE_ID" NOT NULL ENABLE NOVALIDATE);

  • Modify HUGE HASH partition table to RANGE partition and HASH subpartition

    I have a table with 130,000,000 rows hash partitioned as below
    ----RANGE PARTITION--
    CREATE TABLE TEST_PART(
    C_NBR CHAR(12),
    YRMO_NBR NUMBER(6),
    LINE_ID CHAR(2))
    PARTITION BY RANGE (YRMO_NBR)(
    PARTITION TEST_PART_200009 VALUES LESS THAN(200009),
    PARTITION TEST_PART_200010 VALUES LESS THAN(200010),
    PARTITION TEST_PART_200011 VALUES LESS THAN(200011),
    PARTITION TEST_PART_MAX VALUES LESS THAN(MAXVALUE)
    CREATE INDEX TEST_PART_IX_001 ON TEST_PART(C_NBR, LINE_ID);
    Data: -
    INSERT INTO TEST_PART
    VALUES ('2000',200001,'CM');
    INSERT INTO TEST_PART
    VALUES ('2000',200009,'CM');
    INSERT INTO TEST_PART
    VALUES ('2000',200010,'CM');
    VALUES ('2006',NULL,'CM');
    COMMIT;
    Now, I need to keep this table from growing by deleting records that fall b/w a specific range of YRMO_NBR. I think it will be easy if I create a range partition on YRMO_NBR field and then create the current hash partition as a sub-partition.
    How do I change the current partition of the table from HASH partition to RANGE partition and a sub-partition (HASH) without losing the data and existing indexes?
    The table after restructuring should look like the one below
    COMPOSIT PARTITION-- RANGE PARTITION & HASH SUBPARTITION --
    CREATE TABLE TEST_PART(
    C_NBR CHAR(12),
    YRMO_NBR NUMBER(6),
    LINE_ID CHAR(2))
    PARTITION BY RANGE (YRMO_NBR)
    SUBPARTITION BY HASH (C_NBR) (
    PARTITION TEST_PART_200009 VALUES LESS THAN(200009) SUBPARTITIONS 2,
    PARTITION TEST_PART_200010 VALUES LESS THAN(200010) SUBPARTITIONS 2,
    PARTITION TEST_PART_200011 VALUES LESS THAN(200011) SUBPARTITIONS 2,
    PARTITION TEST_PART_MAX VALUES LESS THAN(MAXVALUE) SUBPARTITIONS 2
    CREATE INDEX TEST_PART_IX_001 ON TEST_PART(C_NBR,LINE_ID);
    Pls advice
    Thanks in advance

    Sorry for the confusion in the first part where I had given a RANGE PARTITION instead of HASH partition. Pls read as follows;
    I have a table with 130,000,000 rows hash partitioned as below
    ----HASH PARTITION--
    CREATE TABLE TEST_PART(
    C_NBR CHAR(12),
    YRMO_NBR NUMBER(6),
    LINE_ID CHAR(2))
    PARTITION BY HASH (C_NBR)
    PARTITIONS 2
    STORE IN (PCRD_MBR_MR_02, PCRD_MBR_MR_01);
    CREATE INDEX TEST_PART_IX_001 ON TEST_PART(C_NBR,LINE_ID);
    Data: -
    INSERT INTO TEST_PART
    VALUES ('2000',200001,'CM');
    INSERT INTO TEST_PART
    VALUES ('2000',200009,'CM');
    INSERT INTO TEST_PART
    VALUES ('2000',200010,'CM');
    VALUES ('2006',NULL,'CM');
    COMMIT;
    Now, I need to keep this table from growing by deleting records that fall b/w a specific range of YRMO_NBR. I think it will be easy if I create a range partition on YRMO_NBR field and then create the current hash partition as a sub-partition.
    How do I change the current partition of the table from hash partition to range partition and a sub-partition (hash) without losing the data and existing indexes?
    The table after restructuring should look like the one below
    COMPOSIT PARTITION-- RANGE PARTITION & HASH SUBPARTITION --
    CREATE TABLE TEST_PART(
    C_NBR CHAR(12),
    YRMO_NBR NUMBER(6),
    LINE_ID CHAR(2))
    PARTITION BY RANGE (YRMO_NBR)
    SUBPARTITION BY HASH (C_NBR) (
    PARTITION TEST_PART_200009 VALUES LESS THAN(200009) SUBPARTITIONS 2,
    PARTITION TEST_PART_200010 VALUES LESS THAN(200010) SUBPARTITIONS 2,
    PARTITION TEST_PART_200011 VALUES LESS THAN(200011) SUBPARTITIONS 2,
    PARTITION TEST_PART_MAX VALUES LESS THAN(MAXVALUE) SUBPARTITIONS 2
    CREATE INDEX TEST_PART_IX_001 ON TEST_PART(C_NBR,LINE_ID);
    Pls advice
    Thanks in advance

  • Cost to change hash partition key column in a history table

    Hi All,
    I have the following scenario.
    We have a history table in production which has 16 hash partitions on the basis of key_column.
    But the nature of data that we have in history table that has 878 distinct values of the key_column and about 1000 million data and all partitons are in same tablespace.
    Now we have a Pro*C module which purges data from this history table in the following way..
    > DELETE FROM hsitory_tab
    > WHERE p_date < (TO_DATE(sysdate+1, 'YYYYMMDD') - 210)
    > AND t_date < (TO_DATE(sysdate+1, 'YYYYMMDD') - 210)
    > AND ROWNUM <= 210;
    Now (p_date,t_data are one of the two columns in history table) data is deleted using thiese two date column conditions but key_column for partition is different.
    So as per aboove statement this history table containd 6 months data.
    DBA is asking to change this query and use partiton date wise.Now will it be proper to change the partition key_column (the existing hash partiton key_column >have 810 distinct values) and what things we need to cosider to calculate cost behind this hash partition key_column cahange(if it is appropriate to change >partition )key_column)Hope i explained my problem clearly and waiting for your suggestions .
    Thanks in advance.

    Hi Sir
    Many thanks for the reply.
    For first point -
    we are in plan to move the database to 10g after a lot of hastle between client.For second point -
    If we do partition by date or week we will have 30 or 7 partitions .As suggested by you as we have 16 partitions in the table best approach would be to have >partition by week then we will have 7 partitions and then each query will heat 7 partitions .For third point -
    Our main aim to reduce the timings of a job(a Pro*C program) which contains the following delete query to delete data from a history table .So accroding to the >query it is deleting data every day for 7 months and while deleting it it queries this hug etable by date.So in this case hash partition or range partiton or >hash/range partition which will be more suitable.
    DELETE FROM hsitory_tab
    WHERE p_date < (TO_DATE(sysdate+1, 'YYYYMMDD') - 210)
    AND t_date < (TO_DATE(sysdate+1, 'YYYYMMDD') - 210)
    AND ROWNUM <= 210;I have read in hash partition is used so that data will be evenly distributed in all partitions (though it depends on nature of data).In my case i want some suggestion from you to take the best approach .

  • Update in table partition by hash

    I have a table partitioned by hash. I want to make some updates (not on the partition key column and also not based on this column, i.e this column is not used in where clause).
    Do I need to specify partition name in the query?
    For a concrete example:
    CREATE TABLE invoices
    (invoice_id NUMBER NOT NULL,
    customer_id NUMBER NOT NULL,
    invoice_date DATE NOT NULL,
    comments VARCHAR2(500))
    PARTITION BY HASH (customer_id)
    PARTITIONS 10
    primary key is customer_id + invoice_date
    I need to update invoice_id based on the rowid, like update invoices set invoice_id = MEMO_ID_1SQ.nextval where rowid = <variable>. I will be running this query from multiple processes and I want to make sure they are hitting different partitions, so they actually run in parallel.
    Thanks in advance,
    Radu

    Radu,
    You can use parallel hint on your update statement.
    update /*+ PARALLEL(invoices, 4) */  invoices set invoice_id = MEMO_ID_1SQ.nextval where rowid = <variable>;See following execution plan for both with and without using parallel option
    SQL> update interfacerecords set status=1 where interfaceid=5;
    200000 rows updated.
    Elapsed: 00:00:03.75
    Execution Plan
    Plan hash value: 3154550297
    | Id  | Operation          | Name             | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT   |                  |   200K|  3125K|   128   (3)| 00:00:02 |
    |   1 |  UPDATE            | INTERFACERECORDS |       |       |            |          |
    |*  2 |   TABLE ACCESS FULL| INTERFACERECORDS |   200K|  3125K|   128   (3)| 00:00:02 |
    Predicate Information (identified by operation id):
       2 - filter("INTERFACEID"=5)
    Statistics
            262  recursive calls
         458353  db block gets
           1539  consistent gets
            378  physical reads
       91750476  redo size
            655  bytes sent via SQL*Net to client
            585  bytes received via SQL*Net from client
              3  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
         200000  rows processed
    SQL> commit;
    Commit complete.
    Elapsed: 00:00:00.00
    SQL> set autotrace traceonly;
    SQL> set timi on;
    SQL> set lines 400;
    SQL> update /*+ PARALLEL(interfacerecords, 4) */ interfacerecords set status=5 where status=1;
    200000 rows updated.
    Elapsed: 00:00:02.48
    Execution Plan
    Plan hash value: 2940696107
    | Id  | Operation             | Name             | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
    |   0 | UPDATE STATEMENT      |                  |     1 |    13 |    35   (0)| 00:00:01 |        |   |       |
    |   1 |  UPDATE               | INTERFACERECORDS |       |       |            |          |        |   |       |
    |   2 |   PX COORDINATOR      |                  |       |       |            |          |        |   |       |
    |   3 |    PX SEND QC (RANDOM)| :TQ10000         |     1 |    13 |    35   (0)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
    |   4 |     PX BLOCK ITERATOR |                  |     1 |    13 |    35   (0)| 00:00:01 |  Q1,00 | PCWC |            |
    |*  5 |      TABLE ACCESS FULL| INTERFACERECORDS |     1 |    13 |    35   (0)| 00:00:01 |  Q1,00 | PCWP |            |
    Predicate Information (identified by operation id):
       5 - filter("STATUS"=1)
    Statistics
            309  recursive calls
         214609  db block gets
          30287  consistent gets
              0  physical reads
       63356488  redo size
            654  bytes sent via SQL*Net to client
            617  bytes received via SQL*Net from client
              3  SQL*Net roundtrips to/from client
              3  sorts (memory)
              0  sorts (disk)
         200000  rows processedRegards

  • How to find the partition/overflow tablespace for hash partition?

    CREATE TABLE sales(acct_no NUMBER(5),
    acct_name CHAR(30),
    amount_of_sale NUMBER(6),
    week_no INTEGER,
    sale_details VARCHAR2(1000),
    PRIMARY KEY (acct_no, acct_name, week_no))
    ORGANIZATION INDEX
    INCLUDING week_no
    OVERFLOW
    PARTITION BY HASH (week_no)
    PARTITIONS 16
    STORE IN (tsp101, tbs_scott01)
    OVERFLOW STORE IN (tsp101, tbs_scott01);
    Query the partition tablespace like below, get null instead of 'tsp101' and 'tbs_scott01':
    SELECT tp.PARTITION_NAME, tp.TABLESPACE_NAME
    FROM ALL_TAB_PARTITIONS tp, ALL_PART_TABLES pt
    WHERE tp.TABLE_NAME='SALES'
    AND tp.TABLE_OWNER = pt.OWNER(+) AND tp.TABLE_NAME = pt.TABLE_NAME(+)
    ORDER BY PARTITION_POSITION

    CREATE TABLE sales(acct_no NUMBER(5),
    acct_name CHAR(30),
    amount_of_sale NUMBER(6),
    week_no INTEGER,
    sale_details VARCHAR2(1000),
    PRIMARY KEY (acct_no, acct_name, week_no))
    ORGANIZATION INDEX
    INCLUDING week_no
    OVERFLOW
    PARTITION BY HASH (week_no)
    PARTITIONS 16
    STORE IN (tsp101, tbs_scott01)
    OVERFLOW STORE IN (tsp101, tbs_scott01);
    Query the partition tablespace like below, get null instead of 'tsp101' and 'tbs_scott01':
    SELECT tp.PARTITION_NAME, tp.TABLESPACE_NAME
    FROM ALL_TAB_PARTITIONS tp, ALL_PART_TABLES pt
    WHERE tp.TABLE_NAME='SALES'
    AND tp.TABLE_OWNER = pt.OWNER(+) AND tp.TABLE_NAME = pt.TABLE_NAME(+)
    ORDER BY PARTITION_POSITION

  • What is this Partition type mention in code "Partition by HASH".

    Hi Team,
    Regularly i am Adding new partions and sub-Partitions to production table, based on Date. For example Every Day Data stored in one partion.
    please find below code, what i am using to add new partitions. I think this called RANGE partition.
    CREATE TABLE "owner"."TABLE_NAME"
    (     "COLUMN01" VARCHAR2(4),
         "ACOLUMN02" VARCHAR2(32) NOT NULL ENABLE,
    BUFFER_POOL DEFAULT)
    TABLESPACE "Tablespace_name"
    PARTITION BY RANGE ("Daily_TIME")
    (PARTITION "ABC_2008_08_31" VALUES LESS THAN (TO_DATE(' 2008-08-31 23:59:59', '
    SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
    STORAGE(INITIAL 1048576 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    Now i have found new type of code from one of the new table created by development team.
    Code is.....
    CREATE TABLE "owner"."TABLE_NAME"
    (     "COLUMN01" VARCHAR2(4),
         "ACOLUMN02" VARCHAR2(32) NOT NULL ENABLE,
    BUFFER_POOL DEFAULT)
    TABLESPACE "Tablespace_name"
    PARTITION BY HASH ("ACCOUNT_NUMBER")
    (PARTITION "PART_P01"
    TABLESPACE "tABLESPACE01",
    PARTITION "pART_P13"
    TABLESPACE "Tabelspace01") ENABLE ROW MOVEMENT;
    There is no below code in new Table code....
    ( (PARTITION "ABC_2008_08_31" VALUES LESS THAN (TO_DATE(' 2008-08-31 23:59:59', '
    SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    SO, i am unable to alter this table to add new partions monthly wise.
    Please suggest me, How to save data date wise in this table. Also suggest me if it is not comes under RANGE Partion or not.
    If not possible to add new partition data wise, I will inform to client.
    Thanks & Regards,
    Venkat

    New table use hash partitioning, not range partitioning. You can refer to the Concepts:
    http://docs.oracle.com/cd/E11882_01/server.112/e25789/schemaob.htm#CNCPT88864
    The key of new partitioned table is account number, not date, therefore you cannot partition this table date-wise.

  • A question on Hash Partition

    Hi,
    I'm facing a proble.My table has 16 partition and all the partitions are hash partitioned.
    But i found only one partition is being populated heavily rather than the other ones it near to 3-4 times of other partitions.
    My database version is 9i.
    Can anyone suggest me in this.
    Thanks in advance
    say my table structure like this ..
    CREATE TABLE TAB1(COL1 NUMBER,COL2 VARCHAR2(10),COL3 VARCHAR(10));
    PARTITON BY HASH(COL3)
    PARTITION P1 TABLESPACE TS1
    PARTITION P16 TABLESPACE TS1
    And i have only one index i.e
    create index indx on tab1(col1,col2,col3);
    Edited by: bp on Feb 17, 2009 4:40 AM

    bp wrote:
    My table has near 1000 million data as it is a history table.
    Partition_key (col3) has distinct 926 values.
    One thing is sure as the cardinality of col3 is very low in comparison with the amount of data in the table data is not evenly distributed.
    Now another problem is one value (say col3 =1) of col3 from the 926 distinct values only goes to p16 partition but surprisingly this is not going to any other partitons.We have no other objects on this table to control the flow of data between partitions.
    I really counld not find any reason of such behaviour.I'm not sure if I understand what you attempt to describe. You mean to say that in partition p16 there is only one value of COL3 found, and this partition holds more rows than the other partitions. Whereas the remaining partitions cover more COL3 values but hold less rows.
    A single COL3 value always maps to the same hash value, so if you don't change the number of hash partitions and cause a "rebalancing" the same value should always map to the same partition (it still does after rebalancing but it might be a different partition now). You might be unlucky that there is currently no other value than "1" that maps to the same hash value. You could think about adding/removing hash partitions to change the distribution of the rows, but this could be a quite expensive operation given the amount of data in your table.
    Are these 926 distinct values evenly distributed or is the data skewed in this column? Your description suggests that the data is skewed if a single value in a partition holds more rows than the other partitions that cover multiple values.
    You could do a simple
    SELECT COUNT(*), COL3
    FROM TAB
    GROUP BY COL3
    ORDER BY COUNT(*) DESC
    to find this out, or check the column statistics if there is an histogram on that column describing the column skew. If that query takes too long use a SAMPLE size (...FROM TAB SAMPLE (1)...) indicates a 1 percent sampling. You need to scale the counts then by the sampling factor.
    Regards,
    Randolf
    Oracle related stuff blog:
    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/

  • Does hash partition distribute data evenly across partitions?

    As per Oracle documentation, it is mentioned that hash partitioning uses oracle hashing algorithms to assign a hash value to each rows partitioning key and place it in the appropriate partition. And the data will be evenly distributed across the partitions. Ofcourse following following conditions :
    1. Partition count should follow 2^n logic
    2. Data in partition key column should have high cardinality.
    I have used hash partitioning in some of our application tables, but data isn't distributed evenly across partitions. To verify it, i performed a small test :
    Table script :
    Create table ch_acct_mast_hash(
    Cod_acct_no number)
    Partition by hash(cod_acct_no)
    PARTITIONS 128;
    Data population script :
    declare
    i number;
    l number;
    begin
    i := 1000000000000000;
    for l in 1 .. 100000 loop
    insert into ch_acct_mast_hash values (i);
    i := i + 1;
    end loop;
    commit;
    end;
    Row-count check :
    select count(1) from Ch_Acct_Mast_hash ; --rowcount is 100000
    Gather stats script :
    begin
    dbms_stats.gather_table_stats('C43HDEV', 'CH_ACCT_MAST_HASH');
    end;
    Data distribution check :
    Select min(num_rows), max(num_rows) from dba_tab_partitions
    where table_name = 'CH_ACCT_MAST_HASH';
    Result is :
    min(num_rows) = 700
    max(num_rows) = 853
    As per the result, it seems there is lot of skewness in data distribution across partitions. Maybe I am missing something, or something is not right.
    Can anybody help me to understand this behavior?
    Edited by: Kshitij Kasliwal on Nov 2, 2012 4:49 AM

    >
    I have used hash partitioning in some of our application tables, but data isn't distributed evenly across partitions.
    >
    All keys with the same data value will also have the same hash value and so will be in the same partition.
    So the actual hash distribution in any particular case will depend on the actual data distribution. And, as Iordan showed, the data distribution depends not only on cardinality but on the standard deviation of the key values.
    To use a shorter version of that examle consider these data samples which each have 10 values. There is a calculator here
    http://easycalculation.com/statistics/standard-deviation.php
    0,1,0,2,0,3,0,4,0,5 - total 10, distinct 6, %distinct 60, mean 1.5, stan deviation 1.9, variance 3.6 - similar to Iordan's example
    0,5,0,5,0,5,0,5,0,5 - total 10, distinct 2, %distinct 20, mean 2.5, stan dev. 2.64, variance 6.9
    5,5,5,5,5,5,5,5,5,5 - total 10, distinct 1, %distinct 10, mean 5, stan dev. 0, variance 0
    0,1,2,3,4,5,6,7,8,9 - total 10, distinct 10, %distinct 100, mean 4.5, stan dev. 3.03, variance 9.2
    The first and last examples have the highest cardinality but only the last has unique values (i.e. 100% distinct).
    Note that the first example is lower for all other attributes but that doesn't mean it would hash more evenly.
    Also note that the last example, the unique values, has the highest variance.
    So this is no single attribute that is controlling. As Iordan showed the first example has a high %distinct but all of those '0' values will hash to the same partition so even using a perfect hash the data would use 6 partitions.

  • Hash Partitioning and Partition-Wise Joins

    Hi,
    For the ETL process of a Data Warehouse project I have to join 2 tables (~10M rows) over their primary key.
    I was thinking of hash partitioning these 2 tables over their PK. Through this the database (9.2) should be able to do a Hash-Hash Full Partition-wise Join. For more detail about that you can have a look at:
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96520/parpart.htm#98291
    What I'm looking for are some documents or recommandation concerning the number of hash partitions to create depending on the number of rows of the tables, CPU of the server or any other parameters.
    I would be grateful if someone could give some input.
    Mike

    here you have all papers:
    Oracle9i Database List of Books
    (Release 2 (9.2))
    http://otn.oracle.com/pls/db92/db92.docindex?remark=homepage
    Joel P�rez

  • How many hash partitions create is prefer

    I want to create hash partitions on a large table,but i don't know how many partitions to create?
    create table T_PARTITION_HASH
      ID   NUMBER,
      NAME VARCHAR2(50)
    partition by hash (ID)
      partition T_HASH_P1
        tablespace USERS,
      partition T_HASH_P2
        tablespace USERS,
      partition T_HASH_P3
        tablespace USERS
    );

    Agustin UN wrote:
    What is the table size in rows and Mb?
    What is the grow estimated of table?
    What access is on table?
    . :-) Any help with my english will be welcome :-).the table contain about 1 hundred million rows.
    the table grows 1000000 rows per day.
    the table is use for statistical analysis in data wasehouse.
    Edited by: user7244870 on Nov 5, 2010 2:22 AM

  • Is list partition and hash partition one and the same

    I am creating table with partition with the commands
    CREATE TABLE ABD (ENO NUMBER(5),CID NUMBER(3),ENAME VARCHAR2(10))
    PARTITION BY LIST (ENO)
    (PARTITION P1 VALUES (123),
    PARTITION P2 VALUES (143),
    PARTITION CLIENT_ID VALUES (746))
    ALTER TABLE ABD
    ADD PARTITION CLIENT_756 VALUES (756)
    but when i describe the table script it is showing like this
    CREATE TABLE ABD (
    ENO NUMBER (5),
    ENAME VARCHAR2 (10),
    CID NUMBER (3) )
    PARTITION BY HASH (ENO)
    PARTITIONS 4
    STORE IN ( USERS,USERS,USERS,
    USERS);
    actually i am creating list partition but it is showing hash partition why is it so?

    when i describe the table script it is showing like thisHow do you describe it, and which version are you on ?
    TEST@db102 SQL> CREATE TABLE ABD (ENO NUMBER(5),CID NUMBER(3),ENAME VARCHAR2(10))
      2  PARTITION BY LIST (ENO)
      3  (PARTITION P1 VALUES (123),
      4  PARTITION P2 VALUES (143),
      5* PARTITION CLIENT_ID VALUES (746))
    TEST@db102 SQL> /
    Table created.
    TEST@db102 SQL> ALTER TABLE ABD
      2* ADD PARTITION CLIENT_756 VALUES (756)
    TEST@db102 SQL> /
    Table altered.
    TEST@db102 SQL> select dbms_metadata.get_ddl('TABLE','ABD','TEST') from dual;
    DBMS_METADATA.GET_DDL('TABLE','ABD','TEST')
      CREATE TABLE "TEST"."ABD"
       (    "ENO" NUMBER(5,0),
            "CID" NUMBER(3,0),
            "ENAME" VARCHAR2(10)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(
      BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
      PARTITION BY LIST ("ENO")
    (PARTITION "P1"  VALUES (123)
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" NOCOMPRESS ,
    PARTITION "P2"  VALUES (143)
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" NOCOMPRESS ,
    PARTITION "CLIENT_ID"  VALUES (746)
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" NOCOMPRESS ,
    PARTITION "CLIENT_756"  VALUES (756)
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" NOCOMPRESS )
    TEST@db102 SQL>                                                                               

  • Need help on List-Hash partition - oracle 11 feature !

    Can a list-hash partitioned tabled be exchanged for a partition?
    Say, the table is partitioned by list on CODE (varchar2) column and subpartitioned by a NUMBER column
    i.e. create table TAB1 (ID, Code, Number)
    partition by LIST (Code)
    subpartition by HASH (Number)
    subpartition template
    ( subpartition1 , subpartition2 , subpartition3)
    partition part1 values ('A'),
    partition part1 values ('B'),
    partition part1 values ('C')
    Lets say the subpartitions1,2 and 3 have values 1,2,3,4,5,6....10, how can I move only say value 1 and 2 into another table using exchange partition method? Is this possible?

    >
    Thanks for the reply. The db version details is as below. And I am more interested in knowing if and how can data be extracted from hash sub-partitions for a given sub-partition key value, using partition exchange. Can anyone demonstrate this or point to any article that demonstrates this? I am not even sure if something like is possible.
    >
    What part of my reply didn't you undertand?
    Except now you are saying 'extract' where before you wanted to exchange the hash subpartition. If you exchange then the subpartition will now have NO data since it will have been exchanged with an empty table.
    In a partition exchange ALL of the partition (or subpartition) is exchanged, not just part of it. So for a hash subpartition you either exchange ALL data or none of it. If you only want some of the data in the subpartition you have to query it out.
    No one can provide any samples until you provide a valid sample yourself. You said your partitions have character data
    partition part1 values ('A'),
    partition part1 values ('B'),
    partition part1 values ('C')
    );But then you ask about manipulating numeric data
    >
    Lets say the subpartitions1,2 and 3 have values 1,2,3,4,5,6....10, how
    >
    Which is it?
    Post the DDL for the table and show which subpartition you want to query or exchange.

Maybe you are looking for

  • How to reformat a used dvd disc

    Hi   I have a MacBook and the installed programs and dvd drive. If I burn a dvd movie, how can I reformat and delete that info in order to reuse the dic afterwards. Thanks Phil

  • Sony Bravia KDL-52S5100 LCD Picture?

    My husband just hooked up our new Sony Bravia KDL-52S5100 LCD with an HD cable box from Comcast.  I have seen several Sony LCD's in other people's homes and somehow the picture looked sharper than what I see on ours.  Do we have to do any type of tun

  • HT4623 When is the iOS 7 update going to be released?

    Wanted to know when in the new ios7 going to be released for iPhone.

  • Drill Up/Down in Webi Report

    Hi All, We have a requirement to drill down and drill up  in webi report. The hierarchy set is Country>Region>State-->City.The fact table structure is Location             Population (in Cr) India             20000 East India             5000 West In

  • Accessing environment variables

    Good morning, I have an implementation of Oracle Application Server 10G using a Shibboleth Service Provider (SP) 2.1 for SSO authentication. The problem I am facing now is to accessing with APEX the environmental variables created by the SP. In my te