{"id":2605,"date":"2015-10-21T10:12:57","date_gmt":"2015-10-21T14:12:57","guid":{"rendered":"https:\/\/academy.sqlbak.com\/?p=2605"},"modified":"2023-10-17T05:41:49","modified_gmt":"2023-10-17T09:41:49","slug":"database-backup","status":"publish","type":"post","link":"https:\/\/academy.sqlbak.com\/database-backup\/","title":{"rendered":"Database Backup"},"content":{"rendered":"
Everyone who works with SQL Server databases\u00a0first or last faces the need to protect their information. That implies making database backups. So what is a database backup?\u00a0Database backup is a process of saving your database in its present condition. It allows making a copy of your database in case you made some unnecessary\u00a0changes and want to roll back or your primary database is corrupted.<\/p>\n
There are three\u00a0main types of backup:<\/p>\n
Keep in mind that in order to maintain your databases safe and sound you should make backups regularly. The question here is: “How often should I backup my databases?” The answer is: it\u00a0depends on how large your database is, how often you make changes to your database and how important your data is, etc. For example, you can make a full backup every 24 hours, differential backup every 6 hours and backup your transaction log every hour.<\/p>\n
There are many ways of making database backups. However, in this article we are going to explore only three of them.<\/p>\n
For making\u00a0a full backup<\/strong>\u00a0execute “BACKUP DATABASE” command:<\/p>\n For differential backup<\/strong> you need to add “WITH DIFFERENTIAL”\u00a0clause:<\/p>\n For\u00a0transaction log backup <\/strong>use “BACKUP LOG” command:<\/p>\nBACKUP DATABASE <\/span>your_database <\/em>TO DISK<\/span>\u00a0= 'full.bak'<\/span><\/pre>\n
BACKUP DATABASE <\/span>your_database <\/em>TO DISK<\/span> = 'diff.bak'<\/span> WITH DIFFERENTIAL<\/span><\/pre>\n
BACKUP<\/span> LOG<\/span> your_database<\/em> TO DISK<\/span> = 'log.bak'<\/span><\/pre>\n
How to Backup SQL Server using SSMS<\/h2>\n