Mysql backup strategy - backup

I was wondering whats the best way to backup MySQL (v5.1.x) data -
creating mysql data dir archive
use mysqldump
What are the pro/cons for the above? I am guessing mysqldump has some performance impact on a live database. How much impact are we talking about?
We plan to take a backup every few hours, lets say 4 hrs. Whats the best practice around MySQL backups or database backups in general.

I think that the best way is using mysqldump.
Normally I create a cron task to run in a time of little traffic, it generate a dump naming with a timestamp_databasename_enviroment.sql, so it verify if there are old backups and compact it.
I think that is a good form to do database backups.

If your data size is huge then its better to use
MySQL enterprise backup tools.it takes online backup and it will not impact live services.
xtraback is also like MySQL enterprise backup from percona .

Related

Is incremental backup in couchdb possible?

As I'm about to implement it myself, I'm curious to know how people handle
incremental backups for their DB's.
The straight-forward way, as I see it, is to shutdown couch and use a tool
like rsync or duplicity to backup db files. It should do the job well, and
as an added bonus, it could also be used to backup views.
Does anyone know if a similar backup could be done while the couch is still
on (and the db is being updated)?
Does anyone do incremental backups in couchdb2.0?
For incremental backup, you can query the changes feed of a database using the "since" parameter, passing the latest revision from your last backup and then copy only the changes into a new database on the same or different server. AFAIK, there is no "since" parameter for replication, so you will need to roll your own framework for this.

Can HANA incremental backups be scripted?

Can HANA incremental backups be scripted?
As per SAP note ‘1642148 - FAQ: SAP HANA Database Backup & Recovery’:
“Are incremental and differential backups available?
Yes. Starting with HANA SPS 10 incremental and differential data backups are available.
It's also possible to combine both kinds of backups in one backup strategy, e.g. an incremental backup can be created based on a complete data backup, a differential or an incremental data backup.”
SAP note ‘1651055 - Scheduling SAP HANA Database Backups in Linux’ leads me to believe that hdbsql (like the following) could be used in a script:
hdbsql -U user_store_key "backup data INCREMENTAL using backint('backup_prefix')"
But, I am not 100% sure that incremental backups can be scripted.
Any help is very much appreciated.
Many thanks,
Fionn
generally speaking, yes, incremental backups can be scripted just as the other backup options can.
Concerning the mentioned SAP note, well, it is written in the note, the documentation PDF and in the script as well: there is no support nor further development happening with this example script.
So, if a HANA user wants to take the script as a sort of template and create its own script that can do incremental backups, that's definitively possible.
In fact, I'd recommend explaining to that user, that the challenge with INCREMENTAL backups is not so much creating them, but maintaining the backups that have already been made. How long should which backup set be retained? Which backup paths have to be supported/guaranteed? When it comes to housekeeping, increm. backups are much more similar to log backups than to full data backups.
Anyhow, to come back to your original question: yes, that's possible.
Cheers,
Lars

MySQL backup process slowing down inserts and updates

Currently i am using the mysqldump program to create backups, below is an example of how i run it.
mysqldump --opt --skip-lock-tables --single-transaction --add-drop-database
--no-autocommit -u user -ppassword --databases db > dbbackup.sql
I perform alot of inserts and updates on my database through out the day, but when this process starts it can really slow the inserts and updates down, does anyone see any flaw in the way i am backing it up ? (e.g. tables being locked), or is there a way i can improve the backup process so it doesn't effect my inserts and updates as much?
Thanks.
The absolutely best way of doing this without disturbing the production database is to have a master/slave replication set up, you then do the dump from the slave database.
More on MySQL replication here http://dev.mysql.com/doc/refman/5.1/en/replication-howto.html
Even with --skip-lock-tables, mysqldump will issue a READ lock on every table to keep consistency.
Using mysqldump will always lock your database. To perform hot mysql backups, you will need to either set up a slave (that implies some costs) or using some dedicated tools like Percona Xtrabackup (http://www.percona.com/software/percona-xtrabackup), and that is if your database is innoDB (we use xtrabackup for terabytes of data without an issue, on slaves. If your database is not as big, having a slave and locking it to perform the backup shouldn't be that big of a deal :) )

MySQL - how to backup database to a different server?

I have 2 databases with MyISAM tables which are updated once a week. They are quite big in size (one DB is 2GB and the other is 6GB). I currently back them up once a week with mysqldump and keep the last 2 weeks' worth of .sql dumps on the same server where the DBs are running.
I would like, however, to be able to dump the backups to another server, as they are taking up server space unnecessarily. What is the best way to achieve this? If possible, I would like to keep the databases running during the backup. (no inserts or updates take place during the backup process, just selects).
Thanks in advance,
Tim
Were I you, I would create a script that did the backup and then sent the backup elsewhere. I know that is kind of what you are asking how to so, but you left out some things that would be good to know, such as what OS are your two systems running?
Of they are both windows, you could mount a network drive and have the backup dump there (or copy the dump there). If they are linux servers I would recommend copying it across using the scp command. If it is a mix then it gets fun and tricky.
If you are working with linux servers, the following guide should walk you through the process of backup. Click me!
If you are still scratching your head after reading that, let me know what kind of OSes you are rolling with and I can provide more detailed instructions.
Good luck!

DBA - SQL Server 2005 - Backups

I am trying to figure out how SQL Server DBAs are doing their backups and verify in 2005. I use the Idera's free stored procs (which is no longer available to download btw) to backup and verify and have gotten around 65% compression. If there any other free alternative?
Not sure if this is what Idera's scripts do, but you could script a (native) SQL backup to a temporary location, then call PKZip or 7zip or some command-line compression software to compress the backup to a permanent storage location.
Note that most of these zip utilities have a high CPU cost.
See the discussion in the comments of this post:
https://blog.stackoverflow.com/2009/02/our-backup-strategy-inexpensive-nas/
(Edit: Or just upgrade to SQL2008 R2, which supports native backup compression.)
The Idera which you are using an 3rd party tool , with that tool it can be backup/restore & you can monitor for your server & databases..
As you asked the question-
am trying to figure out how SQL Server DBAs are doing their backups and verify in 2005. I use the Idera's free stored procs (which is no longer available to download btw) to backup and verify and have gotten around 65% compression. If there any other free alternative?
SQL server has it's own native tool where you can set up your backup of databases to go disk,
usually with the SSIS packages by using Maitenace plan (or)T-sql(where you can configure Full,differntial and log backup also)(where after backup finish you can check the verify integrity of the backup) but if the database grows more and more then you may need to ensre about the capcity as this goes to disk(here you need cut the backup stragegy for big database say 1TB bcz usually for Big database taking full daily causes lot of I/O then you have to decide weekly full backup along with the other days differntial backup in place) & you should do the cleanup also for howmany days you want(in the same maintenace plan only it exists).
see for ex-http://bradmcgehee.com/2010/01/13/how-to-use-sql-backup-inside-a-maintenance-plan/
but the backup/restore totally depends on how well you manage from your side by knowing the business risk & communincated with them.
In sql server 2008 onwards you have backup compression like how the Idera sql safe does.
But the Backup usually depends on what they have Implemented whether from the Native tool or from any other 3rd part like Commvault,Idera,TDP(goes to tape) etc... it depeds on what is agreed for.
Backup-
http://msdn.microsoft.com/en-us/library/ms186865.aspx
Free (good) SQL Server DBA tools are hard to find. = /
Have you considered Windows Backups?
It's definitely not the best thing out there, and it takes up a lot of space, but it is free, it does backup your data, and you already have it installed.