After clicking Next on the introduction page, you are asked if you wish to configure security to include a witness server instance.. After clicking Next you are prompted with a page wit
Trang 1Once you get the Database Mirroring page on the screen, the first thing you
must do is click the Configure Security button This button will present you
with a wizard, which will walk you through the process The key screens will be
shown here, the others merely described After clicking Next on the introduction
page, you are asked if you wish to configure security to include a witness server
instance
After clicking Next you are prompted with a page with the Principal and
Mirror checked and grayed out with the Witness server either checked or grayed
out If you select No on the first page then this page is skipped
On the next page you are asked to configure the Database Mirroring Endpoint
as shown in Figure 6.5 This is the endpoint that will be created on the Principal
server that the Mirror instance (and Witness instance) will use to contact the
Principal instance Port 5022 is the default TCP port number, however this port
number can be changed to another port number if required You can also change
the Endpoint name if you so desire
Figure 6.4 Database Mirroring Menu
Trang 2The next page asks you to select the Mirror server instance and set its port number and Endpoint name If the instances are on different physical servers it
is recommended that you use the same port number because this keeps your configuration less complex If the instances are on the same physical server then you will need to select different port numbers since only one instance at a time can use a single port number
If you have selected to use a Witness then the next page lets you select the instance to use as the Witness instance as well as the port number and name of the endpoint The same rules about port numbers apply
The next page asks you for the service accounts of the SQL Servers If the machines are on the same domain, or the domains are trusted, then fill out these fields If the machines are not on trusted domains, or the machines are not on a domain then leave the fields all blank If the instances are all on the same machine and are running under a local machine account enter the machine account here
Figure 6.5 Database Mirroring Principle Server Endpoint Configuration
Trang 3running under domain accounts we enter these accounts in the boxes as shown in
Figure 6.6 If you are not configuring a Witness then that field will not appear
From this screen you can click Next or Finish since you have completed the
wizard Doing so will configure the Endpoints and grant the remote instances
accounts rights to connect to that Endpoint Confirm any messages that the
wizard gives you
Since you will have the SQL Servers connecting to each other it is recommended
that you run the SQL Servers and SQL Server Agents under a domain account
Although this is not required it is recommended, and it makes database mirroring
easier to set up and manage
Figure 6.6 Database Mirroring Service Accounts Page
After completing the wizard you will be prompted with a screen similar to the
one shown in Figure 6.7
Trang 4If you select the Do Not Start Mirroring button then database mirroring will not be configured and you will need to reconfigure the Mirror and Partner connection information before you can start database mirroring If everything goes correctly you should be greeted with a screen like the one shown in Figure 6.8
Figure 6.7 Database Mirroring Confirmation Window
Figure 6.8 Database Mirroring Running Correctly
Trang 5EXERCISE 6.2
SEttIng Up DatabaSE MIRRoRIng
1 Set up a database in one instance of SQL Server.
2 Configure database mirroring in High Performance mode.
Once database mirroring is running you will notice some additional information
in the object explorer when you are connected to the servers that are being mirrored The Principal database will show the word Principal, and the Mirror will show
“Restoring…” next to it The Principal will also tell you the status of the mirror
In Figure 6.9 we can see that the mirror is synchronized to the Principal If the
mirror is receiving its log updates the principle will report this as well
Figure 6.9 Object Explorer Showing Mirrored Databases