sp_configure [<configname> [, <configvalue>] | <group_name> |
<non_unique_parameter_fragment>] 'drop instance'
[, <instance_name>] [display_nondefault_settings]
sp_configure "configuration file", 0, {"write" | "read" | "verify" | "restore"}
"<file_name>"
<configname>
显示符合 <parameter> 的所有参数的当前值、缺省值、最近更改的值以及该设置所使用的内存量。
<configvalue>
将 <configname> 重置为 <configvalue>,并显示当前值、缺省值、配置值和 <configname> 所使用的内存量。
sp_configure <configname,> 0, "default" 将 <configname> 重置为缺省值,并显示当前值、缺省值、配置值和 <configname> 使用的内存量。
<group_name>
显示 <group_name> 中的所有配置参数、它们的当前值、缺省值、最近设置的值(如果适用)以及该设置所使用的内存量。
<non_unique_parameter_fragment>
显示符合 <non_unique_parameter_fragment> 的所有参数名,它们的当前值、缺省值、配置值以及所使用的内存量。
drop instance
允许您删除实例特定的配置设置
<instance_name>
(在集群环境中)指示要为其设置实例特定选项的实例。
display_nondefault_settings
显示配置值或运行值不同于缺省值的配置选项。
write
从当前配置中创建 <file_name>。如果 <file_name> 已经存在,则向错误日志写入一条消息,并使用约定 <file_name> 001、<file_name>.002(依此类推)对现有文件进行重命名。如果已经更改了静态参数但没有重新启动服务器,则“write”会提供该参数的当前运行值。
read
对包含在 <file_name> 中的值执行验证检查,并且将通过验证的值读入服务器。如果 <file_name> 遗漏了任何参数,则使用这些参数的当前运行值。
verify
对 <file_name> 中的值执行验证检查。
restore
用 sysconfigures 中的值创建 <file_name>。在配置文件的所有副本都已丢失,且需要生成一个新的副本时,这会很有帮助。
<file_name>
是要对其使用 sp_configure 的文件的名称。
按组显示所有配置参数、其当前值、缺省值、最近设置的值(如果适用)以及该设置所使用的内存量:
sp_configure
显示包括“identity”一词的所有配置参数:
sp_configure "identity"
Configuration option is not unique.
Parameter Name Default Memory Used Config Value Run Value Unit Type
-------------- ------- ----------- ------------ --------- ------ ----
identity burning set 1 0 1 1 id static
identity grab size 0 0 0 0 id dyna
size of auto identit 10 0 10 10 bytes dyna
. . .
将系统 recovery interval in minutes 设置为 3 分钟:
sp_configure "recovery interval in minutes", 3
Parameter Name Default Memory Used Config Value Run Value Unit Type
-------------- ------- ----------- ------------ --------- ------ ----
recovery interval 5 0 3 3 min dyn
Configuration option changed. The SQL Server need not be rebooted since the option is dynamic.
将 number of devices 的值重置为 SAP ASE 缺省值:
sp_configure "number of device", 0, "default"
配置要同时恢复的四个数据库:
sp_configure "max concurrently recovered db", 4
启动四个检查点任务:
sp_configure "number of checkpoint tasks", 4
在服务器级别捕获查询处理指标(qp 指标):
sp_configure "enable metrics capture", 1
对 srv.config 文件中的值执行验证检查,并将通过验证的参数读入到服务器中。当前的运行值会替代没有通过验证检查的值:
sp_configure "configuration file", 0, "read",
"srv.config"
对文件 restore.config 中的值执行验证检查:
sp_configure "configuration file", 0, "restore",
"generic.config"
创建文件 my_server.config,并将服务器正在使用的当前配置值写入该文件:
sp_configure "configuration file", 0, "write",
"my_server.config"
对 $SYBASE/backup_config.cfg 中的值执行验证检查:
sp_configure "configuration file", 0, "verify",
"backup_config.cfg"
任何用户都可以执行 sp_configure 来显示参数及其当前值的信息(但不能修改参数)。系统管理员可以执行 sp_configure 来更改大多数配置参数的值。只有系统安全员才能执行某些参数。本节的“权限”部分中列出了这些参数。
sp_configure 允许以单位指示符指定配置参数的值。单位指示符用 p 或 P 代表页,用 m 或 M 代表兆字节,用 g 或 G 代表千兆字节,用 t 或 T 代表兆兆字节。如果不指定单位,并且配置了控制内存的参数,则 SAP ASE 服务器使用逻辑页大小作为基本单位。
使用 sp_configure 创建的文件有权限限制。
当执行 sp_configure 修改动态参数时:
当执行 sp_configure 修改静态参数时:
如果发出不带任何参数的 sp_configure,则它将以报告形式按组显示所有配置参数、其当前值、缺省值、最近设置的值(如果适用)以及该设置所使用的内存量:
注意
如果服务器使用的是不区分大小写的排序顺序,则不带参数的 sp_configure 会按字母顺序返回所有配置参数和组的列表而不分组显示。
每个配置参数都具有一个关联的显示级别。有三个显示级别:
设置为其它显示级别时可使用配置参数的子集,从而减少 sp_configure 显示的信息量。
用于显示当前显示级别的语法是:sp_displaylevel。
sp_configure 可以在没有打开的事务时在使用链式事务模式的会话中运行。
number of checkpoint tasks 参数配置并行检查点。
并行检查点取决于数据库的布局和基础 I/O 子系统的性能。根据活动数据库的数目和处理写入操作的 I/O 子系统的功能调优此参数。
此配置参数是动态的。当减小此参数的值时,将清除某些检查点任务;当增大该值时,将创建其它任务
max concurrently recovered db 参数确定数据库恢复期间的并行度:
当 SAP ASE 服务器未处于恢复过程时,此配置参数以静态方式生效。但是,当 SAP ASE 服务器处于恢复过程时,系统管理员可以动态强制执行依次恢复。
max concurrently recovered db 的效力取决于数据库布局和基础 I/O 子系统的性能。
配置集群的注意事项。
sp_configure <configuration_name>, <config_value>, NULL, <instance_name>