简体   繁体   English

SQL Server 2005备份策略

[英]SQL Server 2005 Backup strategy

I manage a web application for a client with the following specs: 我通过以下规范为客户管理Web应用程序:

  • ASP.net 3.5 running on a Virtual Windows 2003 Web Server 在虚拟Windows 2003 Web服务器上运行的ASP.net 3.5
  • SQL Server Standard hosting the database 托管数据库的SQL Server Standard
  • Database current size of 6Gb, with 1Gb/month growth rate 数据库当前大小为6Gb,月增长率为1Gb
  • One single table is responsible for 98% of the size, holds the most critical data for the client 一个表负责98%的大小,为客户保存最关键的数据
  • Log is not kept for this big table, only selects are done in this table 该大表不保留日志,仅在该表中进行选择
  • 50 Gb FTP space avaiable for backup 50 Gb FTP空间可用于备份

Considering this scenario, what would be the best strategy for a SQL Backup and what tool would be best suited for this task (commercial applications included, client can pay for the license fee)? 考虑到这种情况,SQL备份的最佳策略是什么,哪种工具最适合此任务(包括商业应用程序,客户可以支付许可费)?

It depends how critical is the data. 这取决于数据的重要性。 Here is however how I i'd do it. 但是,这就是我的做法。 1. Run a full backup every day. 1.每天运行一次完整备份。 2. Run a differential backup every 4 hours. 2.每4小时运行一次差异备份。 3. Run a transactional log backup every 15 minutes 4. Keep a copy at the site and move a copy off the site as well as soon as the backup is done. 3.每15分钟运行一次事务日志备份。4.在站点上保留一份副本,并在备份完成后立即将副本从站点上移开。

The database is not too big, and this is easily doable. 数据库不是太大,这很容易做到。

Use a third party tool like Redgate SQL Backup and it will automatically compress and encrypt the database backup for you. 使用第三方工具(如Redgate SQL Backup) ,它将为您自动压缩和加密数据库备份。 I have used it extensively and am a big fan. 我已经广泛使用它,并且非常喜欢。

Additionally if you another site available, and the data is very critical, you might want to think about setting up log shipping as well. 此外,如果另一个站点可用,并且数据非常重要,则您可能还需要考虑设置日志传送。

Here is the strategy we use for CodePlex.com: 这是我们用于CodePlex.com的策略:

  • All SQL servers run with a peer server using SQL mirroring 所有SQL服务器都使用SQL镜像与对等服务器一起运行
  • Weekly full backup (stored on separate drive from databases) 每周完整备份(与数据库存储在单独的驱动器上)
  • Daily differential backup (stored on separate drive from databases) 每日差异备份(存储在与数据库不同的驱动器上)
  • Transaction log backup every 5 minutes (stored on separate drive from databases) 每5分钟备份一次事务日志(存储在与数据库不同的驱动器上)
  • Daily tape backup 每日磁带备份
  • Tape backups taken offsite weekly 每周异地备份磁带

Also very important test your backups! 测试您的备份也很重要 Studies have shown that over 30% of untested backup procedures are flawed. 研究表明,超过30%的未经测试的备份过程存在缺陷。 Here is our backup testing strategy: 这是我们的备份测试策略:

  • Every 30 minutes verify the full backup file exists (using scheduled task) 每30分钟验证完整备份文件是否存在(使用计划任务)
  • Every 30 minutes verify the differential backup file exists (using scheduled task) 每30分钟验证差异备份文件是否存在(使用计划任务)
  • Every 30 minutes verify the transaction log backup file exists (using scheduled task) 每30分钟验证一次事务日志备份文件是否存在(使用计划任务)
  • Every 30 minutes verify the database mirroring is configured (using scheduled task) 每30分钟验证一次数据库镜像配置(使用计划任务)
  • Every day, do a test restore of the full+differential backup and report the table row counts (using scheduled task) 每天都要对完整备份和差异备份进行测试还原,并报告表行计数(使用计划任务)
  • Once a month do a test restore of the most recent tape backup and verify the data 每月一次,对最新的磁带备份进行测试还原,并验证数据

This is a VPC? 这是VPC吗? Can you install apps? 您可以安装应用程序吗?

http://www.jungledisk.com/ http://www.jungledisk.com/

That's what we use - make a sql job that pushes out a backup every day, then use that service to push a copy back to Amazons S3 service. 这就是我们使用的-制作一个每天执行一次备份的sql作业,然后使用该服务将副本推回到Amazons S3服务。 If not maybe you could have a local app that pulls the backup to a machine then pushes it /w S3 webservice, or still using Jungledisk. 如果不是这样,您可能有一个本地应用程序将备份拉到计算机上,然后将其推送到/ w S3 Web服务,或者仍在使用Jungledisk。

This is important! 这个很重要! If your app goes down it hurts! 如果您的应用程序出现故障,则很痛苦! Also make sure you backup your deployed app and resources stored there... ie uploaded content to your apps storage directory. 还要确保备份已部署的应用程序和存储在其中的资源...即将内容上载到应用程序的存储目录。

I was supposed to type in my answer to your question but I realized there are lots of far greater resources somewhere like this article in SQLServerCentral.com . 我本应该输入对您问题的回答,但是我意识到,像SQLServerCentral.com中的这篇文章一样,这里有很多更多的资源。 You can also find lots of "Best Practices on Backup" like this one . 您还可以找到许多类似的“备份最佳实践”。

You might also want to take into consideration how much data you can afford to lose and how long it will take you to restore the database. 您可能还需要考虑丢失多少数据以及恢复数据库需要多长时间。 Your client may decide that they never want to lose more than 15 minutes of data ever, or they may decide that losing up to a days worth of data is okay with them. 您的客户可能会决定他们永远不会丢失超过15分钟的数据,或者他们可能会认为丢失长达一天的数据是可以的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM