Sybase常用配置参数

来源:互联网 发布:淘宝中评怎么改差评 编辑:程序博客网 时间:2024/04/27 21:04

Sybase常用配置参数
可以采用sp_configure查看SYBASE所有的配置,也可以在sybase根目录下面有"[库名].cfg"配置,该文件中用户没有更改的项全部显示值为DEFAULT,如果有更改则显示用户更改后的
值,这里列出来一些常见的配置,参考了文章:
http://www.blogjava.net/shanben/archive/2008/07/09/213731.html
http://as400bks.rochester.ibm.com/tividd/td/tec/SC32-1233-00/zh_CN/HTML/ecoimst97.htm

--配置最大cpu使用个数
sp_configure 'max online engines',4
go
--配置启动cpu个数
sp_configure 'number of engines at startup',4
go
--配置最大内存数
--内存总量是从用户输入值配置的,它定义从操作系统的可用内存分配到事件数据库服务器的内存总量,以 2K 为单位。较高的值将为事件数据库服务器分配更多的内部缓冲区
--和--高速缓存,因此会减少对磁盘的 I/O 数目并改善性能。
--注:事件数据库服务器必须能够获取启动时定义的内存总量,否则它将不会启动。如果服务器不启动,请在配置文件中为该服务器设置较低的值并重新启动服务器。
sp_configure 'max memory' ,2097151
go
--分配最大存储过程缓存
sp_configure 'procedure cache',102400
go
--配置高速缓存
sp_cacheconfig  'default data cache' , '700M'
go
--缺省缓存分配页大小
sp_poolconfig 'default data cache','200M','16K'
go
--网络包大小
sp_configure 'max network packet size',1024
go

--最大连接数
sp_configure 'number of user connections',500
go
--最大打开对象
sp_configure  'number of open object',9000
go
--最大索引
sp_configure  'number of open index',10000
go
--最大锁数
--锁数设置为 10000。此值设置所有用户可使用的事件数据库服务器上的锁数。
sp_configure  'number of locks',100000
go

--增加网络内存
sp_configure  'additional network memory',1024
go

--锁内存
sp_configure  'lock shared memory',512
go

--配置设备数
--设备数目设置为 25。它设置可以用磁盘 init 定义的设备数目。设备号的初始设置为 0 到 9。事件数据库配置最多可达 11 个附加设备,因此设置新值 25。
--如果设置 25 不允许添加 11 个新设备,请将其更改为更高的值。
sp_configure 'number of devices',50
go

--配置较大的 I/O 缓冲区数目
--较大的 I/O 设备数目设置为 12。此值设置较大的 I/O 实用程序(例如装入数据库、创建数据库和更改数据库)可用的 16K 缓冲区的数目。
sp_configure 'disk i/o structures',4096

--分配最大共享内存
sp_configure 'allocate max shared memory',1

--为每个用户分配堆栈大小
sp_configure 'heap memory per user'

--优化tempdb
select dbid, name,segmap
from sysusages,  sysdevices
where sysdevices.low  <= sysusages.size +vstart
and sysdevices.high >=sysusages.size+vstart -1
and dbid =2
and (status=2 or status=3)
go
use tempdb
go
sp_dropsegment  'default',tempdb,master
go
sp_dropsegment  'logsegment',tempdb,master
go


select dbid, name,segmap
from sysusages,  sysdevices
where sysdevices.low  <= sysusages.size +vstart
and sysdevices.high >=sysusages.size+vstart -1
and dbid =2
and (status=2 or status=3)
go

sp_cacheconfig tempdb_cache, '100M'
go
sp_poolconfig tempdb_cache,'50M','16K'
go
sp_bindcache 'tempdb_cache',tempdb
go
sp_helpcache tempdb_cache

select name,id from syscharsets

dbcc traceon(3604)
dbcc memusage

本文出自:冯立彬的博客