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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Drop Partitioning

Re: Drop Partitioning

From: Bryan Wells <bunjibry_at_gmail.com>
Date: Thu, 4 Aug 2005 18:56:56 -0600
Message-ID: <b78d5a200508041756195331e2@mail.gmail.com>


Here is what I did...
 I was able to get it to work. well kinda. I removed all the physical datafiles to create a little more disk space, however i still see the partitioned tablespaces in the instance, eventhough they are offline. I cant get them to drop???
 Please keep in mind before heckling me, im fairly new at this and learning the best way I can. Ass to the fire!
 add disk space to following tablespaces so that there is 2 times the amount available:    

merge all partitions down to one single partition    

create new table <base.invoice_new> with DDL of old table <base.invoice> only without partitioning
alter table base.invoice exchange partition BASE_INVOICE_FY00_05 with base.invoice_new;
alter index (new indexes) rebuild compute statistics on <base.invoice_new> drop table base.invoice cascade constraints; determine which tablespace holds new table    

create new data and index tablespaces    

rename <base.invoice_new> to <base.invoice> ==> need to login as table/schema owner
alter table base.invoice nologging 
alter table base.invoice move tablespace base_invoices 
alter table base.invoice logging 

drop old partitioned tablespace
resize tablespace to be @ 50% capacity
verify and/or apply indexes where needed alter index (new indexes) rebuild compute statistics backup controlfile to trace
 however i still see partitions in the instance, eventhough they are offline. I cant get them to drop
 On 8/4/05, Sriram Kumar <k.sriramkumar_at_gmail.com> wrote:
>
> Hi,
>
> I think you can use the dbms_redefinition package. i used sometime
> back and was successful in doing it.
>
> Regards
>
> Sriram Kumar
>
> On 8/3/05, Bryan Wells <bunjibry_at_gmail.com> wrote:
> > But I have 5 partitions. I guess the experiment will tell me if i can
> > EXCHANGE all five into one new table eh?
> >
> > Thanks for the quick response
> >
> > On 8/3/05, Hallas, John, Tech Dev <John.Hallas_at_gb.vodafone.co.uk> wrote:
> > >
> > >
> > >
> > > I think it is much simpler than that. Experiment first though
> > >
> > >
> > >
> > > John
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > ALTER TABLE <table_name>
> > > EXCHANGE PARTITION <partition_name>
> > > WITH TABLE <new_table_name>
> > > <including | excluding> INDEXES
> > > <with | without> VALIDATION
> > > EXCEPTIONS INTO <schema.table_name>;
> > >
> > >
> > > ALTER TABLE sales
> > > EXCHANGE PARTITION feb97 WITH TABLE sales_feb97
> > > INCLUDING INDEXES
> > > WITHOUT VALIDATION
> > > EXCEPTIONS INTO uwclass.problems;
> > >
> > >
> > >
> > >
> > >
> > > ________________________________
> >
> > >
> > > From: oracle-l-bounce_at_freelists.org [mailto:
> > oracle-l-bounce_at_freelists.org] On Behalf Of Bryan Wells
> > > Sent: 03 August 2005 10:57
> > > To: Oracle-L
> > > Subject: Drop Partitioning
> > >
> > >
> > >
> > >
> > >
> > > We have a test box that we want to remove partitioning from. does
> anyone
> > have the steps to retain table data while dropping the date range
> > partitioning. My first thought was the following. please correct me
> where
> > I go astray:
> > >
> > > export the table data
> > > create similar table in the same tablespace with the appropriate
> > constraints/indexes
> > > insert into <new> as select * from <old>
> > > alter table <old> drop partition
> > > drop table <old> cascade
> > > alter table <new> rename to <old>
> > >
> > >
> > >
> > >
> > >
> > > Thank you in advance for your help and expertise...
> > >
> > >
> > >
> >
> >
> >
> > --
> > Bryan Wells
> > bunjibry_at_gmail.com
> > Oracle DBA hopeful
>
-- 
Bryan Wells
bunjibry_at_gmail.com
Oracle DBA hopeful

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Aug 04 2005 - 20:00:38 CDT

Original text of this message

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