• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

SQL 2008: Best way to perform backups on Windows Server 2008?

What would be the best way to implement backups for an SQL 2008 instance with a dozen or so databases running on Window Server 2008 R2? I was thinking weekly or bi-weekly full backups with daily differentials.  How would it be best implemented?
0
VoodooFrog
Asked:
VoodooFrog
  • 4
  • 3
  • 2
2 Solutions
 
niazCommented:
There are many question to be asked before you implement a backup policy. I'm sure all the databases on a server are not of same importance. You should categorize the database based on Service Level Requirements, Size, Role (Production, Dev/Test etc) and Type (OLTP, Data Warehouse, Reporting etc.) then consider the implementation.

As a general rule of thumb, the target should be that critical databases must be backup so that there is no loss of data. That is could be a combination of Full, differential and transaction log backup.

Please see the link below to see how it could be implemented to minimize the loss.

http://www.sqlbackuprestore.com/mainbackuptypes.htm
0
 
VoodooFrogAuthor Commented:
Thank you, that link explains the differing backup types and their uses very well.  I the best way to schedule the backups using Task Scheduler? or is there a better way of managing the scheduling of the backups?
0
 
niazCommented:
I use the SQL server agent to schedule jobs. You can create a step to email you an alert using "sp_send_dbmail " in case of a failure with some detail information related to failure or you can use the notification tab to add a group or individual operators to receive failure alerts.

exec msdb.dbo.sp_send_dbmail
@profile_name ='sqlsvc',
@recipients = N'abc@xyz.com',
@subject = N'PUBS Data Backup Succeeded on <hostname>',
@body = ' PUBS FULL Backup Succeeded on <hostname>';

You can also log the  SQL Agent Jobs to a log file and view history.
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
pieropingiCommented:
If you have a Window Server 2008 with a dozen of databases I assume it must serve an enterprise in a production installation. So I would put a second HD and configure a RAID 1 (mirror) array. If there is a problem on one HD, data are at disposition. This would be my first level of back-up and would garantize me to avoid service interruptions. The costs are really low.

About the choice between full and differential, I thanks niaz for the very explanatory link above.

I determine the frequency of back-ups depending on the following criteria (in order of importance):
1 - The importance of the data written to the server. Am I doing accounting or data warehouse, or am I logging web traffic? In the first case I need absolutely all the operations restored, in the second I can accept some loss of data.
2 - The number of operation pro day (or pro hour, minute, second): this will determine the time I need to recover the actual situation in case of data restore (eventually the time I need to manually re-insert the operations that are not in the last back-up). The more operations I have, the often I want to back-up.
3 - The work-load for the server: is the server working near his limits? Are the back-ups slowing down the machine and db-response times? But if my data are very important the solution is to empower the hardware and do more back-ups.

I hope you can understand my bad english.
0
 
niazCommented:
If you want to go to next level of data protection after RAID implementation and are running mission critical databases and can't afford loss of data or down time for recovery, you should also look into Log Sipping, Mirroring, Replicaion and Clustering. These are some of the solution available within SQL Server for disaster recovery and high availability.

You decision to implement any strategy should be based on the three points listed above by "pieropingi" and the Service Level Requirement (SLR).
0
 
VoodooFrogAuthor Commented:
If you had to write a t-sql statement to backup every database, how would you do it?  Ideally I would like to write it so that if a new database is created, it will be backed up without having to alter the Job.

I will include the code I have so far:
DECLARE @BackupLocation varchar(255); 

SET @BackupLocation = 'X:\MyBackups\' + REPLACE(CONVERT(VARCHAR(19), GETDATE(), 120),':','.') + ' - Full Backup.bak';

BACKUP DATABASE [DatabaseName] TO DISK = @BackupLocation;

Open in new window

0
 
pieropingiCommented:
Perhaps my intervention is trivial, but not knowing you and having seen several times bad things, I cite an obvious point:
every back-up has to be on a phisically separated storage device (not in D: drive on a second partition of the same hard disk, please!) in case of hardware-failure. That can be a second internal IDE, SATA or SCSI/SAS hard disk, an external-one (USB or FireWire) or a networked-one, depending on server-load and data-volume.
Having big amounts of strategical data, I will avoid external HDs preferring internal SATA with Native Command Queuing technology. Motherboard must also support NCQ. With this configuration SATA is even faster and really cheaper as SCSI. In case of PC substitution, It has more flexibility, too.
0
 
VoodooFrogAuthor Commented:
Pieropingi, thank you for the input, I have this covered.  The system drive is mirrored.  I also have a RAID 5E set up with 4 drives for data storage.  The backups are going to data raid, where they will be then uploaded to an offsite location.
0
 
niazCommented:
I would not recommend to have just one script to do all database backup. Having all eggs in one basket is not a good idea. You can either create separate jobs for each DB or group databases based on the criticality and create jobs for each group. Still I would recommend to create separates steps for each DB within each job.

But if you still want to keep the backup process on auto pilot you can use the un-documented stored procedure "sp_foreachdb"

EXEC sp_foreachdb
       @command = N'BACKUP DATABASE [?]
               TO DISK = ''C:\databasebackups\?.bak''  WITH INIT, COMPRESSION;',
       @user_only = 1,
       @recovery_model_desc = N'SIMPLE',
       @suppress_quotename = 1;

You can also use the script discussed in the following link.
http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/d74615c2-edc0-4a65-b8a6-fdb1d1108027/

Yet another simple approach is to create a maintenance plan for all you databases.
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now