Solved

add another partiton to existing partition table in oracle

Posted on 2008-06-17
5
667 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

910 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

21 Experts available now in Live!

Get 1:1 Help Now