Вы находитесь на странице: 1из 7

MOAC 70-431: Working with High-Availability Methods, Lab 20a

Page 1 of 7

Lab Detailed Steps

MOAC 70-431: Working with High-Availability Methods, Lab 20a


Print this page.

Note:
These lab detailed steps are located on the Lab Review page of the course, as well as under detailed steps in the expandable Lab Instructions pane of the launched lab. Both sets contain the same information, so please use the instructions from the location you feel is most convenient.
Exercise 1: Implementing Database Mirroring Task 1: Log on to the NYC-DC1 computer, with the user name Contoso\Student, and the password Pa$$w0rd. Proceed to the next task.
1. 2. To log on to NYC-DC1, click the Ctrl-Alt-Delete button. Type the following:


3.

User name: Contoso\Student Password: Pa$$w0rd Click the OK button. You are now connected to the NYC-DC1 computer.

Task 2: Back up the Sales database from the default instance of SQL Server.
1. Create a folder, Temp, in C:\ and another folder, Copy in C:\Temp to restore the databases of Sales and AdventureWorks. Provide Full Control permissions to share both the Temp and Copy folders for everyone. a. On the Start menu of NYC-DC1, click My Computer. The My Computer window appears. b. In the My Computer window, double-click Local Disk (C:). The C:\ window appears. c. Right click anywhere in the C:\ window, point to New, click Folder. Key Temp, and then press ENTER. d. Double-click Temp folder. The C:\Temp window appears. Right-click anywhere in the C:\Temp window, point to New, and click Folder. Key Copy and press ENTER. e. Navigate to C:\ folder, right-click Temp, and then click Properties. The Temp Properties dialog box appears. f. On the Sharing tab of the Temp Properties dialog box, click Share this folder radio button, and then click Permissions. The Permissions for Temp dialog box appears. g. In the Permissions for Temp dialog box, click Everyone from the Group or user names list, select the Allow check box against Full Control in Permissions for Everyone box, click Apply, and then click OK. h. In the Temp Properties dialog box, click Apply and then click OK. i. Double-click Temp folder, right-click Copy folder, and then click Properties. The Copy Properties dialog box appears. j. On the Sharing tab of the Copy Properties dialog box, click Share this folder radio button, and then click Permissions. The Permissions for Copy dialog box appears. k. In the Permissions for Copy dialog box, click Everyone from the Group or user names list, select the Allow check box against Full Control in Permissions for Everyone box, click Apply, and then click OK. l. In the Copy Properties dialog box, click Apply and then click OK. m. Close the C:\Temp window. 2. Create a back up of the Sales database from the default instance of SQL Server with the following settings:

Database: Sales Backup type: Full Description: Full Backup of Sales

mhtml:https://itacademy.microsoftelearning.com/plo_content/org6024/course127513/med... 11/27/2009

MOAC 70-431: Working with High-Availability Methods, Lab 20a

Page 2 of 7

Destination: C:\Temp\Sales.bak a. On the Start menu of NYC-DC1, point to All Programs, point to Microsoft SQL Server 2005, and then click SQL Server Management Studio. The Connect to Server dialog box appears. b. In the Connect to Server dialog box., click Connect. The Microsoft SQL Server Management Studio window appears. c. In Object Explorer, expand Databases, right-click Sales, point to Tasks, and click Back Up. d. In the Back Up Database - Sales dialog box, ensure Sales is the selected Database to back up and Backup type is Full. e. Leave the default name in the Name box. In the Description box, enter Full Backup of Sales. f. Under Destination, a Disk device may already be listed. If so, select the device, and click Remove. g. Under Destination, click Add. h. In the Select Backup Destination box, click File name radio button, and in the text box enter C:\Temp\Sales.bak. Click OK. i. Click OK to start the backup. j. When the backup is complete, Microsoft SQL Server Management Studio message box appears. In the Microsoft SQL Server Management Studio message box, click OK.

Task 3: Back up the Transaction log from the default instance of SQL Server.
1. Back up the Transaction log of the Sales database from the default instance of SQL Server, with the following settings:

Database: Sales Backup type: Transaction Log Description: Transaction Log Backup of Sales Device: C:\Temp\Sales.bak a. In the Object Explorer, under Databases, right-click Sales, point to Tasks, and click Back Up. b. In the Back Up Database - Sales dialog box, ensure Sales is the selected Database to back up and from Backup type select Transaction Log. c. Leave the default name in the Name box. In the Description box, enter Transaction Log Backup of Sales. d. Make sure C:\Temp\Sales.bak is the only device listed, and click OK. e. When the backup is complete, Microsoft SQL Server Management Studio message box appears. In the Microsoft SQL Server Management Studio message box, click OK to close it.

Task 4: Restore the Sales database to the second instance of SQL Server.
1. Select a device to back up by using the second instance of SQL Server. a. On Microsoft SQL Server Management Studio, connect to the Second instance by clicking Connect from Object Explorer and then click Database Engine. The Connect to Server dialog box appears. b. In the Connect to Server dialog box, in the Server name drop down list click <Browse for more>. The Browse for Servers dialog box appears. c. In the Browse for Servers dialog box, expand Database Engine and then select NYC-DC1\SECOND and click OK. d. In the Connect to Server dialog box, ensure Server name is NYC-DC1\SECOND and Authentication is Windows Authentication, and then click Connect. e. Under NYC-DC1\SECOND (SQL Server 9.0.2047 - CONTOSO\Student) right-click Databases, and click Restore Database. f. Enter Sales in the To database box. g. Under Source for restore, select From device. Click the browse button next to the text box to select a device. 2. Select the Sales.bak file by using the Specify Backup dialog box.

mhtml:https://itacademy.microsoftelearning.com/plo_content/org6024/course127513/med... 11/27/2009

MOAC 70-431: Working with High-Availability Methods, Lab 20a

Page 3 of 7

a. In the Specify Backup dialog box, select File from the Backup media drop-down list box, and click Add. b. In the Locate Backup File - NYC-DC1\SECOND dialog box, expand C:, expand Temp, click Sales.bak file, and then click OK. c. Click OK to close the Specify Backup dialog box. 3. Restore the backup of the Sales database by using the Restore the database files as grid option. a. In the Restore Database Sales dialog box, under Select the backup sets to restore, check the boxes for both backups of Sales. b. On the Options page, in the Restore the database files as grid, under the Restore As column, make these changes by clicking each column:

Change Sales_Data.mdf to Sales_Data_mir.mdf. Change Sales_Data2.ndf to Sales_Data_mir2.ndf. Change Sales_log.ldf to Sales_log_mir.ldf. c. Also on the Options page, select the Leave the database non-operational, and do not roll back uncommitted transactions. Additional transaction logs can be restored. (RESTORE WITH NORECOVERY) option is selected. d. Click OK to begin the restore process. e. Click OK in the Microsoft SQL Server Management Studio message box that opens after the restore is complete.

Task 5: Configure database mirroring for the Sales database on the default instance of SQL Server.
1. Mirror the Sales database for the default instance of SQL Server with the following settings:

Include Witness Server: No Principal Server Instance: default Mirror Server Instance: Second instance of SQL Server a. On Microsoft SQL Server Management Studio, click Connect in Object Explorer, click Database Engine, select NYC-DC1 from the Server name dropdown list, and then click Connect. and connect to the default instance. b. Under NYC-DC1 (SQL Server 9.0.2047 CONTOSO\Student), expand Databases, right-click Sales, point to Tasks, and click Mirror. c. Click the Configure Security button to start the Configure Database Mirroring Security Wizard, which will create the endpoints required for mirroring. d. On the welcome screen, click Next. e. Select No on the Include Witness Server page, and then click Next. f. On the Choose Servers to Configure page, click Next. g. On the Principal Server Instance page, accept the defaults, and click Next. h. On the Mirror Server Instance page, select the NYC-DC1\SECOND instance of SQL Server from the Mirror server instance dropdown list, and click the Connect button. i. Accept the defaults that are filled in for you, and click Next. j. On the Service Accounts page, leave both account names blank because you configured the services to use the same accounts. Click Next. k. On the Complete the Wizard page, click Finish. l. Click Close when the wizard is complete. m. In the Database Properties dialog box that opens, click Start Mirroring. n. Click OK to close the Database Properties - Sales dialog box.

Question 1

How quickly can the mirror respond to users after the production server fails? Compare with restoring from a full backkup to a cold standby server. How quickly can you restore services to users without mirroring?

mhtml:https://itacademy.microsoftelearning.com/plo_content/org6024/course127513/med... 11/27/2009

MOAC 70-431: Working with High-Availability Methods, Lab 20a

Page 4 of 7

Task 6: Verify that mirroring is implemented in the database.


1. Verify that the Sales database has been mirrored on the second instance of SQL Server. a. Connect to both instances and look at the Sales database in Object Explorer. b. On the NYC-DC1 (SQL Server 9.0.2047 CONTOSO\Student) instance, ensure (Principal, Synchronized) next to the Sales database. c. Right-click the NYC-DC1\SECOND (SQL Server 9.0.2047 CONTOSO\Student) instance, click Refresh, and ensure (Mirror, Synchronized / Restoring...) next to Sales.

Note:
The label for the Sales database will show you what role it plays in the database-mirroring session.

Task 7: You have completed all tasks in this exercise.


1. A successful completion of this exercise results in the following outcomes:


2.

The Sales database is backed up. The Transaction log for the Sales database is backed up. The Sales database is restored to the second instance of SQL Server. Database mirroring is configured for the Sales database. Mirroring for the Sales database is verified. To proceed to another exercise, click the desired exercise.

Exercise 2: Implementing Log Shipping Task 1: Back up the AdventureWorks database from the default instance of SQL Server.
1. Back up the AdventureWorks database from the default instance of SQL Server with the following settings:

Database: AdventureWorks Backup type: Full Description: Full Backup of AdventureWorks Destination: C:\Temp\AdvWorks.bak a. On Microsoft SQL Server Management Studio, under NYC-DC1 (SQL Server 9.0.2047 CONTOSO\Student), under Databases, right-click AdventureWorks, point to Tasks, and click Back Up. b. In the Back Up Database AdventureWorks dialog box, make sure AdventureWorks is the selected Database to back up and Backup type is Full. c. Leave the default name in the Name box. In the Description box, enter Full Backup of AdventureWorks. d. Under Destination, a disk device may already be listed. If so, select the device, and click Remove. e. Under Destination, click Add. f. In the Select Backup Destination box, click File name, and in the text box enter C:\Temp\AdvWorks.bak (make sure the temp directory exists on the selected drive). Click OK. g. Click OK to start the backup. h. When the backup is complete, click OK in the Microsoft SQL Server Management Studio message box to close it.

Task 2: Back up the Transaction log for the AdventureWorks database on the default instance of SQL Server.

mhtml:https://itacademy.microsoftelearning.com/plo_content/org6024/course127513/med... 11/27/2009

MOAC 70-431: Working with High-Availability Methods, Lab 20a

Page 5 of 7

1.

Back up the Transaction log of the AdventureWorks database from the default instance of SQL Server, with the following settings:

Database: AdventureWorks Backup type: Transaction Log Description: Transaction Log Backup of AdventureWorks Device: C:\Temp\AdvWorks.bak a. On Microsoft SQL Server Management Studio, under NYC-DC1 (SQL Server 9.0.2047 CONTOSO\Student), under Databases, right-click AdventureWorks, point to Tasks, and click Back Up. b. In the Back Up Database AdventureWorks dialog box, make sure AdventureWorks is the selected Database to back up and from Backup type select Transaction Log. c. Leave the default name in the Name box. In the Description box, enter Transaction Log Backup of AdventureWorks. d. Make sure C:\Temp\AdvWorks.bak is the only device listed, and click OK. e. When the backup is complete, click OK in the Microsoft SQL Server Management Studio message box to close it.

Task 3: Restore the AdventureWorks database to the second instance of SQL Server.
1. Select a device to back up by using the second instance of SQL Server. a. In the Microsoft SQL Server Management Studio window, select the NYC-DC1\SECOND (SQL Server 9.0.2047 CONTOSO\Student) second instance from the Object Explorer window. b. Right-click Databases, and click Restore Database. c. Enter AdventureWorks in the To database box. d. Under Source for restore, select From device. Click the browse button next to the text box to select a device. 2. Select the AdventureWorks.bak file using Specify Backup. a. In the Specify Backup dialog box, select File from the Backup media drop-down list box, and click Add. b. In the Locate Backup File NYC-DC1\SECOND dialog box, expand C:, expand Temp, click AdvWorks.bak file, and click OK. c. Click OK to close the Specify Backup dialog box. 3. Restore the backup of the AdventureWorks database by using the Restore the Database Files As grid option.. a. Under Select the backup sets to restore, check the boxes for both backups of AdventureWorks. b. On the Options page, in the Restore the database files as grid, under the Restore As column, make these changes by clicking on each grid:

Change AdventureWorks_Data.mdf to AdventureWorks_Data_ls.mdf. Change AdventureWorks_Log.ldf to AdventureWorks_Log_ls.ldf. c. Also on the Options page, select the Leave the database in read-only mode. Undo uncommitted transactions, but save the undo actions in a standby file so that recovery effects can be reversed. (RESTORE WITH STANDBY) option is selected. d. Click OK to begin the restore process. e. Click OK in the Microsoft SQL Server Management Studio message box that opens after the restore is complete.

Task 4: Configure log shipping on the default instance of SQL Server.


1. Configure log shipping for the AdventureWorks database on the default instance of SQL Server. a. In the Microsoft SQL Server Management Studio, select the NYC-DC1 (SQL Server 9.0.2047 CONTOSO\Student) default instance ,from the Object Explorer window.

mhtml:https://itacademy.microsoftelearning.com/plo_content/org6024/course127513/med... 11/27/2009

MOAC 70-431: Working with High-Availability Methods, Lab 20a

Page 6 of 7

b. Under Databases, right-click AdventureWorks, point to Tasks, and click Ship Transaction Logs. c. Check the Enable this as a primary database in a log shipping configuration. d. Click the Backup Settings button. e. In the Transaction Log Backup Settings dialog box, in the Network path to backup folder (example: \\primaryserver\backup): text box, type \\NYC-DC1\C$\Temp. f. In the Transaction Log Backup Settings dialog box, in the If the backup folder is located on the primary server, type a local path to the folder (example: c:\backup): text box, type C:\Temp. g. Under Backup job area click Schedule button. h. In the Job Schedule Properties LSBackupSchedule_NYC-DC11 dialog box, in the Daily frequency area, click Occurs every radio button, type 5 in the hours box, and then click OK. i. In the Transaction Log Backup Settings dialog box, click OK. j. In the Database Properties AdventureWorks dialog box, click the Add button under the Secondary server instances and databases grid. k. Click the Connect button next to the Secondary server instance text box. l. In the Server name box of the Connect to Server dialog box, click NYC-DC1\SECOND and then click Connect. m. On the Initialize Secondary Database tab, make sure the No, the secondary database is initialized option is selected. n. On the Copy Files tab, in the Destination folder for copied files: (This folder is usually located on the secondary server.) box, enter C:\Temp\Copy. o. In the Secondary Database Settings dialog box, under Copy job area, click Schedule. p. In the Job Schedule Properties DefaultCopyJobSchedule dialog box, in the Daily frequency area, click Occurs every: radio button, select 5 minutes and then click OK. q. On the Restore Transaction Log tab, select the Standby mode option to allow users readonly access to the standby database. r. In Secondary Database Settings dialog box, in the Restore job area, click Schedule button. s. In the Job Schedule Properties DefaultRestoreJobSchedule dialog box, in the Daily frequency area, click Occurs every: radio button, select 5 minutes and then click OK. t. Click OK to return to the Database Properties AdventureWorks dialog box. u. Click OK again to finish configuring log shipping. v. In the Save Log Shipping Configuration dialog box, click Close when restoring backup to secondary database is complete.

Note:
Converting from the production server to the hot standby server requires manual intervention. Someone will have to be available in the middle of the night when the failure occurs. Someone must be trained on the procedures. Make this a drill you perform occasionally.

Task 5: Verify that log shipping is implemented in the database.


1. Ship a log to the second instance of SQL Server. a. In Object Explorer of the Microsoft SQL Server Management Studio window, under NYC-DC1 (SQL Server 9.0.2047 CONTOSO\Student), ensure whether AdventureWorks is selected, and then click New Query on the toolbar. b. To create a new record to ship to the NYC-DC1\SECOND (SQL Server 9.0.2047 CONTOSO\Student) instance, enter and execute the following code: USE AdventureWorks GO

mhtml:https://itacademy.microsoftelearning.com/plo_content/org6024/course127513/med... 11/27/2009

MOAC 70-431: Working with High-Availability Methods, Lab 20a

Page 7 of 7

INSERT HumanResources.Shift(Name, StartTime, EndTime, ModifiedDate) VALUES(Test Shift 3, getdate() + 1, getdate()+ 2, getdate())

c. Wait approximately 10 minutes for the log-shipping jobs to run. d. Clear the query window. From the Query menu, point to Connection, and click Change Connection. 2. Verify that the log was successfully shipped. a. In the Server name box of the Connect to Database Engine dialog box, click NYC-DC1\SECOND and then click Connect to connect to the Second instance of SQL Server. b. Run this query to see whether the log was successfully shipped: USE AdventureWorks GO SELECT * FROM HumanResources.Shift

Note:
Notice the new Test Shift 3 record after the logs are shipped. If the logs do not ship, ensure the SQL Server Agent is running on both instances.

c. In the Microsoft SQL Server Management Studio window, click the Close button. The Microsoft SQL Server Management Studio message box appears. d. In the Microsoft SQL Server Management Studio message box, click No. 3. Log off NYC-DC1.

Note:
If directed by your instructor:

At the end of lab exercises, the lab itself, or at other points within the lab specified by your instructor, press the Print Screen key to get a screenshot of what youve completed. You can then paste the screenshot in an e-mail or document and provide this record of your lab completion to your instructor.

a. Log off from NYC-DC1.

Task 6: You have completed all tasks in this exercise.


1. A successful completion of this exercise results in the following outcomes:

The AdventureWorks database is backed up. The Transaction log for the AdventureWorks database is backed up. The AdventureWorks database is restored to the second instance of SQL Server. Log shipping is configured for the AdventureWorks database. The log shipping configuration for the AdventureWorks database is verified.

mhtml:https://itacademy.microsoftelearning.com/plo_content/org6024/course127513/med... 11/27/2009

Вам также может понравиться