轉(zhuǎn)帖|其它|編輯:郝浩|2010-11-18 14:00:22.000|閱讀 459 次
概述:數(shù)據(jù)庫(kù)服務(wù)器主要用于存儲(chǔ)、查詢、檢索企業(yè)內(nèi)部的信息,因此需要搭配專用的數(shù)據(jù)庫(kù)系統(tǒng),對(duì)服務(wù)器的兼容性、可靠性和穩(wěn)定性等方面都有很高的要求。本文主要介紹SQL Server數(shù)據(jù)庫(kù)服務(wù)器高性能設(shè)置,希望對(duì)大家有幫助。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
數(shù)據(jù)庫(kù)服務(wù)器主要用于存儲(chǔ)、查詢、檢索企業(yè)內(nèi)部的信息,因此需要搭配專用的數(shù)據(jù)庫(kù)系統(tǒng),對(duì)服務(wù)器的兼容性、可靠性和穩(wěn)定性等方面都有很高的要求。
下面是進(jìn)行籠統(tǒng)的技術(shù)點(diǎn)說明,為的是讓大家有一個(gè)整體的概念,如果想深入可以逐個(gè)擊破;
希望大家能一起補(bǔ)充完善。
<!--[if !supportLists]-->一、<!--[endif]-->服務(wù)器規(guī)劃:
<!--[if !supportLists]-->1. <!--[endif]-->使用64位的操作系統(tǒng),最好是2008的;(Windows Server 2008 64位)
<!--[if !supportLists]-->2. <!--[endif]-->使用64位的數(shù)據(jù)庫(kù)程序,最好是2008的;(SQL Server 2008 64位)
<!--[if !supportLists]-->3. <!--[endif]-->使用千兆網(wǎng)卡;
<!--[if !supportLists]-->4. <!--[endif]-->使用硬RAID5;
<!--[if !supportLists]-->5. <!--[endif]-->使用64K的簇大小;
<!--[if !supportLists]-->6. <!--[endif]-->LUN0用作系統(tǒng)盤,LUN1用作程序(主要是數(shù)據(jù)庫(kù)程序)安裝盤,LUN2用作數(shù)據(jù)庫(kù)文件盤,動(dòng)態(tài)盤;
<!--[if !supportLists]-->二、<!--[endif]-->系統(tǒng)設(shè)置:
如果服務(wù)器使用的配置是:Windows Server 2003 x86 + SQL Server 2005 x86 + 12G內(nèi)存
<!--[if !supportLists]-->1. <!--[endif]-->使用Windows Server 2003 Enterprise Edition,如果有可能的話也可以使用Windows 2003 Datacenter Edition;
<!--[if !supportLists]-->2. <!--[endif]-->在boot.ini中啟用pae;
<!--[if !supportLists]-->3. <!--[endif]-->使用gpedit.msc設(shè)置【內(nèi)存中鎖定頁(yè)】;
<!--[if !supportLists]-->4. <!--[endif]-->設(shè)置虛擬內(nèi)存到系統(tǒng)盤之外的物理磁盤中,如果是同一塊物理磁盤,分到其它邏輯分區(qū)也可以;設(shè)置大小看情況而定;
<!--[if !supportLists]-->5. <!--[endif]-->去掉【最大化文件共享數(shù)據(jù)吞吐量】,選擇【最大化網(wǎng)絡(luò)應(yīng)用程序數(shù)據(jù)吞吐量】
<!--[if !supportLists]-->三、<!--[endif]-->數(shù)據(jù)庫(kù)設(shè)置:
<!--[if !supportLists]-->1. <!--[endif]-->設(shè)置數(shù)據(jù)庫(kù)的AWE,如果是16G的內(nèi)存,一般是分配80%內(nèi)存給數(shù)據(jù)庫(kù)程序使用;
<!--[if !supportLists]-->2. <!--[endif]-->設(shè)置數(shù)據(jù)庫(kù)實(shí)例的增長(zhǎng)為10%,具體需要設(shè)置多少需要看你的業(yè)務(wù)需要,其目的就是盡量減少磁盤空間的分配次數(shù)還有較少磁盤碎片的產(chǎn)生;
<!--[if !supportLists]-->3. <!--[endif]-->設(shè)置數(shù)據(jù)庫(kù)實(shí)例的恢復(fù)模式為簡(jiǎn)單模式,如果在可以的情況下;
<!--[if !supportLists]-->4. <!--[endif]-->設(shè)置TempDB的大小,一般來說可以給到4G以上,看具體需要和環(huán)境;
<!--[if !supportLists]-->5. <!--[endif]-->把除了SQL Server和SQL Server Browser 的其它數(shù)據(jù)庫(kù)服務(wù)都停止掉,除非你有使用到這些服務(wù)的需要;
<!--[if !supportLists]-->四、<!--[endif]-->數(shù)據(jù)庫(kù)設(shè)計(jì):
<!--[if !supportLists]-->1. <!--[endif]-->表分區(qū);(單臺(tái)數(shù)據(jù)庫(kù)服務(wù)器)
<!--[if !supportLists]-->2. <!--[endif]-->事件復(fù)制讀寫分離;(兩臺(tái)數(shù)據(jù)庫(kù)服務(wù)器)
<!--[if !supportLists]-->3. <!--[endif]-->對(duì)等事務(wù)復(fù)制;(多臺(tái)數(shù)據(jù)庫(kù)服務(wù)器)
<!--[if !supportLists]-->五、<!--[endif]-->SQL優(yōu)化:
<!--[if !supportLists]-->1. <!--[endif]-->創(chuàng)建合適的索引;
<!--[if !supportLists]-->2. <!--[endif]-->減少游標(biāo)的使用;
<!--[if !supportLists]-->3. <!--[endif]-->可以考慮CLR編程,比如一些頻繁查詢并且變動(dòng)很小的表;
<!--[if !supportLists]-->4. <!--[endif]-->使用批量操作,減少頻繁而小的操作;
<!--[if !supportLists]-->5. <!--[endif]-->這里的調(diào)優(yōu)細(xì)節(jié)很多,大家可以慢慢深入了解;
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)