SQL Server数据库配置改进

针对SQL Server数据库的配置,遵从最佳实践,有如下几项,看能否修改生产环境实例配置。

以下为调整方法和依据:

启动账号内存锁定

保证SQL Server提交内存不会被交换或空间被操作系统收缩。

The SQL Server 64-bit version uses "locked pages" to prevent the process working set (committed memory) from being paged out or trimmed by the operating system.

参考:

https://support.microsoft.com/en-us/kb/2659143

限制最大内存大小

保留一定内存供SQL Server连接内存、其它应用、系统内存等使用。

参考:

https://mssqlwiki.com/2013/04/22/max-server-memory-do-i-need-to-configure/

启动帐号即时文件初始化

快速初始化数据文件空间分配,减少等待。

This should be enabled in the vast majority of cases. SQL Server 2016 lets you enable this during the SQL server installation process.

参考:

Database Instant File Initialization

https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-instant-file-initialization

Misconceptions around instant file initialization

https://www.sqlskills.com/blogs/paul/misconceptions-around-instant-file-initialization/

tempdb根据CPU核数配置多个文件

根据CPU核数配置多个相同配置的tempdb文件,提高tempdb的访问性能,已成为SQL Server 2016的标配。

参考:

https://www.derekseaman.com/2014/09/sql-2014-always-ag-pt-7-tempdb.html

https://blogs.msdn.microsoft.com/psssql/2016/03/17/sql-2016-it-just-runs-faster-automatic-tempdb-configuration/

https://blogs.sentryone.com/aaronbertrand/sql-server-2016-tempdb-fixes/

Trace Flag放到启动参数中

跟踪标志用于开启特定功能提高数据库性能。

Common trace flags that should be enabled in most cases

TF 1117 - When growing a data file, grow all files at the same time so they remain the same size, reducing allocation contention points

参考:

http://support2.microsoft.com/kb/2154845

TF 1118 - Helps alleviate allocation contention in tempdb, SQL Server allocates full extents to each database object, thereby eliminating the contention on SGAM pages (more important with older versions of SQL Server). Recommendations to reduce allocation contention in SQL Server tempdb database

参考:

http://support2.microsoft.com/kb/2154845

TF 2371 - Lowers auto update statistics threshold for large tables.

参考:

http://blogs.msdn.com/b/saponsqlserver/archive/2011/09/07/changes-to-automatic-update-statistics-in-sql-server-traceflag-2371.aspx

TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log.

参考:

https://www.sqlskills.com/blogs/paul/fed-up-with-backup-success-messages-bloating-your-error-logs/

optimize for ad hoc workloads

优化即系查询的内存占用。

参考:

https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/optimize-for-ad-hoc-workloads-server-configuration-option

https://www.red-gate.com/simple-talk/blogs/using-optimize-for-ad-hoc-workloads/

remote admin connections

数据库有性能瓶颈时提供远程管理访问连接。

参考:

https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/remote-admin-connections-server-configuration-option

https://www.brentozar.com/archive/2011/08/dedicated-admin-connection-why-want-when-need-how-tell-whos-using/

时间: 2024-07-31 09:35:47

SQL Server数据库配置改进的相关文章

连接局域网的SQL Server数据库配置

首先要保证两台机器位于同一局域网内,然后打开配置工具→SQL Server配置管理器进行配置,将MSSQLSERVER的协议的TCP/IP的(IP1,IP2)TCP端口改为1433,已启用改为是. 服务器名称:输入IP 登录名:输入数据库帐号 密码:输入数据库帐号的密码 说明:跟远程桌面连接无关系,但是跟系统防火墙有关,必须通过SQL Server或者直接关闭防火墙.

局域网连接SQL Server数据库配置

首先要保证两台机器位于同一局域网内,然后打开配置工具→SQL Server配置管理器进行配置.将MSSQLSERVER的协议的TCP/IP的(IP1.IP2)TCPport改为1433,已启用改为是. server名称:输入IP 登录名:输入数据库帐号 password:输入数据库帐号的password 说明:使用远程桌面连接没有任何关系,但随着系统防火墙相关.必须通过SQL Server或者干脆关闭防火墙.

SQL Server数据库告警改进

考虑对生产环境所有SQL Server服务器开启数据库邮件功能,它是数据库自带的邮件发送功能,通过配置到邮件服务器的访问,及时接收SQL Server事件告警. SQL Server警报是基于引擎的事件通知机制发送告警,当事件发生时出发告警通知. 现阶段,需要收集如下两类SQL Server事件告警: Severity - 事件严重性级别13到25告警: Error Number - 包括操作系统错误.IO错误.内存错误.AlwaysOn状态相关告警. 策略调整 我们考虑将这些需要监控的告警整合

BlogEngine的SQL Server数据库配置

大家可以查看以下视频:http://nyveldt.com/misc/BE13SQLBlogProvider.html

SQL SERVER 2008配置Database Mail –用SQL 数据库发邮件

SQL SERVER 2008配置Database Mail –用SQL  数据库发邮件 https://blogs.msdn.microsoft.com/apgcdsd/2011/06/28/sql-server-2008database-mail-sql/ 原文来自:http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/  Aug

Windows 2008服务器环境PHP连接SQL Server数据库的配置及连接方法

背景: PHP程序常用的数据库是Mysql数据库,但是由于实际项目需要,要求PHP网站连接SQL Server数据库查询一些必要信息.因此,本文就来给大家介绍一下如何安装及配置PHP扩展,可以实现PHP利用PDO函数连接SQL Server数据库. 正文: 要让PHP配置支持sql server,需要安装一些必要软件及扩展,步骤如下: 1.在微软官方页面https://www.microsoft.com/en-us/download/details.aspx?id=20098下载PHP扩展压缩包

SQL Server之 (一) 数据库简介 SQL Server环境配置 数据库基础知识

   前言 这个是我工作两年多后,再次从最基础的SQL入门开始,认真的学一遍SQL Server,捡漏和巩固都有;因为自己刚开始学的时候,总是心烦气躁,最近换工作,发现1到2年经验,问到基础性的东西还是很多,这个时候需要的是扎实的基础功夫,所以一系列打击+反省后,自己节假日在家从最基础重新认识一下SQL Server,继续沉淀一下.哪里有不对或需深入探讨,请直接留言或者小窗我;欢迎~ (一) 数据库简介   SQL Server环境配置   数据库基础知识 1.什么是数据库,数据库有哪些特点,为

5、SQL Server数据库

SQL Server数据库基础 一.安装SQL Server数据库 setup.exe->安装->全新SQL Server独立安装或向现有安装添加功能->输入序列号->下一步->默认实例->混合模式->输入sa密码->实例账号添加当前账号即可. 如果想要其他机器访问这台机器的sqlserver,需要使用windows防火墙中的入站规则,端口写1433. 二.SQL Server配置管理器 包含各个sql服务,连接数据库时,务必保证sql server服务已开

SQL Server数据库镜像关键性能计数器

SQL Server数据库镜像关键性能计数器 监视数据库镜像基本有以下5种方法: 1. 配置数据库镜像监视器.设置告警阈值. 2. 配置WMI EVENT ALERT,配置镜像状态修改后的动作或告警. 3. 使用系统监视器查看关键性能计数器. 4. 部署作业监控异常镜像状态,发送告警. 5. 使用sp_dbmmonitorresults获取镜像数据. 当然,使用扩展事件和SQL Server Profiler也能监控到数据库事件中的数据库镜像状态修改.这种工具主要用于跟踪,而非监控的常规手段.