Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: 8i (8.1.5) - Add Partitions to previously Non-Partitioned Table containing data ???

Re: 8i (8.1.5) - Add Partitions to previously Non-Partitioned Table containing data ???

From: Jan Nowitzky <nowitzky_at_informatik.uni-jena.de>
Date: Thu, 21 Oct 1999 08:37:47 +0200
Message-ID: <380EB4BB.6FBB1996@informatik.uni-jena.de>

If you want to have a table with only/exactly one partiton then use Jonathans way. But if you then will/must split the one partition in two or more then is an other way better (in my sight - I had tested it). Following

(1) create the n partitions as separate tables

    Have a look at the right partition borders!

(2) create the indexes 
(3) create the statistics
(4) create the partitioned table with n empty partitions
    create table xxx partitioned by range (aaa)
	( partition p1 ...,
          partition p2 ...
	)
        as select * from table where 0=1
(5) alter table xxx exchange partition p1 with table ...

    -> do this for each partition

Jan

This is the fastest way, if you want to create more then one partition. Christian Roig wrote:
>
> 8i (8.1.5) - Add Partitions to previously Non-Partitioned Table
> containing data ???
>
> Is it possible to use the Alter Table command to add partitions to a
> table that contains data and was not previously partitioned ???
>
> Or do I have to do a 'Create Table As Select' with Partition creation
> statements ???
>
> I have looked at the Oracle documentation, but I don't thnk that it is
> stated very clearly wether or not it is possible to use the Alter
> Table command to add partitions to a table that contains data and was
> not previously partitioned.
>
> TIA - Christian

--



Jan Nowitzky
Friedrich-Schiller-Universität o Institut für Informatik E-Mail nowitzky_at_informatik.uni-jena.de
Received on Thu Oct 21 1999 - 01:37:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US