WL#390: Options for better dump control for MySQLDUMP
Status: Assigned
Currently MySQL misses some options which is really useful in real applications: 1) Dumping only some table types. There is usually no need to dump HEAP tables as they anyway can be recreated with server restart, MERGE tables as this will produce major mess during recovery as rows will be attempted to insert both to MERGE table and original underlaying table. Sometimes it does not make sence to dump MYISAM tables - in case they are backed up by faster BACKUP TABLE. 2) Currently mysqldump requires you to dump fixed list of tables/databases or all of them. This is not that comportable. Often you would need to dump all but several tables/databases or dump some tables from different databases in one run. How this would be solved: 1) Controling table types - Options --dump-table-types=TYPE1,TYPE2,TYPE3 and --skip-table- types=TYPE1,TYPE2,TYPE3 will be added. This would allow to specify for which types you do not want data to be dumped - Option --persistent-tables as the alias to --skip-table-types=HEAP,MERGE To easier programm usage - Option --opt will imply --persistent-tables as this is how you would usually like to dump your data. 2) Controling table list --only-dump-tables=d1.t1,d2.t2,t3 Dump only these tables. One may allow specify database name to match. If table name is specified without database name it will be dumped from all specified databases. Of course this option makes sense only for multiple databases. --skip-dump-tables=d1.t1,d2.t2,t3 Skip these tables from dump. Works exactly the same way. --skip-databases=d1,d2,d3 Do not dump some of the databases. Main purpose is to skip cache databases etc. Should be together with --all-databases --dump-regexp=regexp --skip-regexp=regexp These options are to make mysqldump really powerfull backup tool by allowing to match tables to be dumped against these regexp. Full table name (with database name) is matched to be uniform.
Copyright (c) 2000, 2024, Oracle Corporation and/or its affiliates. All rights reserved.