IT tutorials
 
Database
 

Microsoft SQL Server 2008 R2 : Setting Up and Configuring Database Mirroring (part 5) - Monitoring a Mirrored Database Environment & Removing Mirroring

2/27/2012 6:19:14 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

Monitoring a Mirrored Database Environment

After active mirroring has started, you can monitor the complete mirrored topology in a few ways. You can start by registering the database being mirrored to a new facility within SSMS called Database Mirroring Monitor. Database Mirroring Monitor allows you to monitor roles of the mirroring partnership (that is, principal, mirror, and witness), see the history of transactions flowing to the mirror server, see the status and speed of this transaction flow, and set thresholds to alert you if failures or other issues occur. In addition, you can administer the logins/service accounts being used in the mirrored database topology.

Figure 15 shows how you launch the Database Mirroring Monitor from SSMS: you right-click the principal database being mirrored, choose Tasks, and then choose Launch Database Mirroring Monitor.

Figure 15. Launching Database Mirroring Monitor from SSMS.

You must register the database being mirrored. To do so, you select the principal or mirror server instance and set the Register check box for the database. Database Mirroring Monitor registers the database and both partner server instances, as shown in Figure 16.

Figure 16. Registering the mirrored database within the Database Mirroring Monitor.

After the database is registered, all partners and the witness server instances show up in the Database Mirroring Monitor, as shown in Figure 17.

Figure 17. The registered database and status of each mirroring partner.

At a glance, you can see which server is playing what role (principal or mirror) and whether each partner has defined and is connecting to a witness server. In addition, you can see the unsent log (in size), the un-restored log (in size), when the oldest unsent transaction occurred, the amount of time it took to send the transaction to the mirror server instance, the send rate (KB/second), the current rate at which the transactions get restored (KB/second), the mirror commit overhead (in milliseconds), the listener port of the witness server instance, and the operating mode of the mirroring (in this case, high safety with automatic failover—synchronous).

Figure 18 shows the detailed transaction history for a particular part of the mirroring flow (either the send out of the principal part or the restore to the mirror part). You can click the appropriate partner to see all transaction history details of the mirrored copy and restore process.

Figure 18. Transaction history of mirroring partners.

If you click the Warnings tab of the Database Mirroring Monitor, you can set various thresholds within the monitor to alert you when they have been reached (see Figure 19). Basically, you want to set thresholds that monitor the effectiveness of the mirroring operation.

Figure 19. Setting thresholds to monitor mirroring effectiveness.

If these key thresholds are ever exceeded, you want to be notified that something is very wrong and that failover may be in jeopardy. When a threshold is exceeded, an event is logged to the Application event log. You can configure an alert on this event by using SSMS or Microsoft Management Operations Manager (MOM). The threshold levels depend on your own failover tolerance. Our advice is to monitor the transaction and transfer rates for a peak period and then set the thresholds to be 100% higher than that. For example, if you see a peak mirror commit overhead value of 750 milliseconds, you should set the threshold to 1,500 milliseconds. This should be within the tolerance for commit overhead in your organization.

Figure 20 shows how easy it is to administer the service accounts/login IDs being used for database mirroring. You simply click an Edit button to change or set the login account you want to use for database mirroring at each instance in the mirroring topology.

Figure 20. Setting service accounts/login IDs within the mirroring topology.

From the Database Properties Mirroring page, you can easily pause (and resume) database mirroring if you suspect that there are issues related to the mirroring operation. In addition, you can easily see what role each server instance is playing.

Removing Mirroring

Very likely, you will have to remove all traces of database mirroring from each server instance of a database mirroring configuration at some point. Doing so is actually pretty easy. Basically, you have to disable mirroring of the principal, drop the mirror server’s database, and remove all endpoints from each server instance. You can simply start from the Database Properties page and the Mirroring option and do the whole thing. Alternatively, you can do this through SQL scripts. Let’s first use the Mirroring options. Looking at the options on Figure 21, you simply choose to remove mirroring (from the principal server instance). This is just a bit too easy to do—almost dangerous!

Figure 21. Removing database mirroring.

The mirroring process is immediately disabled. When mirroring is disabled, you can drop the database on the mirror server instance, remove the endpoints on each server instance (that is, principal, mirror, and witness instances), and be done—all through SSMS. This approach is straightforward.

If you’re removing mirroring with SQL scripts, however, you need to break the mirroring from the principal, remove the principal’s endpoint, drop the mirror database and remove the mirror’s endpoint, and then drop the witness server’s endpoint. At this point, all mirroring is removed. Follow along as we remove the database mirroring configuration we just set up.

The ALTER DATABASE and DROP ENDPOINT SQL commands break mirroring on the principal and remove the endpoint:

ALTER DATABASE AdventureWorks set partner off
go
DROP ENDPOINT EndPoint4DBMirroring1430
go

From the mirror server instance (not the principal!), you run the DROP DATABASE and DROP ENDPOINT SQL commands, as follows:

DROP DATABASE AdventureWorks
go
DROP ENDPOINT EndPoint4DBMirroring1440
go

From the witness server instance, you remove the endpoint as follows:

DROP ENDPOINT EndPoint4DBMirroring1450
go

To verify that you have removed these endpoints from each server instance, you simply run the following SELECT statements:

select name,type_desc,port,ip_address from sys.tcp_endpoints
select name,role_desc,state_desc from sys.database_mirroring_endpoints

All references to the endpoints and roles are removed.

You can also take a peek at the SQL Server log entries being made as you remove database mirroring:

02/05/2009 13:06:42,spid55,Unknown,The Database
            Mirroring protocol transport is disabled or not configured.
02/05/2009 13:06:40,spid55,Unknown,The Database Mirroring
            protocol transport has stopped listening for connections.
02/05/2009 12:52:55,spid19s,Unknown,Database mirroring
            connection error 4 'An error occurred while receiving
            data: '64(The specified network name is no longer
            available.)'.' for 'TCP:// REM1233..:1440'.
02/05/2009 12:52:55,spid19s,Unknown,Error: 1474
            <c/> Severity: 16<c/> State: 1.
02/05/2009 12:52:55,spid19s,Unknown,Database mirroring
           connection error 4 'An error occurred while
           receiving data: '64(The specified network name is
           no longer available.)'.' for 'TCP://REM1233..:1450'.
02/05/2009 12:52:55,spid19s,Unknown,Error: 1474
           <c/> Severity: 16<c/> State: 1.
02/05/2009 12:51:14,spid21s,Unknown,Database mirroring
           has been terminated for database 'AdventureWorks'.

These are all informational messages only. No user action is required. As you can see from these messages, you are now in a state of no database mirroring. You have to completely build up database mirroring again if you want to mirror the database again.

 
Others
 
 
 
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
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us