Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

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

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
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.

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
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server