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: need advice for partitioning in 8.1.7.2

Re: need advice for partitioning in 8.1.7.2

From: Saikat Chakraborty <saikatchak_at_hotmail.com>
Date: Tue, 1 Apr 2003 20:11:32 +0000 (UTC)
Message-ID: <be1b756931a9ddd9b504abb1a21e8207.16981@mygate.mailgate.org>


>
> What is the best method to migrate existing table to partitioned table?

Hi,
First you decide on a partitioning key. It should be used in most of your queries to help partition prunning. If it a date field and you partition by month, then you create partitions for each month.
You may also combine different months data in a partition. Let us assume that the table is like

create table emp
(
empno numebr(10),
hierdate date
)

you decide to partition on hierdate. So you create another table "emp_part" of the same structure but partitoned. Then you insert records in the emp_part table. You should not build any indexes on emp_part before the data insertion. For system resource you may want to use multiple insert statements (may be for each month). After the data is inserted, you drop the table emp. And rename the table "emp_part" to "emp". Then you create any indexes that are previously there.
I feel this is the best method. There are also some other method like export-recreate partitoned table-import. But the method I said is the faster one. The only problem being at one point of time there will the same data in two tables and that means twice the space is needed. Thanks,
Saikat Chakraborty
http://saikatchak.tripod.com

-- 
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Tue Apr 01 2003 - 14:11:32 CST

Original text of this message

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