转载自:http://technet.microsoft.com/en-us/magazine/gg299551.aspx

Many companies have downsized their IT departments over the last few years. Many database administrators (DBAs) have ended up with responsibility for large numbers of SQL Server databases. Worse yet, often there’s no actual DBA. Someone is tagged as the involuntary or de facto DBA. In some cases, the DBA ends up in pure fire-fighting mode, moving from one crisis to the next. This sort of environment is difficult, toxic and unsustainable. No one likes being under constant stress and interruption.

One way out of this type of situation is to invest a little bit of time streamlining your SQL Server environment to make it easier to understand and manage. Based on my SQL Server consulting practice, here are the top 10 ways a SQL Server DBA can take control of his environment and reduce the overall potential for crises to occur. This list is presented in roughly increasing order of importance.

10. Take Inventory

How many times have you been requested to restore damaged data on a database you had no idea even existed? It’s easy for SQL Server databases to sprawl across an enterprise. The DBA team can lose track of what’s out there, resulting in unmanaged instances of SQL Server. This results in databases that aren’t backed up, aren’t patched, aren’t properly secured and missing out on a host of other necessary management tasks.

It’s critical to have an up-to-date inventory of what instances and databases you have in your enterprise and under your control. This is the only way you can properly manage them, consolidate where necessary, and correctly scope and plan projects and upgrades. It also helps you establish limits to your responsibilities by publishing a list of known instances for which you accept responsibility, with agreement from the various teams in your organization. You can define support policies for known instances and insist that new instances adhere to your configuration guidelines before you support them.

There are a number of tools to help you create a SQL Server inventory—from simple tools such as SQLPing3 and SQLRecon to the Microsoft Assessment and Planning Toolkit and the Quest Discovery Wizard.

9. Standardize Configurations

If the number of databases and SQL instances for which you’re responsible is growing all the time, you’ll know that the number of different configurations grows in a similar fashion. It’s extremely hard to work efficiently when moving from instance to instance if you have to constantly remember the configuration details for different instances.

The solution is to standardize your configuration to the greatest extent possible in terms of drive letters, server configuration options, database settings, database maintenance, security settings and so on. SQL Server 2008 introduced the Policy-Based Management feature to help define and enforce policies. Lara Rubbelke, a SQL Server technology specialist at Microsoft, has also produced the Enterprise Policy Management (EPM) Framework, which easily extends the capabilities to SQL Server 2005 and SQL Server 2000 instances. You can find the EPM Framework on CodePlex. Figure 1 shows a sample EPM Framework report.

Figure 1 The Enterprise Policy Management Framework report

8. Understand the I/O Subsystem

There are several factors related to the I/O subsystem that can affect your SQL Server instances. You need to be aware of these and their potential impact:

  • The capacity of the I/O subsystem in terms of read/write throughput and disk space. It must be able to cope with workload peak demands and still provide space for the data volume to grow before you have to purchase more capacity. By identifying I/O bottlenecks and moving data and/or log files to other portions of the I/O subsystem, you can more evenly balance the load.
  • The redundancy capabilities of the I/O subsystem in terms of RAID level and whether it can do things like split-mirror backups and any form of mirroring/replication (at the I/O subsystem level, not the SQL Server level). It’s important to protect your data and log files from drive failures and other potential problems. This is often a trade-off—RAID-10 offers better redundancy than RAID-5, but is more expensive. Read the white paper, “Physical Database Storage Design” for more guidance.
  • The I/O subsystem is configured correctly in terms of RAID stripe size, NTFS allocation unit/cluster size and partition alignment. Check out this blog post, “Are your disk partition offsets, RAID stripe sizes, and NTFS allocation units set correctly?” for more details.
7. Create a Customized Maintenance Plan

Whenever I teach database maintenance classes I always start off by saying, “You can’t just put a database into production and walk away.” Indexes become fragmented over time, which leads to performance degradation. Statistics become out-of-date, which leads to bad query plans and poor performance. I/O subsystems can get corrupted, and there’s the ever-present need for backups.

You can tackle all these problems by having a comprehensive maintenance plan tailored for your databases. A customized plan is far better than a generic plan that doesn’t adequately address your needs. My August 2008 TechNet Magazine feature,  “Top Tips for Effective SQL Server Database Maintenance,” tells you how to construct a good maintenance plan. The best starting point for building your own maintenance plan is the comprehensive and free script from Ola Hallengren. That’s what I recommend to my clients.

6. Ensure the Security of Your System

Investing time in proactively discovering security problems is essential to preventing incidents and not having to deal with them later. Another one of my TechNet Magazine features, “Common SQL Server Security Issues and Solutions,” lists the 10 most common security problems and how to avoid them. Also, don’t forget to stay on top of patching your systems as you discover vulnerabilities.

5. Get on Good Terms with Your Developers

One of the major tension points in any IT department is often between the DBA team and the development team. The two groups typically don’t understand each others’ priorities and concerns—from development deadlines to SQL Server design decisions. Differing opinions about behavior and performance issues and responsibilities around deployment and support are relatively common.

You can make your job a lot smoother by engaging proactively and productively with the development team. Organizing mutual education sessions works well, especially when done in a non-accusatory manner. Conduct design reviews with someone from the DBA team present, and test code adequately before being put into production—hopefully avoiding damaging errors that can further erode inter-team relationships.

4. Develop a Comprehensive Disaster Recovery Strategy

No matter how bullet-proof your infrastructure may be, you must have a contingency plan for when disaster strikes. You can’t predict corruption, power outages, fires, accidental data loss or a host of other potential problems. You need a plan to cope with and recover from these problems.

Work with management to define down-time and data-loss software license agreements for your databases, plan how to recover data from various kinds of data loss, determine how your databases and all SQL instances figure into your company’s business-continuity plan. Work out the relative importance of all the databases and instances so you can prioritize disaster recovery.

You’ll also need to implement technologies to help you know when problems occur, such as page checksums, consistency checks, SQL Agent alerts and System Center Operations Manager alerts. This disaster recovery infrastructure will help you protect data with backups, log shipping, replication and database mirroring; and potentially failover to a redundant system with database mirroring or failover clustering. There are two Microsoft white papers that can help you with this: “High Availability with SQL Server 2008” and “Proven SQL Server Architectures for High Availability and Disaster Recovery.”

3. Take and Test Regular Backups

No matter how good your high availability and disaster recovery planning is, you cannot avoid taking regular backups of your databases. If your database is destroyed or fatally corrupted, your only recourse may be to restore from your last set of backups, so if you don’t have any backups your company could suffer major consequences. Not only do you need to take backups, you also need to regularly practice restoring from them so you know they’ll work when needed.

You can find more information in two of the articles I wrote for TechNet Magazine in 2009: “Understanding SQL Server Backups” and “SQL Server: Recovering From Disasters Using Backups.

2. Monitor and Maintain Performance

Performance tuning takes up the majority of a DBA’s time, but there are plenty of ways to streamline the process:

  • Establish a performance baseline so you can see whether performance has really changed.
  • Break the system up into primitives you can measure in isolation without the uncertainty of external factors.
  • Use the waits-and-queues methodology to quickly pinpoint performance problems.
  • Monitor performance with system primitives, performance counters and wait statistics. This way you’ll know when performance starts to degrade. Use the performance Data Collector feature in SQL Server 2008 and the Performance Dashboard for SQL Server 2005.
  • Establish a maintenance plan.
  • Carefully plan and execute your indexing strategy with tools such as the Database Engine Tuning Advisor, or DTA, missing index Dynamic Management Views (DMVs) and index usage DMV.
1. Know Where to Find Information

With a never-ending to-do list, it’s vital that you know when to call it quits and look for help. You have to know your limitations and accept that you can’t know everything about SQL Server. There’s no point in beating your head against a wall and wasting precious time when someone out there can help with your task or problem.

Your No. 1 source of information about SQL Server is SQL Server Books Online, which you can download and install locally or search online on MSDN. SQL Server Books Online is great for looking up syntax, but if you have a more involved how-to question, or are trying to troubleshoot a problem, the best thing to do is post a question on an online forum. There are lots of SQL Server forums on MSDN and popular community sites like SQL Server Central.

Another fast way to find help is to tap into the SQL Server community on Twitter. Post your question with the #sqlhelp hash-tag, which many SQL experts (including me) monitor.

Attend a SQL Server-specific conference such as the annual PASS Community Summit, the bi-annual SQL Server Connections or more frequent SQL Saturdays. Follow some of the many blogs run by SQL Server experts in the community. You can get a good idea of which blogs are active and worth following from the blog rankings maintained by fellow-MVP Thomas LaRock.

You may be overloaded and overwhelmed, but if you can put in some extra effort to work through these suggestions, you should find you get huge benefits. Your systems will run smoother, you’ll be better organized, you’ll have more peace of mind—and you’ll be a more proficient DBA.

SQL Server: Top 10 Secrets of a SQL Server Expert的更多相关文章

  1. sql server top 10 IO性能查询

    use master go ), ((case qs.statement_end_offset then datalength(qt.text) else qs.statement_end_offse ...

  2. ASP.NET Core中的OWASP Top 10 十大风险-SQL注入

    不定时更新翻译系列,此系列更新毫无时间规律,文笔菜翻译菜求各位看官老爷们轻喷,如觉得我翻译有问题请挪步原博客地址 本博文翻译自: https://dotnetcoretutorials.com/201 ...

  3. SQL SELECT TOP, LIMIT, ROWNUM 子句

    SQL SELECT TOP, LIMIT, ROWNUM 子句 SQL SELECT TOP 子句 SELECT TOP 子句用于规定要返回的记录的数目. SELECT TOP 子句对于拥有数千条记 ...

  4. Top 10 steps to optimize data access in SQL Server

    2009年04月28日 Top 10 steps to optimize data access in SQL Server: Part I (use indexing) 2009年06月01日 To ...

  5. SQL Server’s Storage Top 10 Best Practices

    好文章, 简明扼要. Storage Top 10 Best Practices http://technet.microsoft.com/en-us/library/cc966534.aspx

  6. SQL Server代理(10/12):使用代理账号运行作业

    SQL Server代理是所有实时数据库的核心.代理有很多不明显的用法,因此系统的知识,对于开发人员还是DBA都是有用的.这系列文章会通俗介绍它的很多用法. 在这一系列的上一篇,你查看了msdb库下用 ...

  7. SQL Server定时自动抓取耗时SQL并归档数据发邮件脚本分享

    SQL Server定时自动抓取耗时SQL并归档数据发邮件脚本分享 第一步建库和建表 USE [master] GO CREATE DATABASE [MonitorElapsedHighSQL] G ...

  8. 微软官方提供的用于监控MS SQL Server运行状况的工具及SQL语句

    Microsoft SQL Server 2005 提供了一些工具来监控数据库.方法之一是动态管理视图.动态管理视图 (DMV) 和动态管理函数 (DMF) 返回的服务器状态信息可用于监控服务器实例的 ...

  9. SQL Server定时自动抓取耗时SQL并归档数据脚本分享

    原文:SQL Server定时自动抓取耗时SQL并归档数据脚本分享 SQL Server定时自动抓取耗时SQL并归档数据脚本分享 第一步建库 USE [master] GO CREATE DATABA ...

随机推荐

  1. JDK1.7之Fork/join

    Fork/Join框架是Java 7提供的一个用于并行执行任务的框架,是一个把大任务分割成若干个小任务,最终汇总每个小任务结果后得到大任务结果的框架.Fork/Join框架要完成两件事情: 1.任务分 ...

  2. jQuery单选框跟复选框美化

    在线演示 本地下载

  3. 记一次网卡报错ERROR,some other host already uses address

    提示IP地址冲突,但是此IP确实没有被其他Server占用 解决如下: 编辑此文件 搜索arping 将下面几行注释掉 保存退出 激活网卡 此时IP地址已生效 下面是我的系统版本 (一般应该不会出现这 ...

  4. netbeans等宽字体却不支持中文

    一直用netbeans,各方面都很满意,就是这字体十分不爽,如用等宽字体却不支持中文,百度了一下,找到了解决办法,贴出来,给需要的朋友. 01.找到自己java字体目录.我的目录是[C:\Progra ...

  5. sqlserver一般需求

    1.创建一个函数:将用逗号分隔的字符串变成一个表的一列,这样就可以运用在select 语句的in中查询 create Function StrToTable(@str varchar()) Retur ...

  6. 快速将对象转化为JSON格式

    1.导入阿里巴巴fastjson包. <!-- fastJson将对象转化为Json对象 --> <dependency> <groupId>com.alibaba ...

  7. Django之ModelForm详解

    前言 这是一个神奇的组件,通过名字我们可以看出来,这个组件的功能就是把model和form组合起来.先来一个简单的例子来看一下这个东西怎么用: 比如我们的数据库中有这样一张学生表,字段有姓名,年龄,爱 ...

  8. Spring 静态注入讲解(MethodInvokingFactoryBean)

    /* * Copyright (c) 2017 4PX Information Technology Co.,Ltd. All rights reserved. */package com.fpx.o ...

  9. Sqrt(X),求平方根,折半查找

    算法分析:利用折半查找,降低算法复杂度.前面求x得y次幂,也是将y/2,都是为了降低复杂度. //折半查找的思想 public class Sqrt { public int sqrt(int x) ...

  10. MapReduce job在JobTracker初始化源码级分析

    mapreduce job提交流程源码级分析(三)中已经说明用户最终调用JobTracker.submitJob方法来向JobTracker提交作业.而这个方法的核心提交方法是JobTracker.a ...