High Availability with SQL Server 2005
This was a great session. It was cut a little short by an EMERGENCY EVACUATION!!! Go figure. :) It focused on the new enhancements that SQL Server 2005 has added to provide for greater flexibility and implementation of high-availability networks. For those who are members of PASS, the slides can be downloaded from www.sqlpass.org when the conference is over. Here are my takeaways from the session:
- Covered Database Mirroring.
- Can be a long ways away.
i. Have to keep transactions in sync though, which can cost performance.
ii. Don’t need to be on compatability list like clustering.
iii. Should run equal hardware though; however, it’s not a requirement.
iv. No shared disk.
- Can pick synchronous/asynchronous.
i. A client attached to the “principal” server.
ii. Principal server sends “secondary transactions” to the “mirror” server.
iii. There is a “witness”. Provides vote on who is principal and mirror. Provides the winning vote. Allows failover if the connection breaks between principal and mirror vs. the actual servers failing.
- We can use database snapshots on the mirror, put it in read-only, and use it for reporting.
- To become the Principal, a server must talk to at least one other server. Can provide some long distance problems.
- Big question came up on whether you can mirror the master database.???
i. This is a great question. The answer appears to be no.
ii. Would be a problem.
- It’s pretty efficient because it catches the writes in the log buffer and automatically sends the log entries to the other server. There’s two types of commits:
i. Safety mode: Verifies the commit on the other side before it commits. Has automatic failover capability.
ii. Safety off: Just forgets about the transactions after it sends them.
- Because it’s just sending stuff, when you rollback a transaction it’s slower. It has to verify the rollback on the other side as well.
- DDL Changes are captured.
- Is able to handle multiple databases together with cross-database updates.
i. Need to find out more information. This wasn’t covered as the session was cut short.
- Can you tell how much latency exists between the mirrors?
i. Would be very efficient in a SAN configuration.
- There’s a client library to automatically redirect to mirror. Requires no changes to application code. Client automatically redirected if session is dropped. It’s aware of the principal and mirror servers. The library caches mirror name upon initial connect to principal.
- There is a manual failover process if you decide to use asynchronous.
i. ALTER DATABASE db SET PARTNER FAILOVER
- Covered replication, log shipping, cold standby.
Database Snapshots (new)
- Not changing log shipping. Lots of sessions on replication.
- Good chart on how to choose different types of failover.
- Allow recovery from user erros by allowing the database to go back in time.
- Multiple snapshots are allowed.
- It’s read only. To drop the database it’s attached to, you need to drop the snapshot first.
- CREATE DATABASE mydbsnap ON (filelist) AS SNAPSHOT OF mydb
- DROP DATABASE mydbsnap
- You can restore from a snapshot database.
i. RESTORE DATABASE mydb FROM DATABASE_SNAPSHOT = ‘mydbsnap0600’.
ii. Good Question: Can you restore to a different database?