SQL: Enough business intelligence time for administration intelligence

27
Enough BI, time for Administration Intelligence! Dr. Nico Jacobs, @SQLWaldorf

description

Microsoft has a lot of useful Business Intelligence (BI) tools in both SQL Server and Office. But why would you only use them to analyze your business? Whether you want to keep a business up and running or a bunch of servers... both can benefit from the same tools. In this talk we have a look at typical problems SQL Server administrators are facing... and how to analyze them using the Microsoft BI tools. From simple reporting up to data mining, this talk covers (and uncovers) them all...

Transcript of SQL: Enough business intelligence time for administration intelligence

Page 1: SQL: Enough business intelligence  time for administration intelligence

Enough BI, time for Administration Intelligence!Dr. Nico Jacobs, @SQLWaldorf

Page 2: SQL: Enough business intelligence  time for administration intelligence

Business Intelligence is not about business• Business Intelligence (BI) is applying tools to business

data– Sales data– Stock management– …

• But why not apply these tools administration data?– Log files– Status tables– …

Page 3: SQL: Enough business intelligence  time for administration intelligence

3 ways to get the Intelligence1.Reporting– Directly query the data• Fastest to create

Query

Page 4: SQL: Enough business intelligence  time for administration intelligence

When to use reporting?• Reporting is ideal in situations where

1. You know which fields you want to see, and

2. There is only one interesting way to look at it

Page 5: SQL: Enough business intelligence  time for administration intelligence

Reporting tools

Management Studio

Reports

Ad-hoc queries

Activity monitor

Database engine tuning advisor

Dedicated tools

Idera

Redgate

Lepide

SolarWinds (Confio)

Other tools

Perfmon

Event viewer

Excel

Access reports

Page 6: SQL: Enough business intelligence  time for administration intelligence

Demo: Custom reports in Management Studio

Ingredients:

• SQL Server Data Tools Business Intelligence

• Management Studio (for SQL specific)

Steps

• Write a query to read database log file sizes

• Run the wizard• Adjust the report to

your own taste• Run it in

Management Studio

Page 7: SQL: Enough business intelligence  time for administration intelligence

Custom SSRS Reports• Filtering, grouping and calculating derived values

can be done – in the query (if you like SQL), or– in the report (if you like VB.Net)

• Easy to add nice visualizations• Integrates with Management Studio• Adopts to context: current SQL Server instance and

database• Support print, export and multi-page

Page 8: SQL: Enough business intelligence  time for administration intelligence

Reporting Disadvantages• Hard to reuse any work:– Every new report requires new, complex

queries– Whenever the data source changes, we must

update all reports– Certain report constructs can be challenging

• Growth figures• Year-to-date calculations

Page 9: SQL: Enough business intelligence  time for administration intelligence

3 ways to get the Intelligence1.Reporting2.Modeling– Copy relevant data in model– Define all useful calculations once in the

model– Reuse them in multiple reports

Query

Query

Query

Page 10: SQL: Enough business intelligence  time for administration intelligence

When to use modeling?• Modeling is ideal in situations where

1. You know which fields you want to see, and

2. There are multiple interesting ways to look at the problem

Page 11: SQL: Enough business intelligence  time for administration intelligence

Modeling tools• SQL Server Analysis Services Multi-dimensional• SQL Server Analysis Services Tabular• Excel PowerPivot• Pentaho Mondrian• IBM Cognos• Microstrategy• …

Page 12: SQL: Enough business intelligence  time for administration intelligence

Demo: Building a model in PowerPivot

Ingredients

• Excel 2010 or 2013 for the modeling and pivot report

• Excel 2013 for the PowerView report

Steps

• Load data into PowerPivot model

• Create relationships between tables

• Defined calculations where needed

• Build reports to taste

Page 13: SQL: Enough business intelligence  time for administration intelligence

Building modelsAdvantages• Easy to quickly create

multiple reports• Allows for advanced

analysis• Lots of reuse options

Disadvantages• More work before first

report is available• Need to master two

querying tools

Page 14: SQL: Enough business intelligence  time for administration intelligence

3 ways to get the Intelligence1.Reporting2.Modeling3.Mining– Define search space of possible ‘patterns’– Report on the discovered patterns

Query

Query

Query

Page 15: SQL: Enough business intelligence  time for administration intelligence

When to use data mining?• Data mining is useful when:– You don’t know which fields you want to

see!– You do know what type of pattern you’re

interested in– You do have relevant historical data

Page 16: SQL: Enough business intelligence  time for administration intelligence

Small case study: Capacity planning

• We could start with very simple model:– 1 variable linear regression, easy 2D

chart

10 12 14 16 18 20 22 24 26 28 300

100

200

300

400

500

600

700

800

900

Indexes vs mdf size

Page 17: SQL: Enough business intelligence  time for administration intelligence

Multiple variables• But what if we have more

information?– If we know the number of clustered and

non-clustered indexes, we must work in 3D…

– If we know number of tables as well, we must work in 4D

– And if we add columns, blob columns, … we quickly end in 10D or more

Page 18: SQL: Enough business intelligence  time for administration intelligence

Linear regression• One of the many patterns that data

mining can discover is linear regression formulas in multiple dimensions

Page 19: SQL: Enough business intelligence  time for administration intelligence

Regression trees• If we add to our model non-numeric

information (server name, database type), we could build different regression formulas for different situations

• This is a regression tree

Page 20: SQL: Enough business intelligence  time for administration intelligence

Many types of patterns• Regression trees is just one of the

many types of data mining available

Page 21: SQL: Enough business intelligence  time for administration intelligence

Mining tools

Microsoft

Analysis Services Multi-

Dimensional

Excel front-end

Commercial tools

SPSS

SAS

Open Source tools

R

Pentaho Weka

Knime

Page 22: SQL: Enough business intelligence  time for administration intelligence

Demo: Analyzing Report server log files with data mining

Ingredients

• SQL Server Analysis Services Multi-Dimensional

• Excel 2007 or later with Data Mining add-in

Steps

• Load relevant data in Excel worksheet

• Use Excel Analysis ribbon to select relevant type of pattern

Page 23: SQL: Enough business intelligence  time for administration intelligence

Conclusions• The Business Intelligence tools are not just for

business analysts!• If you know which are the important fields to report

upon– And you can only imagine one way to look at it: use

reporting– But you can come up with multiple views on these fields:

use modeling

• If you don’t know which are the important fields in a certain problem, consider data mining

Page 24: SQL: Enough business intelligence  time for administration intelligence

Get the material• You can download this presentation,

report definitions and Excel workbooks from http://1drv.ms/1quLAnw

Page 25: SQL: Enough business intelligence  time for administration intelligence
Page 26: SQL: Enough business intelligence  time for administration intelligence

Follow Technet Belgium@technetbelux

Subscribe to the TechNet newsletteraka.ms/benews

Be the first to know

Page 27: SQL: Enough business intelligence  time for administration intelligence

Belgium’s biggest IT PRO Conference