I have customers that find themselves still in the situation where they are sitting with SQL Server 2000 servers (32-bit, no less!) in their environment not because they really don’t want to move to a later version and not because they don’t want to be using 64-bit, but because they are waiting for their SOFTWARE vendor to release updates to the product they are bound to for business.
Because this product faces end of life with Microsoft and it is on extended support only at this time – it is really hard to find guidance on how to configure the memory for the servers that are sitting in datacenters running this version of SQL.
Things to know:
Advanced Windowing Extensions (AWE) API allows applications that are written to use the AWE API to access more than 4GB of RAM.
Physical Address Extensions (PAE) is a function of the Windows 2000 and Windows Server 2003 memory managers that provides more physical memory to a program that requests memory. The program is not aware that any of the memory that it uses resides in the range greater than 4 GB, just as a program is not aware that the memory it has requested is actually in the page file.
AWE is an API set that enables programs to reserve large chunks of memory. The reserved memory is non-pageable and is only accessible to that program.
AWE is only available starting with Windows 2000 Advanced Server and Windows 2000 Datacenter Edition. Windows 2000 Server *does not* have the ability to leverage AWE. Windows Server 2003 Enterprise and Windows Server 2003 Datacenter can leverage AWE. Windows Server 2003 Standard edition cannot leverage AWE.
SQL Server 2000 STANDARD edition does not have the ability to leverage AWE and therefore, regardless of the server version, the AWE enabled option should be left to 0 (which is the default) – which means that AWE memory is not being used. SQL Server 2005 STANDARD DOES have the ability to leverage AWE as long as the OS supports it as well.
SQL Server 2000 ENTERPRISE edition can leverage AWE if it is enabled.
By default, EVEN IF you are running Windows 2000 Advanced Server or Windows 2000 Datacenter Edition AND you are running SQL Server 2000 Enterprise, and you have more than 4GB of RAM, your server will still not utilize it by default. You must make changes to the OS configuration and to the SQL configuration.
If your 32 -bit server has the following RAM configurations, then you require special switches in the boot.ini file – after you make a change to the boot.ini file, you must reboot your server:
4GB RAM: /3GB (AWE support is not used)
8GB RAM: /3GB /PAE
16GB RAM: /3GB /PAE
16GB + RAM: / PAE
Then for servers where there is more than 4GB of RAM, AWE needs to be enabled and the SQL Server service needs to be restarted. And without Physical Address Extensions (PAE), AWE cannot reserve memory in excess of 4 GB.
Here is an example of how to configure it:
SP_CONFIGURE ‘show advanced options’, 1
RECONFIGURE
GO
SP_CONFIGURE ‘awe enabled’, 1
RECONFIGURE
GO
THEN, I configure max server memory to tell SQL what is the maximum amount of memory it can use within the system. This is important because if you don’t, you will end up with SQL taking all but 128MB of RAM and leave only about 128MB for the OS and then you will find the OS being starved of memory. My rule of thumb is to leave anywhere from 1GB to 2GB of RAM for the OS itself. Therefore, if I have a 16GB system, I will tell SQL it can use anywhere from 14 – 15GB of that memory by using the following:
SP_CONFIGURE ‘max server memory’, 14336
RECONFIGURE
GO
Some other things to consider is that is AWE is not necessary on 64-bit platforms, but it is there. Memory pages that are allocated through the AWE mechanism are referred to as locked pages on the 64-bit platform. On both 32-bit and 64-bit platforms, memory allocated through AWE cannot be paged out – this can be advantages to the application and it is one of the reasons why it will sometimes be used on a 64-bit platform. BUT, this comes at a cost – it affects the amount of RAM that is available to the system and to other applications (hence the ‘ max server memory’ recommendation earlier). Because of the underlying constructs, it is necessary for the account that runs the SQL Server service to have Lock Pages in Memory privilege. This privilege is enabled by default during the installation, but important to know if there are have permissions settings modifications. Using gpedit.msc may be necessary to re-enable this privilege.