星期二, 8月 13, 2013

[轉載] Sybase性能調優

Sybase性能調優 (http://tc.itkee.com/database/detail-959.html)

1、修改之前 sp_configure 保存資訊
2、sp_configure "lock scheme"--查看當前服務器默認鎖模式
3、sp_configure "lock scheme",0,datarows--修改默認級別爲數據行鎖
4、sp_help tab_name或sp_help "schema.tab_name"--查看當前數據庫表對象鎖模式
5、select 'alter table ' + name + ' lock datarows' from sysobjects where type='U'--修改表對象鎖模式
6、reorg rebuild tab_name或reorg rebuild ind_name --修改完服務器數據庫表對象信息後,先執行REORG後UPDATE STATISTICS
7、sp_spaceused    sp_helpsegment--查看數據使用空間、剩餘空間
8、sp_helpdb--查看當前服務器中所有數據庫資訊
9、--查看數據庫設備物理位元址 sp_helpdevice
10、--擴展臨時數據庫空間
disk init name='tempdb01',physname='g:\sybase\data\tempdb01.dat',size='1G'
alter database tempdb on tempdb01='1G' with override
11、--檢查當前服務器指定數據庫所有表對象資訊
dbcc checkdb (db_name) dbcc checktable (tab_name)
12、--查看內存
sp_configure "memory"
13、--修改服務器最大使用內存
sp_configure 'max memory',0,'6G'
14、--修改用戶連接數
sp_configure 'number of user connections',200
15、--修改服務器鎖數量
sp_configure 'number of lock',200000
16、--修改服務器打開對象數
sp_configure 'number of open objects',5000
17、--修改服務器打開索引數
sp_configure 'number of open indexes',5000
18、--修改服務器可創建的數據設備數
sp_configure 'number of devices',100
19、--配置存儲過程緩衝
sp_configure 'procedure cache size',0,'800M'
20、--修改服務器I/O爲8K(默認緩衝池I/O)默認數據緩衝內存
sp_cacheconfig 'default data cache','3000M'
21、--修改服務器I/O爲64K(最大爲PAGESIZE*4)的默認數據緩衝池內存,值大小是I/O大小的整數倍
sp_poolconfig 'default data cache','500M','64k'
22、--配置運行CPU數量
sp_configure 'max online engines',6
23、--配置啓動時運行CPU數量
sp_configure 'number of engines at startup',6
24、--配置工作進程數
sp_configure 'number of worker processes',50    默認爲0
25、--配置最大並行度
sp_configure 'max parallel degree',3     默認爲1 暫不調整 SYBASE內部問題解決
26、--配置最大掃描並行度
sp_configure 'max scan parallel degree',3 默認爲1 暫不調整 SYBASE內部問題解決
27、--創建臨時數據庫高速緩存
sp_cacheconfig 'tempdb_cache','512M','mixed'
28、--捆綁臨時數據庫到tempdb_cache高速緩存
sp_bindcache 'tempdb_cache',tempdb

沒有留言:

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...