sp_helpconfig "config_name"
[, { "size" | "estimate [using_argument = value [, using_argument = value ] [, ...] ] } ]
<configname>
是要查询的配置参数,或者是非唯一参数片段。
<size>
是内存的大小,指定 B 表示字节,指定 K 表示千字节,指定 M 表示兆字节,指定 G 表示千兆字节,或者指定 P 表示页。在使用时如果未指定大小的类型,<size> 将指定要使用此参数配置的实体的数目;例如锁或打开的索引的数目等。如果 <configname> 不是唯一参数名,则忽略 <size>。
estimate
建议您可以为 compression info pool size 设置的值。此建议是基于其它配置参数的设置,或覆盖这些设置的用户指定值。estimate 参数仅对 compression info pool size 配置参数有效。请参见估算 compression info pool size 的内存需求。
返回有关以“allow”开头的所有配置选项的报告:
sp_helpconfig "allow"
Configuration option is not unique.
option_name config_value run_value
------------------------------ ------------ -----------
allow backward scans 1 1
allow nested triggers 1 1
allow procedure grouping 1 1
allow remote access 1 1
allow resource limits 0 0
allow sendmsg 0 0
allow sql server async i/o 1 1
allow updates to system tables 0 0
返回有关为 421 个对象描述符创建元数据高速缓存所需的内存量的报告:
sp_helpconfig "open objects", "421"
number of open objects sets the maximum number of database objects that are open at one time on SQL Server. The default run value is 500.
Minimum Value Maximum Value Default Value Current Value Memory Used
------------- ------------- ------------- ------------- -----------
100 2147483647 500 500 243
Configuration parameter, 'number of open objects', will consume 207K of memory if configured at 421.
返回与多少个数据库描述符将会填满 1 MB 数据库高速缓存有关的报告:
sp_helpconfig "open databases", "1M"
number of open databases sets the maximum number of databases that can be
open at one time on SQL Server. The default run value is 12.
Minimum Value Maximum Value Default Value Current Value Memory Used
------------- ------------- ------------- ------------- -----------
5 2147483647 12 12 433
Configuration parameter, 'number of open databases', can be configured to
28 to fit in 1M of memory.
返回与多少个锁将占用 512 K 内存有关的报告:
sp_helpconfig "number of locks", "512K"
number of locks sets the number of available locks. The default run value
is 5000.
Minimum Value Maximum Value Default Value Current Value Memory Used
------------- ------------- ------------- ------------- -----------
1000 2147483647 5000 5000 528
Configuration parameter 'number of locks', can be configured to 4848 to fit
in 512K of memory.
返回与 allow updates to system tables 配置参数的状态有关的报告:
sp_helpconfig "allow updates to system tables"
allow updates to system tables allows system tables to be updated directly.
The default is 0 (off).
Minimum Value Maximum Value Default Value Current Value Memory Used
------------- ------------- ------------- ------------- -----------
0 1 0 0 0
显示关于 enable in-memory row storage 配置参数的信息:
sp_helpconfig 'enable in-memory row storage’
The configuration option enables or disables the use of in-memory row
storage caches and associated features. The default value is 0 (disabled).
Minimum Value Maximum Value Default Value Current Value Memory
Used Unit Type
--------------- --------------- --------------- --------------- -------
------ ------ -------
0 1 0 1 0
switch dynamic
<b>注意</b>
“最大值”设置指的是参数的数据类型可以接受的最大数字,而不是指实际的可配置值。
在许多情况下,配置参数能允许的最大值是极高的。服务器的最大值通常受限于可用内存和其它资源,而与配置参数限制无关。
a) cluster – sp_helpconfig 显示有关集群中所有实例的配置信息。
b) instance – sp_helpconfig 显示有关当前实例的配置信息。
<configname>,则 sp_helpconfig 返回与其配置值和当前值匹配的参数的列表。请参见示例 1。
sp_helpconfig 'restricted decrypt permission'
0 - restricted decrypt permission disabled (default).
1 - restricted decrypt permission enabled
Minimum Value Maximum Value Default Value Current Value
Memory Used Unit Type
------------- ------------- ------------- --------------
----------- -------------
0 1 0 0
0 switch dynamic
在计划服务器的元数据高速缓存配置时使用 sp_helpconfig。
例如,假定您计划将包含 2000 个用户索引的数据库移到不同服务器。若要确定需要为该服务器配置多少内存,才能使该服务器容纳该数据库的用户索引,请输入以下命令:
sp_helpconfig "open indexes", "2000"
number of open indexes sets the maximum number of indexes that can be
open at one time on SQL Server. The default run value is 500.
Minimum Value Maximum Value Default Value Current Value Memory Used
------------- ------------- ------------- ------------- -----------
100 2147483647 500 500 208
Configuration parameter, 'number of open indexes', will consume 829k of memory if configured at 2000.
或者,假定您有 1 MB 的内存可用于索引高速缓存,并且需要知道它将支持多少个索引描述符。运行以下命令:
sp_helpconfig "open indexes", "1M"
number of open indexes sets the maximum number of indexes that can be
open at one time on SQL Server. The default run value is 500.
Minimum Value Maximum Value Default Value Current Value Memory Used
------------- ------------- ------------- ------------- -----------
100 2147483647 500 500 208
Configuration parameter 'number of open indexes', can be configured to 2461 to fit in 1M of memory.
基于此输出,如果您具有 1MB 的内存,则可以创建可包含最多 2461 个索引描述符的索引描述符高速缓存。若要创建此高速缓存,请按如下所示设置 number of open indexes 配置参数:
sp_configure "number of open indexes", 2461
使用 estimate 参数确定 compression info pool size 配置参数所需的近似内存量。
estimate 参数建议您可以为 compression info pool size 设置的值。此建议基于其它配置参数的设置,或覆盖这些设置的用户指定值。
sp_helpcofig "config_name"
[, { "size" | "estimate [<using_argument> = <value>[, <using_argument> = <value> ] [, ...] ] } ]
<using_argument>= <value> 为 estimate 参数覆盖缺省值提供了这些额外参数:
maxconcusers = <value> – 指定可以访问压缩表的 number of concurrent users 的最大整数值。
例如,maxconcusers = 0.7 指示了 number of user connections 配置值的 70%。一个等于或大于 1 的整数值指定了并发用户数的绝对数量。
numcolumns = <value> – 指定了压缩表中的平均列数。
numcompobjs = <value> – 指定了需要压缩元数据内存的打开对象的缺省数(整数或百分比形式)。例如,numcompobjs = 0.2 指示了 number of open objects 配置值的 20%。一个等于或大于 1 的整数值指定了打开对象的绝对数量。
numtables = <value> – 确定了在一个语句中访问的压缩表的平均数。
发出不带参数的 sp_helpconfig 生成使用情况信息,显示可指定的子句和一些典型用法示例。
此示例显示了从系统数据库(如 master 或 tempdb)运行的 sp_helpconfig ... estimate 参数。在此示例中,sp_helpconfig 使用缺省值作为影响内存需求的因素进行估计:
sp_helpconfig 'compression info pool', 'estimate'
The compression information pool size parameter indicates the
amount of memory currently available to store table compression
information.
Minimum Value Maximum Value Default Value Current Value Memory Used Unit Type
------------- -------------- ------------- -------------- ------------ -------------- -------
0 2147483647 4096 4096 8240 memory pages(2k) dynamic
Estimated memory required for 600 concurrent users requesting
memory from this pool, accessing 500 compressed objects with
50 columns, on an average, per compressed table is 22600 KB.
Configuration parameter, 'compression info pool size', can be
configured to 21971 to fit in 44200K of memory.
此示例用特定于站点的参数替换了缺省值来估计内存和配置值设置。sp_helpconfig 从系统数据库(如 master 或 tempdb)第二次执行以估计服务器范围内并发访问压缩对象所需内存(这时这些对象被服务器中的多个数据库所访问):
sp_helpconfig 'compression info pool', 'estimate
using numcompobjs=0.3, numtables=2.25, numcolumns=25,
maxconcusers=0.85'
The compression information pool size parameter indicates the
amount of memory currently available to store table compression
information.
Minimum Value Maximum Value Default Value Current Value Memory Used Unit Type
------------- -------------- ------------- -------------- ------------ -------------- -------
0 2147483647 4096 4096 8240 memory pages(2k) dynamic
Estimated memory required for 1020 concurrent users requesting
memory from this pool, accessing 150 compressed objects with 25
columns, on an average,
per compressed table is 37020 KB.
Configuration parameter, 'compression info pool size', can be
configured to 18402 to fit in 37020K of memory.
此示例显示了 sp_helpconfig ... estimate 针对包含大量压缩表的用户数据库运行(这些表经常被应用程序使用)。服务器被配置为:
sp_configure 'user connections', 900
sp_configure 'worker processes', 500
sp_configure 'max parallel degree', 5
在此示例中,estimate 从您发出过程的用户数据库中收集指标:
利用这些输入值,sp_helpconfig 估计出存储压缩表信息时 compression info pool 需要的内存量:
sp_helpconfig 'compression info pool size', 'estimate'
The compression information pool size parameter indicates
the amount of memory currently available to store table
compression information.
Minimum Value Maximum Value Default Value Current Value Memory Used Unit Type
------------- -------------- ------------- -------------- ------------ -------------- -------
0 2147483647 4096 15396 33384 memory pages(2k) dynamic
Estimated memory required for 1400 concurrent users requesting
memory from this pool, accessing 78240 compressed objects
with 10 columns, on an average, per compressed table is 74850 KB.
Configuration parameter, 'compression info pool size', can be
configured to 34519 to fit in 74850K of memory.
这个输出指示一共有 1400 个并行用户将同时请求内存。该数据库包含略多于 78,000 个压缩对象,每个表平均包含 10 个列。此配置选项的估计值是 34,519。
但是,如果并非所有的对象都被例行同时访问,而且并非所有的配置用户连接都同时处于活动状态,您可以通过 using 参数子句提供特定于站点的替换值来优化估计。
sp_helpconfig 'compression info pool size', 'estimate
using numcompobjs = 50000, maxconcusers=600'
The compression information pool size parameter indicates
the amount of memory currently available to store table
compression information.
Minimum Value Maximum Value Default Value Current Value Memory Used Unit Type
------------- -------------- ------------- -------------- ------------ -------------- -------
0 2147483647 4096 15396 33384 memory pages(2k) dynamic
Estimated memory required for 1100 concurrent users requesting
memory from this pool, accessing 50000 compressed objects with
10 columns, on an average, per compressed table is 55225 KB.
Configuration parameter, 'compression info pool size', can be
configured to 25468 to fit in 55225K of memory.
在此输出中,maxconcusers = 600 表明有 600 个访问压缩对象的并行客户端连接请求内存。由于并行配置设置,sp_helpconfig 估计出一共 1100 个请求者可以并行请求内存。此配置选项的估计值是 25468。
sp_helpconfig 包括多个仅由 SAP 产品支持部门用于 sybdiagdb 数据库的 <configname> 选项:
<number of ccbs> – 是可用于协助调试的可配置操作点控制块的数量。
<caps per ccb> – 是在一个可配置操作点中可随时配置的可配置操作点的最大数量。
<average cap size> – 是存储与典型可配置操作点相关信息所需的估计内存量(以字节为单位)。
⚠️
SAP 技术支持部门出于调试目的,会在系统中创建 sybdiagdb 数据库。此数据库存有诊断配置数据,仅供 SAP 技术支持部门使用。
例如:
sp_helpconfig "number of ccbs"
Minimum Value Maximum Value Default Value Current Value Memory Used
------------- ------------- ------------- ------------- -----------
0 100 0 0 0
sp_helpconfig "caps per ccb"
Minimum Value Maximum Value Default Value Current Value Memory Used
------------- ------------- ------------- ------------- -----------
5 500 50 50 0
sp_helpconfig "average cap size"
Minimum Value Maximum Value Default Value Current Value Memory Used
------------- ------------- ------------- ------------- -----------
100 10000 200 200 0