0% found this document useful (0 votes)
70 views

Collect and Analyze Troubleshooting Data

Uploaded by

Nixon Muluh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Collect and Analyze Troubleshooting Data

Uploaded by

Nixon Muluh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

7/23/2019 Print content

Administering Microsoft SQL Server 2012 Databases

Collect and Analyze Troubleshooting Data

Introduction
Tools for Troubleshooting Data
Summary

Introduction
The Collect and Analyze Troubleshooting Data module provides you with the
instruction and server hardware to develop your hands on skills in the defined topics.
This module includes the following exercises:

Tools for Troubleshooting Data

Lab Diagram

During your session you will have access to the following lab configuration. Depending
on the exercises you may or may not use all of the devices, but they are shown here in the
layout to get an overall understanding of the topology of the lab.

Connecting to your lab

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 1/26
7/23/2019 Print content

In this module you will be working on the following equipment to carry out the steps
defined in each exercise.

PLABSQL01 (SQL Server 1)

To start, simply choose a device and click Power on. In some cases, the devices may
power on automatically.

For further information and technical support, please see our Help and Support
page.

Copyright Notice
This document and its content is copyright of Practice-IT - © Practice-IT 2014. All rights reserved. Any
redistribution or reproduction of part or all of the contents in any form is prohibited other than the
following:
1) You may print or download to a local hard disk extracts for your personal and non-commercial use
only.
2) You may copy the content to individual third parties for their personal use, but only if you
acknowledge the website as the source of the material. You may not, except with our express written
permission, distribute or commercially exploit the content. Nor may you transmit it or store it in any
other website or other form of electronic retrieval system.

Exercise 1 - Tools for Troubleshooting Data


In this exercise, you will perform the tasks required to collect and analyze
troubleshooting data. To better understand this task, please refer to your course material
or visit http://technet.microsoft.com/en-us/library/bb500469.aspx to gain an
understanding of this topic.

In this exercise, you will learn the following about Microsoft SQL Server 2012:

Monitoring using Profiler


Gathering performance metrics
Identify performance problems
Creating alerts on critical server conditions
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 2/26
7/23/2019 Print content

Monitoring data and server access by creating audit and other controls
Using Data Collector tools

Monitoring using Profiler

To monitor using Profiler, perform the following steps:

Step 1
Ensure you have powered on the required devices and Connect to PLABSQL01.

Click Start, click All Programs, select Microsoft SQL Server 2012, select
Performance Tools and then select SQL Server Profiler.

The SQL Server Profiler window is displayed.

Click File and then select New Trace.

The Connect to Server dialog box is displayed. Click Connect.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 3/26
7/23/2019 Print content

After the connection is successful, the Trace Properties dialog box is displayed.

Click the Event Selection tab. Ensure all check boxes are selected. Then, click the
General tab.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 4/26
7/23/2019 Print content

In the Name text box, enter PLAB. Select Enable trace stop time and click Run.

The data collection starts.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 5/26
7/23/2019 Print content

When you want to stop, click Stop Selected Trace.

Creating Alerts on Critical Server Condition

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 6/26
7/23/2019 Print content

To create alerts on critical server condition, perform the following steps:

Step 1
From PLABSQL01 open SQL Server Management Studio from the shortcut on the
desktop.

In the Connect to Server dialog box, enter PLABSQL01, , in the Server name text
box, if already not entered, and click Connect.

After the connection is successful, the PLABSQL01 server is displayed in Object


Explorer.

Check if SQL Server Agent is running. If not, right-click and then select Start.

The Microsoft SQL Server Management Studio dialog box is displayed. Click Yes.

After SQL Server Agent is started, select Alerts. Note that there is no alert defined.
You will need to first define an alert.

Right-click Alerts and select New Alert.

The New Alert dialog box is displayed.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 7/26
7/23/2019 Print content

In the Name text box, enter PLAB.

From the Database name drop-down list, select AdventureWorks2012.

From the Severity drop-down list, select any of the fatal errors. For this task, you can
select 019 - Fatal Error in Resource.

Select Response in the left pane of the dialog box.

Select Execute job and select PLAB. Note that this job was created in the previous task.
If you do not have this job readily available, create a job with the name PLAB.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 8/26
7/23/2019 Print content

The alert is now created and should now be enabled.

Gathering Performance Metrics

To gather performance metrics, perform the following steps:

Step 1
From Microsoft SQL Server Management Studio.

On the menu bar, click Activity Monitor.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 9/26
7/23/2019 Print content

The Activity Monitor tab opens in the right pane.

Note that there is data being reflected in the Activity Monitor. You can now execute one
or more queries to ensure data is being captured.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 10/26
7/23/2019 Print content

Open a new query window and execute the following query:

SELECT City, PostalCode, AddressLine1


FROM AdventureWorks2012.Person.Address
WHERE City = ‘Seattle’
GO

Note: Ignore any error in the query. The intent is to execute a query and generate data in
the Activity Monitor.

Switch back to Activity Monitor. Note that the graphs now show some amount of data:

Identifying Performance Problems

To identify performance problems, perform the following steps:

Step 1

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 11/26
7/23/2019 Print content

From Microsoft SQL Server Management Studio.

Right-click the instance name, PLABSQL01, and select New Query. The new query
window opens in the right pane.

You can use different dynamic management views to return the status of the performance
of a specific instance.

Let’s see how long a task had to wait for a specific wait_type since the SQL Server
instance started.

Enter the following query and click Execute:

SELECT * FROM sys.dm_os_wait_stats


ORDER BY wait_time_ms DESC

Note the responses in the lower section of the query window.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 12/26
7/23/2019 Print content

You can use different dynamic management views to extract different types of data.

Monitoring Data and Server Access

To monitor data and server access, perform the following steps:

Step 1
From Microsoft SQL Server Management Studio.

In Object Explorer, right-click PLABSQL01 and select Properties. The Server


Properties - PLABSQL01 dialog box is displayed.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 13/26
7/23/2019 Print content

In the left pane, click Security.

You can enable auditing at different levels. Note that in the Login auditing section,
auditing is enabled only for Successful logins only. Select Failed logins only.
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 14/26
7/23/2019 Print content

In the Options section, select Enable Common Criteria compliance and Enable
C2 audit tracing and then click OK.

The Microsoft SQL Server Management Studio dialog box is displayed. Click OK
to close.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 15/26
7/23/2019 Print content

Using the Data Collector Tool

To use the Data Collector tool, perform the following steps:

Step 1
From Microsoft SQL Server Management Studio.

In Object Explorer, expand Management, right-click Data Collection and select


Configure Management Data Warehouse.

The Configure Management Data Warehouse Wizard is displayed. Click Next.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 16/26
7/23/2019 Print content

On the Select configuration task screen, the Create or upgrade a management


data warehouse option is selected by default. Click Next.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 17/26
7/23/2019 Print content

On the Configure Management Data Warehouse Storage screen, select


AdventureWorks2012 from the Database name drop-down list and click Next.

On the Map Logins and Users screen, select PRACTICELABS\Administrator and


then select mdw_admin from the Database role membership for:
AdventureWorks2012. Click Next.

Note: The remaining two role memberships will automatically get selected when you
select mdw_admin.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 18/26
7/23/2019 Print content

On the Complete the Wizard screen, click Finish.

Tracking Object Modification To track object modification, perform the following


steps:
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 19/26
7/23/2019 Print content

Step 1
From Microsoft SQL Server Management Studio.

In Object Explorer, expand Databases, expand AdventureWorks2012, expand


Security, right-click Database Audit Specification and select New Database
Audit Specification.

In the Name text box, enter PLAB.

From the Audit drop-down list, select the audit that you created in the previous task. If
you didn't created an audit, then first create it now.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 20/26
7/23/2019 Print content

From the Audit Action Type column, select DELETE from the drop-down list.

From the Object Class column, select Database.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 21/26
7/23/2019 Print content

Click ... next to the Object Name column. The Select Objects dialog box is displayed.

In the Enter the object names to select text box, enter AdventureWorks2012 and
click Check Names. Then, click OK to close the dialog box.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 22/26
7/23/2019 Print content

Click ... next to the Principal Name column. The Select Objects dialog box is
displayed.

In the Enter the object names to select text box, enter db_owner and click Check
Names. Then, click OK to close the dialog box.

Click OK to close the Create Database Audit Specifications dialog box.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 23/26
7/23/2019 Print content

Note that PLAB is created under the Database Audit Specifications node. Right-
click PLAB and select Enable Database Audit Specification. The Enable
Database Audit Specification dialog box is displayed.

Click Close.

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 24/26
7/23/2019 Print content

Note that PLAB is now enabled.

Shutdown all virtual machines used in this lab, by using the power functions located in
the Tools bar before proceeding to the next module. Alternatively you can log out of the
https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 25/26
7/23/2019 Print content

lab platform.

Summary
In this exercise, you learnt the following about Microsoft SQL Server 2012:

Monitoring using Profiler


Gathering performance metrics
Identify performance problems
Creating alerts on critical server conditions
Monitoring data and server access by creating audit and other controls
Using Data Collector tools

Also try
Using the current lab setup, you can perform the following tasks at your own pace.

Using dynamic management views to gather server statistics like job waits
Configuring auditing at the server level
Using the Activity Monitor, run multiple queries in parallel and find the result in the
Activity Monitor
Creating multiple alerts for fatal errors

https://www.practice-labs.com/authenticated/vNext/vn-print-content.aspx 26/26

You might also like