版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、7-1,7,YBASE,S,7-2,本章要點(diǎn),ASE的配置參數(shù) 修改配置參數(shù)、sp_configure 命 令 SQL Server內(nèi)存配置 如何配置用戶連接數(shù) 其它與內(nèi)存相關(guān)參數(shù)的配置,7-3,7.1 調(diào)整SQL Server配置參數(shù)的目的,7.1.1 什么是缺省配置 7.1.2 誰能修改配置參數(shù) 7.2 SQL Server配置參數(shù),7-4,7.2.2 什么時(shí)候需要調(diào)整配置參數(shù),SQL Server為所有的配置參數(shù)提供了缺省值, 缺省值的設(shè)定依據(jù) 如下假設(shè): 1. 分配給SQL Server 的RAM至少15MB 2. SQL Server無需做大批量的修改操作 3.少量的存儲過程被頻繁地
2、使用 如果你的應(yīng)用與以上假設(shè)有重大的區(qū)別,則需要 重新調(diào)整SQL Server配置參數(shù)。 若應(yīng)用與以上假設(shè)有重大區(qū)別,則需要重新調(diào)整 SQL Server配置參數(shù),7-5,7.2.3 配置參數(shù)的類型 靜態(tài)參數(shù) 動態(tài)參數(shù) 7.2.4 sysconfigures表和syscurconfigs表,7.2.5 配置SQL Server參數(shù) 的方法 1. 使用帶有相應(yīng)參數(shù)名和值的系統(tǒng)存儲過程sp_configure。 2. 手工編輯配置文件。,7-6,7.3 配置文件,7.3.1 什么是配置文件 Server在啟動時(shí)使用$SYBASE/.cfg 文件作為配置文件,用戶亦可指定另一個(gè)文件 作為配置文件。
3、7.3.2 配置文件的版本維護(hù),SYBASE.001 SYBASE.002 SYBASE.003,7-7,7.3.4 SQL Server 啟動時(shí)如何指定配置文件,1. 使用dataserver的命令選項(xiàng)“-c”指定配置文件。格式: dataserver -c configuration_file 例如: /work/Server11/bin/dataserver -d/devices/master.dat -sSYBASE -e/work/Server11/install/errorlog -c/work/Server11/sybase.003 & 2. 如果指定的配置文件不存在,Serve
4、r將不能啟動。 3. 系統(tǒng)管理員必須有規(guī)律地清除不再使用的配置文件, 避免文件系統(tǒng)被填滿。,SYBASE.001 SYBASE.002 SYBASE.003,7-8,7.3.5 配置文件的備份文件,SYBASE.cfg SYBASE.bak,7.3.6 手動編輯配置文件 語法:parameter_name=value | default,7-9,7.3.9 配置文件的樣本 Configuration Options General Information Backup/Recovery recovery interval in minutes = DEFAULT print recovery
5、information = DEFAULT tape retention in days = DEFAULT Cache Manager number of oam trips = DEFAULT number of index trips = DEFAULT procedure cache percent = 10 memory alignment boundary = DEFAULT,7-10,7.4 sp_configure命令,7.4.1 sp_configure 命令的用途 1. 顯 示SQL Server配置參數(shù)值 2. 修 改SQL Server 配 置 參 數(shù) 3. 執(zhí)行對命令
6、選項(xiàng)的檢查 4. 讀/寫配置文件中參數(shù)的值,7.4.2 配 置 值 和 運(yùn) 行 值 SQL Server 當(dāng)前使 用 的 配 置 參 數(shù) 值 稱之 為 運(yùn) 行 值(Run_value),運(yùn) 行 值 存 放 在syscurconfigs 表 中。 sysconfigures 表 的 config_value 字段存放的值是配置 值, 此 值可通過 使 用sp_configure進(jìn)行修 改。 Parameter Name Default Memory Used Config Value Run Value - - - - - number of user connections 25 2712 3
7、0 25,7-11,sp_configure 顯示所有配置參數(shù)的值 sp_configure parameter 顯示缺省、當(dāng)前、最近修改的值,以及該參數(shù)所占內(nèi)存 sp_configure parameter ,value 設(shè)置參數(shù) sp_configure parameter ,0,default 將參數(shù)設(shè)置為缺省值 sp_configure group name 顯示一組值 sp_configure configuration file, 0, sub_command, file_name” 帶 configurationfile參數(shù)的sp_configure 命 令,7-12,7.4.3
8、 使用sp_configure配置或顯示SQL Server參數(shù) 語法:sp_configure config_name ,config_value sp_configure 顯示配置參數(shù)值 方 法 一舉例: sp_configure Group: Configuration Options Group: Backup/Recovery Parameter Name Default Memory Used Config Value Run Value - - - - - allow remote access 1 0 1 1 print recovery information 0 0 0 0
9、 recovery interval in minutes 5 0 5 5 tape retention in days 0 0 0 0 Group: Cache Manager Parameter Name Default Memory Used Config Value Run Value - - - - - memory alignment boundary 2048 0 2048 2048 number of index trips 0 0 0 0 number of oam trips 0 0 0 0 procedure cache percent 20 14210 20 20 to
10、tal data cache size 0 54782 0 54782 total memory 7500 81920 40960 40960 .,7-13,方 法二舉例:sp_configure number of user connections Parameter Name Default Memory Used Config Value Run Value - - - - - number of user connections 25 2712 25 25 方 法 三舉例:sp_configure physical Memory Group: Physical Memory Param
11、eter Name Default Memory Used Config Value Run Value - - - - - additional network memory 0 0 0 0 lock shared memory 0 0 0 0 shared memory starting address 0 0 0 0 total memory 7500 81920 40960 40960,7-14,使用sp_configure命令設(shè)置和修改配置參數(shù)的值 語 法: sp_configure config_name,config_value 例 如: sp_configure number
12、of user connections,30 Parameter Name Default Memory Used Config Value Run Value - - - - - number of user connections 25 2712 30 25 Configuration option changed. The SQL Server must be rebooted before the change in effect since the option is static. (配置參數(shù)已改變,因?yàn)樵搮?shù)為靜態(tài)參數(shù),所以 SQL Server 需重啟,修改才有效。,7-15,
13、7.6 如 何使 用 帶 configurationfile參數(shù) 的sp_configure 命 令,7.6.1 如何使用sp_configure 的 read參數(shù) 語法: sp_configure configuration file”,0,“read”,“file_name” 舉 例: sp_configure configurationfile ,0,“read”,“SYBASE.DSS”,Run Values updates,SYBASE.DSS,7-16,7.6.2 如何使用sp_configure 的 verify參數(shù) 語法: sp_configure configurationf
14、ile”,0,“verify”,“file_name 舉例:sp_configure configuration file ,0, ” verify ”, SYBASE.new ,7-17,7.6.3 如 何使用sp_configure 的 write參數(shù) 語法: sp_configure “configuration file”,0,write”,file_name” 舉例: sp_configure “configuration file”,0, “write”,”SYBASE.enterprise”,7-18,7.6.5如 何使用sp_configure 的 restore 語法: sp
15、_configure “configure file”,0,restore”,”SYBASE.cfg” 舉例: sp_configure “configure file”,0,restore”,SYBASE.cfg”,7.6.5 如何獲得當(dāng)前的配置文件名 使 用sp_configure configuration file來獲得當(dāng)前使用文件的文件名。,7-19,7.8 小結(jié),1. 配置文件的參數(shù)按功能分組,使之更好理解。 2.新的sp_configure選項(xiàng),允許你去讀、寫和檢驗(yàn)配置文件 3. 語法: sp_configure 顯示參數(shù)的結(jié)果(根據(jù)用戶的顯示急) sp_configure gr
16、oup_name 顯示指定組的參數(shù) sp_configure config_name ,config_value 為 配置參數(shù) 設(shè)置新值 sp_configure configuration file,0, 允許讀、寫和檢驗(yàn)配置參數(shù),7-20,7.9 SQL Server內(nèi)存配置,1. 物理內(nèi)存的使用,Os,和其他應(yīng)用程序,SQL Server,可執(zhí)行程序,靜態(tài)開銷,內(nèi)核和服務(wù)器結(jié)構(gòu),過程,數(shù)據(jù)高速緩存開銷,7-21,2、為確定系統(tǒng)中數(shù)據(jù)庫可用內(nèi)存的最大值 確定系統(tǒng)物理內(nèi)存 從總物理內(nèi)存中減去操作系統(tǒng)內(nèi)存 若機(jī)器不是專門用于數(shù)據(jù)庫,減去其他系統(tǒng)所需內(nèi)存 減去分配給additional netw
17、ork memory配置參數(shù)的內(nèi)存 3、sp_configure total memory參數(shù)來配置 如果配置的參數(shù)太大,則SQL Server不能啟動,7-22,4、在啟動時(shí)SQL Server如何進(jìn)行內(nèi)存分配 SQL Server 啟 動 時(shí)按以下順序預(yù)分配內(nèi)存: SQLServer可執(zhí)行代碼, SQL Server 使 用 的靜態(tài)內(nèi)存 用戶 可配置的參數(shù)所占用內(nèi)存 剩余部分分配給: 數(shù)據(jù)緩 存 過程緩 存(根據(jù)procedure cache percent參數(shù)值),7-23,5. SQL Server可執(zhí)行代碼所占內(nèi)存的大小 SQL Server 可執(zhí)行 代碼的大小因平臺和版本的不同而異
18、,但一般在3M至4M之 間。用dbcc memusage顯示 executable code size 參數(shù)的值來 確定。 6. 靜態(tài)內(nèi)存 的大小 這部分內(nèi)存不受用戶配置參數(shù)的影響,一般在2.2MB至3.25 之間。 7. 用戶配置參數(shù)占用的內(nèi) 存 可調(diào)用不帶參數(shù)的sp_configure來顯示所有參數(shù)和每個(gè) 參數(shù)使 用 的 內(nèi) 存 值。 8. 數(shù)據(jù)和過程緩存的計(jì)算: 系統(tǒng)按procedure cache percent所設(shè)定的百分比分配給過程緩 存,剩余部分分配給數(shù)據(jù) 緩 存。procedure cache percent 的缺省 值為20%.,7-24,7.9.2 使用dbcc監(jiān)測內(nèi)存的使
19、用,1dbcc traceon(3604) 2go 1dbcc memusage 2go Memory Usage: Meg. 2K Blks Bytes configured Memory: 14.6484 7500 153600000 Code size: 3.3339 1707 3495856 kernel Structures: 2.1106 1081 2213098 Server Structure: 3.7646 1928 3947480 Catch Memeory: 4.2422 2172 44448256 Proc Buffers: 0.0394 21 41344 Proc H
20、eaders: 1.1543 591 1210368,7-25,7.9.3 如何使用errorlog監(jiān)測內(nèi)存的使用 例 如 errorlog 中 信 息 如 下: 00:95/11/10 08:47:20:94 Server number of proc buffers allocated: 543. 00:95/11/10 08:47:21.12 Server number of blocks left for proc headers: 591 00:95/11/10 08:47:21.12 Server memory allocated for the default data cach
21、e cache: 4078Kb 1.數(shù) 據(jù)緩 存 Server memory allocated for the default data cache cache:4078Kb 根 據(jù) 上 述 信 息 可 知數(shù)據(jù) 緩 存 的 大 小 為:4078*1024=4,175,872 Bytes 2.過 程 緩 存 Server number of proc buffers allocated: 543. 該語 句 說 明 了 過 程 高 速 緩 存 中 分配的 過 程 緩 沖 區(qū) 總 數(shù)為543 Server Number of blocks left for proc headers: 591 該語 句說明了過程 高 速 緩 存中可 用的 過 程 頭總 數(shù)為591,7-26,7.10 如何設(shè)置用戶連接數(shù),7.10.1 計(jì)算用戶連接數(shù),7-27,7.10.2 如何設(shè)置用戶連接數(shù) 舉例: sp_configure number of user connections,40 如何計(jì)算用戶連接數(shù)所占內(nèi)存: 例如:15個(gè)用戶所占內(nèi)存的計(jì)算: 每個(gè)用戶連接占內(nèi)存:70K=(70*1,024)=71,680 Bytes 15個(gè)用戶占用內(nèi)存為:(15*71,680)/2,048=525pages 增 加 了15 個(gè) 用 戶 之 后 內(nèi) 存 的 分 配 情 況 1dbcc m
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 絮錦加工工誠信品質(zhì)強(qiáng)化考核試卷含答案
- 射孔取心工誠信品質(zhì)強(qiáng)化考核試卷含答案
- 甲酸裝置操作工安全規(guī)程知識考核試卷含答案
- 昆蟲標(biāo)本采集制作工崗前溝通協(xié)調(diào)考核試卷含答案
- 2025年東北石油大學(xué)輔導(dǎo)員考試筆試題庫附答案
- 2024年海南開放大學(xué)輔導(dǎo)員考試參考題庫附答案
- 2024年湖北理工學(xué)院馬克思主義基本原理概論期末考試題附答案
- 食品安全操作與檢驗(yàn)規(guī)范手冊
- 2024年許昌市特崗教師筆試真題題庫附答案
- 2024年遼寧特殊教育師范高等專科學(xué)校輔導(dǎo)員招聘備考題庫附答案
- 智能家居系統(tǒng)設(shè)計(jì)規(guī)范指南(標(biāo)準(zhǔn)版)
- 2025年宜昌市“招才興業(yè)”市直事業(yè)單位人才引進(jìn)47人·重慶大學(xué)站筆試歷年典型考題(歷年真題考點(diǎn))解題思路附帶答案詳解
- 2026海南交通投資控股公司秋招面筆試題及答案
- 2025年安徽理工大學(xué)馬克思主義基本原理概論期末考試模擬試卷
- 2025年大學(xué)大一(法學(xué))法理學(xué)試題及答案
- 膽囊癌課件教學(xué)課件
- 廣西2025年高等職業(yè)教育考試全區(qū)模擬測試 能源動力與材料 大類試題及逐題答案解說
- 2026江蘇省公務(wù)員考試公安機(jī)關(guān)公務(wù)員(人民警察)歷年真題匯編附答案解析
- 超市冷庫應(yīng)急預(yù)案(3篇)
- 5年(2021-2025)山東高考生物真題分類匯編:專題17 基因工程(解析版)
- 2025年10月自考00610高級日語(二)試題及答案
評論
0/150
提交評論