SlideShare a Scribd company logo
1 of 22
You need rules?
You need PBM!
@BorisHristov
Me and My Experience
Here’s how this will go…
What? How? WOW!
What’s PBM?
Policy-Based Management is…
Way to define rules
SQL Server 2008/R2/2012/2014 Feature
Express Edition and higher
(in Express – Limited functionality)
Can be used against 2000 and 2005
… kind of
How does it work?
Main components
Facets
Conditions
Targets
Evaluation Modes
PolicyOn demand
On schedule
On change: log only
On change: prevent
Nested Triggers
EXEC sp_configure 'nested triggers', 1
RECONFIGURE
GO
Microsoft – our Friend
C:Program Files (x86)Microsoft SQL Server110ToolsPolicies
Advanced policies
Script as a condition!
ExecuteSql(‘Numeric’,
‘SELECT COUNT(*) FROM sys.databases’)
ExecuteWql
('String', 'rootCIMV2',
'SELECT State
FROM Win32_Service
WHERE Name = "SQLAgent$SECOND"')
Centralized Management Server
(your time saver)
Introduced in SQL Server 2008
Available even in Express
Allows you to:
• Run scripts
• Evaluate policies
From one, centralized place…
Monitoring Policies
with Agent Alerts?
Views
syspolicy_policies
syspolicy_policy_category_subscriptions
syspolicy_policy_execution_history
syspolicy_policy_execution_history_details
syspolicy_system_health_state
syspolicy_conditions
syspolicy_target_sets
syspolicy_object_sets
syspolicy_policy_categories
DEMO
Working with Policies, Alerts and CMS
Reporting on PBM!
The EPM
Framework
(yes, it is free!)
DEMO
Enterprise Policy Management Framework
Shall we end?
PBM is all about managing your environments even better!
More resources:
Book: Apress Pro SQL Server 2008 PBM
Pluralsight Course: Auditing SQL Server with PBM
Whitepaper: http://tinyurl.com/7b2w2ug
Enterprise Policy Management Framework:
http://epmframework.codeplex.com/
Thank you.
@BorisHristov
brshristov@live.com
www.borishristov.com

More Related Content

Similar to You want rules? You need Policy-Based Management!

Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Mark Broadbent
 
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
psaramago1
 
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
psaramago1
 
new resume of Database Administrator
new resume of Database Administratornew resume of Database Administrator
new resume of Database Administrator
Getahun Gebremariam
 
SQL Server 2008 Security Overview
SQL Server 2008 Security OverviewSQL Server 2008 Security Overview
SQL Server 2008 Security Overview
ukdpe
 
MICROSOFT SQL Server
MICROSOFT SQL ServerMICROSOFT SQL Server
MICROSOFT SQL Server
webhostingguy
 
MICROSOFT SQL Server
MICROSOFT SQL ServerMICROSOFT SQL Server
MICROSOFT SQL Server
webhostingguy
 
MICROSOFT SQL Server
MICROSOFT SQL ServerMICROSOFT SQL Server
MICROSOFT SQL Server
webhostingguy
 
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
SpanishPASSVC
 

Similar to You want rules? You need Policy-Based Management! (20)

SQL Server and System Center Advisor
SQL Server and System Center AdvisorSQL Server and System Center Advisor
SQL Server and System Center Advisor
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
 
Understanding performance bottlenecks using performance dashboard
Understanding performance bottlenecks using performance dashboardUnderstanding performance bottlenecks using performance dashboard
Understanding performance bottlenecks using performance dashboard
 
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
 
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
TechNet livemeeting_Should I upgrade to SCOM 2012 (Dieter Wijckmans's conflic...
 
Trainmesfottech - Sql Server DBA Training Course Content
Trainmesfottech - Sql Server DBA Training Course ContentTrainmesfottech - Sql Server DBA Training Course Content
Trainmesfottech - Sql Server DBA Training Course Content
 
Srs template ieee se-1
Srs template ieee se-1Srs template ieee se-1
Srs template ieee se-1
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 
Auditing Data Access in SQL Server
Auditing Data Access in SQL ServerAuditing Data Access in SQL Server
Auditing Data Access in SQL Server
 
Nadzor sql a
Nadzor sql aNadzor sql a
Nadzor sql a
 
SharePoint Administration: Tips from the Field
SharePoint Administration: Tips from the FieldSharePoint Administration: Tips from the Field
SharePoint Administration: Tips from the Field
 
Sql dba 2008 r2 online training
Sql dba 2008 r2 online trainingSql dba 2008 r2 online training
Sql dba 2008 r2 online training
 
Cqrs and Event Sourcing Intro For Developers
Cqrs and Event Sourcing Intro For DevelopersCqrs and Event Sourcing Intro For Developers
Cqrs and Event Sourcing Intro For Developers
 
new resume of Database Administrator
new resume of Database Administratornew resume of Database Administrator
new resume of Database Administrator
 
SQL Server 2008 Security Overview
SQL Server 2008 Security OverviewSQL Server 2008 Security Overview
SQL Server 2008 Security Overview
 
MICROSOFT SQL Server
MICROSOFT SQL ServerMICROSOFT SQL Server
MICROSOFT SQL Server
 
MICROSOFT SQL Server
MICROSOFT SQL ServerMICROSOFT SQL Server
MICROSOFT SQL Server
 
MICROSOFT SQL Server
MICROSOFT SQL ServerMICROSOFT SQL Server
MICROSOFT SQL Server
 
PowerShell DSC - State of the Art & Community by Gael Colas
PowerShell DSC - State of the Art & Community by Gael ColasPowerShell DSC - State of the Art & Community by Gael Colas
PowerShell DSC - State of the Art & Community by Gael Colas
 
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
 

More from Boris Hristov

The World of Business Intelligence
The World of Business IntelligenceThe World of Business Intelligence
The World of Business Intelligence
Boris Hristov
 

More from Boris Hristov (20)

The Secret to Engaging Presentations
The Secret to Engaging PresentationsThe Secret to Engaging Presentations
The Secret to Engaging Presentations
 
Presentation Design Fundamentals
Presentation Design FundamentalsPresentation Design Fundamentals
Presentation Design Fundamentals
 
The World of Business Intelligence
The World of Business IntelligenceThe World of Business Intelligence
The World of Business Intelligence
 
The 5 Hidden Performance Gems of SQL Server 2014
The 5 Hidden Performance Gems of SQL Server 2014The 5 Hidden Performance Gems of SQL Server 2014
The 5 Hidden Performance Gems of SQL Server 2014
 
Securing SQL Azure DB? How?
Securing SQL Azure DB? How?Securing SQL Azure DB? How?
Securing SQL Azure DB? How?
 
The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!
 
How to Deliver Technical Presentations: The Right Way!
How to Deliver Technical Presentations: The Right Way!How to Deliver Technical Presentations: The Right Way!
How to Deliver Technical Presentations: The Right Way!
 
Securing SQL Azure DB? How?
Securing SQL Azure DB? How?Securing SQL Azure DB? How?
Securing SQL Azure DB? How?
 
Top 5 T-SQL Improvements in SQL Server 2014
Top 5 T-SQL Improvements in SQL Server 2014Top 5 T-SQL Improvements in SQL Server 2014
Top 5 T-SQL Improvements in SQL Server 2014
 
Presentation Skills: The Next Level
Presentation Skills: The Next LevelPresentation Skills: The Next Level
Presentation Skills: The Next Level
 
The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!
 
SQL Server 2014: Ready. Steady. Go!
SQL Server 2014: Ready. Steady. Go!SQL Server 2014: Ready. Steady. Go!
SQL Server 2014: Ready. Steady. Go!
 
BI PoC for the Telco Industry
BI PoC for the Telco IndustryBI PoC for the Telco Industry
BI PoC for the Telco Industry
 
Presentation Design Basics
Presentation Design BasicsPresentation Design Basics
Presentation Design Basics
 
Deep Into Isolation Levels
Deep Into Isolation LevelsDeep Into Isolation Levels
Deep Into Isolation Levels
 
Top 5 T-SQL Improvements in SQL Server 2014
Top 5 T-SQL Improvements in SQL Server 2014Top 5 T-SQL Improvements in SQL Server 2014
Top 5 T-SQL Improvements in SQL Server 2014
 
Database Transactions and SQL Server Concurrency
Database Transactions and SQL Server ConcurrencyDatabase Transactions and SQL Server Concurrency
Database Transactions and SQL Server Concurrency
 
Database Performance
Database PerformanceDatabase Performance
Database Performance
 
The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!
 
The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!The Nightmare of Locking, Blocking and Isolation Levels!
The Nightmare of Locking, Blocking and Isolation Levels!
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

You want rules? You need Policy-Based Management!

Editor's Notes

  1. Way to define rules and audit your environment. Limited functionality – CMS, on-demand only (no Agent in Express) No all facets are available for all versions. No all features are available in all version, so test! In 2000 – no DDL triggers! On change prevent – does not work!
  2. On change – log – only if an event is generated! On prevent – only AFTER trigger! The example of index rebuild! The trigger fires after finished :D
  3. On-change: prevent mode will fail or perform unexpectedly.
  4. Now that’s all cool, but can it be even easier? YES, IT CAN! Because… Microsoft + The whole community shares
  5. But can I do even complex policies because the facets are cool, but not enough. ExecuteWql(‘String’, ‘BRSHRISTOV\SECOND’, ‘SELECT State FROM Win32_Service WHERE Name = ’SQLAgent$SECOND’) ExecuteSql(‘Numeric’, ‘SELECT COUNT(*) FROM sys.databases’) PolicyAdministratorRole in MSDB - can edit all - so stop it!!! ##MS_PolicyTsqlExecutionLogin## - used when you schedule a policy that executes ExecuteSQL(). You need to give this login the needed permissions. All permissions you give to this login though are actually given to everyone in the PolicyAdministrator role too, so be careful! ##MS_PolicyEventProcessing## - used internally by the service broker – do not do anything with it.
  6. So after executing those policies, you may think. OK, but what if I want to be informed when something is wrong! Execution mode Message number On change: prevent (if automatic) 34050 On change: prevent (if On demand) 34051 On schedule 34052 On change 34053
  7. And every single thing that you do is actually stored in msdb, so be careful with it. Backup it and make sure you can restore those backups. Everything is stored procedures. You cannot even rename your policies without running a stored proc and there are number of views you can use to find useful information.