Dat403 Massie

20
1 WMI for the Command Line DBA Jason Massie Lead Database Consultant Terremark Worldwide DAT403

description

 

Transcript of Dat403 Massie

Page 1: Dat403 Massie

1

WMI for the Command Line DBA

Jason MassieLead Database ConsultantTerremark Worldwide

DAT403

Page 2: Dat403 Massie

2

WMI For Command Line DBASession Agenda

WMI Tools and Utilities

What is WMI?

SQL Server as a WMI Provider

Why use WMI?

A WQL Primer

Technologies in Play

SQL Server as a WMI Consumer

Page 3: Dat403 Massie

3

What Is WMI?An overview of WMI

What is Windows Management Interface?Extension of windows driver model that provides an OS interface to information and notificationsWMI is Microsoft's implementation of the Web-Based Enterprise Management (WBEM) and Common Information Model (CIM) standards from the Distributed Management Task Force (DMTF)

WMI and SQL ServerSQL Server as a providerSQL Server as a consumerSSIS as a consumer

Page 4: Dat403 Massie

4

Why Do I Care About WMI?Benefits of tapping into WMI

Access OS data that was previously hard to get from SQLAccess trace data without running a traceLog DDL eventsAdd better intelligence to expensive queriesRespond to events in SSISAugment your monitoring system

Page 5: Dat403 Massie

5

WMI Architecture

Web-Based Enterprise Management (WBEM)Windows Management Interface (WMI)

WindowsPerfmon DataEventLogsHardwareDisk Usage Process InfoService infoMuch more!

SQL ServerTrace EventsDDL EventsSSIS TasksCustom Code

Page 6: Dat403 Massie

6

WMI Tools And UtilitiesLet's start off with the GUI's

Microsoft toolsWMI Code CreatorScriptomatic 2.0WBEMTest

3rd PartyWMI ExplorerWQL AnalyzerMost monitoring tools

Page 7: Dat403 Massie

7

WQL OverviewHey, that looks familiar…

Subset of ANSI SQLEvent query exampleSELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE Targetinstance ISA "CIM_DirectoryContainsFile" and TargetInstance.GroupComponent= "Win32_Directory.Name=\"e:\\\\temp\""

Data query exampleSelect * from Win32_NTLogEvent Where Logfile = ‘Application' and EventType = ‘error' and SourceName like ‘%SQL%’

Page 8: Dat403 Massie

8

WMI Tools and Utilities

Page 9: Dat403 Massie

9

Technologies In PlayA partial list

Consumers.NetVBScriptPowerShellSSIS3rd Party

ProvidersSQL ServerWindowsHardware

Page 10: Dat403 Massie

10

Quick and Dirty

Page 11: Dat403 Massie

11

CLR Integration

Page 12: Dat403 Massie

12

Displaying WMI data in SSRS

Page 13: Dat403 Massie

13

Powershell

Page 14: Dat403 Massie

14

WMI Provider for Server Events

Page 15: Dat403 Massie

15

Page 16: Dat403 Massie

16

Let’s Connect

Email: [email protected]: http://statisticsio.comRSS: http://feeds.feedburner.com/statisticsioLinkedIN: http://linkedin.com/in/jasonmassieTwitter: http://twitter.com/statisticsioFriendFeed: http://friendfeed.com/statisticsio

I welcome questions or comments. I am open to networking.

Page 17: Dat403 Massie

Track Resources

Resource 1 My blog – http://statisticsio.comResource 1 My blog – http://statisticsio.com

Resource 2 MSDN WMI Class Reference - Resource 2 MSDN WMI Class Reference - http://msdn.microsoft.com/en-us/library/aa394554%28VS.85%29.aspxhttp://msdn.microsoft.com/en-us/library/aa394554%28VS.85%29.aspx

Resource 3 MSDN PowerShell Reference - Resource 3 MSDN PowerShell Reference - http://msdn.microsoft.com/en-us/library/bb905330.aspxhttp://msdn.microsoft.com/en-us/library/bb905330.aspx

Resource 4 – MSDN SQL Reference - Resource 4 – MSDN SQL Reference - http://msdn.microsoft.com/en-us/library/bb545450.aspxhttp://msdn.microsoft.com/en-us/library/bb545450.aspx

Page 18: Dat403 Massie

Complete anComplete anevaluation evaluation ononCommNet CommNet andandenter to win!enter to win!

1 Year 1 Year Subscription!Subscription!

Page 19: Dat403 Massie

19

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,

IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Page 20: Dat403 Massie