設定32位的windows2003使用大記憶體 大於1.7

zhangweizhao發表於2011-04-12
轉自http://space.itpub.net/10834762/viewspace-445622

 

設定32位的windows2003使用大於1.7的記憶體

前兩天出差遇到:32位的windows 2003使用大於1.7的記憶體的問題,PCserver上記憶體為16G,但由於32位的CPU的在windows系統中2G給系統用2G給應用程式使用,如系統及oracle引數不作修改時,oracleSGA記憶體使用不能超過1.7G,所以要對一些進行windos
ows
oracle引數據進行修改,大致有以下幾步:

windows上的引數據修改:
   1.
修改boot.ini檔案,加/3GB /PAE:
     
在這行,multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows" /3GB /PAE

   2.修改windows登錄檔:
     regedit
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0這個目錄中找到AWE_WINDOW_MEMORY這個引數,將其修改為oracle需要記憶體的大小:例如:6G時為:6*1024*1024*1024
    
這個引數如不存大時,可以新建一個字串名為AWE_WINDOW_MEMORY,值為上面講過的大小,這個值需要足夠大,不夠時將報:
         ORA-27102 out of memory
         OSD-00034 Message 34 not found;  Product=RDBMS;facility =SOSD
         O/S Error: (OS 8) Not enough storage is available to process this command


   3.
修改windows控制皮膚中的管理工具--&gt 域安全策略--&gt本地安全策略--&gt使用者許可權分配--&gt鎖定記憶體頁(記憶體中鎖定頁面)中加入啟oracle資料庫OS使用者名稱.


ORACLE資料庫中要改的引數:
   1.
在改引數之前最好能先備份一個spfilepfile檔案以防資料庫修改失敗時可以從這個引數檔案在啟動資料庫: create pfile='d:\inittest.ora' from spfile;

   2.主要修改的引數為:
     _db_block_lru_latches --
這個引數據大小為=CPU*2*8
    
取消引數據:db_cache_size,sga_max_size  
     db_block_buffers
     USE_INDIRECT_DATA_BUFFERS=TRUE 
 

SQL> shutdown immediate;
資料庫已經關閉。
已經解除安裝資料庫。
ORACLE
例程已經關閉。
SQL> startup
ORACLE
例程已經啟動。

Total System Global Area 1008280152 bytes
Fixed Size                   455256 bytes
Variable Size             478150656 bytes
Database Buffers          528482304 bytes
Redo Buffers                1191936 bytes
資料庫裝載完畢。
資料庫已經開啟。
SQL> alter system set "_db_block_lru_latches"=32 scope=spfile;

系統已更改。

SQL> alter system reset db_cache_size scope=spfile sid='*';

系統已更改。

SQL> alter system set lock_sga=false scope=spfile;

系統已更改。

SQL> alter system set db_block_buffers=1179648 scope=spfile;

系統已更改。

SQL> alter system set use_indirect_data_buffers=true scope=spfile;

系統已更改。

SQL> create pfile='f:\init2.ora' from spfile;

檔案已建立。

SQL> shutdown immediate;
資料庫已經關閉。
已經解除安裝資料庫。
ORACLE
例程已經關閉。

可以通過OEM來修改PGA,shared pool這些記憶體大小


SQL> startup
ORACLE
例程已經啟動。

Total System Global Area 7516192768 bytes
Fixed Size                   455256 bytes
Variable Size             478150656 bytes
Database Buffers          3528482304 bytes
Redo Buffers                1191936 bytes
資料庫裝載完畢。
資料庫已經開啟。


 

下為metalink為文章:

Subject:

Implementing Address Windowing Extensions (AWE) or VLM on Windows Platforms

 

Doc ID:

Note:225349.1

Type:

BULLETIN

 

Last Revision Date:

11-JUL-2007

Status:

PUBLISHED

PURPOSE
-------

To address the growing need for use of more memory on 32-Bit Windows platforms,
and explain how AWE is implemented by Oracle on Windows.

 
SCOPE & APPLICATION
-------------------
   Oracle DBA's running on the Microsoft Windows platform.
   Oracle Support Analysts, Field Engineers troubleshooting problems
   related to AWE and/or memory issues on Windows.

AWE Memory implementation on Windows 2000
------------------------------------------
 
   A common question on the Windows NT/Windows 2000 platform. revolves around
   how to take advantage of systems with more than 4 GB of RAM. As discussed
   in MetalinkNote 46001.1andNote 46053.1, the 32-Bit process address
   space for any process on Windows equates to a total of 4GB of addressable
   RAM. Of this, by default, 2GB is reserved for the process itself, and 2GB
   for the kernel. On systems running either Windows 2000 Advanced Server,
   or Windows NT 4.0 Enterprise Edition, this ratio can be changed by adding
   the /3GB switch to the boot.ini, allowing a process to address 3GB and
   reserving 1GB for the kernel. However, the total addressable memory for
   a single process is still only 4GB.
   See alsoNote 1036312.6: Utilizing Up to 3GB Virtual Memory on Windows NT Server 4.0


__________________________________________________________________

What can be done to address memory beyond 4GB?:
===============================================


   The answer is to take advantage of Physical Address Extensions (PAE), or
   Address Windowing Extensions (AWE)(These two terms are used interchangeably,
   so the rest of this document will refer to this simply as AWE).
   AWE support is available if you are running on a machine with more than 4GB  
   of physical RAM which is running any of the below Windows operating systems:

   * Windows 2000 Datacenter Server
   * Windows 2000 Advanced Server
   * Windows 2003 Data Center Edition (32-Bit)
   * Windows 2003 Enterprise Edition (32-Bit)

   On the above operating systems, AWE support is built into the OS. No
   special drivers are needed to take advantage of the additional memory.

 AWE CANNOT be used on the following Operating Systems:

   * Windows 2000 Server (Standard)
   * Windows 2000 Professional
   * Windows XP Home Edition
   * Windows XP Professional
   * Windows 2003 Standard Edition
   * Windows 2003Web
Edition

  NOTE Also that on 64-Bit Windows operating systems, there is no need for AWE
  implementation support, because the directly addressable memory for a single
  process on 64-Bit Windows is 8 Terabytes.

__________________________________________________________________

Oracle versions that can use AWE:
=================================

   Oracle can take advantage of AWE in the following 32-Bit RDBMS releases:

   * Oracle8.1.6.x
   * Oracle 8.1.7.x
   * Oracle 9.2.x
   * Oracle 10.1.x
   * Oracle 10.2.x

  Oracle does NOT implement AWE support in release 9.0.1.x


  AWE support is available on both the Enterprise Edition of Oracle and
  the Standard Edition of Oracle. However, on Standard Edition of 9.2.0.1,
  you may receive the following error if trying to start the database with
  USE_INDIRECT_DATA_BUFFERS=TRUE:

  ORA-439 - FEATURE NOT ENABLED: VERY LARGE MEMORY

  In Standard Edition 9.2.0.2 and 9.2.0.3, you will not receive the above errors,
  but VLM functionality is still not enabled. Refer to BUG#2945011 for more detail.
  This BUG is fixed in 9.2.0.3 Patch 2, and will be fixed in 9.2.0.4 as well.

__________________________________________________________________

Enabling support at the OS level:
==================================

   AWE can be enabled at the OS by adding the /PAE switch to the boot.ini
   as such:

multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced Server" /PAE

   It IS possible to have BOTH the /PAE and /3GB switch in place on the same
   machine, as such:

multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced Server" /3GB /PAE

   However, be aware that if BOTH switches are in place, the server will only
   be able to recognize up to 16GB of RAM. If you are working with a server
   with more than 16GB of RAM, you will need to choose between the two.

   It is important to note that once either or both of these switches are in
   place in the boot.ini, ALL processes running can take advantage of these
   switches. Thus, in a case where multiple Oracle instances are running on
   the same server, ALL instances can take advantage of the additional memory               
   afforded by these switches, up to the amount of physical memory on the box.


Operating System Privileges Needed at the OS Level:
====================================================

  In order to take advantage of the additional memory afforded through PAE,
  the operating system user account which is used to start the OracleService
  must be granted the 'Lock Pages in Memory' system privilege at the operating system
  level.  By default, the OracleService starts as the LocalSystem account.
  The LocalSystem account has the privilege to Lock Pages in Memory granted to
  it by default.

  However, if you change the OracleService to logon as a user OTHER than
  LocalSystem, you may see the following errors when attempting to start the
  database with USE_INDIRECT_DATA_BUFFERS set to TRUE :


  SQL> startup pfile=c:\temp\initscott.ora
  ORA-27102: out of memory
  OSD-00010: Message 10 not found; product=RDBMS; facility=SOSD
  
  O/S-Error: (OS 1300) Not all privileges referenced are assigned to the caller.


  To rectify this, you must grant the 'Lock pages in memory' privilege to the user
  that the OracleService starts as. To do this, click on:
  Start -> Programs -> Administrative Tools -> Local Security Policy
  (on a Domain Controller, click on 'Domain Security Policy' instead of 'Local Security Policy')
  Double-click on the 'Lock Pages in memory' policy.
  Add the appropriate user and click 'Ok'.
  Restart the OracleService


__________________________________________________________________

Understanding the Oracle implementation of AWE support:
=======================================================

   What the PAE switch allows you to do from the Oracle perspective is to
   increase the amount of memory that can be used for the Oracle Database
   Block Buffer Cache. It is important to note that this additional memory
   can ONLY be used by Oracle in the form. of an increased value for
   DB_BLOCK_BUFFERS. 

   There is still confusion on the old style. of VLM versus AWE on Windows 2000.
   With VLM on Windows NT 4.0, there was the concept of pointers pointing to
   the extended memory area, but that is no longer the case on Windows 2000.
   Instead, the windowing technology as described in these articles is being
   used. For more information on AWE/PAE implementation on the Windows
   platform, refer to Microsoft's website.

   As mentioned previously, with AWE enabled, this allows the process(es)
   (in this case ORACLE.EXE) to use memory above and beyond the 4GB
   mark defined by a 32-Bit Process Address space. The physical location of
   these blocks does not matter. However, the database blocks must still be
   accessed from within a ‘window’, which exists (logically) in that regular
   3GB process address space.
   The size of this window is defined by a registry setting in the HOME key for
   Oracle (HKLM\Software\Oracle\Homex) called AWE_WINDOW_MEMORY. By default,
   this value is 1GB, so if this value is not set in the registry, 
   AWE_WINDOW_MEMORY will be 1GB. 

   If you add the registry key yourself, the datatype should be a string value,
   or a REG_SZ.  The value for AWE_WINDOW_MEMORY must be specified in BYTES.

   It is important to realize that any database blocks accessed by Oracle
   (or any user/background thread within Oracle.exe) must first be mapped into
   the 'window' defined by AWE_WINDOW_MEMORY. In this scenario, it does not
   matter where the blocks are physically located - there is no need to be
   concerned with where the blocks are physically residing. The window will be
   drawn around the block (i.e. the block will be mapped) wherever it is located 
   in memory. If the block is in memory but has not been mapped into the
   ‘window’, then it may be necessary to unmapped another block that IS in the
   window, in order to accommodate the new block. While this mapping and
   unmapping of blocks does add some cost, it is still faster than incurring
   an I/O operation to read the block from disk. This will be discussed
   further down in the section on troubleshooting.
   
   Note:  

   Keep in mind that if there are multiple instances on a machine with
   the /PAE switch enabled, ALL instances can take advantage of the additional
   memory. However, AWE_WINDOW_MEMORY cannot be set on a per-instance basis,
   so all databases that are running out of the HOMEx key where
   AWE_WINDOW_MEMORY is set will inherit the same value.


__________________________________________________________________

Enabling AWE Support at the Database/Instance Level:
====================================================

   To enable the AWE implementation on Oracle, you must set the following
   parameter in the init file (or spfile) used to start the instance:

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23368118/viewspace-692324/,如需轉載,請註明出處,否則將追究法律責任。

相關文章