Tara Kizer Blog

Tara Kizer

How to failover Database Mirroring in SQL Server 2005 using T-SQL

I've previously shown how to setup Database Mirroring in SQL Server 2005 with T-SQL, but how do you failover to the mirrored databases using T-SQL? Here's how: --Run on principal USE master GO ALTER DATABASE dbName SET SAFETY FULL GO ALTER DATABASE dbName SET PARTNER FAILOVER GO --Run on new principal USE master GO ALTER DATABASE dbName SET SAFETY OFF GO If you are using synchronous database mirroring, just ignore the "SET SAFETY" commands. Read more →

SQL Server 2005 Performance Dashboard Reports

If you have SQL Server 2005 service pack 2 installed on your database server, then you might want to check this out. "The SQL Server 2005 Performance Dashboard Reports are Reporting Services report files designed to be used with the Custom Reports feature introduced in the SP2 release of SQL Server Management Studio" and "are used to monitor and resolve performance problems on your SQL Server 2005 database server. Read more →

Defragment Indexes stored procedure

UPDATE: This stored procedure has been updated. This stored procedure defragments indexes in SQL Server 2005. It utilizes sys.dm_db_index_physical_stats, a dynamic management function, to retrieve the fragmentation levels. If you plan to use DETAILED for @statsMode, you may want to consider running the query that builds the #FragIndex table on a database snapshot. Read more →