# SQL Server First Responder Kit
<a name="header1"></a>
[![licence badge]][licence]
[![stars badge]][stars]
[![forks badge]][forks]
[![issues badge]][issues]
[![contributors_badge]][contributors]
Navigation
- [How to Install the Scripts](#how-to-install-the-scripts)
- [How to Get Support](#how-to-get-support)
- Common Scripts:
- [sp_Blitz: Overall Health Check](#sp_blitz-overall-health-check)
- [Advanced sp_Blitz Parameters](#advanced-sp_blitz-parameters)
- [Writing sp_Blitz Output to a Table](#writing-sp_blitz-output-to-a-table)
- [Skipping Checks or Databases](#skipping-checks-or-databases)
- [sp_BlitzCache: Find the Most Resource-Intensive Queries](#sp_blitzcache-find-the-most-resource-intensive-queries)
- [Advanced sp_BlitzCache Parameters](#advanced-sp_blitzcache-parameters)
- [sp_BlitzFirst: Real-Time Performance Advice](#sp_blitzfirst-real-time-performance-advice)
- [sp_BlitzIndex: Tune Your Indexes](#sp_blitzindex-tune-your-indexes)
- [Advanced sp_BlitzIndex Parameters](#advanced-sp_blitzindex-parameters)
- Performance Tuning:
- [sp_BlitzInMemoryOLTP: Hekaton Analysis](#sp_blitzinmemoryoltp-hekaton-analysis)
- [sp_BlitzLock: Deadlock Analysis](#sp_blitzlock-deadlock-analysis)
- [sp_BlitzQueryStore: Like BlitzCache, for Query Store](#sp_blitzquerystore-how-has-a-query-plan-changed-over-time)
- [sp_BlitzWho: What Queries are Running Now](#sp_blitzwho-what-queries-are-running-now)
- [sp_BlitzAnalysis: Query sp_BlitzFirst output tables](#sp_blitzanalysis-query-sp_BlitzFirst-output-tables)
- Backups and Restores:
- [sp_BlitzBackups: How Much Data Could You Lose](#sp_blitzbackups-how-much-data-could-you-lose)
- [sp_AllNightLog: Back Up Faster to Lose Less Data](#sp_allnightlog-back-up-faster-to-lose-less-data)
- [sp_DatabaseRestore: Easier Multi-File Restores](#sp_databaserestore-easier-multi-file-restores)
- [Parameters Common to Many of the Stored Procedures](#parameters-common-to-many-of-the-stored-procedures)
- [License MIT](#license)
You're a DBA, sysadmin, or developer who manages Microsoft SQL Servers. It's your fault if they're down or slow. These tools help you understand what's going on in your server.
* When you want an overall health check, run [sp_Blitz](#sp_blitz-overall-health-check).
* To learn which queries have been using the most resources, run [sp_BlitzCache](#sp_blitzcache-find-the-most-resource-intensive-queries).
* To analyze which indexes are missing or slowing you down, run [sp_BlitzIndex](#sp_blitzindex-tune-your-indexes).
* To find out why the server is slow right now, run [sp_BlitzFirst](#sp_blitzfirst-real-time-performance-advice).
To install, [download the latest release ZIP](https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/releases), then run the SQL files in the master database. (You can use other databases if you prefer.)
The First Responder Kit runs on:
* SQL Server 2012, 2014, 2016, 2017, 2019, 2022 on Windows - fully supported.
* SQL Server on Linux - yes, fully supported except sp_AllNightLog and sp_DatabaseRestore, which require xp_cmdshell, which Microsoft doesn't provide on Linux.
* SQL Server 2008 R2 and earlier - not supported since it's out of Microsoft support, but check the Deprecated folder for older versions of the scripts which may work, depending on your versions and compatibility levels.
* Amazon RDS SQL Server - fully supported.
* Azure SQL DB - not supported. Some of the procedures work, but some don't, and Microsoft has a tendency to change DMVs in Azure without warning, so we don't put any effort into supporting it. If it works, great! If not, any changes to make it work would be on you. [See the contributing.md file](CONTRIBUTING.md) for how to do that.
## How to Install the Scripts
There are three installation scripts. Choose the one that most suits your needs:
* **Install-Core-Blitz-No-Query-Store.sql** - if you don't know which one to use, use this. This contains the most commonly used stored procedures. Open this script in SSMS or Azure Data Studio, switch to the database where you want to install the stored procedures, and run it. It will install the stored procedures if they don't already exist, or update them to the current version if they do exist.
* **Install-Core-Blitz-With-Query-Store.sql** - for SQL Server 2016 & newer only. Same as above, but adds sp_BlitzQueryStore.
* **Install-All-Scripts.sql** - you're very clever (and also attractive), so as you may guess, this installs all of the scripts, including sp_DatabaseRestore and sp_AllNightLog, both of which depend on Ola Hallengren's Maintenance Solution. When running this script, you'll get warnings if you don't already have his scripts installed. To get those, go to https://ola.hallengren.com.
We recommend installing these stored procedures in the master database, but if you want to use another one, that's totally fine - they're all supported in any database - but just be aware that you can run into problems if you have these procs in multiple databases. You may not keep them all up to date, and you may hit an issue when you're running an older version.
## How to Get Support
Everyone here is expected to abide by the [Contributor Covenant Code of Conduct](CONTRIBUTING.md#the-contributor-covenant-code-of-conduct).
When you have questions about how the tools work, talk with the community in the [#FirstResponderKit Slack channel](https://sqlcommunity.slack.com/messages/firstresponderkit/). If you need a free invite, hit [SQLslack.com](http://SQLslack.com/). Be patient - it's staffed with volunteers who have day jobs, heh.
When you find a bug or want something changed, [read the contributing.md file](CONTRIBUTING.md).
When you have a question about what the scripts found, first make sure you read the "More Details" URL for any warning you find. We put a lot of work into documentation, and we wouldn't want someone to yell at you to go read the fine manual. After that, when you've still got questions about how something works in SQL Server, post a question at [DBA.StackExchange.com](http://dba.stackexchange.com) and the community (that includes us!) will help. Include exact errors and any applicable screenshots, your SQL Server version number (including the build #), and the version of the tool you're working with.
[*Back to top*](#header1)
## sp_Blitz: Overall Health Check
Run sp_Blitz daily or weekly for an overall health check. Just run it from SQL Server Management Studio, and you'll get a prioritized list of issues on your server right now.
Output columns include:
* Priority - 1 is the most urgent, stuff that could get you fired. The warnings get progressively less urgent.
* FindingsGroup, Findings - describe the problem sp_Blitz found on the server.
* DatabaseName - the database having the problem. If it's null, it's a server-wide problem.
* URL - copy/paste this into a browser for more information.
* Details - not just bland text, but dynamically generated stuff with more info.
Commonly used parameters:
* @CheckUserDatabaseObjects = 0 - by default, we check inside user databases for things like triggers or heaps. Turn this off (0) to make checks go faster, or ignore stuff you can't fix if you're managing third party databases. If a server has 50+ databases, @CheckUserDatabaseObjects is automatically turned off unless...
* @BringThePain = 1 - required if you want to run @CheckUserDatabaseObjects = 1 with over 50 databases. It's gonna be slow.
* @CheckServerInfo = 1 - includes additional rows at priority 250 with server configuration details like service accounts.
* @IgnorePrioritiesAbove = 50 - if you want a daily bulletin of the most important warnings, set @IgnorePrioritiesAbove = 50 to only get the urgent stuff.
Advanced tips:
* [How to install, run, and centralize the data from sp_Blitz using PowerShell](https://garrybargsley.com/2020/07/14/sp_blitz-for-all-servers/)
[*Back to top*](#header1)
### A
没有合适的资源?快使用搜索试试~ 我知道了~
SQL Server故障诊断工具集合,适用于DBA、系统管理员和开发人员进行问题故障诊断
共54个文件
sql:24个
md:13个
ps1:12个
需积分: 5 1 下载量 10 浏览量
2024-03-07
22:29:07
上传
评论
收藏 1.42MB ZIP 举报
温馨提示
如果你是管理 Microsoft SQL Server 的 DBA、系统管理员或开发人员。如果它们出现故障或速度变慢,那是您的错。这些工具可帮助您了解服务器中发生的情况。
资源推荐
资源详情
资源评论
收起资源包目录
SQL-Server-First-Responder-Kit-dev.zip (54个子文件)
SQL-Server-First-Responder-Kit-dev
sp_BlitzCache.sql 334KB
.editorconfig 243B
Documentation
sp_BlitzFirst_Checks_by_Priority.md 5KB
sp_BlitzIndex_Checks_by_Priority.md 7KB
Development
Merge Blitz.ps1 2KB
Test sp_DatabaseRestore.sql 2KB
ReleaseProcess.md 5KB
_TestBed.sql 2KB
sp_Blitz_Checks_by_Priority.md 29KB
sp_BlitzCache_Checks_by_Priority.md 9KB
Install-Core-Blitz-With-Query-Store.sql 2.01MB
sp_BlitzBackups.sql 64KB
LICENSE.md 2KB
sp_BlitzLock.sql 152KB
sp_BlitzInMemoryOLTP.sql 78KB
sp_BlitzWho.sql 61KB
.github
ISSUE_TEMPLATE
feature_request.md 776B
bug_report.md 700B
feature_request.md 409B
workflows
integration-tests.yml 2KB
bug_report.md 620B
.gitattributes 1KB
sp_BlitzIndex.sql 339KB
sp_AllNightLog_Setup.sql 44KB
tests
sp_BlitzWho.tests.ps1 656B
sp_BlitzInMemoryOLTP.tests.ps1 833B
sp_BlitzQueryStore.tests.ps1 616B
sp_BlitzIndex.tests.ps1 335B
sp_BlitzCache.tests.ps1 653B
sp_BlitzAnalysis.tests.ps1 767B
sp_BlitzFirst.tests.ps1 2KB
run-tests.ps1 670B
sp_BlitzLock.tests.ps1 482B
sp_Blitz.tests.ps1 316B
sp_BlitzBackups.tests.ps1 842B
CONTRIBUTING.md 8KB
Uninstall.sql 3KB
sp_ineachdb.sql 13KB
sp_BlitzAnalysis.sql 31KB
Install-All-Scripts.sql 2.17MB
sp_DatabaseRestore.sql 65KB
CODE_OF_CONDUCT.md 3KB
sp_BlitzQueryStore.sql 236KB
Deprecated
sp_BlitzIndex_SQL_Server_2005.sql 129KB
sp_BlitzCache_SQL_Server_2005.sql 2KB
sp_Blitz_SQL_Server_2005.sql 226KB
readme.txt 200B
Install-Core-Blitz-No-Query-Store.sql 1.78MB
.gitignore 1KB
sp_Blitz.sql 455KB
SqlServerVersions.sql 71KB
sp_BlitzFirst.sql 311KB
sp_AllNightLog.sql 48KB
README.md 40KB
共 54 条
- 1
资源评论
AI普惠行者
- 粉丝: 1677
- 资源: 117
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功