MySQL Forums
Forum List  »  Partitioning

Re: Archiving Partition .MYD files
Posted by: Mattias Jonsson
Date: December 22, 2009 03:00AM

Disclaimer: I have not tested this and it should be considered as a 'hack'!

It should be possible to archive the partition by:

create table archived_part like partitioned_table;
alter table archived_part remove partitioning;
<shut down server or LOCK/FLUSH>
cp partitioned_table#P#<partition>[#SP#subpartition].MYD archive_part.MYD
cp partitioned_table#P#<partition>[#SP#subpartition].MYI archive_part.MYI
<start server or UNLOCK/FLUSH>
alter table partitioned_table DROP PARTITION <partition>;
select * from archived_part;

I am actually experimenting with 'ALTER TABLE t1 EXCHANGE PARTITION p WITH TABLE t2' which will make it possible to do this properly, watch out for worklog 4445.

Options: ReplyQuote


Subject
Views
Written By
Posted
5604
December 11, 2009 05:41AM
2723
December 11, 2009 05:48AM
2668
December 12, 2009 03:48PM
Re: Archiving Partition .MYD files
2899
December 22, 2009 03:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.