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 : Client Setup and Configuration for Database Mirroring

- 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:42:17 PM
Microsoft has enhanced the client connection capabilities to become mirroring aware. In other words, a client application is now able to connect to either partner in a mirrored configuration. The client would, of course, be connecting only to the server instance that is the current principal. With the help of an extension to the client connection configuration file, all .NET applications can easily add both partners to their connection string information, and when a principal fails, they can automatically establish a connection to the new principal (in a mirrored configuration). Figure 1 shows the added connection string information that you provide in the configuration file (app.config) for your application. This enhancement uses the Failover Partner= addition that identifies the proper failover server instance for this mirrored configuration.
Figure 1. A client connection string configuration identifying the failover partner.

As a bonus, we have provided a small .NET C# client application that you can easily use to test client connections in a database mirroring configuration. With Visual Studio, you just open the WindowsApplication4.sln file (solution file), and the entire application comes up in Visual Studio. Figure 2 shows this simple application in Visual Studio.

Figure 2. A SQL client test program for database mirroring in Visual Studio.

This simple test program displays data from the Product table in the AdventureWorks database (which you are mirroring), along with the exact date and time of the data retrieval, the name of the server instance the data came from, and the SQL process ID (SPID) of the current server instance. This way, you can easily see which physical server the data is coming from. If you are trying to use this program, all you have to do is update the app.config file connection string entry with your two partner server instance names (REM12374333\SQL08DE01 and REM12374333\SQL08DE02, in this example):

ConnectionString=
"Server= REM12374333\SQL08DE01;
 Failover Partner= REM12374333\SQL08DE02;
 Database=AdventureWorks;...."

Then you execute the test application. This application automatically connects to the current principal database (AdventureWorks on the REM12374333\SQL08DE01 server instance, in this example), as you can see in Figure 3.

Figure 3. A SQL client test against the current principal server instance.

Next, you can fail over the principal to the mirror server, using the Database Properties Mirroring page’s Failover button . After you have failed this server over to its mirror (that is, switched roles), you simply click the Retrieve button at the bottom of the client test program to access the data in the AdventureWorks database again. Figure 4 shows this subsequent data retrieval. The test application shows the same data rows, along with the date and time of this data retrieval and the name of the server instance from which it got its data.

Figure 4. A SQL client test against the current principal server instance (formerly the mirror server) after failover.

In this case, the data came from the other partner server instance (AdventureWorks on the REM12374333\SQL08DE02 server instance, in this example). The test application simply uses the added connection information to reestablish its connection to the failed-over server instance (that is, the mirror server), completely transparently to the application.

Other -----------------
- Microsoft SQL Server 2008 R2 : Testing Failover from the Principal to the Mirror
- 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
 
 
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