Subpartition by range?

Hello,
I created the following partitioned table, using Oracle 11g R2 interval partitioning:
CREATE TABLE ACCOUNTS_IMPORT (
SIGNING_ACCOUNT VARCHAR2(16 CHAR),
REPORT_MM DATE,
IMPORT_ID INTEGER -- this is a unique number incremented by 1 (1, 2, 3,....etc)
PARTITION BY RANGE (REPORT_MM)
INTERVAL( NUMTOYMINTERVAL(1,'MONTH'))
(PARTITION p_first VALUES LESS THAN ('01-JAN-2006'));
Works correctly; every time I insert data for a new month, Oracle automatically creates a new partition.
For example: for the month of July I add 3 batches of records identified by IMPORT_ID 11, 12 and 13 and they all go into the same partition. This is exactly what I want.
But I also want that any record batch identified by the unique IMPORT_ID to go into a new subpartition. How can I achieve that?
Because IMPORT_ID keeps incrementing I cannot create from the beginning the subpartitions using something like:
PARTITION BY RANGE (REPORT_MM) INTERVAL( NUMTOYMINTERVAL(1,'MONTH'))
SUBPARTITION BY RANGE(IMPORT_ID)
SUBPARTITION TEMPLATE(
SUBPARTITION sp_11 VALUES(11),
SUBPARTITION sp_12 VALUES(12) ,
SUBPARTITION sp_13 VALUES(13))
Would be possible to add subpartitions on the fly or maybe get Oracle to create them automatically?
Thanks,
M.R.

user7047382 wrote:
Hello,
I created the following partitioned table, using Oracle 11g R2 interval partitioning:
CREATE TABLE ACCOUNTS_IMPORT (
SIGNING_ACCOUNT VARCHAR2(16 CHAR),
REPORT_MM DATE,
IMPORT_ID INTEGER -- this is a unique number incremented by 1 (1, 2, 3,....etc)
PARTITION BY RANGE (REPORT_MM)
INTERVAL( NUMTOYMINTERVAL(1,'MONTH'))
(PARTITION p_first VALUES LESS THAN ('01-JAN-2006'));
Works correctly; every time I insert data for a new month, Oracle automatically creates a new partition.
For example: for the month of July I add 3 batches of records identified by IMPORT_ID 11, 12 and 13 and they all go into the same partition. This is exactly what I want.
But I also want that any record batch identified by the unique IMPORT_ID to go into a new subpartition. How can I achieve that?
Because IMPORT_ID keeps incrementing I cannot create from the beginning the subpartitions using something like:
PARTITION BY RANGE (REPORT_MM) INTERVAL( NUMTOYMINTERVAL(1,'MONTH'))
SUBPARTITION BY RANGE(IMPORT_ID)
SUBPARTITION TEMPLATE(
SUBPARTITION sp_11 VALUES(11),
SUBPARTITION sp_12 VALUES(12) ,
SUBPARTITION sp_13 VALUES(13))
Would be possible to add subpartitions on the fly or maybe get Oracle to create them automatically?NO!

Similar Messages

  • Subpartition existing range partition in Oracle

    I have table xyz with following structure
    xyz ( vld_dte date,
    prd_typ varchar2(100),
    sales number
    table XYZ is partitioned by range on field vld_dte and partitions are monthly partitions like JAN-2009 , FEB-2009....DEC-2009 and so on.table is currently loaded with data.
    How can I modify existing range partition into composite range-list partition so that every partiton is subpartitioned on prd_typ , basically three sub-partitions for every partition 1- Grocery , 2-Home decoration,3-OTHERS

    ORA-14759: SET INTERVAL is not legal on this table.
    Cause: ALTER TABLE SET INTERVAL is only legal on a range partitioned table with a single partitioning column. Additionally this table cannot have a maxvalue partition.
    Action: Use SET INTERVAL only on a valid table
    mark answered post as helpful / correct*

  • List-range partition and subpartition

    Does anyone know that Oracle 10g support partition by list and subpartition by range? Thanks.

    check the documentation link [http://download.oracle.com/docs/cd/B19306_01/appdev.102/b31695/dialogs.htm#sthref441]
    hope you will find your answer on link page.

  • Oracle 11g  List - Range Partition - Help Needed

    Hi All,
    I want to create a composite partition (LIST-RANGE) but RANGE partition should using interval partition
    This is my query .
    CREATE TABLE "DMSDB"."DEVICE_UTILS"
    (     "ULID" VARCHAR2(100 CHAR),
         "IP_ADDRESS" VARCHAR2(24 CHAR),
         "PORT" VARCHAR2(8 CHAR),
         "SHUTDOWN" NUMBER(10,0),
         "LINE_TYPE" NUMBER(10,0) DEFAULT '0',
         "OCCUPIED" NUMBER(10,0),
         "UTILIZATION" NUMBER(10,0),
         "IDLE_TIME" VARCHAR2(32 CHAR),
         "ACTIVATION_TIME" VARCHAR2(32 CHAR),
         "PULLED_DATE" TIMESTAMP (6) DEFAULT SYSDATE,
         "ACCESS_TIME" TIMESTAMP (6) DEFAULT SYSDATE
    PARTITION BY LIST(ULID)
              PARTITION PART_DEVUTILS_ULID VALUES (DEFAULT)
         SUBPARTITION BY RANGE( PULLED_DATE)
         PARTITION PART_DEVUTILS_WEEK INTERVAL (NUMTOYMINTERVAL(1,'WEEK'))
    Somehow its not working. can you please suggest where i am making mistake?

    Interval partitioning is not supported at the subpartition level.
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_7002.htm#BABCDDIA
    Regards
    Girish Sharma

  • Pruning on subpartition not occurs

    Hello
    I have a little problem of performance on a query that seems for me simple
    SELECT /*+ no_parallel (dwh_ind_ca_marge) use_nl(dwh_ind_ca_marge) */
    FROM dwh_ind_ca_marge, dwh_ag ag, dwh_ag com
    WHERE com.pk_id_ag = ag.id_ag_com
    AND fk_id_ag = ag.pk_id_ag
    AND com.cd_ag = 121
    AND id_an_mois = 200910
    Dwh_ind_ca_marge is a subpartition table (range / hash) :
    the range is on the month (200101 200102 .....)
    the hash is on fk_id_ag : the id of an agency (128 subpartitions)
    dwh_ag is the table of agency with primary key pk_id_ag
    In fact I dont understand why subquery pruning on fk_id_ag doesn t occur
    The problem is workarounded by forcing the nested loop between dwh_ag andf dwh_ind_ca_marge
    What is surprising is that on the 10053 trace the nested loop has a lower cost that the plan choosen !!!!
    What s the problem ?
    thanks
    ps : i am on 10.2.0.5 enterprise edition
    Edited by: user12210577 on 21 oct. 2010 05:22
    Edited by: user12210577 on 21 oct. 2010 05:44

    QUERY BLOCK TEXT
    select /*+ no_parallel (dwh_ind_ca_marge) */ -----use_nl(dwh_ind_ca_marge) */
    * from dwh_ind_ca_marge, dwh_ag ag, dwh_ag com where
    com.pk_id_ag = ag.id_ag_com and fk_id_ag= ag.pk_id_ag and
    com.cd_ag=121 and id_an_mois=200910 and 1=1
    QUERY BLOCK SIGNATURE
    qb name was generated
    signature (optimizer): qb_name=SEL$1 nbfros=3 flg=0
    fro(0): flg=0 objn=14305 hint_alias="AG"@"SEL$1"
    fro(1): flg=0 objn=14305 hint_alias="COM"@"SEL$1"
    fro(2): flg=0 objn=121227 hint_alias="DWH_IND_CA_MARGE"@"SEL$1"
    SYSTEM STATISTICS INFORMATION
    Using WORKLOAD Stats
    CPUSPEED: 1257 millions instructions/sec
    SREADTIM: 10 milliseconds
    MREADTIM: 42 millisecons
    MBRC: 51.000000 blocks
    MAXTHR: 33554432 bytes/sec
    SLAVETHR: 2097152 bytes/sec
    BASE STATISTICAL INFORMATION
    Table Stats::
    Table: DWH_AG Alias: COM (NOT ANALYZED)
    #Rows: 1634 #Blks: 20 AvgRowLen: 100.00
    Column (#1): PK_ID_AG(NUMBER) NO STATISTICS (using defaults)
    AvgLen: 13.00 NDV: 51 Nulls: 0 Density: 0.019584
    Index Stats::
    Index: IDX_DWH_AG_1 Col#: 5 (NOT ANALYZED)
    LVLS: 1 #LB: 25 #DK: 100 LB/K: 1.00 DB/K: 1.00 CLUF: 800.00
    Index: PK_DWH_AG Col#: 1 (NOT ANALYZED)
    LVLS: 1 #LB: 25 #DK: 100 LB/K: 1.00 DB/K: 1.00 CLUF: 800.00
    Table Stats::
    Table: DWH_AG Alias: AG (NOT ANALYZED)
    #Rows: 1634 #Blks: 20 AvgRowLen: 100.00
    Column (#22): ID_AG_COM(NUMBER) NO STATISTICS (using defaults)
    AvgLen: 13.00 NDV: 51 Nulls: 0 Density: 0.019584
    Column (#1): PK_ID_AG(NUMBER) NO STATISTICS (using defaults)
    AvgLen: 13.00 NDV: 51 Nulls: 0 Density: 0.019584
    Index Stats::
    Index: IDX_DWH_AG_1 Col#: 5 (NOT ANALYZED)
    LVLS: 1 #LB: 25 #DK: 100 LB/K: 1.00 DB/K: 1.00 CLUF: 800.00
    Index: PK_DWH_AG Col#: 1 (NOT ANALYZED)
    LVLS: 1 #LB: 25 #DK: 100 LB/K: 1.00 DB/K: 1.00 CLUF: 800.00
    Table Stats::
    Table: DWH_IND_CA_MARGE Alias: DWH_IND_CA_MARGE (Using composite stats)
    #Rows: 100302273 #Blks: 46538 AvgRowLen: 452.00
    Index Stats::
    Index: IDX_DWH_IND_CA_MARGE_1 Col#: 88
    LVLS: 2 #LB: 1223 #DK: 98204 LB/K: 1.00 DB/K: 2.00 CLUF: 277386.00
    Index: IDX_DWH_IND_CA_MARGE_2 Col#: 10 5
    LVLS: 3 #LB: 350280 #DK: 1086 LB/K: 322.00 DB/K: 33633.00 CLUF: 36526000.00
    Index: IDX_DWH_IND_CA_MARGE_3 Col#: 6
    LVLS: 3 #LB: 385313 #DK: 2124 LB/K: 181.00 DB/K: 19421.00 CLUF: 41252307.00
    Index: IDX_DWH_IND_CA_MARGE_4 Col#: 9
    LVLS: 3 #LB: 353713 #DK: 6863 LB/K: 80.00 DB/K: 14320.00 CLUF: 98677547.00
    Index: IDX_DWH_IND_CA_MARGE_5 Col#: 10
    LVLS: 3 #LB: 302187 #DK: 112 LB/K: 2698.00 DB/K: 95529.00 CLUF: 10699333.00
    Index: IDX_DWH_IND_CA_MARGE_6 Col#: 5
    LVLS: 3 #LB: 315320 #DK: 18 LB/K: 17517.00 DB/K: 1746632.00 CLUF: 31439393.00
    Index: PK_DWH_IND_CA_MARGE Col#: 1
    LVLS: 3 #LB: 314060 #DK: 97686787 LB/K: 1.00 DB/K: 1.00 CLUF: 92745280.00
    SINGLE TABLE ACCESS PATH
    BEGIN Single Table Cardinality Estimation
    *** 2010-10-21 13:52:04.086
    ** Performing dynamic sampling initial checks. **
    Column (#8): ID_AN_MOIS(NUMBER)
    AvgLen: 5.00 NDV: 79 Nulls: 0 Density: 5.9155e-06 Min: 200404 Max: 201010
    Histogram: Freq #Bkts: 79 UncompBkts: 15045341 EndPtVals: 79
    ** Dynamic sampling initial checks returning FALSE.
    Table: DWH_IND_CA_MARGE Alias: DWH_IND_CA_MARGE
    Card: Original: 100302273 Rounded: 1907307 Computed: 1907306.66 Non Adjusted: 1907306.66
    END Single Table Cardinality Estimation
    Access Path: TableScan
    Cost: 4014.54 Resp: 4014.54 Degree: 0
    Cost_io: 3710.00 Cost_cpu: 3963249652
    Resp_io: 3710.00 Resp_cpu: 3963249652
    Best:: AccessPath: TableScan
    Cost: 4014.54 Degree: 1 Resp: 4014.54 Card: 1907306.66 Bytes: 0
    SINGLE TABLE ACCESS PATH
    BEGIN Single Table Cardinality Estimation
    *** 2010-10-21 13:52:04.087
    ** Performing dynamic sampling initial checks. **
    ** Dynamic sampling initial checks returning TRUE (level = 4).
    ** Dynamic sampling updated table stats.: blocks=20
    *** 2010-10-21 13:52:04.087
    ** Generated dynamic sampling query:
    query text :
    SELECT /* OPT_DYN_SAMP */ /*+ ALL_ROWS IGNORE_WHERE_CLAUSE NO_PARALLEL(SAMPLESUB) opt_param('parallel_execution_enabled', 'false') NO_PARALLEL_INDEX(SAMPLESUB) NO_SQL_TUNE */ NVL(SUM(C1),0), NVL(SUM(C2),0), COUNT(DISTINCT C3), NVL(SUM(CASE WHEN C3 IS NULL THEN 1 ELSE 0 END),0) FROM (SELECT /*+ NO_PARALLEL("AG") FULL("AG") NO_PARALLEL_INDEX("AG") */ 1 AS C1, 1 AS C2, "AG"."ID_AG_COM" AS C3 FROM "DWH_AG" "AG") SAMPLESUB
    *** 2010-10-21 13:52:04.089
    ** Executed dynamic sampling query:
    level : 4
    sample pct. : 100.000000
    actual sample size : 565
    filtered sample card. : 565
    orig. card. : 1634
    block cnt. table stat. : 20
    block cnt. for sampling: 20
    max. sample block cnt. : 64
    sample block cnt. : 20
    ndv C3 : 557
    scaled : 557.00
    nulls C4 : 6
    scaled : 6.00
    min. sel. est. : -1.00000000
    ** Dynamic sampling col. stats.:
    Column (#22): ID_AG_COM(NUMBER) Part#: 0
    AvgLen: 22.00 NDV: 557 Nulls: 6 Density: 0.0017953
    ** Using dynamic sampling NULLs estimates.
    ** Using dynamic sampling NDV estimates.
    Scaled NDVs using cardinality = 565.
    ** Using dynamic sampling card. : 565
    ** Dynamic sampling updated table card.
    Table: DWH_AG Alias: AG
    Card: Original: 565 Rounded: 565 Computed: 565.00 Non Adjusted: 565.00
    END Single Table Cardinality Estimation
    Access Path: TableScan
    Cost: 3.05 Resp: 3.05 Degree: 0
    Cost_io: 3.00 Cost_cpu: 713079
    Resp_io: 3.00 Resp_cpu: 713079
    Best:: AccessPath: TableScan
    Cost: 3.05 Degree: 1 Resp: 3.05 Card: 565.00 Bytes: 0
    SINGLE TABLE ACCESS PATH
    BEGIN Single Table Cardinality Estimation
    *** 2010-10-21 13:52:04.090
    ** Performing dynamic sampling initial checks. **
    Column (#5): CD_AG(NUMBER) NO STATISTICS (using defaults)
    AvgLen: 13.00 NDV: 51 Nulls: 0 Density: 0.019584
    ** Dynamic sampling initial checks returning TRUE (level = 4).
    ** Dynamic sampling updated index stats.: IDX_DWH_AG_1, blocks=6
    ** Dynamic sampling updated index stats.: PK_DWH_AG, blocks=1
    ** Dynamic sampling index access candidate : IDX_DWH_AG_1
    ** Dynamic sampling updated table stats.: blocks=20
    *** 2010-10-21 13:52:04.090
    ** Generated dynamic sampling query:
    query text :
    SELECT /* OPT_DYN_SAMP */ /*+ ALL_ROWS IGNORE_WHERE_CLAUSE NO_PARALLEL(SAMPLESUB) opt_param('parallel_execution_enabled', 'false') NO_PARALLEL_INDEX(SAMPLESUB) NO_SQL_TUNE */ NVL(SUM(C1),0), NVL(SUM(C2),0), COUNT(DISTINCT C3), NVL(SUM(CASE WHEN C3 IS NULL THEN 1 ELSE 0 END),0) FROM (SELECT /*+ IGNORE_WHERE_CLAUSE NO_PARALLEL("COM") FULL("COM") NO_PARALLEL_INDEX("COM") */ 1 AS C1, CASE WHEN "COM"."CD_AG"=121 THEN 1 ELSE 0 END AS C2, "COM"."PK_ID_AG" AS C3 FROM "DWH_AG" "COM") SAMPLESUB
    *** 2010-10-21 13:52:04.091
    ** Executed dynamic sampling query:
    level : 4
    sample pct. : 100.000000
    actual sample size : 565
    filtered sample card. : 1
    orig. card. : 1634
    block cnt. table stat. : 20
    block cnt. for sampling: 20
    max. sample block cnt. : 64
    sample block cnt. : 20
    ndv C3 : 565
    scaled : 565.00
    nulls C4 : 0
    scaled : 0.00
    min. sel. est. : 0.01000000
    ** Dynamic sampling col. stats.:
    Column (#1): PK_ID_AG(NUMBER) Part#: 0
    AvgLen: 22.00 NDV: 565 Nulls: 0 Density: 0.0017699
    ** Using dynamic sampling NULLs estimates.
    ** Using dynamic sampling NDV estimates.
    Scaled NDVs using cardinality = 565.
    ** Using recursive dynamic sampling card. est. : 565.000000
    *** 2010-10-21 13:52:04.091
    ** Generated dynamic sampling query:
    query text :
    SELECT /* OPT_DYN_SAMP */ /*+ ALL_ROWS opt_param('parallel_execution_enabled', 'false') NO_PARALLEL(SAMPLESUB) NO_PARALLEL_INDEX(SAMPLESUB) NO_SQL_TUNE */ NVL(SUM(C1),0), NVL(SUM(C2),0), NVL(SUM(C3),0) FROM (SELECT /*+ NO_PARALLEL("COM") INDEX("COM" IDX_DWH_AG_1) NO_PARALLEL_INDEX("COM") */ 1 AS C1, 1 AS C2, 1 AS C3 FROM "DWH_AG" "COM" WHERE "COM"."CD_AG"=121 AND ROWNUM <= 2500) SAMPLESUB
    *** 2010-10-21 13:52:04.091
    ** Executed dynamic sampling query:
    level : 4
    sample pct. : 100.000000
    actual sample size : 565
    filtered sample card. : 1
    filtered sample card. (index IDX_DWH_AG_1): 1
    orig. card. : 565
    block cnt. table stat. : 20
    block cnt. for sampling: 20
    max. sample block cnt. : 4294967295
    sample block cnt. : 20
    min. sel. est. : 0.01000000
    index IDX_DWH_AG_1 selectivity est.: 0.00176991
    ** Using dynamic sampling card. : 565
    ** Dynamic sampling updated table card.
    ** Using single table dynamic sel. est. : 0.00176991
    Table: DWH_AG Alias: COM
    Card: Original: 565 Rounded: 1 Computed: 1.00 Non Adjusted: 1.00
    END Single Table Cardinality Estimation
    Access Path: TableScan
    Cost: 3.02 Resp: 3.02 Degree: 0
    Cost_io: 3.00 Cost_cpu: 301409
    Resp_io: 3.00 Resp_cpu: 301409
    Access Path: index (AllEqRange)
    Index: IDX_DWH_AG_1
    resc_io: 3.00 resc_cpu: 28264
    ix_sel: 0.0017699 ix_sel_with_filters: 0.0017699
    Cost: 3.00 Resp: 3.00 Degree: 1
    Best:: AccessPath: IndexRange Index: IDX_DWH_AG_1
    Cost: 3.00 Degree: 1 Resp: 3.00 Card: 1.00 Bytes: 0
    OPTIMIZER STATISTICS AND COMPUTATIONS
    GENERAL PLANS
    Considering cardinality-based initial join order.
    Permutations for Starting Table :0
    Join order[1]: DWH_AG[COM]#0 DWH_AG[AG]#1 DWH_IND_CA_MARGE[DWH_IND_CA_MARGE]#2
    Now joining: DWH_AG[AG]#1
    NL Join
    Outer table: Card: 1.00 Cost: 3.00 Resp: 3.00 Degree: 1 Bytes: 706
    Inner table: DWH_AG Alias: AG
    Access Path: TableScan
    NL Join: Cost: 6.06 Resp: 6.06 Degree: 1
    Cost_io: 6.00 Cost_cpu: 741343
    Resp_io: 6.00 Resp_cpu: 741343
    Best NL cost: 6.06
    resc: 6.06 resc_io: 6.00 resc_cpu: 741343
    resp: 6.06 resp_io: 6.00 resp_cpu: 741343
    Join Card: 1.00 = outer (1.00) * inner (565.00) * sel (0.0017763)
    Join Card - Rounded: 1 Computed: 1.00
    SM Join
    Outer table:
    resc: 3.00 card 1.00 bytes: 706 deg: 1 resp: 3.00
    Inner table: DWH_AG Alias: AG
    resc: 3.05 card: 565.00 bytes: 706 deg: 1 resp: 3.05
    using dmeth: 2 #groups: 1
    SORT resource Sort statistics
    Sort width: 598 Area size: 1048576 Max Area size: 104857600
    Degree: 1
    Blocks to Sort: 1 Row size: 787 Total Rows: 1
    Initial runs: 1 Merge passes: 0 IO Cost / pass: 0
    Total IO sort cost: 0 Total CPU sort cost: 13013721
    Total Temp space used: 0
    SORT resource Sort statistics
    Sort width: 598 Area size: 1048576 Max Area size: 104857600
    Degree: 1
    Blocks to Sort: 55 Row size: 787 Total Rows: 565
    Initial runs: 1 Merge passes: 0 IO Cost / pass: 0
    Total IO sort cost: 0 Total CPU sort cost: 13246441
    Total Temp space used: 0
    SM join: Resc: 8.07 Resp: 8.07 [multiMatchCost=0.00]
    SM cost: 8.07
    resc: 8.07 resc_io: 6.00 resc_cpu: 27001505
    resp: 8.07 resp_io: 6.00 resp_cpu: 27001505
    HA Join
    Outer table:
    resc: 3.00 card 1.00 bytes: 706 deg: 1 resp: 3.00
    Inner table: DWH_AG Alias: AG
    resc: 3.05 card: 565.00 bytes: 706 deg: 1 resp: 3.05
    using dmeth: 2 #groups: 1
    Cost per ptn: 0.50 #ptns: 1
    hash_area: 256 (max=25600) buildfrag: 1 probefrag: 50 ppasses: 1
    Hash join: Resc: 6.56 Resp: 6.56 [multiMatchCost=0.00]
    HA cost: 6.56
    resc: 6.56 resc_io: 6.00 resc_cpu: 7304854
    resp: 6.56 resp_io: 6.00 resp_cpu: 7304854
    Best:: JoinMethod: Hash
    Cost: 6.56 Degree: 1 Resp: 6.56 Card: 1.00 Bytes: 1412
    Now joining: DWH_IND_CA_MARGE[DWH_IND_CA_MARGE]#2
    NL Join
    Outer table: Card: 1.00 Cost: 6.56 Resp: 6.56 Degree: 1 Bytes: 1412
    Inner table: DWH_IND_CA_MARGE Alias: DWH_IND_CA_MARGE
    Access Path: TableScan
    NL Join: Cost: 4017.38 Resp: 4017.38 Degree: 1
    Cost_io: 3716.00 Cost_cpu: 3922124065
    Resp_io: 3716.00 Resp_cpu: 3922124065
    Access Path: index (RangeScan)
    Index: IDX_DWH_IND_CA_MARGE_2
    resc_io: 329255.00 resc_cpu: 4355303457
    ix_sel: 0.0089286 ix_sel_with_filters: 0.0089286
    NL Join: Cost: 329596.23 Resp: 329596.23 Degree: 1
    Cost_io: 329261.00 Cost_cpu: 4362608310
    Resp_io: 329261.00 Resp_cpu: 4362608310
    Access Path: index (AllEqJoinGuess)
    Index: IDX_DWH_IND_CA_MARGE_5
    resc_io: 98230.00 resc_cpu: 2748127704
    ix_sel: 0.0089286 ix_sel_with_filters: 0.0089286
    NL Join: Cost: 98447.73 Resp: 98447.73 Degree: 1
    Cost_io: 98236.00 Cost_cpu: 2755432557
    Resp_io: 98236.00 Resp_cpu: 2755432557
    ****** trying bitmap/domain indexes ******
    ****** finished trying bitmap/domain indexes ******
    Best NL cost: 4017.38
    resc: 4017.38 resc_io: 3716.00 resc_cpu: 3922124065
    resp: 4017.38 resp_io: 3716.00 resp_cpu: 3922124065
    Join Card: 17090.67 = outer (1.00) * inner (1907306.66) * sel (0.0089286)
    Join Card - Rounded: 17091 Computed: 17090.67
    SM Join
    Outer table:
    resc: 6.56 card 1.00 bytes: 1412 deg: 1 resp: 6.56
    Inner table: DWH_IND_CA_MARGE Alias: DWH_IND_CA_MARGE
    resc: 4014.54 card: 1907306.66 bytes: 452 deg: 1 resp: 4014.54
    using dmeth: 2 #groups: 1
    SORT resource Sort statistics
    Sort width: 598 Area size: 1048576 Max Area size: 104857600
    Degree: 1
    Blocks to Sort: 1 Row size: 1564 Total Rows: 1
    Initial runs: 1 Merge passes: 0 IO Cost / pass: 0
    Total IO sort cost: 0 Total CPU sort cost: 13013721
    Total Temp space used: 0
    SORT resource Sort statistics
    Sort width: 598 Area size: 1048576 Max Area size: 104857600
    Degree: 1
    Blocks to Sort: 118623 Row size: 508 Total Rows: 1907307
    Initial runs: 10 Merge passes: 1 IO Cost / pass: 42378
    Total IO sort cost: 161001 Total CPU sort cost: 4727050693
    Total Temp space used: 2604131000
    SM join: Resc: 165386.34 Resp: 165386.34 [multiMatchCost=0.00]
    SM cost: 165386.34
    resc: 165386.34 resc_io: 164717.00 resc_cpu: 8710618919
    resp: 165386.34 resp_io: 164717.00 resp_cpu: 8710618919
    HA Join
    Outer table:
    resc: 6.56 card 1.00 bytes: 1412 deg: 1 resp: 6.56
    Inner table: DWH_IND_CA_MARGE Alias: DWH_IND_CA_MARGE
    resc: 4014.54 card: 1907306.66 bytes: 452 deg: 1 resp: 4014.54
    using dmeth: 2 #groups: 1
    Cost per ptn: 15.16 #ptns: 1
    hash_area: 256 (max=25600) buildfrag: 1 probefrag: 108032 ppasses: 1
    Hash join: Resc: 4036.26 Resp: 4036.26 [multiMatchCost=0.00]
    HA cost: 4036.26
    resc: 4036.26 resc_io: 3716.00 resc_cpu: 4167792216
    resp: 4036.26 resp_io: 3716.00 resp_cpu: 4167792216
    Best:: JoinMethod: Hash
    Cost: 4036.26 Degree: 1 Resp: 4036.26 Card: 17090.67 Bytes: 1864
    Best so far: Table#: 0 cost: 3.0022 card: 1.0000 bytes: 706
    Table#: 1 cost: 6.5613 card: 1.0036 bytes: 1412
    Table#: 2 cost: 4036.2614 card: 17090.6711 bytes: 31857624
    Join order[2]: DWH_AG[COM]#0 DWH_IND_CA_MARGE[DWH_IND_CA_MARGE]#2 DWH_AG[AG]#1
    Now joining: DWH_IND_CA_MARGE[DWH_IND_CA_MARGE]#2
    NL Join
    Outer table: Card: 1.00 Cost: 3.00 Resp: 3.00 Degree: 1 Bytes: 706
    Inner table: DWH_IND_CA_MARGE Alias: DWH_IND_CA_MARGE
    Access Path: TableScan
    NL Join: Cost: 4017.55 Resp: 4017.55 Degree: 1
    Cost_io: 3713.00 Cost_cpu: 3963277916
    Resp_io: 3713.00 Resp_cpu: 3963277916
    Best NL cost:
    .55
    resc: 4017.55 resc_io: 3713.00 resc_cpu: 3963277916
    resp: 4017.55 resp_io: 3713.00 resp_cpu: 3963277916
    Join Card: 1907306.66 = outer (1.00) * inner (1907306.66) * sel (1)
    Join Card - Rounded: 1907307 Computed: 1907306.66
    Best:: JoinMethod: NestedLoop
    Cost: 4017.55 Degree: 1 Resp: 4017.55 Card: 1907306.66 Bytes: 1158
    Now joining: DWH_AG[AG]#1
    NL Join
    Outer table: Card: 1907306.66 Cost: 4017.55 Resp: 4017.55 Degree: 1 Bytes: 1158
    Inner table: DWH_AG Alias: AG
    Access Path: TableScan
    NL Join: Cost: 3148354.25 Resp: 3148354.25 Degree: 1
    Cost_io: 3043540.00 Cost_cpu: 1364023464708
    Resp_io: 3043540.00 Resp_cpu: 1364023464708
    Access Path: index (UniqueScan)
    Index: PK_DWH_AG
    resc_io: 1.00 resc_cpu: 10031
    ix_sel: 0.0017699 ix_sel_with_filters: 0.0017699
    NL Join: Cost: 874409.56 Resp: 874409.56 Degree: 1
    Cost_io: 873283.21 Cost_cpu: 14658019216
    Resp_io: 873283.21 Resp_cpu: 14658019216
    Access Path: index (AllEqUnique)
    Index: PK_DWH_AG
    resc_io: 1.00 resc_cpu: 10031
    ix_sel: 0.0089286 ix_sel_with_filters: 0.0089286
    NL Join: Cost: 874409.56 Resp: 874409.56 Degree: 1
    Cost_io: 873283.21 Cost_cpu: 14658019216
    Resp_io: 873283.21 Resp_cpu: 14658019216
    Best NL cost: 874409.56
    resc: 874409.56 resc_io: 873283.21 resc_cpu: 14658019216
    resp: 874409.56 resp_io: 873283.21 resp_cpu: 14658019216
    Join Card: 17090.67 = outer (1907306.66) * inner (565.00) * sel (1.5860e-05)
    Join Card - Rounded: 17091 Computed: 17090.67
    SM Join
    Outer table:
    resc: 4017.55 card 1907306.66 bytes: 1158 deg: 1 resp: 4017.55
    Inner table: DWH_AG Alias: AG
    resc: 3.05 card: 565.00 bytes: 706 deg: 1 resp: 3.05
    using dmeth: 2 #groups: 1
    SORT resource Sort statistics
    Sort width: 598 Area size: 1048576 Max Area size: 104857600
    Degree: 1
    Blocks to Sort: 299827 Row size: 1284 Total Rows: 1907307
    Initial runs: 24 Merge passes: 1 IO Cost / pass: 107112
    Total IO sort cost: 406939 Total CPU sort cost: 9189380397
    Total Temp space used: 5208237000
    SORT resource Sort statistics
    Sort width: 598 Area size: 1048576 Max Area size: 104857600
    Degree: 1
    Blocks to Sort: 55 Row size: 787 Total Rows: 565
    Initial runs: 1 Merge passes: 0 IO Cost / pass: 0
    Total IO sort cost: 0 Total CPU sort cost: 13246441
    Total Temp space used: 0
    SM join: Resc: 411666.75 Resp: 411666.75 [multiMatchCost=0.00]
    SM cost: 411666.75
    resc: 411666.75 resc_io: 410655.00 resc_cpu: 13166617832
    resp: 411666.75 resp_io: 410655.00 resp_cpu: 13166617832
    HA Join
    Outer table:
    resc: 4017.55 card 1907306.66 bytes: 1158 deg: 1 resp: 4017.55
    Inner table: DWH_AG Alias: AG
    resc: 3.05 card: 565.00 bytes: 706 deg: 1 resp: 3.05
    using dmeth: 2 #groups: 1
    Cost per ptn: 50003.38 #ptns: 1
    hash_area: 256 (max=25600) buildfrag: 272406 probefrag: 50 ppasses: 1
    Hash join: Resc: 54024.11 Resp: 54024.11 [multiMatchCost=0.13]
    HA Join (swap)
    Outer table:
    resc: 3.05 card 565.00 bytes: 706 deg: 1 resp: 3.05
    Inner table: DWH_IND_CA_MARGE Alias: DWH_IND_CA_MARGE
    resc: 4017.55 card: 1907306.66 bytes: 1158 deg: 1 resp: 4017.55
    using dmeth: 2 #groups: 1
    Cost per ptn: 15.16 #ptns: 1
    hash_area: 256 (max=25600) buildfrag: 50 probefrag: 272406 ppasses: 1
    Hash join: Resc: 4035.76 Resp: 4035.76 [multiMatchCost=0.00]
    HA cost: 4035.76
    resc: 4035.76 resc_io: 3716.00 resc_cpu: 4161313305
    resp: 4035.76 resp_io: 3716.00 resp_cpu: 4161313305
    Best:: JoinMethod: Hash
    Cost: 4035.76 Degree: 1 Resp: 4035.76 Card: 17090.67 Bytes: 1864
    Best so far: Table#: 0 cost: 3.0022 card: 1.0000 bytes: 706
    Table#: 2 cost: 4017.5461 card: 1907306.6603 bytes: 2208661506
    Table#: 1 cost: 4035.7635 card: 17090.6711 bytes: 31857624
    Join order[3]: DWH_AG[AG]#1 DWH_AG[COM]#0 DWH_IND_CA_MARGE[DWH_IND_CA_MARGE]#2
    Now joining: DWH_AG[COM]#0
    NL Join
    Outer table: Card: 565.00 Cost: 3.05 Resp: 3.05 Degree: 1 Bytes: 706
    Inner table: DWH_AG Alias: COM
    Access Path: TableScan
    NL Join: Cost: 918.14 Resp: 918.14 Degree: 1
    Cost_io: 905.00 Cost_cpu: 171009051
    Resp_io: 905.00 Resp_cpu: 171009051
    Access Path: index (UniqueScan)
    Index: PK_DWH_AG
    resc_io: 1.00 resc_cpu: 10081
    ix_sel: 0.0017699 ix_sel_with_filters: 0.0017699
    NL Join: Cost: 568.49 Resp: 568.49 Degree: 1
    Cost_io: 568.00 Cost_cpu: 6409092
    Resp_io: 568.00 Resp_cpu: 6409092
    Access Path: index (AllEqJoin)
    Index: IDX_DWH_AG_1
    resc_io: 3.00 resc_cpu: 28264
    ix_sel: 0.0017699 ix_sel_with_filters: 0.0017699
    NL Join: Cost: 1699.28 Resp: 1699.28 Degree: 1
    Cost_io: 1698.00 Cost_cpu: 16682420
    Resp_io: 1698.00 Resp_cpu: 16682420
    Access Path: index (AllEqUnique)
    Index: PK_DWH_AG
    resc_io: 1.00 resc_cpu: 10081
    ix_sel: 0.0017699 ix_sel_with_filters: 0.0017699
    NL Join: Cost: 568.49 Resp: 568.49 Degree: 1
    Cost_io: 568.00 Cost_cpu: 6409092
    Resp_io: 568.00 Resp_cpu: 6409092
    ****** trying bitmap/domain indexes ******
    Access Path: index (AllEqJoin)
    Index: IDX_DWH_AG_1
    resc_io: 1.00 resc_cpu: 8971
    ix_sel: 0.0017699 ix_sel_with_filters: 0.0017699
    NL Join: Cost: 568.44 Resp: 568.44 Degree: 1
    Cost_io: 568.00 Cost_cpu: 5781942
    Resp_io: 568.00 Resp_cpu: 5781942
    Access Path: index (AllEqUnique)
    Index: PK_DWH_AG
    resc_io: 0.00 resc_cpu: 1900
    ix_sel: 0.0017699 ix_sel_with_filters: 0.0017699
    NL Join: Cost: 3.14 Resp: 3.14 Degree: 1
    Cost_io: 3.00 Cost_cpu: 1786579
    Resp_io: 3.00 Resp_cpu: 1786579
    Access path: Bitmap index - rejected
    Cost: 577.49 Cost_io: 576.81 Cost_cpu: 8873906 Sel: 1.7763e-05
    Not believed to be index-only
    ****** finished trying bitmap/domain indexes ******
    Best NL cost: 568.49
    resc: 568.49 resc_io: 568.00 resc_cpu: 6409092
    resp: 568.49 resp_io: 568.00 resp_cpu: 6409092
    Join Card: 1.00 = outer (565.00) * inner (1.00) * sel (0.0017763)
    Join Card - Rounded: 1 Computed: 1.00
    SM Join
    Outer table:
    resc: 3.05 card 565.00 bytes: 706 deg: 1 resp: 3.05
    Inner table: DWH_AG Alias: COM
    resc: 3.00 card: 1.00 bytes: 706 deg: 1 resp: 3.00
    using dmeth: 2 #groups: 1
    SORT resource Sort statistics
    Sort width: 598 Area size: 1048576 Max Area size: 104857600
    Degree: 1
    Blocks to Sort: 55 Row size: 787 Total Rows: 565
    Initial runs: 1 Merge passes: 0 IO Cost / pass: 0
    Total IO sort cost: 0 Total CPU sort cost: 13246441
    Total Temp space used: 0
    SORT resource Sort statistics
    Sort width: 598 Area size: 1048576 Max Area size: 104857600
    Degree: 1
    Blocks to Sort: 1 Row size: 787 Total Rows: 1
    Initial runs: 1 Merge passes: 0 IO Cost / pass: 0
    Total IO sort cost: 0 Total CPU sort cost: 13013721
    Total Temp space used: 0
    SM join: Resc: 8.07 Resp: 8.07 [multiMatchCost=0.00]
    SM cost: 8.07
    resc: 8.07 resc_io: 6.00 resc_cpu: 27001505
    resp: 8.07 resp_io: 6.00 resp_cpu: 27001505
    HA Join
    Outer table:
    resc: 3.05 card 565.00 bytes: 706 deg: 1 resp: 3.05
    Inner table: DWH_AG Alias: COM
    resc: 3.00 card: 1.00 bytes: 706 deg: 1 resp: 3.00
    using dmeth: 2 #groups: 1
    Cost per ptn: 0.51 #ptns: 1
    hash_area: 256 (max=25600) buildfrag: 50 probefrag: 1 ppasses: 1
    Hash join: Resc: 6.56 Resp: 6.56 [multiMatchCost=0.00]
    HA Join (swap)
    Outer table:
    resc: 3.00 card 1.00 bytes: 706 deg: 1 resp: 3.00
    Inner table: DWH_AG Alias: AG
    resc: 3.05 card: 565.00 bytes: 706 deg: 1 resp: 3.05
    using dmeth: 2 #groups: 1
    Cost per ptn: 0.50 #ptns: 1
    hash_area: 256 (max=25600) buildfrag: 1 probefrag: 50 ppasses: 1
    Hash join: Resc: 6.56 Resp: 6.56 [multiMatchCost=0.00]
    HA cost: 6.56
    resc: 6.56 resc_io: 6.00 resc_cpu: 7304854
    resp: 6.56 resp_io: 6.00 resp_cpu: 7304854
    Best:: JoinMethod: Hash
    Cost: 6.56 Degree: 1 Resp: 6.56 Card: 1.00 Bytes: 1412
    Now joining: DWH_IND_CA_MARGE[DWH_IND_CA_MARGE]#2
    NL Join
    Outer table: Card: 1.00 Cost: 6.56 Resp: 6.56 Degree: 1 Bytes: 1412
    Inner table: DWH_IND_CA_MARGE Alias: DWH_IND_CA_MARGE
    Access Path: TableScan
    NL Join: Cost: 4017.38 Resp: 4017.38 Degree: 1
    Cost_io: 3716.00 Cost_cpu: 3922124065
    Resp_io: 3716.00 Resp_cpu: 3922124065
    Access Path: index (RangeScan)
    Index: IDX_DWH_IND_CA_MARGE_2
    resc_io: 329255.00 resc_cpu: 4355303457
    ix_sel: 0.0089286 ix_sel_with_filters: 0.0089286
    NL Join: Cost: 329596.23 Resp: 329596.23 Degree: 1
    Cost_io: 329261.00 Cost_cpu: 4362608310
    Resp_io: 329261.00 Resp_cpu: 4362608310
    Access Path: index (AllEqJoinGuess)
    Index: IDX_DWH_IND_CA_MARGE_5
    resc_io: 98230.00 resc_cpu: 2748127704
    ix_sel: 0.0089286 ix_sel_with_filters: 0.0089286
    NL Join: Cost: 98447.73 Resp: 98447.73 Degree: 1
    Cost_io: 98236.00 Cost_cpu: 2755432557
    Resp_io: 98236.00 Resp_cpu: 2755432557
    ****** trying bitmap/domain indexes ******
    ****** finished trying bitmap/domain indexes ******
    Best NL cost: 4017.38
    resc: 4017.38 resc_io: 3716.00 resc_cpu: 3922124065
    resp: 4017.38 resp_io: 3716.00 resp_cpu: 3922124065
    Join Card: 17090.67 = outer (1.00) * inner (1907306.66) * sel (0.0089286)
    Join Card - Rounded: 17091 Computed: 17090.67
    SM Join
    Outer table:
    resc: 6.56 card 1.00 bytes: 1412 deg: 1 resp: 6.56
    Inner table: DWH_IND_CA_MARGE Alias: DWH_IND_CA_MARGE
    resc: 4014.54 card: 1907306.66 bytes: 452 deg: 1 resp: 4014.54
    using dmeth: 2 #groups: 1
    SORT resource Sort statistics
    Sort width: 598 Area size: 1048576 Max Area size: 104857600
    Degree: 1
    Blocks to Sort: 1 Row size: 1564 Total Rows: 1
    Initial runs: 1 Merge passes: 0 IO Cost / pass: 0
    Total IO sort cost: 0 Total CPU sort cost: 13013721
    Total Temp space used: 0
    SORT resource Sort statistics
    Sort width: 598 Area size: 1048576 Max Area size: 104857600
    Degree: 1
    Blocks to Sort: 118623 Row size: 508 Total Rows: 1907307
    Initial runs: 10 Merge passes: 1 IO Cost / pass: 42378
    Total IO sort cost: 161001 Total CPU sort cost: 4727050693
    Total Temp space used: 2604131000
    SM join: Resc: 165386.34 Resp: 165386.34 [multiMatchCost=0.00]
    SM cost: 165386.34
    resc: 165386.34 resc_io: 164717.00 resc_cpu: 8710618919
    resp: 165386.34 resp_io: 164717.00 resp_cpu: 8710618919
    HA Join
    Outer table:
    resc: 6.56 card 1.00 bytes: 1412 deg: 1 resp: 6.56
    Inner table: DWH_IND_CA_MARGE Alias: DWH_IND_CA_MARGE
    resc: 4014.54 card: 1907306.66 bytes: 452 deg: 1 resp: 4014.54
    using dmeth: 2 #groups: 1
    Cost per ptn: 15.16 #ptns: 1
    hash_area: 256 (max=25600) buildfrag: 1 probefrag: 108032 ppasses: 1
    Hash join: Resc: 4036.26 Resp: 4036.26 [multiMatchCost=0.00]
    HA cost: 4036.26
    resc: 4036.26 resc_io: 3716.00 resc_cpu: 4167792216
    resp: 4036.26 resp_io: 3716.00 resp_cpu: 4167792216
    Join order aborted: cost > best plan cost
    Join order[4]: DWH_AG[AG]#1 DWH_IND_CA_MARGE[DWH_IND_CA_MARGE]#2 DWH_AG[COM]#0
    Now joining: DWH_IND_CA_MARGE[DWH_IND_CA_MARGE]#2
    **************

  • Create list-range partition table

    Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    I am trying to create a partition table with LIST-Range, and I am getting this following error, is oracle 10.2.0.4 database supports to create list-range partition(composite)
    SQL> CREATE TABLE tbp_list_range
    REPORT_DATE DATE,
    member_id_01 varchar2(2),
    DATE_SERVICE date,
    member_id varchar2(15)
    PARTITION BY LIST(member_id_01)
    SUBPARTITION BY RANGE (DATE_SERVICE)
    PARTITION SPTYR04M01_C VALUES('AA','aa')
    NOLOGGING
    COMPRESS (
    SUBPARTITION PTYR12M011 VALUES LESS THAN (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION PTYR12M021 VALUES LESS THAN (TO_DATE(' 2012-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION recent1 VALUES LESS THAN (MAXVALUE)
    PARTITION SPTYR04M01_Yo VALUES('BJ','bj')
    NOLOGGING
    COMPRESS (
    SUBPARTITION PTYR12M01 VALUES LESS THAN (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION PTYR12M02 VALUES LESS THAN (TO_DATE(' 2012-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION recent2 VALUES LESS THAN (MAXVALUE)
    SUBPARTITION BY RANGE (DATE_SERVICE)
    ERROR at line 9:
    ORA-00922: missing or invalid option
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    Any help would be greatly appreciated.
    Thanks,

    any possible work around for this scenario on 10.2.0.4
    --thanks                                                                                                                                                                                               

  • Create local spatial index on range sub-partitions?

    Is is possible to create a local spatial index on a table with range sub-partitions? We're trying to do this on a table that contains lots of x,y,z point data.
    Trying to do so gives me the error: ORA-29846: cannot create a local domain index on a composite partitioned tableAccording to the spatial documentation:The following restrictions apply to spatial index partitioning:
    - The partition key for spatial tables must be a scalar value, and must not be a spatial column.
    - Only range partitioning is supported on the underlying table. All other kinds of partitioning are not currently
    supported for partitioned spatial indexes.So there is nothing saying it can or can't be done. The examples I've seen in the documentation tend to partition based on a single value and don't use subpartitioning.
    Example of what we're trying to do:SQL> SELECT * FROM V$VERSION;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for 64-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    SQL>
    SQL> --- Create a table, partioned by X and subpartitioned by Y
    SQL> CREATE TABLE sub_partition_test
      2  (
      3      x               NUMBER,
      4      y               NUMBER,
      5      z               NUMBER,
      6      geometry        MDSYS.SDO_GEOMETRY
      7  )
      8  PARTITION BY RANGE (x)
      9  SUBPARTITION BY RANGE (y)
    10     (
    11     PARTITION p_x100 VALUES LESS THAN (100)
    12     (
    13                     SUBPARTITION sp_x100_y100 VALUES LESS THAN (100),
    14                     SUBPARTITION sp_x100_y200 VALUES LESS THAN (200),
    15                     SUBPARTITION sp_x100_yMAXVALUE VALUES LESS THAN (MAXVALUE)
    16     ),
    17     PARTITION p_x200 VALUES LESS THAN (200)
    18     (
    19                     SUBPARTITION sp_x200_y100 VALUES LESS THAN (100),
    20                     SUBPARTITION sp_x200_y200 VALUES LESS THAN (200),
    21                     SUBPARTITION sp_x200_yMAXVALUE VALUES LESS THAN (MAXVALUE)
    22     ),
    23     PARTITION p_xMAXVALUE VALUES LESS THAN (MAXVALUE)
    24     (
    25                     SUBPARTITION sp_xMAXVALUE_y100 VALUES LESS THAN (100),
    26                     SUBPARTITION sp_xMAXVALUE_y200 VALUES LESS THAN (200),
    27                     SUBPARTITION sp_xMAXVALUE_yMAXVALUE VALUES LESS THAN (MAXVALUE)
    28     )
    29  );
    Table created.
    SQL>
    SQL> -- Insert some sample data
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (1, 1, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(1, 1, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (50, 150, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(50, 150, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (150, 150, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(150, 150, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (150, 250, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(150, 250, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (150, 300, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(150, 300, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (220, 210, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(220, 210, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (220, 150, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(220, 150, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (220, 250, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(220, 250, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (220, 300, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(220, 300, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (320, 250, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(320, 250, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (320, 160, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(320, 160, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (320, 290, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(320, 290, 50), NULL, NULL));
    1 row created.
    SQL> INSERT INTO sub_partition_test (x, y, z, geometry)
      2  VALUES (320, 320, 50, SDO_GEOMETRY(3001, 2157, SDO_POINT_TYPE(320, 320, 50), NULL, NULL));
    1 row created.
    SQL>
    SQL> -- Create some metadata
    SQL> DELETE FROM user_sdo_geom_metadata WHERE TABLE_NAME = 'SUB_PARTITION_TEST';
    1 row deleted.
    SQL> INSERT INTO user_sdo_geom_metadata VALUES ('SUB_PARTITION_TEST','GEOMETRY',
      2  SDO_DIM_ARRAY(
      3     SDO_DIM_ELEMENT('X', 0, 1000, 0.005),
      4     SDO_DIM_ELEMENT('Y', 0, 1000, 0.005)
      5  ), 262152);
    1 row created.
    SQL>
    SQL> -- Create an Unusable Local Spatial Index
    SQL> CREATE INDEX sub_partition_test_spidx ON sub_partition_test (geometry)
      2    INDEXTYPE IS MDSYS.SPATIAL_INDEX
      3  LOCAL
      4  UNUSABLE;
    CREATE INDEX sub_partition_test_spidx ON sub_partition_test (geometry)
    ERROR at line 1:
    ORA-29846: cannot create a local domain index on a composite partitioned tableThanks,
    John

    Ok, thanks. That's what we're planning on doing now.
    SQL> CREATE TABLE partition_test
      2  (
      3      x               NUMBER,
      4      y               NUMBER,
      5      z               NUMBER,
      6      geometry        MDSYS.SDO_GEOMETRY
      7  )
      8  PARTITION BY RANGE (x, y)
      9     (
    10     PARTITION p_x100y100 VALUES LESS THAN (100, 100),
    11     PARTITION p_x100y200 VALUES LESS THAN (100, 200),
    12     PARTITION p_x100yMAX VALUES LESS THAN (100, MAXVALUE),
    13     PARTITION p_x200y100 VALUES LESS THAN (200, 100),
    14     PARTITION p_x200y200 VALUES LESS THAN (200, 200),
    15     PARTITION p_x200yMAX VALUES LESS THAN (200, MAXVALUE),
    16     PARTITION p_x300y100 VALUES LESS THAN (300, 100),
    17     PARTITION p_x300y200 VALUES LESS THAN (300, 200),
    18     PARTITION p_x300yMAX VALUES LESS THAN (MAXVALUE, MAXVALUE)
    19  );
    Table created.
    SQL>
    SQL> INSERT INTO user_sdo_geom_metadata VALUES ('PARTITION_TEST','GEOMETRY',
      2     SDO_DIM_ARRAY(
      3        SDO_DIM_ELEMENT('X', 0, 1000, 0.005),
      4        SDO_DIM_ELEMENT('Y', 0, 1000, 0.005)
      5     ), 262152);
    1 row created.
    SQL> CREATE INDEX partition_test_spidx ON partition_test (geometry)
      2     INDEXTYPE IS MDSYS.SPATIAL_INDEX
      3  LOCAL
      4  UNUSABLE;
    Index created.

  • Will Hash Subpartition be out-dated in the era of Exadata?

    PARTITION BY RANGE(SALES_DAY) SUBPARTITION BY HASH(PRODUCT_ID) was a pretty common way to organize the fact tables in ORACLE.
    Since Exadata automatically distributes data across Storage Server based on 4MB block size, do we still need to subpartition table based on hash value of a high cardinality column? Will partition-wise join be offloaded to storage server without hash subpartition? Please advise and explain.
    Another question: Since both PARTITION BY HASH and SUBPARTITION BY HASH are based ORA_HASH() or the same algorithm as ORA_HASH(), what kind of hash function does Exadata use?
    Thanks.

    :-) Greg, we do need to specify the column or columns which are used to distribute the rows, but this does not have to be part of the partitioning structure. To illustrate, let's see a piece of Teradata DDL:
    PRIMARY INDEX PI_MY_BIG_SALES ( ORDER_ID )
    PARTITION BY (
        RANGE_N(WEBSITE_ID BETWEEN
            1 AND 12 EACH 1),
    CASE_N(IS_OPEN = ‘N’, IS_OPEN = ‘Y’)
    RANGE_N(ORDER_DATE BETWEEN
            DATE '2009-01-01' and DATE '2010-11-30' each interval '1' month,
            DATE '2009-12-01' and DATE '2011-01-31' each interval '1' day,
            NO RANGE
    RANGE_N(PRODUCT_ID BETWEEN
            1 and 99 each 1,
            1000 and 3000 each 100,
            4800 and 4800 each 1,
            5000 and 9999 each 500,
            30000 and 40000 each 1000,
            91900 and 92000 each 100,
            NO RANGE)
    RANGE_N(CATEGORY_ID BETWEEN
            1 and 100 each 10,
            101 and 1000 each 100,
            NO RANGE)
    )If the equivalent of row distribution is handled by ASM, then we can have one more level of partitioning structure to specify in the DDL. Currently, if I need to use HASH partition/subpartition, the only choice is to specify a very complex multi-level RANGE BY(WEBSITE_ID, ORDER_DATE, IS_OPEN, PRODUCT_ID, CATEGORY_ID) SUBPARTITION BY HASH(ORDER_ID) partition clause, instead of a simpler RANGE BY(WEBSITE_ID, ORDER_DATE) SUBPARTITION BY RANGE(IS_OPEN, PRODUCT_ID, CATEGORY_ID).
    Look forward to more powerful DW features and easier syntax in the future Exadata as well.

  • Subpartitions NUM_ROWS not displaying

    i have created the table as
    create table range2 (roll number, age number) partition by range (roll) subpartition by range(age) (partition p1 values less than (100) (subpartition p1sp1 values less than (30), subpartition p1sp2 values less than (60), subpartition p1sp3 values less than (90), subpartition p1sp4 values less than (maxvalue)), partition p2 values less than (200) (subpartition p2sp1 values less than (30), subpartition p2sp2 values less than (60), subpartition p2sp3 values less than (90),subpartition p2sp4 values less than (maxvalue)));
    insert into range2 select rownum,rownum from dual connect by level < 1000;
    commit;
    exec dbms_stats.gather_table_stats('VISHNU','RANGE2');
    select table_name,partition_name,num_rows from user_tab_partitions where table_name='RANGE2';
    TABLE_NAME PARTITION_NAME NUM_ROWS
    RANGE2 P2 100
    RANGE2 P1 99
    RANGE2 P3 800
    select table_name,partition_name,subpartition_name,num_rows from user_tab_subpartitions where table_name='RANGE2';
    TABLE_NAME PARTITION_NAME 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 from DBA_TAB_SUBPARTITIONS it doesn't.. am i missing some thing here...
    Thanks,
    Vishnu P

    You need to specify GRANULARITY parameter:
    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.

  • Composite range - range partitioning gives ORA-14202

    i am trying to do e composite range - range partitioning, but the table is not created. i get an error, which i cannot look up at ora-codes, it says : value is to high for subpartition, which confuses me...
    CREATE TABLE "NJ_VE_AERIAL_RDT"
    (     "RASTERID" NUMBER NOT NULL ENABLE,
    "BANDBLOCKNUMBER" NUMBER NOT NULL ENABLE,
         "PYRAMIDLEVEL" NUMBER NOT NULL ENABLE,
         "ROWBLOCKNUMBER" NUMBER NOT NULL ENABLE,
         "COLUMNBLOCKNUMBER" NUMBER NOT NULL ENABLE,
         "FILENAME" VARCHAR2(100 CHAR) NOT NULL ENABLE,
         "FILESIZE" NUMBER(12,0) NOT NULL ENABLE,
         "NORTH" NUMBER(19,15) NOT NULL ENABLE,
         "SOUTH" NUMBER(19,15) NOT NULL ENABLE,
         "EAST" NUMBER(19,15) NOT NULL ENABLE,
         "WEST" NUMBER(19,15) NOT NULL ENABLE,
         "BLOCKMBR" "MDSYS"."SDO_GEOMETRY" ,
         "RASTERBLOCK" BLOB,
         "INFO_CREATOR" VARCHAR2(100 BYTE) DEFAULT 'novalue' NOT NULL ENABLE,
         "INFO_CREATED" TIMESTAMP (6) WITH LOCAL TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL ENABLE,
         "INFO_LASTMODIFIER" VARCHAR2(100 CHAR) DEFAULT 'novalue' NOT NULL ENABLE,
         "INFO_LASTMODIEFIER" TIMESTAMP (6) WITH LOCAL TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL ENABLE,
         CONSTRAINT "NJ_VE_RDT_PK" PRIMARY KEY
    ("RASTERID"
    ,"BANDBLOCKNUMBER"
    ,"PYRAMIDLEVEL"
    ,"ROWBLOCKNUMBER"
    ,"COLUMNBLOCKNUMBER"))
    PARTITION BY RANGE (WEST) INTERVAL (1)
    SUBPARTION BY RANGE (NORTH)
    SUBPARTITION TMEPLATE (
    SUBPARTITION s0 VALUES LESS THAN (15)
    ,SUBPARTITION s0 VALUES LESS THAN (5)
    (PARTITION p0 VALUES LESS THAN (0));
    What is my problem ? My current solution is fully dropping subpartitioning. but thats a cheesy workaround...
    ingo
    Message was edited by:
    Ingo Jannick

    achso ?!
    this works, but even switching the subpartition definitions results in the mentioned error. adding another sub does the same.
    my guess is that it is a range by interval issue. i have to figure that out...
    Working:
    CREATE TABLE "NJ_VEL_RDT"
    (     "RASTERID" NUMBER NOT NULL ENABLE,
    "BANDBLOCKNUMBER" NUMBER NOT NULL ENABLE,
         "PYRAMIDLEVEL" NUMBER NOT NULL ENABLE,
         "ROWBLOCKNUMBER" NUMBER NOT NULL ENABLE,
         "COLUMNBLOCKNUMBER" NUMBER NOT NULL ENABLE,
         "FILENAME" VARCHAR2(100 CHAR) NOT NULL ENABLE,
         "FILESIZE" NUMBER(12,0) NOT NULL ENABLE,
         "NORTH" NUMBER(19,15) NOT NULL ENABLE,
         "SOUTH" NUMBER(19,15) NOT NULL ENABLE,
         "EAST" NUMBER(19,15) NOT NULL ENABLE,
         "WEST" NUMBER(19,15) NOT NULL ENABLE,
         "BLOCKMBR" "MDSYS"."SDO_GEOMETRY" ,
         "RASTERBLOCK" BLOB,
         "INFO_CREATOR" VARCHAR2(100 BYTE) DEFAULT 'novalue' NOT NULL ENABLE,
         "INFO_CREATED" TIMESTAMP (6) WITH LOCAL TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL ENABLE,
         "INFO_LASTMODIFIER" VARCHAR2(100 CHAR) DEFAULT 'novalue' NOT NULL ENABLE,
         "INFO_LASTMODIEFIER" TIMESTAMP (6) WITH LOCAL TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL ENABLE,
         CONSTRAINT "NJ_VE_PK" PRIMARY KEY
    ( "RASTERID",
    "BANDBLOCKNUMBER",
    "PYRAMIDLEVEL",
    "ROWBLOCKNUMBER",
    "COLUMNBLOCKNUMBER"))
    PARTITION BY RANGE(WEST) INTERVAL (5)
    SUBPARTITION BY RANGE(NORTH)
    SUBPARTITION TEMPLATE
    SUBPARTITION s1 VALUES LESS THAN (65)
    ,SUBPARTITION s0 VALUES LESS THAN (MAXVALUE)
    (PARTITION p0 VALUES LESS THAN (15))
    ;

  • Subpartition rollover

    Hello,
    Can someone please tell me what are the commands to add subpartitions to this table:
    PARTITION BY LIST (DB_ACTN)
    SUBPARTITION BY RANGE (ROW_EFF_DT)
    CREATE TABLE GSDBA.t1
    (c1 DATE,
    c2 INTEGER,
    c3 CHAR(1),
    c4 CHAR(1)
    PARTITION BY LIST (c3)
    SUBPARTITION BY RANGE (c1)
    SUBPARTITION TEMPLATE
    (SUBPARTITION OCT_31_2010 VALUES LESS THAN (TO_DATE(' 2010-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION NOV_01_2010 VALUES LESS THAN (TO_DATE(' 2010-11-02 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION NOV_02_2010 VALUES LESS THAN (TO_DATE(' 2010-11-03 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION FUTURE VALUES LESS THAN (MAXVALUE)
    PARTITION R VALUES ('R')
    ( SUBPARTITION R_OCT_31_2010 VALUES LESS THAN (TO_DATE(' 2010-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION R_NOV_01_2010 VALUES LESS THAN (TO_DATE(' 2010-11-02 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION R_NOV_02_2010 VALUES LESS THAN (TO_DATE(' 2010-11-03 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION R_FUTURE VALUES LESS THAN (MAXVALUE) ),
    PARTITION P VALUES ('P')
    ( SUBPARTITION P_OCT_31_2010 VALUES LESS THAN (TO_DATE(' 2010-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION P_NOV_01_2010 VALUES LESS THAN (TO_DATE(' 2010-11-02 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION P_NOV_02_2010 VALUES LESS THAN (TO_DATE(' 2010-11-03 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    SUBPARTITION P_FUTURE VALUES LESS THAN (MAXVALUE) ))
    I need for example to add a nov 3rd and drop oct31 for all the partitions. Do I have to add them to each partition or can I execute the commands at the table level?
    Thank you,

    K, I found it...
    alter table t1 split subpartition P_NOV_02_2010 AT (TO_DATE(' 2010-11-02 12:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    INTO
    (subpartition P_NOV_02_2010, subpartition P_NOV1_02_2010);

  • Problem creating LOB segment

    Hi all,
    I'm working with 11gR2 version in RAC environment with 2 nodes. I'm creating the schemes on my new database with empty tablespaces and 100Mb of initial free space. I'm having an error on the creation of this table:
    CREATE TABLE "IODBODB1"."DOCUMENTOS"
    (     "ID_DOC" NUMBER NOT NULL ENABLE,
         "ID_APP" NUMBER(5,0) NOT NULL ENABLE,
         "ID_CLS" NUMBER(6,0) NOT NULL ENABLE,
         "CREATE_FEC" DATE NOT NULL ENABLE,
         "LAST_MODIFIED_FEC" DATE NOT NULL ENABLE,
         "DOC_NAME" VARCHAR2(100 BYTE) NOT NULL ENABLE,
         "DOC_SIZE" NUMBER NOT NULL ENABLE,
         "DOC_DATA" BLOB NOT NULL ENABLE,
         "CLASE_FORMATO_FORMATO" VARCHAR2(150 BYTE),
         "REGULAR_NAME" VARCHAR2(100 BYTE) NOT NULL ENABLE,
         "USUARIO" VARCHAR2(25 BYTE),
         "USUARIO_LEVEL" VARCHAR2(5 BYTE)
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "ODBODB_TBD_DADES"
    LOB ("DOC_DATA") STORE AS BASICFILE (ENABLE STORAGE IN ROW CHUNK 8K PCTVERSION 10 NOCACHE LOGGING STORAGE( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))
    PARTITION BY LIST ("ID_APP")
    SUBPARTITION BY RANGE ("ID_DOC")
    PARTITION "PTL_DOCUMENTOS_FICTICIO" VALUES (0) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
    STORAGE(BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "ODBODB_TBD_DADES"
    LOB ("DOC_DATA") STORE AS BASICFILE (ENABLE STORAGE IN ROW CHUNK 8K PCTVERSION 10 NOCACHE LOGGING STORAGE(BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))
    (SUBPARTITION "PTR_DOCUMENTOS_FICTICIO" VALUES LESS THAN (MAXVALUE) LOB ("DOC_DATA") STORE AS (TABLESPACE "ODBODB_TBL_LOBS" ) TABLESPACE "ODBODB_TBD_DADES" NOCOMPRESS ) );
    PARTITION "PTL_DOCUMENTOS_ALFIMG" VALUES (2) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
    STORAGE(BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "ODBODB_TBD_DADES"
    LOB ("DOC_DATA") STORE AS BASICFILE (ENABLE STORAGE IN ROW CHUNK 32K PCTVERSION 10 NOCACHE LOGGING STORAGE(BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))
    (SUBPARTITION "STR_DOCUMENTOS_ALFIMG" VALUES LESS THAN (MAXVALUE) LOB ("DOC_DATA") STORE AS (TABLESPACE "BEALFIMG_TBL_ODB" ) TABLESPACE "BEALFIMG_TBD_ODB" NOCOMPRESS )
    The error is:
    ORA-03252: initial extent size not enough for LOB segment
    I can't understand how Oracle can't allocate enough extents to create the LOB segment, and I don't know to which LOB segment it refers because the sqlplus don't mark it with the error.
    Any ideas about this issue?
    Thanks in advance!
    dbajug

    Please, forget this post, I feel dumb... The LOB segment need to have same size of the rest of partition...

  • Script for automation.

    Rhel 5.
    11.2.0.3
    Any body have idea how to write a scripts to fullfill below requirments.
    script 1) Change Partition name and subpartition name ( Range Hash). First List and then change.
    script 2) Estimate Size and then purge data of selected partition by exchanging into a separate table.
    any help will be highly appreciated!!
    My workaround is
    *1) script 1*
    i) partition and sub partition listening.
    select table_name, PARTITION_NAME,TABLESPACE_NAME from user_tab_partitions where table_name='XXXX';
    select partition_name,TABLESPACE_NAME from user_segments where segment_name='XXXX';
    partition and subparition renaming
    ii) partition and sub parition renaming.
    alter table <tablename> rename partition <old parition name> to <new parition name>;
    ALTER TABLE <tablename> RENAME SUBPARTITION <old-partition-name> TO <new-partition-name>;
    *2) scrpit 2*
    I) Estimate size of sub parition
    select substr(partition_name,1,7) p_name,sum(bytes)/1024/1024 "MB" from user_segments where segment_name='INFO' group by substr(partition_name,1,7);
    ii) Exchange parition.
    a) create a table with sub parition type i.e hash parition table
    b) create new table rang hash.
    c) first exchange partition with sub partition type table than exchange sub partition type table with new rang hash partition.
    alter table <old range hash table> exchange partition <partition name> with table <sub type hash table>;
    alter table <sub type hash table> exchange partition <partition name> with table <new range hash table>;
    Now my question is how can i read partition and sub parition names in script and than rename and exchange it dynamically??.
    Edited by: Kh$n on Apr 25, 2013 5:20 AM

    1) day wise not month wise.what? dont understand sorry, plase elaborate it.
    2) i dn.t want to truncate it directly before truncating i want to save that data to another table thats why am exchanging it.with an example:
    SQL> CREATE TABLE my_table
      2  (id  NUMBER(5),
      3  name VARCHAR2(30),
      4  mydate    DATE)
      5  PARTITION BY RANGE(mydate)
      6  (
      7  PARTITION january2013 VALUES LESS THAN(TO_DATE('01/02/2013','DD/MM/YYYY')),
      8  PARTITION february2013 VALUES LESS THAN(TO_DATE('01/03/2013','DD/MM/YYYY')),
      9  PARTITION march2013 VALUES LESS THAN(TO_DATE('01/04/2013','DD/MM/YYYY')),
    10  PARTITION april2013 VALUES LESS THAN(TO_DATE('01/05/2013','DD/MM/YYYY'))
    11  );
    Tabla creada.
    SQL> insert into my_table values (1, 'Fran', '01/01/2013');
    1 fila creada.
    SQL> insert into my_table values (1, 'Mike', '11/02/2013');
    1 fila creada.
    SQL> insert into my_table values (1, 'Donald', '11/03/2013');
    1 fila creada.
    SQL> insert into my_table values (1, 'Anna', '11/03/2011');
    1 fila creada.
    SQL> commit;
    Confirmaci¾n terminada.
    SQL>
    SQL> select * from my_table;
            ID NAME                           MYDATE
             1 Fran                           01/01/13
             1 Anna                           11/03/11
             1 Mike                           11/02/13
             1 Donald                         11/03/13
    SQL> create table my_new_table(id number(5), name varchar2(30), my_date date);
    Tabla creada.
    SQL> select * from my_new_table;
    ninguna fila seleccionada
    SQL> ALTER TABLE my_table
      2  EXCHANGE PARTITION march2013
      3  WITH TABLE my_new_table;
    Tabla modificada.
    SQL> select * from my_new_table;
            ID NAME                           MY_DATE
             1 Donald                         11/03/13
    SQL> select * from my_table;
            ID NAME                           MYDATE
             1 Fran                           01/01/13
             1 Anna                           11/03/11
             1 Mike                           11/02/13With this you directly exchange data from partition to a table, don't need to purge the partition.

  • AVOID Subpartition(list) to be created when Splitting Main Partition(range)

    I have created a table structure as below:
    CREATE TABLE TEST_SUBPARTITIONS_1
    RECORD_ID INTEGER NOT NULL,
    SUB_ID VARCHAR2(100),
    COBDATE DATE,
    DESC VARCHAR2(2000)
    PARTITION BY RANGE (COBDATE)
    SUBPARTITION BY list(SUB_ID)
    PARTITION INITIAL_PARTITION VALUES LESS THAN (TO_DATE(' 2200-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    TABLESPACE TBS_DATA
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE
    INITIAL 64K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    (SUBPARTITION INITIAL_SUBPARTITION VALUES ('INITIAL_DUMMY_SUB_ID') TABLESPACE TBS_DATA
    CREATE UNIQUE INDEX TEST_SUBPARTITIONS_1_PK ON TEST_SUBPARTITIONS_1 (COBDATE, RECORD_ID, SUB_ID) LOCAL;
    ALTER TABLE TEST_SUBPARTITIONS_1 ADD CONSTRAINT TEST_SUBPARTITIONS_1_PK PRIMARY KEY (COBDATE, RECORD_ID, SUB_ID);
    I am partitioning the table based on range (COBDATE) and subpartitioning based on list (SUB_ID).
    The table now is created with initial partitions and initial subpartition.
    We are splitting the partitions in our procedure as below
    ALTER TABLE TEST_SUBPARTITIONS_1 SPLIT PARTITION
    TST_SUB_R21001231 AT (TO_DATE(20130220,'YYYYMMDD') ) INTO
         (PARTITION TST_SUB_R20130219 TABLESPACE TBS_DATA, PARTITION TST_SUB_R21001231)
    The partition is getting split correctly with new partition as
    TST_SUB_R20130219, but the subpartition is also created automatically with some 'SYS' name.
    (i.e Name: SYS_SUBP693 , Values: INITIAL_DUMMY_SUB_ID)
    This happens after every split of range by COBDATE.
    Here it has created as below:
    Partition          SubPartition
    TST_SUB_R21001231     INITIAL_SUBPARTITION
    TST_SUB_R20130219     SYS_SUBP693
    TST_SUB_R20130220     SYS_SUBP694
    TST_SUB_R20130221     SYS_SUBP695
    I want to AVOID splitting subpartition when I split the main partition
    i.e a SYS subpartition should not be created when I split the partition for COBDATE.
    Let me know how do I avoid this in main "alter statement" above?
    Any other solution?     I do not want to drop the SYS subpartition later, instead want it to avoid creating only when I split the partition.

    >
    I want to AVOID splitting subpartition when I split the main partition
    i.e a SYS subpartition should not be created when I split the partition for COBDATE.
    Let me know how do I avoid this in main "alter statement" above?
    Any other solution? I do not want to drop the SYS subpartition later, instead want it to avoid creating only when I split the partition.
    >
    The subpartitions aren't being split. Oracle is creating new subpartitions for the new partition. The subpartitions need to exist since that is where the data is stored.
    You can avoid the SYS prefix on the name though by using a different naming convention.
    See the 'Splitting a *-List Partition' section of the VLDB and Partitioning Guide
    http://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1008028
    >
    The ALTER TABLE ... SPLIT PARTITION statement provides no means of specifically naming subpartitions resulting from the split of a partition in a composite partitioned table. However, for those subpartitions in the parent partition with names of the form partition name_subpartition name, the database generates corresponding names in the newly created subpartitions using the new partition names. All other subpartitions are assigned system generated names of the form SYS_SUBPn. System generated names are also assigned for the subpartitions of any partition resulting from the split for which a name is not specified. Unnamed partitions are assigned a system generated partition name of the form SYS_Pn.

  • Selecting records from DEFAULT range-list subpartition

    Is it possible to select records which belong to DEFAULT subpartition of a certain partition of a RANGE-LIST partitioned table, using subpartition pruning? Our task assumes creating partitions and subpartitions in a table dynamically before running ETL. But sometimes due to complexity of the path subpartition key goes from staging data to materialized views in data warehouse, we cannot predict all subpartition key values upfront. We can create DEFAULT subpartition for every partition though, and have Oracle place records which don't match any subpartition condition into that subpartition.
    But later we need to split DEFAULT subpartition so that all records will go into their dedicated subpartitions, and DEFAULT will be left empty - other layers of our application need all records to be stored in subpartition other than DEFAULT in order to be available. For that, we need to know which keys are stored in DEFAULT subpartition. And the question is - how can we effectively achieve that?
    The obvious "brute force" approach is to issue a query like:
    select distinct subpart_key from mytable partition (myrangepartition) where not subpart_key in (list of all subpartition key values for this partition)
    but it does not use partition pruning - I have checked execution plan. While it is possible to use only DEFAULT partition, this query will iterate through all subpartitions, which is huge performance impact. How can we instruct Oracle to use only DEFAULT subpartition?

    is the solution. I have overlooked this syntax - now my life is much easier.

Maybe you are looking for

  • How to call View of Component A from Compoenent B

    Hi Friends,          I have a requirment like: There are four views in component A and i want to use view2 of Component A in Component B. Can some one tell me how to work out. Note: All four views are assigned to one window only. Thanks in Advance Re

  • Impact of BIA 7 on BI.7 sizing in terms of CPU requirements

    Hello, We are finalizing the sizing of our future BI.7 environnement. As designed, the BI7 server capacity will be determined by the SAPS/memory quicksizer results. But in addition to that, to be on the safe side, we have also to keep in mind that ou

  • BAdI/method for limiting Delivery type list for webshop

    Hello everyone, I need your help: I have requirement is to limit some Deliver types when ordering in the b2b webshop (webshop only not others).  I'm searching for a BAdI (I don't want to hardcode in order.jsp) and debuging/looking into CRM_ISA_BASKET

  • Sales area

    Hi,    when iam creating the customer in XD01 iam gtting the error that sales area not defined for customers?  I had created the salea area in the enterprise structure? What is meant by sales area not defined for customers?

  • Voice over always on - How can I shut if off?

    somehow, voiceover has decided to turn itself, and I can't shut it off.... Disabling voice over in the universal access system preference does not shut it off. Deleting the user's universal access preference plist as well as voice over's preference p