Solved

Non-Partitioned to Partition Table

Posted on 2001-06-03
5
1,669 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
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

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

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
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…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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.

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now