# Presented by Brad Gall Using BI Techniques for Database Statistics.

## Presentation on theme: "Presented by Brad Gall Using BI Techniques for Database Statistics."— Presentation transcript:

Presented by Brad Gall Using BI Techniques for Database Statistics

BI Consultant with Pragmatic Works Before Consulting I did Corporate IT for many years ▫ Systems Engineer, DBA, Business Intelligence I’ve been working with SQL Server and SharePoint for over 10 years Email: bradgallsql@outlook.com New Blog: bradgallsql.com Twitter: @bradgallsql A little about me

Today we’ll look at a real world example of using Microsoft Business Intelligence to report on SQL DBA Data This is something I did when I was working as a DBA and wanted to ▫ A: get some reports on my databases ▫ B: learn some of the cool new tools from Microsoft in the process Familiar Data to most of us Good end to end example of Self Service BI What are we talking about today

Part 1: Dimensional Modeling Techniques and Terminology ▫ Dimensional Modeling 101 ▫ How does this apply the our DBA Data Part 2 (Demo): DBA statistic queries ▫ Dmv queries ▫ Queries to Load Dimensional Model “DBA Data Mart” Part 3 (Demo): “DBA Data Mart” reporting ▫ Load Data into PowerPivot ▫ Report with PivotTables Agenda

Kimball Data Warehousing 2 Types of Tables ▫ Dimensions (Attributes) … what do I want to “slice by” ▫ Facts (Metrics) …what do I want to measure Dimensional Modeling 101

Dimension tables contain attributes that your users will use to slice and analyze metrics In a STAR schema, the Dimension tables are flattened (denormalized) Related attributes are grouped together into tables (some art some science to this) Keep attributes together in a table that you want to put into a Hierarchy Dimensions

Fact tables contain your “numbers” These are the rows we’ll aggregate Transaction Fact Tables ▫ Should be modeled at the lowest granularity that we need to analyze ▫ Should also be modeled so that the measures are SUM-able across all “grains” (Dimension tables) ▫ Should have a “narrow” physical structure (only keys and metrics) Facts

Dimensions ▫ DimIndex  DatabaseName  TableName  IndexName ▫ DimStoredProcedures ▫ DimDate ▫ DimTime Facts ▫ FactIndexGrowth ▫ FactIndexUsage  Seeks and Scans ▫ FactCachedQueryStats  Executions  LogicalReads ▫ FactWaitStats  WaitCounts  SignalWaitTime What are our Facts and Measures

Star Schema

Query our DMVs (“stage”) “Transform” our data in stored procedure Insert data into “DBA Data Mart” Load Data into PowerPivot (SSAS) Analyze Data with Excel Pivot Table (Power View report if time) Stage Data from Source Transform Data (Cleanse and “Reshape”) Load Into Relational Data Warehouse tables (Dimensional Model) Load Data into SSAS database from Relational Dimensional Model Analytic Report Tools Built on OLAP database Typical Data Life CycleDemo “Data Life Cycle”

sys.dm_db_index_usage_stats sys.dm_db_partition_stats (Index Sizes) sys.dm_os_wait_stats Stored Procedure Stats ▫ sys.dm_exec_query_stats ▫ sys.dm_exec_sql_text ▫ sys.dm_exec_cached_plans Good blog on these views Stratesql.com DMVs used

Built in to Excel 2013 (Add-in) Self-Service Version of Analysis Services Tabular (similar to SQL Express) Uses xVelocity Engine to compress and store data in Memory (Speed!) Excel Pivot Tables and Pivot Charts read PowerPivot Model (drag and drop interface) PowerPivot and Pivot Tables

DEMOS

Scripts and files available on my blog bradgallsql.com Conclusion