1.服务参数 --内存 sp_configure "max memory",524288 --单位为2K,实际大小为524288/1024*2MB=1024MB sp_configure "procedure cache size",51200 --存储过程数据缓存为100MB sp_cacheconfig "default data cache", "400M" --调整默认的高速缓存为400MB sp_cacheconfig "tempdb data cache","200M","mixed" --创建一个200MB的数据缓存用于绑定tempdb库 sp_bindcache "tempdb data cache",tempdb --重启服务后绑定 --CPU sp_configure "max online engines",2 --根据服务器环境配置CPU数量 sp_configure "number of engines at startup",2 --启动时使用CPU数量,不能大于max online engines --网络 sp_configure "max network packet size",2048 --设置网络传送包最大值 sp_configure "default network packet size",2048 --设置网络传送包的大小,不能大于max network packet size --锁 sp_configure "number of locks",50000 --锁的数量 sp_configure "page lock promotion HWM",2000 sp_configure "page lock promotion LWM",200 sp_configure "page lock promotion PCT",75 sp_configure "row lock promotion HWM",2000 sp_configure "row lock promotion LWM",200 sp_configure "row lock promotion PCT",75 --其它 sp_configure "number of user connections",200 --用户最大连接数 sp_configure "number of device",20 --设备最大数量
2. 临时数据库处理 a.删除tempdb的master设备 1)增加tempdb设备 disk init name = 'TEMPData',physname = 'd:\SYBDATA\TEMPData.dat',size = '1G',dsync = false go alter database tempdb on tempdb='1G' with override 2) 从段中移除master设备 sp_dropsegment "default",tempdb,master sp_dropsegment system,tempdb,master 3) 从系统表里移除master设备 use master 4) 重启服务 b.增加多个临时数据库 1)增加设备DEV_TEMP_DATA2,容量与原来的tempdb相当 2)create temporary database tempdb2 on DEV_TEMP_DATA2=2000 --创建名字为tempdb2的临时数据库 3)sp_tempdb 'add',tempdb2,'default' --加入到默认组 c.绑定日结用户DAILY到指定的临时数据库 1)参照a创建一个临时数据库dailytempdb 2)sp_tempdb 'bind','LG','DAILY','DB','dailytempdb' 注:也可以为sa绑定一个专用的tempdb,如: sp_tempdb 'bind','LG','sa','DB','satempdb' d. 查看属于默认组的临时数据库 1)sp_tempdb 'show' |
|