How to Determine SQL Server 2005 Bitness (32/64-bit) and Optimize Memory Configuration on x64 Windows


6 views

When investigating SQL Server 2005's architecture, several diagnostic commands provide definitive answers:

-- Method 1: Check platform via extended stored procedure
EXEC xp_msver 'Platform';

-- Method 2: Query version information
SELECT @@VERSION;

-- Method 3: Check registry (requires admin rights)
EXEC xp_regread 
    @rootkey = 'HKEY_LOCAL_MACHINE',
    @key = 'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\CurrentVersion',
    @value_name = 'CurrentVersion';

Your findings clearly indicate a 32-bit installation:

  • NT INTEL X86 in xp_msver output
  • Intel X86 in @@VERSION output
  • Executable path in x86 Program Files directory

The absence of "*32" in Task Manager is expected behavior on 64-bit Windows - 32-bit processes don't receive this designation when running under WOW64.

Your 32-bit SQL Server installation faces these memory limitations:

-- Check current memory configuration
SELECT 
    physical_memory_in_use_kb/1024 AS [SQL Memory Usage (MB)],
    locked_page_allocations_kb/1024 AS [AWE Memory (MB)],
    total_virtual_address_space_kb/1024 AS [VAS (MB)]
FROM sys.dm_os_process_memory;

Without AWE configuration:

  • Default limit: ~2GB user-mode virtual address space
  • With /3GB boot.ini switch: ~3GB (partial relief)
  • With AWE enabled: Up to 64GB on x64 Windows

For immediate improvement:

-- Enable AWE (requires SQL Server service account privileges)
sp_configure 'show advanced options', 1;
RECONFIGURE;
sp_configure 'awe enabled', 1;
RECONFIGURE;

-- Set max server memory (adjust based on total RAM)
sp_configure 'max server memory', 12288; -- 12GB example
RECONFIGURE;

Additional OS-level optimizations:

  • Add SQL service account to "Lock Pages in Memory" policy
  • Set /PAE switch in boot.ini (though less critical on x64)
  • Verify SQLBUILTIN\Administrators has appropriate permissions

When planning the 64-bit upgrade:

-- Check for 32-bit specific features before migration
SELECT * FROM sys.dm_os_loaded_modules 
WHERE description = 'SQL Server Windows NT' 
AND file_version LIKE '9.00%';

-- Document linked servers, replication, SSIS packages
SELECT * FROM sys.servers;
EXEC sp_helpsubscription;

Critical preparation steps:

  • Validate all COM objects and extended stored procedures
  • Test legacy ODBC connections
  • Schedule downtime during low-usage periods
  • Consider using log shipping for minimal downtime

When working with SQL Server 2005 installations, determining whether you're running the 32-bit or 64-bit version is crucial for performance optimization. Here are the definitive ways to check:

-- Method 1: Using xp_msver
EXEC xp_msver 'Platform';

-- Method 2: Checking @@VERSION
SELECT @@VERSION;

-- Method 3: Program Files location
-- 32-bit: C:\Program Files (x86)\Microsoft SQL Server
-- 64-bit: C:\Program Files\Microsoft SQL Server

In your case, both xp_msver showing "NT INTEL X86" and @@VERSION indicating "(Intel X86)" confirm you're running the 32-bit version, despite the 64-bit OS.

A 32-bit SQL Server installation on a 64-bit OS has specific memory constraints:

  • Without AWE: Limited to ~3.5GB address space
  • With AWE: Can access more memory (up to 64GB on Standard Edition)

Your observation of ~3.5GB memory usage suggests AWE isn't properly configured. Here's how to verify:

-- Check AWE configuration
sp_configure 'show advanced options', 1;
RECONFIGURE;
sp_configure 'awe enabled';

To enable AWE and maximize memory usage:

-- Enable AWE
sp_configure 'show advanced options', 1;
RECONFIGURE;
sp_configure 'awe enabled', 1;
RECONFIGURE;

-- Set max server memory (MB)
sp_configure 'max server memory', 12288; -- Example: 12GB
RECONFIGURE;

Remember to also:

  1. Grant "Lock Pages in Memory" privilege to SQL Server service account
  2. Restart SQL Server service after configuration

While AWE can help, upgrading to 64-bit SQL Server offers significant advantages:

  • No 4GB memory limit per instance
  • Better performance for memory-intensive operations
  • No need for AWE configuration

For production systems, plan the migration carefully:

-- Backup all databases first
BACKUP DATABASE [YourDB] TO DISK = 'C:\Backups\YourDB.bak'
WITH COMPRESSION, STATS = 10;

After configuration, monitor memory usage with:

-- Current memory usage
SELECT
    physical_memory_in_use_kb/1024 AS [SQL Server Memory Usage (MB)],
    locked_page_allocations_kb/1024 AS [AWE Memory (MB)],
    total_virtual_address_space_kb/1024 AS [Virtual Address Space (MB)],
    virtual_address_space_available_kb/1024 AS [Available VAS (MB)]
FROM sys.dm_os_process_memory;

Remember that while AWE can help, it's not a perfect substitute for native 64-bit architecture. For long-term solutions on systems with >4GB RAM, 64-bit SQL Server is the recommended path.