Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: need advice for partitioning in 8.1.7.2
>
> 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.ORGReceived on Tue Apr 01 2003 - 14:11:32 CST
![]() |
![]() |