List:Cluster« Previous MessageNext Message »
From:Tom Hanlon Date:January 1 2010 7:03pm
Subject:Re: MySQL NDB Cluster Table definition manipulation
View as plain text  
Pekka Nousiainen wrote:
> On 091231, Manasi Save wrote:
>> Does anyone have any idea if I can manipulate NDBCluster table at OS level. 
> 
> Short and sweet: no.
> 
>> What I want to do is I want to copy-paste database file of NDB Database file. 
>> Like the way we can do with InnoDB. by just putting dummy data definition and we
> can overwrite file with actual records. 
> 
> I don't know InnoDB (except as Oracle imitation).
> Not sure what above means, tablespaces?
> 
I think I know what he means...

To MySQLD a table exists because there is an .frm file (more or less)

So in a MyISAM example I can clone a table by

mv tablename.frm newtable.frm  (this defines the table)
mv tablename.MYD newtable.MYD (the data is in this file)
mv tablename.MYI newtable.MYI (the indexes are in here)

In innodb although I have not tried I believe the Original Poster is 
implying that you could do the same, assuming innodb file per table.


mv tablename.frm newtable.frm  (this defines the table)
mv tablename.IBD newtable.IBD (the data is in this file)

Moving Innodb tables around like this _might_ work, I have not tried. 
The risk is that the additional information regarding innodb that is 
stored in the log files. I guess if the server has shut down cleanly.. 
then you would get a clean copy. Or come to think of it the undo-redo 
information might be part of the tablespace itself. Regardless I think 
this is the operation that the original poster is discussing.

Okay, now with cluster..
Each sql node does have an frm file.. Copy and rename those.. Storage 
engine is defined there.

Then on each ndb.. after a shutdown or a checkpoint what is the disk 
based representation of a table and is the name of any significance ? If 
I renamed these files do they represent another table ? I doubt it but 
at least now a cluster expert can tell us whether it would work or not.

Also the table is partitioned so each node has a partition of the data, 
it sure does not seem likely to work.. But perhaps I have clarified the 
Original posters intent... or perhaps not.

-- 

Tom Hanlon
Certified MySQL DBA
Certified Cloudera Certified Hadoop Professional (CCHP)

Thread
MySQL NDB Cluster Table definition manipulationManasi Save31 Dec
  • Re: MySQL NDB Cluster Table definition manipulationPekka Nousiainen31 Dec
    • Re: MySQL NDB Cluster Table definition manipulationTom Hanlon1 Jan
  • Re: MySQL NDB Cluster Table definition manipulationStewart Smith14 Jan
Re: MySQL NDB Cluster Table definition manipulationManasi Save7 Jan
  • Re: MySQL NDB Cluster Table definition manipulationSuresh Kuna7 Jan
Re: MySQL NDB Cluster Table definition manipulationManasi Save7 Jan
  • Re: MySQL NDB Cluster Table definition manipulationSuresh Kuna7 Jan
Re: MySQL NDB Cluster Table definition manipulationManasi Save7 Jan
  • Re: MySQL NDB Cluster Table definition manipulationSuresh Kuna7 Jan
    • Re: MySQL NDB Cluster Table definition manipulationStewart Smith14 Jan
  • Re: MySQL NDB Cluster Table definition manipulationAndrew Hutchings7 Jan
    • Re: MySQL NDB Cluster Table definition manipulationTom Hanlon7 Jan
      • Re: MySQL NDB Cluster Table definition manipulationAndrew Hutchings7 Jan
    • Re: MySQL NDB Cluster Table definition manipulationTom Hanlon7 Jan