Evaluate your Daily Checklist against 100+ instances of SQL Server while you get a cup of coffee<br />John Sterrett  (@Joh...
Thank you Attendees & Sponsors<br />
Titles are set to 34 pt, ArialClick to edit Master title style<br />Level 1 text is 28 pt Arial<br />Level 2 text is 24 pt...
I am not an expert but I stayed at a Holiday Inn once….<br />Founder of WVPASS (SQL UG)<br />I reside in Wheeling, WV (Pit...
My Story….<br />BackupsCorruptionFailed mission critical SQL Jobs<br />Failed Jobs<br />Low Disk Space<br />Urgency<br />P...
Do you have a daily checklist?<br />What is your daily checklist?<br />Full backups<br />Transactional Log backups<br />Fr...
Daily Checklist<br />
Daily Checklist?<br />
Daily Checklist?<br />
Job Notifications…..<br />
Trust but verify…..<br />Is the SQL Agent enabled for all servers?<br />Does email operator exist for all jobs?<br />Is th...
I prefer notifications and….<br />
Similar to local server group except it’s a repository for your team.<br />Group database servers<br />Environment<br />Ve...
Which version of SQL should I use?<br />
MSDB is used to store servers and groups<br />Servers – msdb.dbo.sysmanagement_shared_registered_servers_internal<br />Gro...
CMS Security<br />Security –<br />ServerGroupAdministratorRole role can manage the central management server. <br />Server...
First look at CMS<br />
Create Configuration Management Server<br />Create Groups<br />Register Servers<br />Execute scripts against a group<br />...
CMS itself cannot automate query execution.<br />CMS only supports windows authentication<br />Query results are ordered b...
Leverage PowerShell to automate CMS<br />Aaron Nelson – SQL University PowerShell Week<br />
DEMO!<br />Automate CMS with PowerShell<br />
Policy-Based Management is a system for managing one or more instances of SQL Server 2008 (* BOL).<br />Some facets allow ...
Prevent things from happening Apply changes<br />Automate validation of checklists<br />Checklists are prone to human erro...
Targets   <br />facets<br />conditions<br />policy<br />categories<br />server restrictions<br />PBM Concepts and Terms<br />
PBM Example – Page Verify<br /> http://www.littlekendra.com/2011/01/25/pageverify/<br />
On Demand<br />Executed by user or powershell scripts<br />On Schedule<br />Uses SQL Agent<br />On Change – Prevent<br />U...
Not all facets support On-change.<br />On Change – Log (17)<br />On Change – Prevent (12)<br />Application Role          <...
Schema
Stored Procedure
Table Options
User Defined Function
User Options
View Options
Workload Group</li></li></ul><li>Best Practices<br />SQL Server 2008 Feature Packs<br />C:Program FilesMicrosoft SQL Serve...
Policy Alerts<br />* On demand cannot be enabled so there are no alerts.<br />
Views in MSDB database and dbo schema<br />syspolicy_policies<br />syspolicy_conditions<br />syspolicy_system_health_state...
PBM - ExecuteSQL<br />The ExecuteSql() function can be used against any facet and it'll be executed once for each target i...
Cannot modify or create facets<br />Policies fail to read mount points as separate locations<br />ExecuteSQL only supports...
Create a Category<br />Import Policies<br />Export Policies<br />Create Policy<br />Evaluate Policy<br />On-Demand<br />Sc...
Upcoming SlideShare
Loading in …5
×

Evaluate Daily Checklist with PBM and CMS

2,102 views

Published on

This presentation gives an introduction to evaluating a daily checklist against 100+ instances of SQL Server while you get a cup of coffee. It will be given at SQLRally 2011

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,102
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
24
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Evaluate Daily Checklist with PBM and CMS

  1. 1. Evaluate your Daily Checklist against 100+ instances of SQL Server while you get a cup of coffee<br />John Sterrett (@JohnSterrett)<br />http://johnsterrett.com/go/PBM<br />5/12/2011<br />
  2. 2. Thank you Attendees & Sponsors<br />
  3. 3. Titles are set to 34 pt, ArialClick to edit Master title style<br />Level 1 text is 28 pt Arial<br />Level 2 text is 24 pt Arial<br />Level 3 text is 20 pt Arial<br />Level 4 text is 20 pt Arial<br />Level 5 text is 20 pt Arial<br />Session Title <br />3<br />
  4. 4. I am not an expert but I stayed at a Holiday Inn once….<br />Founder of WVPASS (SQL UG)<br />I reside in Wheeling, WV (Pittsburgh, PA)<br />Work for Orrick Herrington & Sutcliffe LLP<br />Responsible 100+ Instances of SQL Server<br />Responsible for PeopleSoft<br />About Me…. <br />
  5. 5. My Story….<br />BackupsCorruptionFailed mission critical SQL Jobs<br />Failed Jobs<br />Low Disk Space<br />Urgency<br />Process improvements<br />Continuing education<br />Projects<br />Index Management<br />Performance Tuning<br />Pittsburgh Pirates winning the world series<br />Everything else…<br />Importance<br />Comes from The 7 Habits of Highly Effective People by Stephen R. Covey<br />
  6. 6. Do you have a daily checklist?<br />What is your daily checklist?<br />Full backups<br />Transactional Log backups<br />Free space<br />SQL Agents are enabled<br />SQL Agent jobs succeeded<br />How do you evaluate your daily checklist?<br />Central Management Server (CMS)<br />Policy Based Management (PBM)<br />Daily Checklist Questions<br />
  7. 7. Daily Checklist<br />
  8. 8. Daily Checklist?<br />
  9. 9. Daily Checklist?<br />
  10. 10. Job Notifications…..<br />
  11. 11. Trust but verify…..<br />Is the SQL Agent enabled for all servers?<br />Does email operator exist for all jobs?<br />Is the operator the same across all servers?<br />Is Database Mail enabled for all servers?<br />
  12. 12. I prefer notifications and….<br />
  13. 13. Similar to local server group except it’s a repository for your team.<br />Group database servers<br />Environment<br />Version<br />Location<br />Apply scripts against all servers in a group<br />Not all checklist items can be validated with PBM<br />Can use SQL Server 2008 R2 Express<br />Central Management Server (CMS)<br />
  14. 14. Which version of SQL should I use?<br />
  15. 15. MSDB is used to store servers and groups<br />Servers – msdb.dbo.sysmanagement_shared_registered_servers_internal<br />Groups – msdb.dbo.sysmanagement_shared_server_groups_internal<br />CMS Internals<br />
  16. 16. CMS Security<br />Security –<br />ServerGroupAdministratorRole role can manage the central management server. <br />ServerGroupReaderRole role is required to connect to a central management server.<br />Windows Authentication of the individual servers is used to execute t-sql and policies.<br />
  17. 17. First look at CMS<br />
  18. 18. Create Configuration Management Server<br />Create Groups<br />Register Servers<br />Execute scripts against a group<br />Find missing backups<br />Find failed SQL Agent Jobs<br />Check SQL Agent Service is enabled<br />DEMO<br />
  19. 19. CMS itself cannot automate query execution.<br />CMS only supports windows authentication<br />Query results are ordered by server name<br />Cannot include host server (Unless you use 127.0.0.1 or add port number)<br />Query executes for all listed servers. (Includes duplicates)<br />CMS Gotchas!<br />
  20. 20. Leverage PowerShell to automate CMS<br />Aaron Nelson – SQL University PowerShell Week<br />
  21. 21. DEMO!<br />Automate CMS with PowerShell<br />
  22. 22. Policy-Based Management is a system for managing one or more instances of SQL Server 2008 (* BOL).<br />Some facets allow you to enforce standards with “On-Change – Prevent”<br />Can import and export policies<br />Apply changes when evaluation fails<br />Policies can run against SQL 2000 & 2005<br />Policy-Based Management (PBM)<br />
  23. 23. Prevent things from happening Apply changes<br />Automate validation of checklists<br />Checklists are prone to human error.<br />Server configurations can change over time.<br />Daily checklist items we will validate<br />SQL Agent is enabled<br />SQL Agent Jobs<br />Full backups<br />Transactional Log backups<br />Free Space<br />I use CMS & PBM to do two things…<br />
  24. 24. Targets <br />facets<br />conditions<br />policy<br />categories<br />server restrictions<br />PBM Concepts and Terms<br />
  25. 25. PBM Example – Page Verify<br /> http://www.littlekendra.com/2011/01/25/pageverify/<br />
  26. 26. On Demand<br />Executed by user or powershell scripts<br />On Schedule<br />Uses SQL Agent<br />On Change – Prevent<br />Uses DDL Triggers<br />* Nested Triggers should be enabled<br />On Change – Log Only<br />uses event notification<br />For More: http://msdn.microsoft.com/en-us/library/bb510667%28SQL.100%29.aspx<br />Evaluation Modes<br />
  27. 27. Not all facets support On-change.<br />On Change – Log (17)<br />On Change – Prevent (12)<br />Application Role <br />Asymmetric Key<br />Database Role<br />Endpoint<br />Login Options<br />Multipart Name<br />On-Change Evaluation….<br /><ul><li>Resource Pool
  28. 28. Schema
  29. 29. Stored Procedure
  30. 30. Table Options
  31. 31. User Defined Function
  32. 32. User Options
  33. 33. View Options
  34. 34. Workload Group</li></li></ul><li>Best Practices<br />SQL Server 2008 Feature Packs<br />C:Program FilesMicrosoft SQL Server100ToolsPoliciesDatabaseEngine1033<br />Interwebs<br />http://www.mssqltips.com/category.asp?catid=89<br />Blogs<br />Bing or Google<br />Where can I find policies?<br />
  35. 35. Policy Alerts<br />* On demand cannot be enabled so there are no alerts.<br />
  36. 36. Views in MSDB database and dbo schema<br />syspolicy_policies<br />syspolicy_conditions<br />syspolicy_system_health_state<br />syspolicy_categories<br />syspolicy_policy_category_subscriptions<br />syspolicy_policy_execution_history<br />syspolicy_policy_execution_history_details<br />syspolicy_object_sets<br />syspolicy_target_sets<br />For more: http://msdn.microsoft.com/en-us/library/bb510742.aspx<br />PBM Views<br />
  37. 37. PBM - ExecuteSQL<br />The ExecuteSql() function can be used against any facet and it'll be executed once for each target in the target set. <br />The proxy account is called ##MS_PolicyTsqlExecutionLogin## used for scheduled jobs<br />http://blogs.msdn.com/b/sqlpbm/archive/2008/07/03/executesql.aspx<br />
  38. 38. Cannot modify or create facets<br />Policies fail to read mount points as separate locations<br />ExecuteSQL only supports @ObjectName and @SchemaName<br />Reporting is very limited out of the box<br />On Change-Prevent is limited<br />Best Practice Policies may not be best practice for your shop.<br />Gotchas!<br />
  39. 39. Create a Category<br />Import Policies<br />Export Policies<br />Create Policy<br />Evaluate Policy<br />On-Demand<br />Scheduled<br />On Change – Prevent<br />On Change – Log<br />Apply Policy<br />Evaluate Policy on Multiple Servers using CMS<br />View Policy History<br />PBM Demo! <br />
  40. 40. http://epmframework.codeplex.com/<br />EPMF leverages<br />Central Management Server<br /> Policy-Based Management<br /> PowerShell<br /> XML<br />SQL Server Reporting Services<br />Reporting - EPM Framework<br />
  41. 41.
  42. 42. Show EMPF…<br />DEMO! <br />
  43. 43. All reference material can be found at http://johnsterrett.com/go/PBM<br />Books On Line<br />Administering Servers by Using Policy-Based Management<br />Book<br />Pro SQL Server 2008 Policy-Based Management<br />White Papers<br />Enterprise Policy Management Framework with SQL Server 2008<br />SQL Server 2008 Policy-Based Management<br />Web<br />www.mssqltips.com<br />Where you should go from here?<br />
  44. 44. Notes (hidden)<br />Some speakers may use this slide for hidden notes<br />Please delete if you prefer not to use<br />Please note you are also able to use notes section for each slide<br />Session Title <br />38<br />
  45. 45. Please Complete the Evaluation Form<br />Pick up your evaluation form:<br />In each presentation room<br />Drop off your completed form<br />Near the exit of each presentation room<br />At the registration area<br />Sponsored by Dell<br />Session Title <br />39<br />
  46. 46. THANK YOU!<br />For attending this session and PASS SQLRally Orlando, Florida<br />Sponsored by Dell<br />Session Code | Session Title <br />40<br />

×