How to exclude a database from your dump with ZRM (MySQL Community help needed)

Last month, Ronald Bradford, Giuseppe Maxia and Mark Leith spoke about how to simulate a mysqldump –ignore-database.
This mysqldump option doesn’t exist and these three guys have given us various helpful solutions.

But for those of us who use ZRM community to make backup with mysqldump, the –exclude-pattern seems to do the job :

--exclude-pattern "pattern" 
All databases or tables that match the pattern are not backed up. 
If --all-databases or --databases are specified, the exclude pattern applies
to database names. If --database is specified, the exclude pattern applies
to table names. Wildcard characters * (match one or more characters),
? (match one character), [] (match one of the characters specified
within parenthesis) and | (match one of the patterns) are supported.
For example: Exclude pattern "*_db|dbase[123]|abcd" will match names
tom_db, dbase1, dbase2, abcd. All tables or databases that match this pattern
will be excluded. Character # is not permitted in the exclude pattern.

But this option seems to not work properly and I remember that I’ve used a hack to force ZRM to exclude a database from the database list since I used this tools.
I’m not talented enough in perl to really hack the code of this tool, so, I made it simple.

I made ​​a simple change to this file : /usr/bin/mysql-zrm-backup
By adding this new line after the row number 1597 :  $params = “–databases @pdbs”

To obtain that :

} else {
 $params = "--all-databases ";
 @pdbs = &enumAllDatabases();
 if( defined $inputs{"exclude-pattern"} ){
 @pdbs = &filterPattern( @pdbs );
 my $l = @pdbs;
 if( $l == 0 ){
 &printAndDie( "Nothing to backup after exclude-pattern is applied\n" );
 }
 $params = "--databases @pdbs"
 }
 if( $verbose ){
 &printLog( "backup of the following databases will be done @pdbs\n" );
 }

I can now exclude a database from my dump (but not a table).

But I’m sure a talented person could try to review the code to improve it in a right way.
If you are this person, you know what needs to be done…

If you are a ZRM Community edition practicer, share your thoughts about that.

Vote for MySQL[plus] awards 2011 !

First of all, I wish you a happy new year.
Many things happened last year, it was really exciting to be involved in the MySQL ecosystem.
I hope this enthusiasm will be increased this year, up to you !

To start the year, I propose the MySQL[plus] Awards 2011
It will only take 5 minutes to fill out these polls.
Answer with your heart first and then with your experience with some of these tools or services.

Polls will be closed January 31, so, vote now !
For “other” answers, please,  let me a comment with details.

Don’t hesitate to submit proposal for tools or services in the comments.
And, please, share these polls !

 

Best MySQL GUI client Tool

  • SQLyog (47%, 85 Votes)
  • MySQL Workbench (20%, 36 Votes)
  • HeidiSQL (8%, 14 Votes)
  • Navicat for MySQL (7%, 12 Votes)
  • MySQL Administrator / Query browser (6%, 10 Votes)
  • Other (5%, 9 Votes)
  • phpMyAdmin (4%, 8 Votes)
  • SQLWave (1%, 1 Votes)
  • SIDU DB Web GUI (1%, 1 Votes)
  • EMS SQL Manager for MySQL (1%, 1 Votes)
  • Sequel Pro (1%, 1 Votes)
  • sqldeveloper (1%, 1 Votes)
  • dbForge Studio (1%, 1 Votes)
  • MyQuery (1%, 1 Votes)
  • DBTools Manager (0%, 0 Votes)
  • SQL Maestro MySQL Tools (0%, 0 Votes)
  • Toad for MySQL (0%, 0 Votes)

Total Voters: 181

Loading ... Loading ...

 

Best MySQL Monitoring Tool

  • MONyog (35%, 135 Votes)
  • MySQL Enterprise Monitor (29%, 113 Votes)
  • Nagios (13%, 52 Votes)
  • Cacti (10%, 38 Votes)
  • Other (6%, 25 Votes)
  • Zabbix (5%, 19 Votes)
  • Ganglia (2%, 4 Votes)

Total Voters: 386

Loading ... Loading ...

 

Best MySQL Backup Tool (two possible answers)

  • Xtrabackup (46%, 151 Votes)
  • mysqldump (29%, 94 Votes)
  • MySQL Enterprise Backup (28%, 91 Votes)
  • mydumper (9%, 30 Votes)
  • LVM Backup (FS snapshot) (6%, 19 Votes)
  • mylvmbackup (5%, 17 Votes)
  • ZRM Enterprise (5%, 15 Votes)
  • ZRM Community (5%, 15 Votes)
  • Other (5%, 15 Votes)
  • Cold backup (2%, 6 Votes)
  • r1soft CDP for MySQL (1%, 2 Votes)

Total Voters: 329

Loading ... Loading ...

 

Best MySQL Replication/Cluster Tools (two possible answers)

  • MySQL Replication (37%, 183 Votes)
  • Tungsten Replicator (21%, 105 Votes)
  • MySQL NDB Cluster (17%, 83 Votes)
  • ShoonerSQL (16%, 76 Votes)
  • Galera Replication (13%, 66 Votes)
  • DRBD (9%, 45 Votes)
  • Other (2%, 11 Votes)
  • ScaleDB (2%, 9 Votes)

Total Voters: 490

Loading ... Loading ...

 

Best MySQL community Tool

  • Percona toolkit (37%, 117 Votes)
  • MySQL Sandbox (28%, 89 Votes)
  • MHA for MySQL (mysql-master-ha) (14%, 45 Votes)
  • Other (6%, 18 Votes)
  • Xtrabackup Manager (5%, 15 Votes)
  • mysqltuner (3%, 11 Votes)
  • Innotop (3%, 10 Votes)
  • mycheckpoint (2%, 5 Votes)
  • openark kit (1%, 3 Votes)
  • MMM (1%, 3 Votes)
  • Common schema (0%, 2 Votes)

Total Voters: 318

Loading ... Loading ...

 

Best MySQL Support Service

  • SkySQL (38%, 130 Votes)
  • Percona (28%, 96 Votes)
  • Oracle (26%, 90 Votes)
  • Other (4%, 15 Votes)
  • FromDual (3%, 9 Votes)
  • Pythian (1%, 4 Votes)
  • Blue Gecko (0%, 1 Votes)
  • PalominoDB (0%, 0 Votes)

Total Voters: 345

Loading ... Loading ...

 

Best MySQL based distribution

  • Oracle MySQL (36%, 122 Votes)
  • MariaDB (33%, 114 Votes)
  • Percona server (27%, 91 Votes)
  • Drizzle (3%, 11 Votes)
  • Other (1%, 4 Votes)
  • TokuDB (0%, 0 Votes)
  • InfiniDB (0%, 0 Votes)

Total Voters: 342

Loading ... Loading ...

 

Best NoSQL solution (two possible answers)

  • Memcached (46%, 120 Votes)
  • Hadoop / HBase (28%, 72 Votes)
  • MongoDB (25%, 65 Votes)
  • Cassandra (10%, 27 Votes)
  • Other (10%, 27 Votes)
  • HandlerSocket (9%, 24 Votes)
  • CouchDB (6%, 16 Votes)
  • Redis (5%, 13 Votes)
  • Tarantool (4%, 11 Votes)
  • Riak (3%, 7 Votes)
  • Amazon SimpleDB (2%, 5 Votes)
  • Tokyo Cabinet / Tyrant (1%, 3 Votes)

Total Voters: 259

Loading ... Loading ...

 

Best MySQL 5.6 improvement

  • Performances (27%, 77 Votes)
  • Replication (26%, 74 Votes)
  • Fulltext (16%, 47 Votes)
  • memcached API (13%, 36 Votes)
  • Backup/Restore buffer pool (8%, 22 Votes)
  • Partitioning (6%, 16 Votes)
  • Other (4%, 11 Votes)

Total Voters: 285

Loading ... Loading ...

 

Happy 2012 !
Cédric

This article is obviously not sponsored !
(MySQL is a trademark of Oracle Corporation and/or its affiliates)

My slides of MySQL Meetup Viadeo / LeMUG Paris

I was glad to present how to schedule and monitor mysqldump with ZRM community last week in Paris as part of the MySQL Meetup Viadeo / LeMUG

You can find my slides below, enjoy ! :

Thanks to Olivier and all the viadeo team in Paris for this event.
And, of course, thanks to all attendees.
We need more events like that in France !