Logo
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
EPL Standings
 
 
Windows Server

Microsoft SQL Server 2008 R2 : Testing Failover from the Principal to the Mirror

- 2015 Chevrolet Camaro Z28 - The Legend Returns
- Wagon Audi Allroad Vs. Subaru Outback
- 996 Carrera 4S is Driving Perfection
6/11/2012 5:40:04 PM
From the SSMS, you can easily fail over from the principal to the mirror server instance (and back again) by using the Failover button on the Database Properties Mirroring page, as shown in Figure 1.
Figure 1. Testing failover of a mirrored database.


You must test this failover at some point to guarantee that it works. When you click the Failover button for this database mirroring configuration, you are prompted to continue with the failover by clicking Yes or No, as in the dialog shown in Figure 2.

Figure 2. The failover message for database mirroring.

Remember that clicking Yes closes all connections to the principal server instance that are currently connected to this database. Later, we show you how to make your clients aware of both the principal and mirror server instances so that they can just pick up and run against either server instance, by design.

Now, if you look at the Database Properties Mirroring page (see Figure 3), you see that the principal and mirror listener port values have switched: the principal instance is now port value 1440, and the mirror instance is port value 1430. The server instances have completely switched their roles. You must now go to the server instance playing the principal role to fail over back to the original operating mode. If you try to open the current mirror server instance database, you get an error stating that you cannot access this database because it is in restore mode.

Figure 3. Server instances switch roles following a failover.

You can also manually run an ALTER DATABASE command to force failover to the mirrored server as follows:

ALTER DATABASE AdventureWorks set partner FAILOVER;

This command has the same effect as using SSMS or even shutting down the principal SQL Server instance service.

One last note with mirroring a database is that you cannot bring the principal offline as you would be able to do in an unmirrored configuration.

Top Search -----------------
- Windows Server 2008 R2 : Work with RAID Volumes - Understand RAID Levels & Implement RAID
- Windows Server 2008 R2 Administration : Managing Printers with the Print Management Console
- Configuring Email Settings in Windows Small Business Server 2011
- Windows Server 2008 R2 : Configuring Folder Security, Access, and Replication - Implement Permissions
- Monitoring Exchange Server 2010 : Monitoring Mail Flow
- Windows Server 2008 R2 :Task Scheduler
- Windows Server 2008 R2 : File Server Resource Manager
- Windows Server 2008 R2 : Installing DFS
- Exchange Server 2010 : Managing Anti-Spam and Antivirus Countermeasures
- Windows Server 2008 R2 : Configuring Folder Security, Access, and Replication - Share Folders
Other -----------------
- System Center Configuration Manager 2007 : Site and SQL Server Backups (part 3) - Restoring ConfigMgr Backups - Performing a Site Reset
- System Center Configuration Manager 2007 : Site and SQL Server Backups (part 2) - Restoring ConfigMgr Backups - ConfigMgr Functional Crash
- System Center Configuration Manager 2007 : Site and SQL Server Backups (part 1) - Backing Up ConfigMgr
- Security and Delegation in Configuration Manager 2007 : Securing Configuration Manager Operations
- Security and Delegation in Configuration Manager 2007 : Securing the Configuration Manager Infrastructure (part 4) - Securing Service Dependencies for Configuration Manager
- Security and Delegation in Configuration Manager 2007 : Securing the Configuration Manager Infrastructure (part 3) - Securing Configuration Manager Accounts
- Security and Delegation in Configuration Manager 2007 : Securing the Configuration Manager Infrastructure (part 2) - Securing Configuration Manager Communications
- Security and Delegation in Configuration Manager 2007 : Securing the Configuration Manager Infrastructure (part 1) - Securing Site Systems
- Backing Up the Exchange Server 2007 Environment : Establishing Service Level Agreements & Supporting Backups with Documentation
- Recovering from a Disaster in an Exchange Server 2007 Environment : Recovering Active Directory - The Active Directory Database
 
 
Most view of day
- Microsoft Excel 2010 : Calculating the Mode (part 1)
- Microsoft Dynamics CRM 2011 : Using Views to Work with Data Records
- SQL Server 2008 : Creating Indexes via T-SQL (part 2) - Creating Filtered Indexes & Creating XML Indexes
- Using Internet Explorer 8 : Working with RSS Feeds and Web Slices
- SOA with .NET and Windows Azure : Process Abstraction and Orchestrated Task Services (part 3)
- Microsoft Dynamics CRM 2011 : Adding Planning Activities
- Windows Phone 8 : Developing for the Phone - Application Lifecycle (part 1)
- Windows Phone 7 Development : Implementing Data Security (part 2) - Using Rfc2898DeriveBytes and AES to Encrypt Data
- Fine-Tuning MDT Deployments : Creating a Linked Deployment Share (part 1) - Understanding Linked Deployment Shares
- Windows Server 2003 : Creating Role-Specific Server Configurations (part 1) - Securing Domain Controllers
Top 10
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 8) - Configuring Transport Rules
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 7) - Configuring Journal Rules
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 6) - Verifying Edge Subscriptions, Removing Edge Subscriptions
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 5) - Getting Edge Subscription Details, Synchronizing Edge Subscriptions
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 4) - Creating an Edge Subscription
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 3) - Enabling Anti-Spam Features
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 2) - Configuring the Transport Dumpster , Configuring Shadow Redundancy
- Microsoft Exchange Server 2010 : Completing Transport Server Setup (part 1) - Configuring Transport Limits
- Advanced Windows 7 Programming : Working in the Background - DEVELOPING TRIGGER-START SERVICES (part 7)
- Advanced Windows 7 Programming : Working in the Background - DEVELOPING TRIGGER-START SERVICES (part 6)
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro