Mirrors aren’t backups

Are you using any of these technologies as a method of database protection?

  • Database mirroring (keeping two database servers synchronized with the same data via SQL 2005/2008)
  • Replication (copying records between databases)
  • Log shipping (copying log files to another server and restoring them immediately)
  • SAN-based mirroring (storing two copies of your database on two different sets of disks)

Do you think you’re completely protected by using these technologies?

If so, you’re dangerously wrong.

Take this all-to-common scenario: a developer screws up and deletes or updates a large number of records.  Being a developer, he doesn’t fess up to the problem right away, because he’s going to try to figure out another way around the problem.  Hours later, when he finally confesses to his manager and they track you down, the data changes have already replicated to your other systems, and the data is gone.

Or heaven forbid, a less common but even scarier scenario: an employee decides he’s had enough, and wants to screw you before he quits.  He writes a delete statement to run on Friday night at 5pm, walks out the door, and it’s a long weekend before you find out what happened.  Toss in “hacker” instead of employee, and it gets even worse.

There is no substitute for regular backups.

These backups need to be located offline, somewhere that a malicious (or incompetent) DBA can’t access.

My favorite scenario is to use a file share that the SQL Server service account can write to, but can’t change.  The DBAs don’t get write access to that share either – they can read, but not write or delete.  The network or backup team is responsible for getting those file backups off to tape, and then out of the building, as soon as possible.  Retain these backups as long as possible.

For more tips, check out my best practices for SQL Server backups.

3 Responses to Mirrors aren’t backups
  1. K_Brian_Kelley
    February 4, 2009 | 5:04 PM

    Yes, I'm going to be nitpicky, but I'm a security guy and since you're pointing out a security shortfall (integrity and availability on the C-I-A triad) II think you need to better define "database protection." You are using it in a narrow scope, as in, "protect data loss or malicious data change." None of these solutions provide database protection from a confidentiality attack using the C-I-A triad. Something as simple as "net stop mssqlserver" and then copy off the .mdf, .ldf, and .ndf files. :)

    • Brent Ozar
      February 4, 2009 | 5:43 PM

      That's absolutely true. In order to get that level of protection, you also have to watch the SAN, because the SAN admin doesn't even need to stop SQL Server in order to take a snapshot at the disk level. Granted, the database might be corrupt, but he can try it a few times to get a good copy and you'll never know the difference.

  2. DavidStein
    February 4, 2009 | 5:05 PM

    Too bad the guys at JournalSpace didn't consult with you 6 months ago.

Leave a Reply


Wanting to leave an <em>phasis on your comment?

Trackback URL http://www.brentozar.com/archive/2009/02/mirrors-arent-backups/trackback/


July 20 - Silicon Valley SQL Server User Group - Top 10 SQL Server Scaling Problems

July 21 - Quest Day-Long Virtual Conference - Perfmon, wait stats, Blitzes, and more.

July 31 SQLSaturday South Florida - frrrreeee training!

Aug 2-6 SQLCruise - learn about SQL Server in Miami, Key West, and Cozumel.

More Upcoming Events