we have 30 GB database.we want to take backup of this database.
here the question is we want to take the backup batch of every 10k records.
How we can take batch of records backup using mysqldump
Here is something you may find intriguing
SUGGESTION #1 : Let mysqldump create the batches
mysqldump already uses an option called --extended-insert. This will group a series of records that can be loaded in a single INSERT command. While you cannot use mysqldump to control the number of rows to be batched together, you can parse a mysqldump. Of course, these means you will have to script it in the language of your choice (Python, Perl, C++, etc).
For any given table in a mysqldump of a single database, you will see the following paradigm:
You could parse the mysqldump as follows:
Each INSERT command you read has a certain number of rows. This number you cannot control unless you script to put them together in the number of rows you choose. I would advise against that be mysqld decided the best number of rows for that particular batch given the current configuration settings (perhaps the max_allowed_packet)
SUGGESTION #2 : Use