Ad Hoc Distributed Queries
```
描述 : 即席分布式查詢選項。此選項設置為 1 時,SQL Server 允許進行即席訪問。如果此選項未設置或設置為 0,則 SQL Server 不允許進行即席訪問。
默認值 : 0
值范圍 : 0~1
是否需要重啟生效 : 否
修改成0(關閉):
# 調用存儲過程,打開高級選項(遇到其他高級選項,不需要重復執行)
sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
# 調用存儲過程,設置即席分布式查詢選項為0
sp_configure 'Ad Hoc Distributed Queries', 0;
RECONFIGURE;
GO
參考鏈接: //learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/ad-hoc-distributed-queries-server-configuration-option?view=sql-server-2016
```
Agent XPs
```
描述 : “代理 XP”選項。使用 Agent XPs 選項可以啟用此服務器上的 SQL Server 代理擴展存儲過程。如果禁用此選項,則 SQL Server Management Studio 對象資源管理器將不顯示 SQL Server 代理節點。
默認值 : 1
值范圍 : 0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
# 調用存儲過程,設置為1
sp_configure 'Agent XPs', 1;
RECONFIGURE
GO
參考鏈接: //learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/agent-xps-server-configuration-option?view=sql-server-2016
```
Database Mail XPs
```
描述 : Database Mail XPs 選項。使用 DatabaseMail XPs 選項可以在此服務器上啟用數據庫郵件。
默認值 : 0
值范圍 : 0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Database Mail XPs', 0;
GO
RECONFIGURE
參考鏈接: //learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/database-mail-xps-server-configuration-option?view=sql-server-ver16
```
EKM provider enabled (企業版)
```
描述 : EKM provider enabled 選項。EKM provider enabled 選項控制 SQL Server 中的可擴展密鑰管理設備支持。
默認值 : 0
值范圍 : 0~1
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'EKM provider enabled', 0;
GO
RECONFIGURE
參考鏈接: //learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/ekm-provider-enabled-server-configuration-option?view=sql-server-2016
```
Ole Automation Procedures
```
描述 : Ole Automation Procedures 選項。使用 Ole Automation Procedures 選項可指定是否可以在 Transact-SQL 批處理中實例化 OLE Automation 對象。還可以使用基于策略的管理或者 sp_configure 存儲過程來配置這一選項。
默認值 : 0
值范圍 : 0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
# 設置為0
sp_configure 'Ole Automation Procedures', 0;
GO
RECONFIGURE;
參考鏈接: //learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/ole-automation-procedures-server-configuration-option?view=sql-server-2016
```
PH timeout (s)
```
描述 : Ph timeout 選項。使用 ph timeout 選項可以指定全文協議處理程序在超時前等待連接到數據庫的時間(秒)。默認值為 60 秒。如果連接嘗試因臨時的網絡問題而超時,可以增加 ph timeout 值。
默認值 : 60
值范圍 : 1~3600
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'PH timeout (s)', 60;
GO
RECONFIGURE;
參考鏈接: //learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/ph-timeout-server-configuration-option?view=sql-server-ver16
```
SMO and DMO XPs
```
描述 : SMO and DMO XPs 選項。SMO and DMO XPs選項用于在此服務器上啟用 SQL Server 管理對象 (SMO) 和 SQL 分布式管理對象 (SQL-DMO) 擴展存儲過程。
默認值 : 1
值范圍 : 0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'SMO and DMO XPs', 1;
GO
RECONFIGURE
參考鏈接: //learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/smo-and-dmo-xps-server-configuration-option?view=sql-server-2016
```
access check cache bucket count
```
描述 : Access check cache quota 和 access check cache bucket count 選項用于控制訪問檢查結果緩存的項數和哈希存儲桶數。
默認值 : 0
值范圍 : 0~65536 (默認值 0 表示 SQL Server 正在管理這些選項。默認值轉換為以下內部配置。)
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'access check cache bucket count', 0;
GO
RECONFIGURE
參考鏈接://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/access-check-cache-server-configuration-options?view=sql-server-2016
```
access check cache quota
```
描述 : Access check cache quota 和 access check cache bucket count 選項用于控制訪問檢查結果緩存的項數和哈希存儲桶數。
默認值 : 0~65536 (默認值 0 表示 SQL Server 正在管理這些選項。默認值轉換為以下內部配置。)
值范圍 : 0~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'access check cache quota', 0;
GO
RECONFIGURE
參考鏈接://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/access-check-cache-server-configuration-options?view=sql-server-2016
```
-
affinity I/O mask
```
描述 : Affinity I/O mask 選項。
默認值 : 0
值范圍 : -2147483648~2147483647
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'affinity I/O mask', 0;
GO
RECONFIGURE
參考鏈接://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/affinity-input-output-mask-server-configuration-option?view=sql-server-2016
```
affinity mask
```
描述 : Affinity mask 選項。
默認值 : 0
值范圍 : -2147483648~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'affinity mask', 0;
GO
RECONFIGURE
參考鏈接://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/affinity-mask-server-configuration-option?view=sql-server-ver16
```
affinity64 I/O mask
```
描述 : Affinity64 I/O mask 與 affinity I/O mask 選項類似,用于將 SQL Server 磁盤 I/O 綁定到指定的 CPU 子集。
默認值 : 0
值范圍 : -2147483648~2147483647
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'affinity64 I/O mask', 0;
GO
RECONFIGURE
參考鏈接://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/affinity-input-output-mask-server-configuration-option?view=sql-server-2016
```
affinity64 mask
```
描述 : Affinity64 mask 選項。affinity64 mask 將處理器綁定到特定的線程,這與 affinity mask 選項相似。
默認值 : 0
值范圍 : -2147483648~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'affinity64 mask', 0;
GO
RECONFIGURE
參考鏈接://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/affinity-mask-server-configuration-option?view=sql-server-ver16
```
backup compression default
```
描述 : 備份壓縮默認選項。僅在 SQL Server 2008 Enterprise 和更高版本中,如果用戶不指定 WITH COMPRESSION 或 WITH NO_COMPRESSION,則由 BACKUP Transact-SQL 語句用于選擇備份壓縮設置。
默認值 : 1
值范圍 : 0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'backup compression default', 1;
GO
RECONFIGURE
參考鏈接://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/view-or-configure-the-backup-compression-default-server-configuration-option?view=sql-server-ver16
```
blocked process threshold (s)
```
描述 : Blocked process threshold 選項。blocked process threshold 選項用于指定閾值(以秒為單位),超過該閾值將生成阻塞的進程報表。
默認值 : 0
值范圍 : 0~86400
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'blocked process threshold (s)', 0;
GO
RECONFIGURE
參考鏈接://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/blocked-process-threshold-server-configuration-option?view=sql-server-2016
```
c2 audit mode
```
描述 : C2 審核模式選項。可以通過 SQL Server Management Studio 或使用 sp_configure 中的 c2 audit mode 選項來配置 C2 審核模式。選擇此選項將配置服務器,以記錄對語句和對象的失敗和成功的訪問嘗試。
默認值 : 0
值范圍 : 0~1
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'c2 audit mode', 0;
GO
RECONFIGURE
參考鏈接://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/c2-audit-mode-server-configuration-option?view=sql-server-2016
```
clr enabled
```
描述 : C2 審核模式選項。可以通過 SQL Server Management Studio 或使用 sp_configure 中的 c2 audit mode 選項來配置 C2 審核模式。選擇此選項將配置服務器,以記錄對語句和對象的失敗和成功的訪問嘗試。
默認值 : 0
值范圍 : 0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'clr enabled', 0;
GO
RECONFIGURE
參考鏈接://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/clr-enabled-server-configuration-option?view=sql-server-2016
```
common criteria compliance enabled (企業版)
```
描述 : Common criteria compliance enabled 選項。common criteria compliance enabled 選項用于啟用通用準則所需的下列元素。
默認值 : 0
值范圍 : 0~1
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'common criteria compliance enabled', 0;
GO
RECONFIGURE
參考鏈接://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/common-criteria-compliance-enabled-server-configuration-option?view=sql-server-ver16
```
### cost threshold for parallelism
```
描述 : Cost threshold for parallelism 選項。使用 cost threshold for parallelism 選項指定 Microsoft SQL Server 創建和運行并行查詢計劃的閾值。
默認值 : 5
值范圍 : 0~32767
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'cost threshold for parallelism', 5;
GO
RECONFIGURE
參考鏈接 : //learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-cost-threshold-for-parallelism-server-configuration-option?view=sql-server-2016
```
cross db ownership chaining
```
描述 : Cross db ownership chaining 選項。使用 cross db ownership chaining 選項可以為 Microsoft SQL Server 實例配置跨數據庫所有權鏈接。
默認值 : 0
值范圍 : 0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'cross db ownership chaining', 0;
GO
RECONFIGURE
參考鏈接 : //learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/cross-db-ownership-chaining-server-configuration-option?view=sql-server-2016
```
cursor threshold
```
描述 : Cursor threshold 選項。使用 cursor threshold 選項可以指定游標集中的行數,超過此行數,將異步生成游標鍵集。
默認值 : -1
值范圍 :-1~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'cursor threshold', -1;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-cursor-threshold-server-configuration-option?view=sql-server-2016
```
default full-text language
```
描述 : Default full-text language 選項。使用 default full-text language 選項可以指定全文索引列的默認語言值。語言分析將對全文索引的所有數據執行,并且取決于數據的語言。該選項的默認值設置為服務器的語言。
默認值 : 1033
值范圍 :0~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'default full-text language', 1033;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-default-full-text-language-server-configuration-option?view=sql-server-2016
```
default language
```
描述 : Default language 選項。使用 default language 選項為所有新創建的登錄指定默認語言。
默認值 : 0
值范圍 :0 或 30 下拉列表
從系統表獲取語言: sys.syslanguages
--> 只有0-34, 其中0代表英語us_englise,30代表簡體中文 Simplified Chinese
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'default language', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-default-language-server-configuration-option?view=sql-server-ver16
```
default trace enabled
```
描述 : Default trace enabled 選項。使用 default trace enabled 選項可啟用或禁用默認跟蹤日志文件。默認跟蹤功能提供了豐富持久的活動日志,并主要根據配置選項進行更改。
默認值 : 1
值范圍 : 0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'default trace enabled', 1;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/default-trace-enabled-server-configuration-option?view=sql-server-2016
```
disallow results from triggers
```
描述 : Disallow results from triggers 選項。使用 disallow results from triggers 選項可控制是否讓觸發器返回結果集。
默認值 : 0
值范圍 : 0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'disallow results from triggers', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/disallow-results-from-triggers-server-configuration-option?view=sql-server-2016
```
filestream access level
```
描述 : 文件流訪問級別選項。可以使用 filestream_access_level 選項來更改此 SQL Server 實例的 FILESTREAM 訪問級別。
默認值 : 0
值范圍 : 0~2
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'filestream access level', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/filestream-access-level-server-configuration-option?view=sql-server-2016
```
fill factor (%)
```
描述 : Fill factor 選項。此選項設置服務器范圍內的默認填充因子值。提供填充因子是為了優化索引數據存儲和性能。
默認值 : 0
值范圍 : 0~100
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'fill factor (%)', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-fill-factor-server-configuration-option?view=sql-server-2016
```
ft crawl bandwidth (max)
```
描述 : Ft crawl bandwidth 選項。使用 ft crawl bandwidth 選項可指定較大內存緩沖池可增長到多大。較大內存緩沖區的大小為 4 MB。max 參數值可指定全文內存管理器應在較大緩沖池中保持的最大緩沖區數。如果 max 的值為零,則較大緩沖池中可以保持的緩沖區數沒有上限。
默認值 : 100
值范圍 : 0~32767
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'ft crawl bandwidth (max)', 100;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/ft-crawl-bandwidth-server-configuration-option?view=sql-server-2016
```
ft crawl bandwidth (min)
```
描述 : Ft crawl bandwidth 選項。min 參數可指定較大內存緩沖池中必須保持的最小內存緩沖區數。Microsoft SQL Server 內存管理器發出請求后,將釋放所有額外的緩沖池,但將保留該最低數量的緩沖區。不過,如果指定的 min 值為零,則釋放所有內存緩沖區。
默認值 : 0
值范圍 : 0~32767
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'ft crawl bandwidth (min)', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/ft-crawl-bandwidth-server-configuration-option?view=sql-server-2016
```
ft notify bandwidth (max)
```
描述 : Ft notify bandwidth 選項。使用 ft notify bandwidth 選項可以指定小內存緩沖區的池可以增長到的大小。小內存緩沖區的大小為 64 KB。max 參數值指定全文內存管理器在小緩沖池中應該維護的最大緩沖區數。如果 max 值為零,則可以位于小緩沖池中的緩沖區數沒有上限。
默認值 : 100
值范圍 : 0~32767
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'ft notify bandwidth (max)', 100;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/ft-notify-bandwidth-server-configuration-option?view=sql-server-2016
```
ft notify bandwidth (min)
```
描述 : Ft notify bandwidth 選項。使用 ft notify bandwidth 選項可以指定小內存緩沖區的池可以增長到的大小。小內存緩沖區的大小為 64 KB。max 參數值指定全文內存管理器在小緩沖池中應該維護的最大緩沖區數。如果 max 值為零,則可以位于小緩沖池中的緩沖區數沒有上限。
默認值 : 0
值范圍 : 0~32767
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'ft notify bandwidth (min)', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/ft-notify-bandwidth-server-configuration-option?view=sql-server-2016
```
in-doubt xact resolution
```
描述 : In-doubt xact resolution 選項。使用 in-doubt xact resolution 選項可以控制 Microsoft 分布式事務處理協調器 (MS DTC) 無法解決的默認事務結果。事務無法解決可能與 MS DTC 停止工作或恢復時的未知事務結果有關。
默認值 : 0
值范圍 : 0~2
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'in-doubt xact resolution', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/in-doubt-xact-resolution-server-configuration-option?view=sql-server-2016
```
index create memory (KB)
```
描述 : Index create memory 選項。在 SQL Server 中,index create memory 選項控制最初為創建索引分配的最大內存量。如果隨后創建索引時需要更多內存,而且有內存可供使用,服務器將使用可用的內存,從而超出此選項的設置。如果沒有內存可供使用,則繼續使用已分配的內存來創建索引。
默認值 : 0
值范圍 : 0 或 704~2147483647 0表示自動設置
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'index create memory (KB)', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-index-create-memory-server-configuration-option?view=sql-server-2016
```
lightweight pooling
```
描述 : Lightweight pooling 選項。使用 lightweight pooling 選項可以減少有時在對稱多處理 (SMP) 環境下遇到的、與過多的上下文切換有關的系統開銷。 如果出現過多的上下文切換,輕型池可以通過上下文切換內聯化,從而降低用戶/內核環的轉換頻率,達到提高吞吐量的目的。
默認值 : 0
值范圍 : 0~1
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'lightweight pooling', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/lightweight-pooling-server-configuration-option?view=sql-server-2016
```
locks
```
描述 : Locks 選項。使用 locks 選項可以設置可用的鎖的最大個數,從而限制數據庫引擎為這些鎖所消耗的內存。默認設置為 0,即允許數據庫引擎根據不斷變化的系統要求動態地分配和釋放鎖結構。
默認值 : 0
值范圍 : 0 或 5000~2147483647 0,即允許 數據庫引擎 根據不斷變化的系統要求動態地分配和釋放鎖結構。
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'locks', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-locks-server-configuration-option?view=sql-server-2016
```
max degree of parallelism
```
描述 : Max degree of parallelism 選項。當 SQL Server 在具有多個微處理器或 CPU 的計算機上運行時,它將為每個并行計劃執行檢測最佳并行度(即運行一個語句所使用的處理器數)。
默認值 : 0
值范圍 : 0~32767
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'max degree of parallelism', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option?view=sql-server-2016
```
max full-text crawl range
```
描述 : Max full-text crawl range 選項。使用 max full-text crawl range 選項可以優化 CPU 使用率,從而提高完全爬網時的爬網性能。使用此選項,可以指定索引完全爬網時 Microsoft SQL Server 使用的分區數。例如,如果有許多 CPU 且它們的使用率并非最佳,則可以增加此選項的最大值。除了此選項以外,SQL Server 還使用眾多其他因素(如表中的行數和 CPU 數)來確定應該使用的實際分區數。
默認值 : 4
值范圍 :0~256
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'max full-text crawl range', 4;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/max-full-text-crawl-range-server-configuration-option?view=sql-server-2016
```
max server memory (MB)
```
描述 :服務器內存選項。使用 min server memory 和 max server memory 這兩個服務器內存選項可以重新配置 Microsoft SQL Server 實例所使用的緩沖池的內存量 (MB)。默認情況下,SQL Server 的內存要求會根據可用系統資源的情況動態地變化。min server memory 的默認設置是 0,max server memory 的默認設置是 2147483647。
默認值 : 2147483647
值范圍 :128~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'max server memory (MB)', 2147483647;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/server-memory-server-configuration-options?view=sql-server-2016
```
max text repl size (B)
```
描述 : Max text repl size 選項。使用 max text repl size 選項,可指定使用單個 INSERT、UPDATE、WRITETEXT 或 UPDATETEXT 語句可以向復制列或已捕獲列添加的 text、ntext、varchar(max)、nvarchar(max)、varbinary(max)、xml 和 image 數據的最大大小(字節)。默認值為 65536。值為 -1 表示沒有限制,而非數據類型指定的限制。此選項適用于事務復制和變更數據捕獲。當將服務器配置為具有事務復制功能和變更數據捕獲功能時,指定的值將適用于這兩項功能。快照復制和合并復制將會忽略此選項。
默認值 : 65536
值范圍 :-1~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'max text repl size (B)', 65536;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-max-text-repl-size-server-configuration-option?view=sql-server-2016
```
max worker threads
```
描述 : Max worker threads 選項。使用 max worker threads 選項可以配置 Microsoft SQL Server 進程可使用的工作線程數。SQL Server 使用 Microsoft Windows 2000 和 Windows Server 2003 操作系統的本機線程服務,從而使一個或多個線程支持 SQL Server 同時支持的每一個網絡,另一個線程處理數據庫檢查點,而線程池則處理所有用戶。
默認值 : 0
值范圍 :0 或 128~65535
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'max worker threads', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-max-worker-threads-server-configuration-option?view=sql-server-2016
```
media retention
```
描述 : Media retention 選項。使用 media retention 選項,可以為各個備份集的保留時間提供一個系統范圍默認值。media retention 選項可以防止在指定的日期前覆蓋備份。如果設置了 media retention,則無需在每次進行系統備份時都指定系統備份的保持時間。默認值為 0 天。如果未等設定的天數過去即使用備份媒體,Microsoft SQL Server 將會發出警告消息。除非更改默認值,否則 SQL Server 不會發出警告。此選項可以由 BACKUP 命令的 RETAINDAYS 子句覆蓋。
默認值 : 0
值范圍 :0~365
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'media retention', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-media-retention-server-configuration-option?view=sql-server-2016
```
min memory per query (KB)
```
描述 :Min memory per query 選項。使用 min memory per query 選項指定分配給查詢執行時所需要的最小內存量 (KB)。例如,如果將 min memory per query 設置為 2,048 KB,則查詢保證將至少獲取那么多的總內存。可以將 min memory per query 設置為從 512 到 2,147,483,647 字節 (2 GB) 的任何值。默認值為 1,024 KB。
默認值 : 1024
值范圍 :512~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'min memory per query (KB)', 1024;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-min-memory-per-query-server-configuration-option?view=sql-server-2016
```
min server memory (MB)
```
描述 :服務器內存選項。使用 min server memory 和 max server memory 這兩個服務器內存選項可以重新配置 Microsoft SQL Server 實例所使用的緩沖池的內存量 (MB)。默認情況下,SQL Server 的內存要求會根據可用系統資源的情況動態地變化。min server memory 的默認設置是 0,max server memory 的默認設置是 2147483647。
默認值 : 0
值范圍 :0~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'min server memory (MB)', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/server-memory-server-configuration-options?view=sql-server-2016
```
nested triggers
```
描述 :Nested triggers 選項。使用 nested triggers 選項可控制 AFTER 觸發器是否可級聯;級聯是指執行某項操作將初始化另一個觸發器,而該觸發器又將初始化另外一個,依此類推。如果 nested triggers 設置為 0,AFTER 觸發器不能級聯。如果 nested triggers 設置為 1(默認值),AFTER 觸發器最多能級聯 32 級。不管此選項如何設置,INSTEAD OF 觸發器都可以嵌套。
默認值 : 1
值范圍 :0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'nested triggers', 1;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-nested-triggers-server-configuration-option?view=sql-server-2016
```
network packet size (B)
```
描述 :Network packet size 選項。使用 network packet size 選項可以設置整個網絡中使用的數據包大小(以字節為單位)。
默認值 : 4096
值范圍 :512~32767
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'network packet size (B)', 4096;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-network-packet-size-server-configuration-option?view=sql-server-2016
```
optimize for ad hoc workloads
```
描述 :針對即席工作負荷進行優化。針對即席工作負荷進行優化”選項用于提高包含許多一次性臨時批處理的工作負荷計劃緩存的效率。如果該選項設置為 1,則數據庫引擎將在首次編譯批處理時在計劃緩存中存儲一個編譯的小計劃存根,而不是存儲完全編譯的計劃。這種情況下不會讓未重復使用的編譯計劃填充計劃緩存,從而有助于緩解內存壓力。
默認值 : 0
值范圍 :0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'optimize for ad hoc workloads', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/optimize-for-ad-hoc-workloads-server-configuration-option?view=sql-server-2016
```
priority boost
```
描述 :Priority boost 選項。使用 priority boost 選項可以指定 Microsoft SQL Server 是否應當以比相同計算機上的其他進程更高的 Microsoft Windows 2000、Windows Server 2003、Windows 2008 或 Windows 2008 R2 計劃優先級運行。如果將該選項設置為 1,SQL Server 將以優先級基數 13 在 Windows 2000、Windows Server 2003、 Windows 2008 或 Windows 2008 R2 計劃程序中運行。默認值為 0,其優先級基數為 7。
默認值 : 0
值范圍 :0~1
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'priority boost', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-priority-boost-server-configuration-option?view=sql-server-2016
```
query governor cost limit
```
描述 :Query governor cost limit 選項。使用 query governor cost limit 選項指定查詢可以運行的時間段上限。估計運行時間超過此限制的查詢返回一個錯誤且不執行。查詢開銷是指在特定硬件配置中完成查詢所需的估計占用時間(以秒為單位)。
默認值 : 0
值范圍 :0~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'query governor cost limit', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-priority-boost-server-configuration-option?view=sql-server-2016
```
query wait (s)
```
描述 :Query wait 選項。query wait 選項可以指定一個查詢在超時前等待所需資源的時間(以秒為單位,范圍從 0 到 2147483647)。如果使用默認值 -1 或指定 -1,則可計算出超時時間是估計查詢開銷的 25 倍。
默認值 : -1
值范圍 :-1~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'query wait (s)', -1;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-query-wait-server-configuration-option?view=sql-server-2016
```
recovery interval (min)
```
描述 :Recovery interval 選項。使用 recovery interval 選項可以設置每個 Microsoft SQL Server 還原數據庫所需的最大分鐘數。每次當 SQL Server 實例啟動時,它就會恢復各個數據庫,回滾未提交的事務,并前滾已提交但更改內容在 SQL Server 實例停止時尚未寫入磁盤中的事務。此配置選項設置了 SQL Server 在恢復每一個數據庫時所應花時間的上限。默認值為 0,指示由 SQL Server 自動配置。實際上,這表示每個數據庫的恢復時間不超過 1 分鐘,對于每個活動的數據庫大約每 1 分鐘有一個檢查點。
默認值 : 0
值范圍 :0~32767
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'recovery interval (min)', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-recovery-interval-server-configuration-option?view=sql-server-2016
```
remote access
```
描述 :Remote access 選項。使用 remote access 選項可以從運行 Microsoft SQL Server 實例的本地或遠程服務器上控制存儲過程的執行。將 remote access 設置為 1表示允許從遠程服務器執行本地存儲過程或從本地服務器執行遠程存儲過程。將此選項設置為 0(默認值)表示阻止本地存儲過程在遠程服務器上執行或遠程存儲過程在本地服務器上執行。
默認值 : 1
值范圍 :0~1
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'remote access', 1;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-remote-access-server-configuration-option?view=sql-server-2016
```
remote admin connections
```
描述 :Remote admin connections 選項。SQL Server 提供了專用管理員連接 (DAC)。DAC 允許管理員訪問運行的服務器以執行診斷函數或 Transact-SQL 語句,或對服務器上的問題進行故障排除,即使服務器已鎖定或在非正常狀態下運行以及不響應 SQL Server 數據庫引擎 連接。默認情況下,只有服務器上的客戶端可以使用 DAC。若要在遠程計算機上啟用客戶端應用程序以使用 DAC,請使用 sp_configure 的遠程管理連接選項。
默認值 : 0
值范圍 :0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'remote admin connections', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/remote-admin-connections-server-configuration-option?view=sql-server-2016
```
remote login timeout (s)
```
描述 :Remote login timeout 選項。使用 remote login timeout 選項可以指定遠程登錄失敗返回前等待的秒數。例如,如果您嘗試登錄到一個遠程服務器而該服務器已關閉,remote login timeout 可確保您在計算機停止登錄嘗試前不必無限期地等待下去。
默認值 : 10
值范圍 :0~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'remote login timeout (s)', 10;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-remote-login-timeout-server-configuration-option?view=sql-server-2016
```
remote proc trans
```
描述 :Remote proc trans 選項。使用 remote proc trans 選項可通過 Microsoft 分布式事務處理協調器 (MS DTC) 事務保護服務器到服務器過程的操作。將 remote proc trans 設置為 1 以提供 MS DTC 協調的分布式事務,該事務能保護事務的 ACID(原子、一致、隔離和持久)屬性。將該選項設置為 1 后所有新開始的會話會繼承該設置并將它作為默認值。
默認值 : 1
值范圍 :0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'remote proc trans', 1;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-remote-proc-trans-server-configuration-option?view=sql-server-2016
```
remote query timeout (s)
```
描述 :Remote query timeout 選項。使用 remote query timeout 選項可指定在 Microsoft SQL Server 超時之前遠程操作可以持續的時間(秒)。默認值為 600,表示允許等待 10 分鐘。該值將應用到由作為遠程查詢的數據庫引擎初始化的發送連接。該值不會對數據庫引擎接收的查詢產生任何影響。
默認值 : 600
值范圍 :0~2147483647
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'remote query timeout (s)', 600;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-remote-query-timeout-server-configuration-option?view=sql-server-2016
```
scan for startup procs
```
描述 :Scan for startup procs 選項。使用 scan for startup procs 選項掃描在 Microsoft SQL Server 啟動時自動執行的存儲過程。如果將該選項設置為 1,則 SQL Server 將掃描服務器上定義的所有自動運行的存儲過程,并運行這些過程。scan for startup procs 的默認值為 0(不掃描)。
默認值 : 0
值范圍 :0~1
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'scan for startup procs', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-remote-query-timeout-server-configuration-option?view=sql-server-2016
```
server trigger recursion
```
描述 :Server trigger recursion 選項。使用 server trigger recursion 選項可指定是否允許服務器級觸發器遞歸激發。當此選項設置為 1 (ON) 時,將允許服務器級觸發器遞歸激發。當設置為 0 (OFF) 時,服務器級觸發器不能遞歸激發。當 server trigger recursion 選項設置為 0 (OFF) 時,僅阻止直接遞歸。(若要禁用間接遞歸,請將 nested triggers 選項設置為 0。)該選項的默認值為 1 (ON)。該設置更改后立即生效,而不需要重新啟動服務器。
默認值 : 1
值范圍 :0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'server trigger recursion', 1;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/server-trigger-recursion-server-configuration-option?view=sql-server-2016
```
set working set size
```
描述 :Set working set size 選項。
默認值 : 0
值范圍 :0~1
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'set working set size', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/set-working-set-size-server-configuration-option?view=sql-server-2016
```
show advanced options
```
描述 :Show advanced options 選項。show advanced options 選項用來顯示 sp_configure 系統存儲過程高級選項。當 show advanced options 設置為 1 時,可以使用 sp_configure 列出高級選項。默認值為 0。
默認值 : 1
值范圍 :0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'show advanced options', 1;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/show-advanced-options-server-configuration-option?view=sql-server-2016
```
transform noise words
```
描述 :Transform noise words 選項。使用 transform noise words 選項可以取消干擾詞或 stopwords 導致全文查詢的布爾操作失敗或返回零行時產生的錯誤消息。此選項對于使用其布爾操作包括干擾詞的 CONTAINS 謂詞的全文查詢非常有用。
默認值 : 0
值范圍 :0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'transform noise words', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/transform-noise-words-server-configuration-option?view=sql-server-2016
```
two digit year cutoff
```
描述 :Two digit year cutoff 選項。two digit year cutoff 選項為了將 2 位數字的年份解釋為 4 位數字的年份,從 1753 到 9999 之間選出一個整數來表示世紀截止年份。
默認值 : 2049
值范圍 :1753~9999
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'two digit year cutoff', 2049;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-two-digit-year-cutoff-server-configuration-option?view=sql-server-2016
```
user connections
```
描述 :User connections 選項。使用 user connections 選項可以指定 Microsoft SQL Server 上允許同時建立的最大用戶連接數。實際允許的用戶連接數還取決于正使用的 SQL Server 版本以及應用程序和硬件的限制。SQL Server 允許的最大用戶連接數為 32767。
默認值 : 0
值范圍 :0 或 10~32767 (默認值為 0,表示允許的最多用戶連接數為 (32,767) 。實際范圍0-32767,這里10應該是為了避免設置用戶數過小導致不可用)
是否需要重啟生效 : 是
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'user connections', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-user-connections-server-configuration-option?view=sql-server-2016
```
user options
```
描述 :User options 選項。使用 user options 選項可以指定適用于所有用戶的全局默認值。將針對用戶工作會話的持續時間,建立一個默認查詢處理選項的列表。user options 選項允許您更改 SET 選項的默認值(如果服務器的默認設置不合適)。用戶可以使用 SET 語句覆蓋這些默認值。可以為新登錄名動態配置 user options。更改 user options 的設置后,新的登錄名會話將使用新的設置,當前登錄名會話受不影響。
默認值 : 0
值范圍 :0~32767
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'user options', 0;
GO
RECONFIGURE
參考鏈接 ://learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/configure-the-user-options-server-configuration-option?view=sql-server-2016
```
xp_cmdshell
```
描述 :Xp_cmdshell 選項。SQL Server 2005 中引入的 xp_cmdshell 選項是服務器配置選項,使系統管理員能夠控制是否可以在系統上執行 xp_cmdshell 擴展存儲過程。
默認值 : 0
值范圍 :0~1
是否需要重啟生效 : 否
修改方式:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'xp_cmdshell', 0;
GO
RECONFIGURE
參考鏈接 : //learn.microsoft.com/zh-cn/sql/database-engine/configure-windows/xp-cmdshell-server-configuration-option?view=sql-server-2016
```