SQL server服务器大内存配置

时间:2007-12-17 08:55:21  来源:  作者:

  以前的服务器,由于内存的价格过高,一般配的内存不是很多,超过4G的当然就不多了.现在的服务器,配置超过4G就很多,在配作SQL 数据库服务器后,很多的人只选默认的设置,虽然可以正常使用,可是却把大量的内存给浪费(SQL服务使用的内存不会超过1.8G),系统的性能也不能因为的大内存而提升,这是很可惜的.pWR第一天空网络

  在本文中,我大致讲一下配置的过程.(如果服务器的内存少于4G,不用配置)(网上完全讲这个的,没有见过,随手写一个)pWR第一天空网络

  1.打开系统中的大内存支持(windows)pWR第一天空网络

  若要启用 Windows 2000 Advanced Server 或 Windows 2000 Datacenter Server 支持pWR第一天空网络

  大于4GB的物理内存,必须将参数 /pae 添加到 boot.ini 文件中。pWR第一天空网络

  [boot loader]pWR第一天空网络

  timeout=0pWR第一天空网络

  default=multi(0)disk(0)rdisk(0)partition(1)\WINNTpWR第一天空网络

  [operating systems]pWR第一天空网络

  multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced Server"pWR第一天空网络

  /fastdetectpWR第一天空网络

  改为pWR第一天空网络

  [boot loader]pWR第一天空网络

  timeout=0pWR第一天空网络

  default=multi(0)disk(0)rdisk(0)partition(1)\WINNTpWR第一天空网络

  [operating systems]pWR第一天空网络

  multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced Server"pWR第一天空网络

  /fastdetect /paepWR第一天空网络

  这个改好后,要重启系统的pWR第一天空网络

  2.启用锁定内存页选项(windows)pWR第一天空网络

  启用锁定内存页选项pWR第一天空网络

  在"开始"菜单上单击"运行"子菜单,然后在"打开"框中键入"gpedit.msc"。pWR第一天空网络

  在"组策略"控制台上,展开"计算机配置",然后展开"Windows 设置"。pWR第一天空网络

  展开"安全设置",然后展开"本地策略"。pWR第一天空网络

  选择"用户权限分配"复选框。pWR第一天空网络

  详细资料窗格中随即显示出策略。pWR第一天空网络

  在详细资料窗格中,双击"锁定内存页"。pWR第一天空网络

  在"本地安全策略设置"对话框中,单击"添加"按钮。pWR第一天空网络

  在"选择用户或组"对话框中,添加有权运行 sqlservr.exe 的帐户。pWR第一天空网络

  3.启用SQL的AWEpWR第一天空网络

  若要启用 AWE,请将 awe enabled 设置为 1。除非指定了 max server memory 的值,否pWR第一天空网络

  则 SQL Server 将保留几乎所有可用内存,只留下 128 MB 或更少。pWR第一天空网络

  如果已成功启用该选项,则当 SQL Server 2000 实例启动时,SQL Server 错误日志中将pWR第一天空网络

  出现"已启用地址窗口扩展"这条消息。pWR第一天空网络

  awe enabled 是高级选项。如果正在使用 sp_configure 系统存储过程更改该设置,则只有pWR第一天空网络

  当 show advanced options 设置为 1 时才能更改 awe enabled。pWR第一天空网络

  code 如下,设定SQL 使用6G的内存pWR第一天空网络

  sp_configure 'show advanced options', 1pWR第一天空网络

  RECONFIGUREpWR第一天空网络

  GOpWR第一天空网络

  sp_configure 'awe enabled', 1pWR第一天空网络

  RECONFIGUREpWR第一天空网络

  GOpWR第一天空网络

  sp_configure 'max server memory', 6144pWR第一天空网络

  RECONFIGUREpWR第一天空网络

  GOpWR第一天空网络

  必须重新启动 SQL Server 2000 实例才能使更改生效。pWR第一天空网络

  net stop mssqlserverpWR第一天空网络

  net start mssqlserverpWR第一天空网络

  这样,SQL 服务启动后,就会把6G的内存给锁定,完全供SQL使用pWR第一天空网络

  参照SQL帮助文件pWR第一天空网络

文章评论

共有 位天空网友发表了评论 查看完整内容

特别推荐
  • 文字广告
  • 文字广告
  • 文字广告
  • 文字广告
站长黑板报

24小时热门信息