1. Trang chủ
  2. » Công Nghệ Thông Tin

Microsoft SQL Server 2008 R2 Unleashed- P70 ppt

10 187 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 861,59 KB

Nội dung

ptg 634 CHAPTER 20 Database Mirroring FIGURE 20.9 Including the witness server instance in the mirroring configuration. You need to click the Configure Security button on the Mirroring page. This immediately launches the Configure Database Mirroring Security Wizard for the database you have selected ( AdventureWorks, in this example). Figure 20.8 shows this initial wizard splash page. You must configure all three server instances (principal, mirror, and witness servers) for the high-availability mode. The first option that must be indicated is whether you plan to include a witness server instance in your mirroring configuration. You are configuring a high-availability database mirroring configuration (synchronous mode with automatic failover), so you should select Yes on the wizard dialog shown in Figure 20.9; you do so because you want to create a full high-availability mode for automated failover. FIGURE 20.8 The Configure Database Mirroring Security Wizard for the AdventureWorks database. Download from www.wowebook.com ptg 635 Setting Up and Configuring Database Mirroring 20 FIGURE 20.10 The Principal Server Instance screen of the Configure Database Mirroring Security Wizard. The next page in the wizard prompts you to decide where to save the security configura- tions for database mirroring. You have no choice for the principal and mirror server instances; their security configuration information must be stored with them. You must also choose the default location for the witness server instance. The wizard then takes you through each server instance in the database mirroring configuration to establish all needed connection information to implement database mirroring. As you can see in Figure 20.10, this starts with the principal server instance. The wizard should find the endpoint and listener_port values you set up earlier (listener_port value 1430 and endpoint name EndPoint4DBMirroring1430, in this example). Next comes the specification of the listener and endpoint entry for the mirror server instance (where the mirror copy of the database will be located). Initially, this page lists all server instances available on your network (that is, possible mirror server instances) and does not have a listener port or endpoint name specified yet. You need to identify which server you want to use as the mirror server instance ( REM12374333\SQL08DE02, in this example) and click the Connect button to establish a valid (authorized) connection to the mirror server instance. Because you already set up the endpoint on this server (and granted connection permission, using a specific login ID), when you complete the connec- tion dialog, the endpoint ( EndPoint4DBMirroring1440, in this example) and listener_port value (1440, in this example) should be enabled, as shown in Figure 20.11. Finally, you need to specify the witness server instance. Again, this dialog page lists all server instances available on the network (that is, possible witness server instances) and does not have a listener port or an endpoint name specified yet. You need to identify which server you want to use as the witness server instance ( REM12374333\SQL08DE03, in this example) and click the Connect button to establish a valid (authorized) connection to the witness server instance. Because you already set up the endpoint on this server (and Download from www.wowebook.com ptg 636 CHAPTER 20 Database Mirroring FIGURE 20.12 The Witness Server Instance screen of the Configure Database Mirroring Security Wizard. FIGURE 20.11 The Mirror Server Instance screen of the Configure Database Mirroring Security Wizard. granted connection permission, using a specific login ID), when you complete the connec- tion dialog, the endpoint ( EndPoint4DBMirroring1450, in our example) and listener_port value (1450, in this example) should be enabled, as shown in Figure 20.12. The last step in the Configure Database Mirroring Security Wizard is to identify any service accounts that you want to use for the server instances in this database mirroring configu- Download from www.wowebook.com ptg 637 Setting Up and Configuring Database Mirroring 20 FIGURE 20.13 Summary of actions to be performed for the database mirroring configuration. ration. You are already using a single domain login ID for this purpose and explicitly granted connect permissions on each endpoint. Therefore, nothing more needs to be done here. If the server instances use different accounts in the same or a trusted domain as their service accounts for SQL Server, you can enter these accounts here. It is best to do this via scripts (as you saw earlier, when you created the endpoints on each server instance). As you can see in Figure 20.13, the Configure Database Mirroring Security Wizard now presents a summary list of all the actions on each server instance that it will perform. You click Finish to execute them. A report is generated, telling the total number of actions taken (three, in this case) and the status of each action. If any errors or warnings result, you can drill down into the Report button option in the bottom-right corner of this summary of actions page to determine what has occurred. If each status shows success, a Database Properties dialog, as shown in Figure 20.14, appears when you close this report page. This dialog gives you the option to start mirroring immediately or not start mirroring (because you will start mirroring at some other time). For this example, you want to start mirroring right away, so click the Start Mirroring button. Download from www.wowebook.com ptg 638 CHAPTER 20 Database Mirroring FIGURE 20.15 Fully configured properties and active mirroring for database mirroring. Figure 20.15 shows the full Database Properties screen for the AdventureWorks database, all server network addresses, and the operating mode for mirroring. If you look at the SQL Server log file (that is, the current log), you can see log entries indi- cating that database mirroring is active: 2/21/2009 22:33:33,spid21s,Unknown,Database mirroring is active with database ‘AdventureWorks’ as the principal copy. This is an informational message only. No user action is required. 2/21/2009 22:33:09,spid17s,Unknown,Starting up database ‘AdventureWorks’. FIGURE 20.14 Specifying to start database mirroring for high safety with automatic failover. Download from www.wowebook.com ptg 639 Setting Up and Configuring Database Mirroring 20 FIGURE 20.16 Launching Database Mirroring Monitor from SSMS. 2/21/2009 22:33:07,Server,Unknown,SQL Server is now ready for client connections. This is an informational message; no user action is required. 2/21/2009 22:33:00,spid12s,Unknown,The Database Mirroring protocol transport is now listening for connections. 2/21/2009 22:33:00,spid12s,Unknown,Server is listening on [ ‘any’ <ipv4> 1430]. Congratulations. You are now mirroring a database! 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 trans- action 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 20.16 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. Download from www.wowebook.com ptg 640 CHAPTER 20 Database Mirroring FIGURE 20.17 Registering the mirrored database within the Database Mirroring Monitor. FIGURE 20.18 The registered database and status of each mirroring partner. 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 20.17. After the database is registered, all partners and the witness server instances show up in the Database Mirroring Monitor, as shown in Figure 20.18. 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 trans- action 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 Download from www.wowebook.com ptg 641 Setting Up and Configuring Database Mirroring 20 FIGURE 20.19 Transaction histor y o f mir roring par tner s. (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 20.19 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. 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 20.20). Basically, you want to set thresholds that monitor the effectiveness of the mirror- ing operation. 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.21 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. Download from www.wowebook.com ptg 642 CHAPTER 20 Database Mirroring FIGURE 20.21 Setting service accounts/login IDs within the mirroring topology. FIGURE 20.20 Setting thresholds to monitor mirroring effectiveness. 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 addi- tion, you can easily see what role each server instance is playing. Download from www.wowebook.com ptg 643 Setting Up and Configuring Database Mirroring 20 FIGURE 20.22 Removing database mirroring. 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 20.22, you simply choose to remove mirroring (from the principal server instance). This is just a bit too easy to do—almost dangerous! 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. Download from www.wowebook.com . which server you want to use as the mirror server instance ( REM12374333 SQL0 8DE02, in this example) and click the Connect button to establish a valid (authorized) connection to the mirror server. which server you want to use as the witness server instance ( REM12374333 SQL0 8DE03, in this example) and click the Connect button to establish a valid (authorized) connection to the witness server. all three server instances (principal, mirror, and witness servers) for the high-availability mode. The first option that must be indicated is whether you plan to include a witness server instance

Ngày đăng: 05/07/2014, 02:20