Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 540
  • Last Modified:

mysqldump question

I have a question about mysqldump.  

I currently run a mysqldump script on my databases daily. One database is very large with blob data and the backup takes quite a while. During the backup we are still able to search update and insert into this database which is necessary at all times.

My question is.. Will mysqldump backup/dump data that is updated or inserted into tables after the mysqldump process is started?

If it does i would be concerned that a restore from the dump would be incomplete.

Example:
Say I have 5 tables. MysqlDump starts dumping and completes the first two tables and starts backing up the third table which is large and takes a while. In the mean time my application is still running and users are inserting and updating data which affects the first two tables that have already been dumped as well as the third which is still being dumped as well as the fouth and fifth table which haven't been dumped yet. This would make for an incomplete record for my application if table three, four and five dumps include the new data but tables one and two don't...
0
Ben720
Asked:
Ben720
4 Solutions
 
johanntagleCommented:
mysqldump by default only locks the current table being backed up, so yes, you are likely going to get tables inconsistent from each other.  Using --databases or --all-databases option will lock and dump all tables a database at a time, which will enable a consistent state, but then you won't be able to do inserts.

Since you put MS OS as one of the zones for this question, I assume your database is on a Windows server, so no option for LVM snapshots.  Suggest you configure replication, then do the backup on the slave while replication is temporarily turned off.

There's also Percona Xtrabackup that does hot backup, but the Windows version is still in Alpha.  See http://www.percona.com/downloads/XtraBackup/XtraBackup-1.6/Windows-alpha/.
0
 
Ben720Author Commented:
Was afraid of that. After some more googleing for backing up the database with out taking it offline I came across "MySQL Enterprise Backup" . It seems to have the ability to do a complete backup while the database is still online (selects/updates/inserts/ect..) then updates the backed up data with any changes made during the backup. Going to run some testing with it, I'll post back the results...
0
 
johanntagleCommented:
Oh yes forgot about that because I don't use it (I believe it's $5000/server?).  Anyway, it's what's Percona Xtrabackup is positioned against - see http://www.percona.com/software/percona-xtrabackup/
0
 
rwwffCommented:
Replication can be a little intimidating to setup the first time, but its really not so bad; and once you have a replication server running, you can do any ole horrible thing to it that you might want without impacting the working server.

0
 
K VDatabase ConsultantCommented:
I'd rather suggest to setup a slave and take a backup from there.
If you are using Innodb "--single-transaction" will help in taking the consistent snapshot.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now