Solved

add another partiton to existing partition table in oracle

Posted on 2008-06-17
5
669 Views
Last Modified: 2013-12-27
Experts,

i have a stupid question. i am new to table partitions. i have a table called AA which is partitioned by range based on date. now i need add 2 more partitions to existing table AA. how do i add /create 2 more partitions to the existing partition table.
PARTITION ATN_1206 VALUES LESS THAN (TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS
    TABLESPACE TXN_DATA2
    PCTUSED    40
    PCTFREE    10
    INITRANS   12
    MAXTRANS   255
    STORAGE    (
                INITIAL          16K
                NEXT             32M
                MINEXTENTS       1
                MAXEXTENTS       1000000
                PCTINCREASE      0
                FREELISTS        12
                FREELIST GROUPS  1
                BUFFER_POOL      DEFAULT
               ),  
 
this is the last partition i have. now i need to create 2 more partitons like ATN_0107 ,ATN_0207 like this.
how do i add new partitions.

Open in new window

0
Comment
Question by:pavan27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 74

Expert Comment

by:sdstuber
ID: 21806556
ALTER TABLE AA
 ADD
  PARTITION ATN_0107 VALUES LESS THAN (TO_DATE(' 2007-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS;

ALTER TABLE AA
 ADD
  PARTITION ATN_0207 VALUES LESS THAN (TO_DATE(' 2007-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    LOGGING
    NOCOMPRESS;
0
 
LVL 1

Author Comment

by:pavan27
ID: 21806637
Hai,

Thanks for response. i am getting this error. how do i fix this error

ERROR at line 1:
ORA-14074: partition bound must collate higher than that of the last partition
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 21806736
you must have other partitions in your table that have upper bounds higher than what you've shown above.

Can you post your entire "create table" for the table as it is now?
0
 
LVL 1

Author Comment

by:pavan27
ID: 21806776
please find the attachment. could you please let me know where i am doing wrong.
now could you pelase send me script to create partitions
cr8-tab-partiton.txt
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 21807656
you have a MAXVALUE partition.    So rather than adding new partitions to the end,  you will need to split the final partition into new segements.


alter table txn split partition txn_max at (to_date('2007-02-01','yyyy-mm-dd')) into (partition txn_0107, partition txn_max) update global indexes;

alter table txn split partition txn_max at (to_date('2007-03-01','yyyy-mm-dd')) into (partition txn_0207, partition txn_max) update global indexes;
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question