dbTalk Databases Forums  

Consistent logical backup of databases that use MyISAM and InnoDBengines

comp.databases.mysql comp.databases.mysql


Discuss Consistent logical backup of databases that use MyISAM and InnoDBengines in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Radoulov, Dimitre
 
Posts: n/a

Default Consistent logical backup of databases that use MyISAM and InnoDBengines - 09-30-2011 , 05:44 AM






Hi all,
I have a question regarding the logical backup of MySQL databases
that use both MyISAM and InnoDB.

The mysqldump utility supports these two options:

--single-transaction - Creates a consistent snapshot by dumping all
tables in a single transaction. Works ONLY for tables stored in storage
engines which support multiversioning (currently only InnoDB does)
[...]
Option automatically turns off --lock-tables.

-x, --lock-all-tables - Locks all tables across all databases. This
is achieved by taking a global read lock for the duration of the whole
dump. Automatically turns --single-transaction and --lock-tables off.

For InnoDB we need --single-transaction, for MyISAM - lock-tables or
lock-all-tables (in case we need cross-database cosistency).

So how a _hybrid_ database (a database that uses both MyISAM and InnoDB
engines) is supposed to be backed up?



Regards
Dimitre

Reply With Quote
  #2  
Old   
Radoulov, Dimitre
 
Posts: n/a

Default Re: Consistent logical backup of databases that use MyISAM and InnoDBengines - 09-30-2011 , 05:54 AM






On 30/09/2011 12:44, Radoulov, Dimitre wrote:
Quote:
Hi all,
I have a question regarding the logical backup of MySQL databases
that use both MyISAM and InnoDB.

The mysqldump utility supports these two options:

--single-transaction - Creates a consistent snapshot by dumping all
tables in a single transaction. Works ONLY for tables stored in storage
engines which support multiversioning (currently only InnoDB does)
[...]
Option automatically turns off --lock-tables.

-x, --lock-all-tables - Locks all tables across all databases. This is
achieved by taking a global read lock for the duration of the whole
dump. Automatically turns --single-transaction and --lock-tables off.

For InnoDB we need --single-transaction, for MyISAM - lock-tables or
lock-all-tables (in case we need cross-database cosistency).

So how a _hybrid_ database (a database that uses both MyISAM and InnoDB
engines) is supposed to be backed up?
Just to clarify, the question could be reformulated like this:

Do the lock-[all-]tables option guarantee a consistent backup of InnoDB
tables?



Regards
Dimitre

Reply With Quote
  #3  
Old   
Axel Schwenke
 
Posts: n/a

Default Re: Consistent logical backup of databases that use MyISAM and InnoDB engines - 09-30-2011 , 06:29 AM



"Radoulov, Dimitre" <cichomitiko (AT) gmail (DOT) com> wrote:

....

Quote:
Just to clarify, the question could be reformulated like this:

Do the lock-[all-]tables option guarantee a consistent backup of InnoDB
tables?
Yes. But of course the global lock will cause writes to queue up,
so anybody tries to avoid it. I.e. by using InnoDB tables and then
mysqldump --single-transaction


XL

Reply With Quote
  #4  
Old   
Radoulov, Dimitre
 
Posts: n/a

Default Re: Consistent logical backup of databases that use MyISAM and InnoDBengines - 09-30-2011 , 07:37 AM



On 30/09/2011 13:29, Axel Schwenke wrote:
Quote:
"Radoulov, Dimitre"<cichomitiko (AT) gmail (DOT) com> wrote:

...

Just to clarify, the question could be reformulated like this:

Do the lock-[all-]tables option guarantee a consistent backup of InnoDB
tables?

Yes. But of course the global lock will cause writes to queue up,
so anybody tries to avoid it. I.e. by using InnoDB tables and then
mysqldump --single-transaction

Thank you, Axel!
I had this doubt because of the fact that the read lock doesn't
guarantee a consistent *copy of the datafiles* with OS utilities when
InnoDB tables are present in the database. That, of course, is different
than the export generated by mysqldump.

Thanks again!

Best regards
Dimitre

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.