{"id":1853,"date":"2014-08-12T00:00:00","date_gmt":"2014-08-12T00:00:00","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/the-mindset-of-the-enterprise-dba-8-ways-to-centralize-your-work\/"},"modified":"2021-08-24T13:39:42","modified_gmt":"2021-08-24T13:39:42","slug":"the-mindset-of-the-enterprise-dba-8-ways-to-centralize-your-work","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/databases\/sql-server\/database-administration-sql-server\/the-mindset-of-the-enterprise-dba-8-ways-to-centralize-your-work\/","title":{"rendered":"The Mindset of the Enterprise DBA: 8 Ways To Centralize Your Work"},"content":{"rendered":"<div class=\"article-content\">\n<table class=\"series-articles table--bare\">\n<tbody>\n<tr>\n<td>&nbsp;<\/td>\n<td>\u00a0<a id=\"ctl00_ctl00_MainContent_MainContent_AllArticles1_repArticles_ctl03_lnkTitle\" href=\"https:\/\/www.simple-talk.com\/sql\/database-administration\/on-adopting-the-mindset-of-an-enterprise-dba\/\">On Adopting the Mindset of an Enterprise DBA<\/a><\/td>\n<\/tr>\n<tr>\n<td>&nbsp;<\/td>\n<td><a id=\"ctl00_ctl00_MainContent_MainContent_AllArticles1_repArticles_ctl02_lnkTitle\" href=\"https:\/\/www.simple-talk.com\/sql\/database-administration\/the-mindset-of-the-enterprise-dba-creating-and-applying-standards-to-our-work-\/\">The Mindset of the Enterprise DBA: Creating and Applying Standards to Our Work<\/a><\/td>\n<\/tr>\n<tr class=\"series-articles--active\">\n<td>&nbsp;<\/td>\n<td>The Mindset of the Enterprise DBA: 8 Ways To Centralize Your Work<\/td>\n<\/tr>\n<tr>\n<td>&nbsp;<\/td>\n<td><a id=\"ctl00_ctl00_MainContent_MainContent_AllArticles1_repArticles_ctl00_lnkTitle0\" href=\"https:\/\/www.simple-talk.com\/sql\/database-administration\/the-mindset-of-the-enterprise-dba-harnessing-the-power-of-automation\/\">The Mindset of the Enterprise DBA: Harnessing the Power of Automation<\/a><\/td>\n<\/tr>\n<tr>\n<td class=\"style1\">\u00a0<\/td>\n<td><a href=\"https:\/\/www.simple-talk.com\/sql\/database-administration\/the-mindset-of-the-enterprise-dba-delegating-work\/\">The Mindset of the Enterprise DBA: Delegating Work<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Introduction<\/h2>\n<p class=\"start\">In <a href=\"https:\/\/www.simple-talk.com\/sql\/database-administration\/the-mindset-of-the-enterprise-dba-creating-and-applying-standards-to-our-work-\/\">the previous installment<\/a> of my series on adopting the mindset of an Enterprise DBA, we discussed the practice of Standardization. Based on the comments, I think we all agree that while this practice is sometimes a bit boring or cumbersome, it is worthwhile. In this installment, we move on to the second practice: Centralization.<\/p>\n<h2>Defining Centralization<\/h2>\n<p>Centralization is about defining and keeping your stuff in as few places as possible, preferably in one. To use a metaphor we database professionals are likely to understand, it is like normalizing database structures. When we practice good normalization, we ensure that information is not kept in several places; the same is true for centralizing our work and systems. There are several advantages to this practice, but two stand out in particular:<\/p>\n<ul>\n<li>By keeping things in as few places as possible, we make maintaining them easier since we only have to touch them once.<\/li>\n<li>We always know where to find things.<\/li>\n<\/ul>\n<h2>The practicalities of Centralization<\/h2>\n<p>Many of these could be their own article, so I&#8217;m not going to go into too much depth, but will provide links to relevant information whenever possible (and thanks to the wonderful SQL community, it usually is).<\/p>\n<h3>Keep Your Documentation in one Place<\/h3>\n<div class=\"indent\">\n<p>Do you remember all that documentation you produced in part one? (You did write all that down, right? If not, go do that right now. Go on, I&#8217;ll wait. Yes, it&#8217;s that important.) All that effort will do you no good if it&#8217;s scattered around in different places and not organized logically. It&#8217;s not so much <em>where<\/em> you put it, just that it&#8217;s all in one place. Do you happen to like SharePoint? Great, make a site and a document library and put it there. Are you more partial to network drives or maybe just don&#8217;t have anything else? No worries; put everything in some folders organized in a way that you will understand. Again, it&#8217;s not <em>how<\/em> you do it, only that you do it at all.<\/p>\n<\/div>\n<h3>Build a Repository<\/h3>\n<div class=\"indent\">\n<p>Every enterprise-minded DBA should have a repository. By &#8216;repository&#8217;, I mean some kind of database in which you keep useful metadata about your systems. Here are some examples of things to store in the database:<\/p>\n<ul>\n<li>Server Names<\/li>\n<li>Build numbers (a.k.a. patch level, both OS and SQL)<\/li>\n<li>Usage &#8211; who uses what databases on the server and how do you contact them.<\/li>\n<li>Environment &#8211; is this a production or test server?<\/li>\n<li>Special instructions &#8211; is there anything special or unusual about this server?<\/li>\n<\/ul>\n<p>The way that you structure it isn&#8217;t important, just so long as you keep it updated religiously. I don&#8217;t want to skip ahead too much, but you&#8217;d be wise to figure out a way to automate the updating process so you never have to worry about forgetting to change some detail. Believe me, this will come in very handy when a server goes down in the middle of the night and you need to quickly send a notice to all parties affected by the outage (or know if the outage is even an issue at all, perhaps the server is only in use in the daytime). If you want some pointers in this area, a good place to start would be something like Rodney Landrum&#8217;s <a href=\"https:\/\/www.simple-talk.com\/books\/sql-books\/sql-server-tacklebox\/\">SQL Server Tacklebox <\/a>or his <a href=\"http:\/\/sqlmag.com\/sql-server\/dba-repository-2010\">SQL Server Pro article<\/a> on the subject.<\/p>\n<\/div>\n<h3>Use Source Control<\/h3>\n<div class=\"indent\">\n<p>Here&#8217;s a place where we can take a point from the developers. If you are keeping a repository of scripts (you are, right?), they need to be in some kind of version control system. Here again, which one you use isn&#8217;t important (though if you insist on using something like VSS you may want to seek therapy), only that you actually use it. There are numerous advantages to using source control, but two stand out:<\/p>\n<ol>\n<li>You have a built in backup for when changes are made, as well as a way to get an old version of things if need be. Say, for example, if you suddenly find a bug in the version of your maintenance package for SQL 2000, and you need to fix it for that one last holdout. Without version control you would have to manually script everything out.<\/li>\n<li>You have a built in mechanism for pushing changes out to other members of your team. All they need to do is update their checked out copy, and all the changes are pulled down immediately. No more copying things out from shared folders or the like.<\/li>\n<\/ol>\n<p>If you&#8217;re ambivalent about which version control system to use (and you don&#8217;t have a corporately blessed one), I would suggest either Mercurial or Subversion. Both are very highly rated and I find them both easy to use and robust. Subversion in particular has a great<a href=\"http:\/\/svnbook.red-bean.com\/\"> set of documentation and tutorials<\/a>.<\/p>\n<\/div>\n<h3>Use Central Management Server<\/h3>\n<div class=\"indent\">\n<p>Central Management Server, or CMS for short, is a great feature of SQL Server that I sadly don&#8217;t see a lot of people using. It lets you define groups of servers, which are stored in (of all things) a database on a central server. You can do things like <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb964743.aspx\">execute statements across multiple servers<\/a>, but honestly I find that the simple organization value alone is worthwhile. If you&#8217;re smart, you could even drive your repository off the CMS database, which is actually just a few tables in MSDB. Setting one up is easy and<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb934126.aspx\"> well documented<\/a>. My one caution would be that you want to ensure your CMS server is highly available, as it clearly won&#8217;t do you any good if it&#8217;s not accessible.<\/p>\n<\/div>\n<h3>Learn PowerShell<\/h3>\n<div class=\"indent\">\n<p>I think that PowerShell is, beyond any other language, far and away the best tool for writing centralized utilities. What do I mean by that phrase? Simply put, the utility runs in one place, but connects remotely to other network resources to gather information about them, or to accomplish some task. PowerShell is excellent for this purpose because:<\/p>\n<ol>\n<li>It <a href=\"http:\/\/technet.microsoft.com\/en-us\/magazine\/2007.05.powershell.aspx?pr=blog\">exposes WMI i<\/a>n ways that are far easier to understand than other languages like VBScript.<\/li>\n<li>It includes some very nice<a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2012\/07\/23\/an-introduction-to-powershell-remoting-part-one.aspx\"> built-in remoting capabilities <\/a>that help you execute commands remotely. Perhaps not quite as useful for a DBA as for a sysadmin, but gravy nonetheless.<\/li>\n<li>With a little help, PowerShell can have some very powerful parallel execution features that let you run things on multiple threads, thereby getting things done faster. Just imagine the difference between running a query against thirty servers one at a time, versus in batches of ten at once.<\/li>\n<\/ol>\n<p>Here&#8217;s a good example of how I used PowerShell in this manner. As a DBA, I wanted to get a morning status report on all my servers, to show me things like failed backups, databases approaching their size limit, or disk drives that were nearing capacity. Rather than rely on distributed alerts which, as wise DBAs have pointed out, can quickly overwhelm your inbox and give you multiple points of failure, I wanted one message every morning, so that I could see the state of things immediately after brewing that oh-so-important cup of coffee. So what&#8217;s a DBA to do? I created a PowerShell based framework (based on Alan Renouf&#8217;s excellent vCheck) which connected to my CMS server, spun off a bunch of threads, and got all my information in one place from my various servers. Problem solved.<\/p>\n<\/div>\n<h3>Build a Tool Server<\/h3>\n<div class=\"indent\">\n<p>One of the most frustrating things about getting a new computer (or having an old one remade) is installing and configuring every piece of software required. The good news is, this one is easy to solve: get a server (it doesn&#8217;t have to be a physical box, in fact I&#8217;d recommend a VM for failure protection), install everything you need there, then use it as much as possible for daily work. Yes, this means that you have some overhead of connecting in, but in today&#8217;s world of remote desktop and application functionality, I&#8217;d argue that is minimal. In addition, you no longer lose your ability to work if your laptop goes kablooey. As a bonus, you can usually avoid the headaches around things like firewall rules or cross domain trust problems.<\/p>\n<\/div>\n<h3>Use Policy Based Management<\/h3>\n<div class=\"indent\">\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb510667.aspx\">Policy Based Management,<\/a> or PBM for short, is a framework developed by Microsoft to allow you to ensure compliance with rules setup in a central repository. It&#8217;s a very powerful tool, though from my experience it does take a little getting used to. You can do both simple checks for compliance, as well as enforcement of rules (i.e. preventing a change from occurring), which is done via DDL triggers. PBM ships with a fairly comprehensive set of <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/cc645723(v=sql.120).aspx\">pre-built rules <\/a>for looking at general best practices, but you can and should build your own.<\/p>\n<\/div>\n<h3>Use SQL Agent Master Servers<\/h3>\n<div class=\"indent\">\n<p>A very powerful feature of SQL Agent since SQL Server 2008 is the concept of <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms180992.aspx\">Master and Target servers<\/a>. This functionality allows you to define and configure SQL Agent jobs in one master setup, which is then pushed down to multiple targets as you define. Think of it this way: you probably have one or more SQL Agent jobs which you need to run on all your servers one the same schedules. Perhaps you have monitoring jobs for things like TempDB space usage, or other things, and certainly you&#8217;re going to have common maintenance tasks that need to be executed such as backups, DBCCs, and index maintenance. Rather than set them up individually on each server, you can define them once on the Master server, then push them down to all your targets. This way, when (not if) you need to make changes, such as adding a job step or tuning a parameter, you can make them once, rather than across each and every server. This works very well with several of the robust maintenance frameworks out there, such as Ola Hallengren&#8217;s <a href=\"http:\/\/ola.hallengren.com\/\">award winning set of scripts.<\/a><\/p>\n<h2>Concluding Thoughts<\/h2>\n<p>While centralizing our work may take some effort up front to get all the supporting pieces in place, the payoff is almost immediate. Knowing where everything is, being able to update it once, and having something approaching the &#8220;keep it in one place&#8221; model increases our efficiency and gives us peace of mind. In addition, it lays another block in the foundation of preparing for our next (and critical) step in the path to becoming an enterprise DBA: automation. After all, automating is far easier when you can set it up once, rather than multiple times in multiple places. This step, combined with the next, will probably have the greatest effect on your daily workload, in that you&#8217;ll start to see your time free up since you have less busywork to do. Stay tuned and stay focused.<\/p>\n<h2>Further Reading<\/h2>\n<h3>Policy-based Management<\/h3>\n<ul class=\"reference-list\">\n<li><a href=\"https:\/\/www.simple-talk.com\/sql\/database-administration\/policy-based-management\/\">Policy-Based Management <\/a><\/li>\n<li><a href=\"https:\/\/www.simple-talk.com\/sql\/database-administration\/policy-based-management-and-central-management-servers\/\">Policy-based Management and Central Management Servers <\/a><\/li>\n<li><a href=\"https:\/\/www.simple-talk.com\/blogs\/2013\/09\/16\/sql-server-policy-based-management-creating-a-custom-condition\/\">SQL Server Policy Based Management &#8211; Creating a custom condition <\/a><\/li>\n<\/ul>\n<h3>Central Management Server<\/h3>\n<ul class=\"reference-list\">\n<li><a href=\"https:\/\/www.simple-talk.com\/sql\/sql-tools\/registered-servers-and--central-management-server-stores\/\">Registered Servers and Central Management Server Stores<\/a><\/li>\n<li><a href=\"https:\/\/www.simple-talk.com\/sql\/backup-and-recovery\/centralized-management-tips-for-managing-backups-on-multiple-servers\/\">Centralized management: Tips for Managing Backups on Multiple Servers<\/a><\/li>\n<\/ul>\n<h2>PowerShell<\/h2>\n<ul class=\"reference-list\">\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/database-administration\/the-posh-dba-getting-to-know-powershell\/\">The PoSh DBA &#8211; Getting to know PowerShell <\/a><\/li>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/database-administration\/the-posh-dba-getting-airborne-with-powershell\/\">The PoSh DBA &#8211; Getting Airborne with PowerShell<\/a><\/li>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/database-administration\/practical-powershell-for-sql-server-developers-and-dbas-part-1\/\">Practical PowerShell for SQL Server Developers and DBAs &#8211; Part 1<\/a><\/li>\n<li><a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/database-administration\/practical-powershell-for-sql-server-developers-and-dbas-part-2\/\">Practical PowerShell for SQL Server Developers and DBAs &#8211; Part 2<\/a><\/li>\n<\/ul>\n<h3>Source Control for DBAs<\/h3>\n<ul class=\"reference-list\">\n<li><a href=\"https:\/\/www.simple-talk.com\/sql\/t-sql-programming\/when-database-source-control-goes-bad\/\">When Database Source Control Goes Bad <\/a><\/li>\n<li><a href=\"https:\/\/www.simple-talk.com\/blogs\/2012\/09\/10\/databases-in-source-control\/\">Databases in Source Control<\/a><\/li>\n<li><a href=\"https:\/\/www.simple-talk.com\/sql\/database-administration\/why-put-your-database-into-source-control\/\">Why Put Your Database into Source Control?<\/a><\/li>\n<li><a href=\"https:\/\/www.simple-talk.com\/sql\/learn-sql-server\/change-management-and-source-control\/\">Change Management and Source Control<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Although it is possible to provide good service to small to medium companies as a DBA without putting in place systems and processes to manage the workload and the demands of teamwork, it isn&#8217;t so in the larger enterprise. As well as standardizing and documenting, the enterprise DBA needs to centralize the management of systems. Joshua Feierman explains.&hellip;<\/p>\n","protected":false},"author":217563,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[143527],"tags":[4170,4150],"coauthors":[6803],"class_list":["post-1853","post","type-post","status-publish","format-standard","hentry","category-database-administration-sql-server","tag-database-administration","tag-sql"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/1853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/217563"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=1853"}],"version-history":[{"count":11,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/1853\/revisions"}],"predecessor-version":[{"id":88790,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/1853\/revisions\/88790"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=1853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=1853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=1853"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=1853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}