Solved

add another partiton to existing partition table in oracle

Posted on 2008-06-17
5
666 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
  • 3
  • 2
5 Comments
 
LVL 73

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 73

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 73

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now