Solved

add another partiton to existing partition table in oracle

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

Suggested Solutions

Title # Comments Views Activity
Unix, date minus 1, 2 or 3 days (last working day) 11 53
Fastest way to replace data in Oracle 5 62
MULTIPLE DATE QUERY 15 77
form builder not starting 3 34
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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 how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

773 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