Solved

Non-Partitioned to Partition Table

Posted on 2001-06-03
5
1,674 Views
Last Modified: 2007-12-19
Hello All,

Two questions :

1) Is there a way to convert a non-partitioned table
to a partitioned table

2) I have a table which has 8 million rows and its
growth rate is fast. Currently the size of data
in this table is around 12MB and its index is around
6MB. Is it advisable to partition this table. Will I
gain performance by partitioning.

Thanks in advance


0
Comment
Question by:freddymac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Accepted Solution

by:
sunrock_in earned 75 total points
ID: 6151422
No u can't change a Ordinary table to Partitioned table directly u have to follow some steps to change this table to Partitioned table.

A table can be partitioned, provided that:

It is not part of a cluster.

It does not contain LONG or LONG RAW datatypes.

the procedure to convert
1. Export this table.
2.Drop the table.
3.Recreate the table with partitions the sybtax for creating partitioned table is here with an example

CREATE TABLE sales
    ( invoice_no NUMBER,
      sale_year  INT NOT NULL,
      sale_month INT NOT NULL,
      sale_day   INT NOT NULL )
  PARTITION BY RANGE (sale_year, sale_month, sale_day)
    ( PARTITION sales_q1 VALUES LESS THAN (1997, 04, 01)
        TABLESPACE tsa,
      PARTITION sales_q2 VALUES LESS THAN (1997, 07, 01)
        TABLESPACE tsb,
      PARTITION sales_q3 VALUES LESS THAN (1997, 10, 01)
        TABLESPACE tsc,
      PARTITION sales_q4 VALUES LESS THAN (1998, 01, 01)
        TABLESPACE tsd );

4. Import the data to the new table

U can add partitions to ur table after creating the partitoned table in future by
Alter table add partition

U can merge two adjecent partitons if u want by
Alter Table Merge partition

U can also create index according to these partions
That is called partitioned indexing

Hope this will solve ur problem for more information on this post a new question.

Thanks
0
 

Expert Comment

by:raid5
ID: 6151838
there is one other way in this can be carried out which is much easier and less time consuming. the syntax for that would be alter table...exchange partition.... you can find more details in the oracle8i administrator's guide. do let me know in case you need the entire syntax with an example.

as far as your second question is concerned, yes ....your table does seem to be a likely candidate for partitioning. however, we need to look at the table more carefully.
just one tip on that would be for you to ensure that you create local indexes for the partitions as well so as to improve performance.
0
 

Author Comment

by:freddymac
ID: 6175563
Sunrock in, your proposed answer was quite informative,
pls let me have some more feedback from others.

Raid5, I have tried exchange partition. I did not
work. Have you actually tried, if so pls let me know
the syntax.

0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7035975
Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.

EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.

Thanks,

** Mindphaser - Community Support Moderator **

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7043020
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
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.

735 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