SUBPARTITION TEMPLATE modify

Is it possible to modify the existing SUBPARTITION TEMPLATE. Table has got data.
I want to add one more value to the SUBPARTITION in the template.
SUBPARTITION TEMPLATE
  (SUBPARTITION PRD VALUES ('303', '660', '148', '150') TABLESPACE TEST,
   SUBPARTITION PRD1 VALUES ('238', '76') TABLESPACE TEST,
table script.
CREATE TABLE SYSADM.TEST1
  BUSINESS_UNIT       VARCHAR2(5 BYTE)          NOT NULL,
  FI_INSTRUMENT_ID    VARCHAR2(20 BYTE)         NOT NULL,
  FI_IBALTYPE_CD      VARCHAR2(10 BYTE)         NOT NULL,
  ASOF_DT             DATE,
  ASOF_STATUS         VARCHAR2(2 BYTE)          NOT NULL,
  FI_BALANCE_AMT      NUMBER(18,3)              NOT NULL,
  FI_BALANCE_BCE_AMT  NUMBER(18,3)              NOT NULL,
  FI_ACCRINT_AMT      NUMBER(18,3)              NOT NULL,
  FI_ACCRINT_BCE_AMT  NUMBER(18,3)              NOT NULL,T
  CURRENCY_CD         VARCHAR2(3 BYTE)          NOT NULL,
  BASE_CURRENCY       VARCHAR2(3 BYTE)          NOT NULL,
  FI_LST_PAYMNT_DT    DATE,
  PROCESS_INSTANCE    NUMBER(10)                NOT NULL
TABLESPACE TEST
LOGGING
PARTITION BY RANGE (AS_DT)
SUBPARTITION BY LIST (BUSINESS_UNIT)
SUBPARTITION TEMPLATE
  (SUBPARTITION PRD VALUES ('303', '660', '148', '150') TABLESPACE TEST,
   SUBPARTITION PRD1 VALUES ('238', '76') TABLESPACE TEST,
  PARTITION JUN_2011 VALUES LESS THAN (TO_DATE(' 2011-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    NOLOGGING
    NOCOMPRESS
    TABLESPACE TEST
  ( SUBPARTITION JUN_2011_PRD VALUES ('303', '660', '148', '150')    TABLESPACE TEST,
    SUBPARTITION JUN_2011_PRD1 VALUES ('238', '76')    TABLESPACE TEST
  PARTITION JULY_2011 VALUES LESS THAN (TO_DATE(' 2011-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    NOLOGGING
    NOCOMPRESS
    TABLESPACE TEST
  ( SUBPARTITION JULY_2011_PRD VALUES ('303', '660', '148', '150')    TABLESPACE TEST,
    SUBPARTITION JULY_2011_PRD1 VALUES ('238', '76')    TABLESPACE TEST,
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;

Please do not multi-post.
https://community.oracle.com/thread/2617016
https://community.oracle.com/thread/2617018
https://community.oracle.com/thread/2617024

Similar Messages

  • Modify SUBPARTITION TEMPLATE

    Is it possible to change the SUBPARTITION TEMPLATE of the table which has got the data.
    I want to add one more value
    to the subpartiion template.
    SUBPARTITION TEMPLATE
      (SUBPARTITION PRD VALUES ('303', '660', '148', '150') TABLESPACE TEST,
       SUBPARTITION PRD1 VALUES ('238', '76') TABLESPACE TEST,
    complete Table script .
    CREATE TABLE SYSADM.TEST1
      BUSINESS_UNIT       VARCHAR2(5 BYTE)          NOT NULL,
      FI_INSTRUMENT_ID    VARCHAR2(20 BYTE)         NOT NULL,
      FI_IBALTYPE_CD      VARCHAR2(10 BYTE)         NOT NULL,
      ASOF_DT             DATE,
      ASOF_STATUS         VARCHAR2(2 BYTE)          NOT NULL,
      FI_BALANCE_AMT      NUMBER(18,3)              NOT NULL,
      FI_BALANCE_BCE_AMT  NUMBER(18,3)              NOT NULL,
      FI_ACCRINT_AMT      NUMBER(18,3)              NOT NULL,
      FI_ACCRINT_BCE_AMT  NUMBER(18,3)              NOT NULL,T
      CURRENCY_CD         VARCHAR2(3 BYTE)          NOT NULL,
      BASE_CURRENCY       VARCHAR2(3 BYTE)          NOT NULL,
      FI_LST_PAYMNT_DT    DATE,
      PROCESS_INSTANCE    NUMBER(10)                NOT NULL
    TABLESPACE TEST
    LOGGING
    PARTITION BY RANGE (AS_DT)
    SUBPARTITION BY LIST (BUSINESS_UNIT)
    SUBPARTITION TEMPLATE
      (SUBPARTITION PRD VALUES ('303', '660', '148', '150') TABLESPACE TEST,
       SUBPARTITION PRD1 VALUES ('238', '76') TABLESPACE TEST,
      PARTITION JUN_2011 VALUES LESS THAN (TO_DATE(' 2011-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
        NOLOGGING
        NOCOMPRESS
        TABLESPACE TEST
      ( SUBPARTITION JUN_2011_PRD VALUES ('303', '660', '148', '150')    TABLESPACE TEST,
        SUBPARTITION JUN_2011_PRD1 VALUES ('238', '76')    TABLESPACE TEST
      PARTITION JULY_2011 VALUES LESS THAN (TO_DATE(' 2011-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
        NOLOGGING
        NOCOMPRESS
        TABLESPACE TEST
      ( SUBPARTITION JULY_2011_PRD VALUES ('303', '660', '148', '150')    TABLESPACE TEST,
        SUBPARTITION JULY_2011_PRD1 VALUES ('238', '76')    TABLESPACE TEST,
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;

    Please do not multi-post.
    https://community.oracle.com/thread/2617016
    https://community.oracle.com/thread/2617018
    https://community.oracle.com/thread/2617024

  • How to add subpartitions to the existing subpartition template

    Hi All,
    My Question is ,how to add Subpartition to the exiting subpartition template. e
    like i have created a table with subpartition template with with 5 subpartitions like
    subpartiton one_1 value (121)
    subpartition two_2 value(122)
    and now i one to add one more subpartitin to the existing subpartition template(Like modify the existing subpartition templete).
    subpartition three_3 value(123)
    Could any suggest me.
    Thanks
    Sree

    >
    My Question is ,how to add Subpartition to the exiting subpartition template.
    >
    Follow the example in the section for 'Modifying a Subpartition Template' in the VLDB and Partitioning Guide
    http://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1007904
    >
    You can modify a subpartition template of a composite partitioned table by replacing it with a new subpartition template. Any subsequent operations that use the subpartition template (such as ADD PARTITION or MERGE PARTITIONS) now use the new subpartition template. Existing subpartitions remain unchanged.
    If you modify a subpartition template of an interval-* composite partitioned table, then interval partitions that have not yet been created use the new subpartition template.
    Use the ALTER TABLE ... SET SUBPARTITION TEMPLATE statement to specify a new subpartition template. For example:
    ALTER TABLE emp_sub_template
    SET SUBPARTITION TEMPLATE
    (SUBPARTITION e TABLESPACE ts1,
    SUBPARTITION f TABLESPACE ts2,
    SUBPARTITION g TABLESPACE ts3,
    SUBPARTITION h TABLESPACE ts4

  • SUBPARTITION template

    Is it possible to modify the subpartition template of the table which has got data.
    I want to add one more value to SUBPARTITION of the template.
    SUBPARTITION TEMPLATE
      (SUBPARTITION PRD VALUES ('303', '660', '148', '150') TABLESPACE TEST,
       SUBPARTITION PRD1 VALUES ('238', '76') TABLESPACE TEST,
    CREATE TABLE SYSADM.TEST1
      BUSINESS_UNIT       VARCHAR2(5 BYTE)          NOT NULL,
      FI_INSTRUMENT_ID    VARCHAR2(20 BYTE)         NOT NULL,
      FI_IBALTYPE_CD      VARCHAR2(10 BYTE)         NOT NULL,
      ASOF_DT             DATE,
      ASOF_STATUS         VARCHAR2(2 BYTE)          NOT NULL,
      FI_BALANCE_AMT      NUMBER(18,3)              NOT NULL,
      FI_BALANCE_BCE_AMT  NUMBER(18,3)              NOT NULL,
      FI_ACCRINT_AMT      NUMBER(18,3)              NOT NULL,
      FI_ACCRINT_BCE_AMT  NUMBER(18,3)              NOT NULL,T
      CURRENCY_CD         VARCHAR2(3 BYTE)          NOT NULL,
      BASE_CURRENCY       VARCHAR2(3 BYTE)          NOT NULL,
      FI_LST_PAYMNT_DT    DATE,
      PROCESS_INSTANCE    NUMBER(10)                NOT NULL
    TABLESPACE TEST
    LOGGING
    PARTITION BY RANGE (AS_DT)
    SUBPARTITION BY LIST (BUSINESS_UNIT)
    SUBPARTITION TEMPLATE
      (SUBPARTITION PRD VALUES ('303', '660', '148', '150') TABLESPACE TEST,
       SUBPARTITION PRD1 VALUES ('238', '76') TABLESPACE TEST,
      PARTITION JUN_2011 VALUES LESS THAN (TO_DATE(' 2011-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
        NOLOGGING
        NOCOMPRESS
        TABLESPACE TEST
      ( SUBPARTITION JUN_2011_PRD VALUES ('303', '660', '148', '150')    TABLESPACE TEST,
        SUBPARTITION JUN_2011_PRD1 VALUES ('238', '76')    TABLESPACE TEST
      PARTITION JULY_2011 VALUES LESS THAN (TO_DATE(' 2011-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
        NOLOGGING
        NOCOMPRESS
        TABLESPACE TEST
      ( SUBPARTITION JULY_2011_PRD VALUES ('303', '660', '148', '150')    TABLESPACE TEST,
        SUBPARTITION JULY_2011_PRD1 VALUES ('238', '76')    TABLESPACE TEST,
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;

    Please do not multi-post.
    https://community.oracle.com/thread/2617016
    https://community.oracle.com/thread/2617018
    https://community.oracle.com/thread/2617024

  • Subpartition templates and DBMS_Metadata.Get_DDL

    Does anyone know of a way to get DBMS_Metadata.Get_DDL to specify a subpartition template clause instead of spitting out a specification for every subpartition? I'm finding a 6,000 line create table statement to be a little unwieldy ...
    This is 10.2.0.4

    Does anyone know of a way to get DBMS_Metadata.Get_DDL to specify a subpartition template clause instead of spitting out a specification for every subpartition? I'm finding a 6,000 line create table statement to be a little unwieldy ...
    This is 10.2.0.4

  • Problem with lower third template & modifying the text...

    I'm doing a top 10 type video, & I downloaded this lower third template & I had never used AE before; I figured out how to duplicate it multiple times through the video where appropriate... but when I modify the text on one template it does the same thing to all of them. How do I make them all separate?

    Ok, think about what you have done to change the text for moment. You drilled down to a pre-comp or nested comp that contains a text layer. This makes perfect sense. Unfortunately that text pre-comp is also nested in a pre-comp. This means you need to find each of these pre-comps in your project panel and duplicate them there, open the duplicates and then change the text in the duplicates, then replace the original nested comps in the main comp.
    I have another observation on your workflow. You've put a bunch of shots and transitions in a single comp which, in effect, tells me that you are using AE as a NLE (editing app). What I would have done is to put every one of your shots that you want to add titles to in a separate comp to simplify each comp. I'd then edit them in a NLE....
    The other way I would do this project is to make a comp that is just the needed titles, one comp for each tltle overlay, render the titles with alpha channels, then bring the titles and the original footage into a NLE to edit and add titles.
    Building extremely complex compositions with multiple shots in a single comp is usually not a very good idea, even for folks like me that have been doing AE for 20 years. AE is perfect at making shots, lousy at editing sequences so always, and I mean always, try to figure out how you can simplify your project to it's basic elements and build a comp on that. I've had 5 second animations with over a hundred layers, but I've never put 10 or 20 video clips in AE in a single comp and tried to create a sequence.

  • Subpartition Template COMPRESS NOCOMPRESS parameter

    Hi ,
    I'm trying to create a table with subpartitions by list already partitioned by list,
    I want to configure that some of my subpartitions are compressed and the rest nocompressed,
    but I couldn't find how to specify it,
    I could specify if the partition at all is compressed or not but not a subpartition level,
    Thanks in advance

    Hi,
    I'm afraid it's not possible to specify this at the subpartition level at the moment.
    I have logged an enhancement request on this.
    Thanks for reporting this issue,
    David

  • Template Modify

    Hi all,
    I was Created one Query in WAD, Now i want write some Java Script code, tel where should i write code for my report.
    pls help me anybody urgent.
    Just i want know where should write java script code to give effect to my web designed query. And also tel me some links on java script related to SAP Coding Style.
    can nay one give some more.
    Regards,
    ANR
    Message was edited by: ANR

    hi,
    you can write in WAD html, before or after <body>
    using normal java script way.
    maybe you can specify more detail your requirement.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/13dc9190-0201-0010-71a4-a9f56cdfcc72
    Changing StyleSheets using BW  WAD
    WAD

  • Where did the Partitions and SubPartitions go?

    I created a table with partition Range (Transaction_Date, Retention_Period) and hash (Record_Id) subpartition template (for 32 subpartitions)
    Then I add more partitions and while the loop is going on I can get counts of partitions and subpartitions. The job finished and my log table shows about 1800 partitions added and there should be 32 subpartitions for each of the partitions. However, user_tab_partitions shows zero records for the table, and user_tab_subpartitions also show zero record. After a few minutes the partitions show up but no subpartitions. The indexes on the table have also disappeared (one local and one global)
    Any explanation for this behaviour?
    Working on Exadata 11.2.0.3
    Querying
    USER_TABLES
    USER_TAB_PARTITIONS
    USER_TAB_SUBPARTITIONS
    USER_INDEXES

    >
    Step 1. Create Table xyz (c1 date, c2 integer c3 integer, etc)
    partition by range (c1,c2)
    subpartition template (s01, s02... s32)
    create index i1 on xyz (c1,c2,c3) local;
    Then, since I want to create about 1800 partitions I have a procedure that has a "loop around" ALTER TABLE add Partition .. until all the partitions are created. This is the "Job" which while running I query USER_TAB_PARTITIONS and USER_TAB_SUBPARTITIONS to see how things are progressing. And Yes ALTER Table has no progressing to verify.
    So al the partitions get created. No errors from the procedure to go through creating all the partitions. So I would expect that at the end I should get to see all the new partitions for the Table. Instead I get "no records" from USER_TAB_PARTITIONS and USER_TAB_SUBPARTITIONS.
    I am also aware that "ALTER TABLE ADD PARTITION .." cannot make indexes go away. However, if the query on USER_INDEXES returns nothing, what happend to the Index created before the partitions were added?
    I am not using DBMS_REDEFINITION. The only procedure is to add partitions one at a time for each date for 3 years. If you have a better way than a procedure please advise accordingly.
    >
    In order to help you the first step is to understand what problem you are dealing with. Then comes trying to determine what options are available for addressing the problem. There are too many times , and yours may, or may not, be another one, where people seem to have settled on a solution before they have really identified the problem.
    Anytime someone mentions the use of dynamic SQL it raises a red flag. And when that use is for DDL, rather than DMl, it raises a REALLY BIG red flag.
    Schema objects need to be managed properly and the DDL that creates them needs to be properly written and kept in some sort of version control.
    Scripts and procedures that use dynamic SQL are more properly used to create DDL, not to execute it. That is, rather than use a procedure to dynamically create or alter a table you would use the procedure to dynamically create a DDL script that would create or alter the table.
    Let's assume that you know for certain that your table really needs to have 1800 partitions, be subpartitioned the way you say and have partition and subpartitions names that you assign. Well, that would be a pain to hand-write 1800 partition definitions.
    So you would create a procedure that would produce a CREATE TABLE script that had the proper clauses and syntax to specify those 1800 partitions. Your 'loop' would not EXECUTE an ALTER TABLE for each partition but would create the partition specification and modify the partition boundaries for each iteration through the loop. Sort of like
    for i from 1 to 365 loop
        add partition spec for startDate + i
    end loop;The number of iterations would be a parameter and you would start with 2 or 3. Always test with the smallest code that will produce the correct results. If the code works for 3 days it will work for any larger reasonable number.
    Then you would save that script in your version control system and run it to create the table. There would be nothing to monitor since there is just one script and when it is done it is done.
    That would be a proper use of dynamic sql: to produce DDL, not to execute it.
    Back to your issue. If I were your manager then based on what you posted I would expect you to already have
    1. a requirements document that stated the problem (e.g. performance, data management) that was being addressed
    2. test results that showed that your proposed solution (a table partitioned the way you posted) solves the problem
    The requirements doc would have detail about what the performance/management issues are and what impact they are having
    You also need to document what the possible solutions are, the relative merits of each solution and the factors you considered when ranking the solutions. That is, why is your particular partitioning scheme the best solution for the problem.
    You should have test results that show the execution plans and performance you achieved by using a test version of your proposed table and indexes.
    Until you have 'proven' that your solution will work as you expect I wouldn't recommend implementing the full-blown version of it.
    1. Create a table MANUALLY that has 2 or three days worth of partitions.
    2. Load those partitions with a representative amount of data
    3. Execute test queries to query data from one of those partitions
    4. Execute the same test queries against your current table
    5. Capture the execution plans (the actual ones) for those queries. Verify that you are getting the performance improvements that you expected.
    Once ALL of that prep work is done and you have concluded that your table/index design is correct then go back to work on writing a script/procedure that will produce (not execute) DDL to produce the main table and partitioning you designed.
    Just an aside on what you posted. The indexes should be created AFTER the table and its partitions are created. If you are creating your local index first, as you post suggests, you are forcing Oracle to revamp it 1800 times when each partition is added. Just create the index after the table.
    p.s. the number of posts anyone has is irrevelant. The only thing that matters is whether the advice or suggestions they provide is helpful. And the helpfullness of those is limited to, and based on, ONLY the information a poster provides. For exampe, your proposed partitioning scheme might be perfectly appropriate for your use case or it could be totally inappropriate. We have no way of knowing without knowing WHY you chose that scheme.
    But I haven't seen one like that so it makes me suspicious that you really need to get that complicated.

  • Doubt in subpartitioning of a table

    hi gems...good evening..
    I have a table which previously had only range partitions.
    Now I changed it to range-hash composite partitioning.
    There are 6 partition tablespaces namely TS_PART1, TS_PART2.....TS_PART 6.
    The default tablespace of the schema is TS_PROD.
    The table had following structure previously:
    create table ORDER_BOOK
    CUST_ID NUMBER(10),
    PROFILE_ID NUMBER(10),
    PRODUCT_ID NUMBER(10),
    SUB_PROFILE_ID VARCHAR2(25),
    CASHFLOW_DATE DATE,
    EARNINGS NUMBER(24,6),
    constraint ORDER_BOOK_PK primary key(CUST_ID,PROFILE_ID,PRODUCT_ID,SUB_PROFILE_ID,CASHFLOW_DATE)
    partition by range (CASHFLOW_DATE)
    partition ORDER_BOOK_PART1 values less than (TO_DATE('01-01-2003', 'DD-MM-YYYY')) tablespace TS_PART1,
    partition ORDER_BOOK_PART2 values less than (TO_DATE('01-01-2006', 'DD-MM-YYYY')) tablespace TS_PART2,
    partition ORDER_BOOK_PART3 values less than (TO_DATE('01-01-2009', 'DD-MM-YYYY')) tablespace TS_PART3,
    partition ORDER_BOOK_PART4 values less than (TO_DATE('01-01-2012', 'DD-MM-YYYY')) tablespace TS_PART4,
    partition ORDER_BOOK_PART5 values less than (TO_DATE('01-01-2015', 'DD-MM-YYYY')) tablespace TS_PART5,
    partition ORDER_BOOK_PART6 values less than (TO_DATE('01-01-2018', 'DD-MM-YYYY')) tablespace TS_PART6
    create index ORDER_BOOK_IDX on ORDER_BOOK(PRODUCT_ID,CASHFLOW_DATE);
    Now I did the following steps to change the previously existing partitions to the new range-hash composite partitions:
    begin
    dbms_redefinition.can_redef_table
    (uname=>'DEMO_TEST',
    tname=>'ORDER_BOOK',
    options_flag=>DBMS_REDEFINITION.CONS_USE_PK);
    end;
    create table INTERIM_ORDER_BOOK
    CUST_ID NUMBER(10),
    PROFILE_ID NUMBER(10),
    PRODUCT_ID NUMBER(10),
    SUB_PROFILE_ID VARCHAR2(25),
    CASHFLOW_DATE DATE,
    EARNINGS NUMBER(24,6),
    constraint INTERIM_ORDER_BOOK_PK primary key(CUST_ID,PROFILE_ID,PRODUCT_ID,SUB_PROFILE_ID,CASHFLOW_DATE)
    partition by range(CASHFLOW_DATE)
    subpartition by hash (CUST_ID)
    subpartition template
    subpartition SP1 tablespace TS_PART1,
    subpartition SP2 tablespace TS_PART2,
    subpartition SP3 tablespace TS_PART3,
    subpartition SP4 tablespace TS_PART4,
    subpartition SP5 tablespace TS_PART5,
    subpartition SP6 tablespace TS_PART6
    (partition P1 values less than (to_date('01-01-2003','DD-MM-YYYY')),
    partition P2 values less than (to_date('01-01-2006','DD-MM-YYYY')),
    partition P3 values less than (to_date('01-01-2009','DD-MM-YYYY')),
    partition P4 values less than (to_date('01-01-2012','DD-MM-YYYY')),
    partition P5 values less than (to_date('01-01-2015','DD-MM-YYYY')),
    partition P6 values less than (to_date('01-01-2018','DD-MM-YYYY')))
    enable row movement;
    begin
    dbms_redifinition.start_redef_table
    (uname=>'DEMO_TEST',
    orig_table=>'ORDER_BOOK',
    int_table=>'INTERIM_ORDER_BOOK',
    options_flag=>DBMS_REDEFINITION.CONS_USE_PK);
    end;
    begin
    dbms_redefinition.finish_redef_table
    (uname=>'DEMO_TEST',
    orig_table=>'ORDER_BOOK',
    int_table=>'INTERIM_ORDER_BOOK');
    end;
    After that I made the index with LOCAL clause i.e local index.
    But the problem is that...initially when there is only range partitioning, then the datas are going to the corresponding partition tablespaces.
    But after modifying the table, populating the table results in consumption of space in both partition tablespaces as well as the default tablespace.
    I have checked the size of the tablespaces. From that I came to know about this.
    The output of the USER_TAB_SUBPARTITIONS is okk...every subpartitions are in the corresponding tablespaces.
    But the main partitions (USER_TAB_PARTITION) are in the default tablespace.
    please help me....thanks in advance...
    Edited by: user12780416 on Apr 13, 2012 7:46 AM

    user12780416 wrote:
    Thanks sir for your reply...
    Yes, by MOVE syntax I can move the partitions in the corresponding tablespaces.
    But i am not getting the reason of consumption of both the tablespaces.
    The TS_PART1 increased 2MB, TS_PART2 increased 6MB, TS_PART3 increased 2MB, TS_PART4 increased 5MB, TS_PART5 increased 9MB.
    and TS_PROD increased (2+6+2+5+9)=24MB
    Why is this happening ?
    I have read that when we make subpartitions, they main partitions are the logical entity only and the subpartitions are the physical entity.Where have you read this?
    As RP rightly pointed out, you can specify a tablespace for each partition (each partition using a different tablespace) and a tablespace for each subpartitions (again, using many if you felt like it).

  • Required alter script for adding partition and subpartition

    Hi Folks,
    Please help me to write ALTER STATEMENT for adding new partition P1 and SUBPARTITION P1_201001 and P1_201002.
    Thank you
    TABLE
    =======
    CREATE TABLE TEST
         "REPORT_ID"    NUMBER,
        "MONTH_ID"      NUMBER,
        "GROUP_ID"      NUMBER,
        "AGE_GROUP_ID"  NUMBER,
        "GENDER_CD"     CHAR(1 BYTE),
    PCTFREE 0 PCTUSED 0 INITRANS 1 MAXTRANS 255 COMPRESS BASIC NOLOGGING STORAGE
        BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
      TABLESPACE "USER_WORK" PARTITION BY RANGE
        "REPORT_ID"
      SUBPARTITION BY LIST
        "MONTH_ID"
      SUBPARTITION TEMPLATE
        SUBPARTITION "M201212" VALUES
          201212
        TABLESPACE "USER_WORK"
    (PARTITION "P3" VALUES LESS THAN (4) PCTFREE 0 PCTUSED 0 INITRANS 1 MAXTRANS 255 STORAGE( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USER_WORK" COMPRESS BASIC NOLOGGING ( SUBPARTITION "P3_M201212" VALUES
          201212
        TABLESPACE "USER_WORK" COMPRESS BASIC, SUBPARTITION "P3_M201301" VALUES
          201301
        TABLESPACE "USER_WORK" COMPRESS BASIC )
    );

    First modify the subpartition template
    ALTER TABLE TEST set
      SUBPARTITION TEMPLATE
        SUBPARTITION "M201212" VALUES
          201212
        SUBPARTITION P1_201001 VALUES (201001),
        SUBPARTITION P1_201002 VALUES (201002)
      )Then if the new partition is HIGHER than ALL existing ranges you can just add it
    alter table test add
    PARTITION "P1" VALUES LESS THAN (5) If the new partition is LOWER than one onf the existing ranges you will need to SPLIT the existing partition.
    alter table test SPLIT PARTITION "P3" AT (2)
    INTO (PARTITION P1, PARTITION P3)See the sections in the VLDB and Partitioning Guide
    Modifying a Subpartition Template
    http://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1007904
    Splitting a Partition of a Range-Partitioned Table
    http://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1008028

  • Parent partition of subpartitions that move to a new TS

    PLATFORM_NAME: Solaris[tm] OE (64-bit)
    VERSION: 11.2.0.2.0
    In our system we have several tables that are partitioned by range. Some of these tables are then sub-partitioned by list. Well initially we were creating a new tablespace every month and creating the new monthly partition on the new tablespace. Well I got annoyed by this, so I decided to move all of the partitions/subpartitions to a single tablespace. And this went smooth, at first, in my dev region. I moved all of the segments to the new tablespace, but then I noticed something odd...
    Example:
    CREATE TABLE me.sub_partitioned_table
    my_range_partitioned_column date,
    my_list_partitioned_column varchar2(30)
    PARTITION BY RANGE (my_range_partitioned_column)
    SUBPARTITION BY LIST (my_list_partitioned_column)
    SUBPARTITION TEMPLATE
    (SUBPARTITION value4 VALUES (4),
    SUBPARTITION value23 VALUES (23),
    SUBPARTITION value60 VALUES (60),
    SUBPARTITION "DEFAULT" VALUES (DEFAULT)
    PARTITION P_HIST VALUES LESS THAN (TO_DATE(' 2007-09-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    TABLESPACE P_HIST
    ( SUBPARTITION P_HIST_value4 VALUES (4) TABLESPACE MONTHLY_PARTITION,
    SUBPARTITION P_HIST_value23 VALUES (23) TABLESPACE MONTHLY_PARTITION,
    SUBPARTITION P_HIST_value60 VALUES (60) TABLESPACE MONTHLY_PARTITION,
    SUBPARTITION P_HIST_DEFAULT VALUES (DEFAULT) TABLESPACE MONTHLY_PARTITION ),
    ...... and there are a lot more partitions/subpartitions
    So I create all of my alter table move subpartition statements, and the execute as they should. If I do:
    select tablespace_name from dba_tab_subpartitions where table_name = 'SUB_PARTITIONED_TABLE' and table_owner = 'ME', I see that all of my subpartitions are on the new, single tablespace. BUUUUUUT, if I do:
    select tablespace_name from dba_tab_partitions where table_name = 'SUB_PARTITIONED_TABLE' and table_owner = 'ME', I see all of the old tablespace names are still listed for my partitions.
    My question is, can this be changed? Did I screw something up? Is this a bug? If I try to alter the table and move the partition I get an error because I'm trying to move something that isn't a segment. Any help would be appreciated. Hopefully this makes sense. If you need clarification on anything, please let me know.
    Thanks!

    I found my answer...
    ALTER TABLE ME.sub_partitioned_table MODIFY DEFAULT ATTRIBUTES FOR PARTITION MONTHLY_PARTITION TABLESPACE NEW_BIG_TS;

  • Pages '08 Business Card Template Question

    In Pages '08, is there a way to change the business card template page view to a single card view, allowing me to create one card that would automatically display itself in all 10 positions when the layout is changed to multiple card view? This can be done with the old Appleworks program, but I can find no way to do this with Pages. It seems I have to choose a card template, modify one of the boxes with my info, then copy and paste it into the other 9 boxes. Is this correct? If so, it is a step way behind the Applewoprks method.

    Yes it is a step backwards, but herre is the way to work with it.
    Create your one card, highlight all of its components, group them, then copy and paste it into the space below it perfectly. NOW DON'T TOUCH ANOTHER KEY!!! Instead, just repeat the paste function (Command+V) 3 times to fill the left side of the card stock. Now paste another one in the right top spot, select the right top, copy and paste and then position in the next lower spot to repeat what you did on the left side. If you positioned the second card correctly, this should have only taken maybe 1-1½ minutes.
    Good Luck.
    Adam (Long live AppleWorks)

  • RTF Templates and report file (.xdo)

    Hi all,
    I use Oracle report and I would like to migrate from that software to Oracle BI Publisher. During my tests, I encountered various problems like the following:
    I create my report (.xdo file is generated) in development with one RTF template. I load my template in the report and the system copy the rtf file is the same directory as the .xdo file. Also, the system modify the .xdo file to add a line like:
    <templates default="stkcinv">
    <template label="stkcinv" type="rtf" url="stkcinv.rtf" outputFormat="html,pdf,rtf"/>
    </templates>
    When my report and template are ok, I update my customer to install them in production mode. When they are installed, my customer would modify the RTF template so he duplicates the RTF template, modify the file and load it in the report. Now, in the report, I have two lines:
    <templates default="stkcinv">
    <template label="stkcinv" type="rtf" url="stkcinv.rtf" outputFormat="html,pdf,rtf"/>
    <template label="stkcinv2" type="rtf" url="stkcinv2.rtf" outputFormat="html,pdf,rtf"/>
    </templates>
    For my part, I modify the report in development to add a new value in the datamodel. Then I update another time my customer and erase the standard report by the new.
    the problem is that doing that, if I look at the .xdo file, I see that in the <templates> section, I have:
    <templates default="stkcinv">
    <template label="stkcinv" type="rtf" url="stkcinv.rtf" outputFormat="html,pdf,rtf"/>
    </templates>
    So the templates loaded in the .xdo file is lost and my customer must reload it in the new report. If my customer has 100 reports, each time I update the soft, he will have to reload all templates... Amazing...
    How can I do to avoid that problem ?

    Well there appears to be a bug in the RTF generator.
    It appears that Oracle want to use paragraph left and right indentation properties to pad text in cells away from cell borders. There is a bug in the rtf reader in word that causes problems if cell padding properties are used so paragraph indentation appears a sensible work round.
    By default there appears to be a left hand indentation of 5 applied to all paragraphs in cells. If a left hand cell maring is applied to cells then the left hand cell margin in the report increases in size.
    However, right hand cell margins appear to be ignored and NOT written as attributes to cell paragraph text in the the generated report, and this causes problems when trying to print an RTF report as numbers in cells get clipped by cell borders.
    Edited by: user7137712 on 18-Mar-2010 03:21

  • Switching themes with customized templates

    Most typical Apex applications start with a quick prototype containing most of the required functionality, get required approvals, and continue building it up.
    During all of this, the concept of "themes" is mentioned and demonstrated as a reassurance that the "look and feel" of the application can be very easily switched at any point. In other words, let's worry about designing the content and behaviour, the presentation can be easily switched.
    All this sounds very good on paper and is do-able as long as one uses the out-of-the-box Apex themes/templates. But, in my experience, any non-trivial application has lots of customized templates. That brings me to my question.
    As soon as you start to customize templates, modify them, create new ones, etc, you start to get "committed" to that specific theme. In other words, if I have a theme with 10 customized templates, 5 slightly modified ones, etc, and I switch to another theme from the Apex repository, I get all the out-of-the-box templates for that theme. I have to painstakingly re-do all my customizations for the corresponding templates in the new theme.
    And Apex does nothing to help me with this task. There is no "diff" utility between themes, no compares, no merges, nothing. I have to eye-ball the old template, copy the HTML snippets from the Builder into Notepad, pull up my new template and manually copy, paste, modify snippets into the new template. Very error-prone.
    How have people handled this sort of thing? Are there any best-practices, any procedures that people follow to make switching between themes painless?
    Thanks

    Hello,
    Second post down.
    http://wiki.shellprompt.net/bin/view/Apex/ThemeTips
    I build out themes all the time that are about 70/30 standard templates to custom templates and following that procedure makes the switches fairly easy.
    Carl

Maybe you are looking for