SQL Server: Top 10 Secrets of a SQL Server Expert
转载自: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的更多相关文章
- sql server top 10 IO性能查询
use master go ), ((case qs.statement_end_offset then datalength(qt.text) else qs.statement_end_offse ...
- ASP.NET Core中的OWASP Top 10 十大风险-SQL注入
不定时更新翻译系列,此系列更新毫无时间规律,文笔菜翻译菜求各位看官老爷们轻喷,如觉得我翻译有问题请挪步原博客地址 本博文翻译自: https://dotnetcoretutorials.com/201 ...
- SQL SELECT TOP, LIMIT, ROWNUM 子句
SQL SELECT TOP, LIMIT, ROWNUM 子句 SQL SELECT TOP 子句 SELECT TOP 子句用于规定要返回的记录的数目. SELECT TOP 子句对于拥有数千条记 ...
- 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 ...
- SQL Server’s Storage Top 10 Best Practices
好文章, 简明扼要. Storage Top 10 Best Practices http://technet.microsoft.com/en-us/library/cc966534.aspx
- SQL Server代理(10/12):使用代理账号运行作业
SQL Server代理是所有实时数据库的核心.代理有很多不明显的用法,因此系统的知识,对于开发人员还是DBA都是有用的.这系列文章会通俗介绍它的很多用法. 在这一系列的上一篇,你查看了msdb库下用 ...
- SQL Server定时自动抓取耗时SQL并归档数据发邮件脚本分享
SQL Server定时自动抓取耗时SQL并归档数据发邮件脚本分享 第一步建库和建表 USE [master] GO CREATE DATABASE [MonitorElapsedHighSQL] G ...
- 微软官方提供的用于监控MS SQL Server运行状况的工具及SQL语句
Microsoft SQL Server 2005 提供了一些工具来监控数据库.方法之一是动态管理视图.动态管理视图 (DMV) 和动态管理函数 (DMF) 返回的服务器状态信息可用于监控服务器实例的 ...
- SQL Server定时自动抓取耗时SQL并归档数据脚本分享
原文:SQL Server定时自动抓取耗时SQL并归档数据脚本分享 SQL Server定时自动抓取耗时SQL并归档数据脚本分享 第一步建库 USE [master] GO CREATE DATABA ...
随机推荐
- Python数据处理实例
使用python进行数据处理的实例(数据为某公司HR部门关于员工信息的部分摘录,kaggle上面的一次赛题) https://www.kaggle.com/c/kfru-dbm-hr-analytic ...
- Spark1.x和2.x如何读取和写入csv文件
看很多资料,很少有讲怎么去操作读写csv文件的,我也查了一些.很多博客都是很老的方法,还有好多转来转去的,复制粘贴都不能看.下面我在这里归纳一下,以免以后用到时再费时间去查.前端实现文件下载和拖拽上传 ...
- jQuery带缩略图的宽屏焦点图插件
在线演示 本地下载
- 20145217《信网络对抗》逆向与BOF基础实践
20145217<信网络对抗>逆向与BOF基础实践 内容: 一.简单机器指令,汇编语言 1.'objdump -d xxx|more'反汇编命令查看机器代码,'cat'显示文件内容,'xx ...
- python图片文字识别笔记
我的环境为python3 坑比较多,在此做记录,以备查阅 命令行安装: pip install PIL pip install pytesseract pip install Pillow 下载tes ...
- minicom退出方法【转】
本文转载自:https://blog.csdn.net/jhyworkspace/article/details/53572284 1)需使用Ctrl+a 进入设置状态2)按z进入设置菜单(1)S键: ...
- Spring_使用 JdbcTemplate和JdbcDaoSupport-代码
applicationContext.xml <?xml version="1.0" encoding="UTF-8"?><beans xml ...
- Spring_通过注解配置 Bean(1)
beans-annotation.xml <?xml version="1.0" encoding="UTF-8"?><beans xmlns ...
- 基于主从复制的Mysql双机热备+amoeba实现读写分离、均衡负载
读写分离指的是客户只能在主服务器上写,只能在从服务器上读,当然了,这也是要看配置,你可以在主服务器配置读的功能,但是在从服务器上只能读不能写,因为从服务器是基于binlog对主服务器的复制,如果在从服 ...
- 在NLP中深度学习模型何时需要树形结构?
在NLP中深度学习模型何时需要树形结构? 前段时间阅读了Jiwei Li等人[1]在EMNLP2015上发表的论文<When Are Tree Structures Necessary for ...