64-bit architecture allows programs to reference large amounts of memory easily, whereas 32-bit architecture limits programs to 4 GB of memory unless special techniques such as Microsoft Address Windows Extensions (AWE) are used. While 64 bit microprocessor architecture is over 15 years old, it has only recently begun to enter the mainstream. This document is an introduction to basic use of SQL Anywhere on 64 bit operating systems and is focused on x64 architecture, specifically Windows 2003 x64 and Windows XP x64.
Advantages of 64 bit
The main advantage of 64 bit computing for use with database servers is the ability to utilize a larger amount of memory. The amount of memory that a program can reference at any point in time is called its address space. 32-bit programs are limited to 4 GB (232 bytes) of address space, whereas 64-bit programs are theoretically limited to 16 exabytes (264 bytes) of address space, though the number is smaller in practice, around 8-16 TB.
For 32-bit programs running on 32-bit Windows, the operating system may reserve up to 2 GB of address space from each process for use by the operating system. By using the /3GB option in boot.ini, users can instruct Windows to use only 1 GB of address space in each process and therefore leave 3 GB available for use by the program. For more information on /3GB, see http://technet.microsoft.com/en-us/library/e834e9c7-708c-43bf-b877-e14ae443ecbf.aspx .
For 32-bit programs running on Windows x64, the operating system does not reserve any of the address space, and the full 4 GB is available for use by the program.
2-4GB is sufficient for most desktop applications; however, on a database server this can negatively limit performance. On Windows x64, programs can easily reference up to 8 TB or 16 TB of memory—effectively removing the address space limitation. However, motherboards have a limited amount of memory slots and would not be able to support this much RAM, and operating systems are not designed to utilize the full amount. For example, Windows Server 2003 R2 Enterprise x64 Edition is limited to 1 TB of memory, but this is still a very large amount. With the removal of the 4 GB address space limit, much more data, if not entire databases, can be cached in memory. This results in significanly faster data access and processing.
Furthermore, 64 bit SQL Anywhere software is now readily available and supported, and since most 64 bit systems can still run 32 bit software, upgrading does not mean abandoning existing applications. In particular, 64-bit SQL Anywhere software is compatible with 32-bit client applications.
Advantages of 32 bit
There are currently some advantages to 32 bit computing; mainly that 32 bit is far more commonly deployed. This means that 32 bit software and drivers are much easier to obtain and maintain. While most 32 bit software can run on both 32 bit and 64 bit operating systems, 32-bit drivers cannot run on 64-bit operating systems. This situation poses a problem since hardware will not run properly without the required drivers.
Finally, there are fewer compatibility issues with legacy software on 32 bit systems. For example, 64 bit operating systems are incapable of running 16 bit applications.
Nuances of 64 Bit Windows operating systems
When using Windows 2003 x64 or Windows XP x64, there are some details and differences from 32 bit Windows to keep in mind.
The nomenclature in 64 bit Windows operating systems is slightly different from regular 32 bit Windows. For backward compatibility, Microsoft named the main (64 bit) system directory System32, while the compatibility layer 32 bit system directory is named SysWOW64, which stands for Windows (32 bit) on Windows 64 (bit).
Program Files directories
When installing software on 64 bit Windows, the system should automatically detect whether the software is 32 or 64 bit and install it in one of two Program Files directories. SQL Anywhere 10 is usually installed in the C:\Program Files directory. Again, for backward compatibility, 64 bit applications go in the Program Files directory, while 32 bit applications go in the Program Files (x86) directory, though this rule is often bent. For example 64 bit SQL Anywhere 10 can install both 64 bit and 32 bit versions, and the 32 bit files also go in the Program Files directory.
ODBC data sources
Another commonly encountered problem when working with SQL Anywhere is the use of data sources and the ODBC Administrator. The 64 bit ODBC Administrator can be found in the usual ODBC Administrator location, C:\WINDOWS\system32\odbcad32.exe, while the 32 bit ODBC Administrator is located in C:\WINDOWS\SysWOW64\odbcad32.exe. Although all existing data sources are visible from either of the ODBC Administrators, it is not possible to add, modify, or remove data sources using the wrong ODBC Administrator unless the driver used is installed in both the 32 bit and 64 bit forms.
To be certain that you open the correct ODBC Administrator, choose Start > Run and type C:\Windows\System32\odbcad32.exe to open the 64 bit ODBC Administrator or type C:\Windows\SysWOW64\odbcad32.exe to open the 32 bit ODBC Administrator.
If drivers that should be installed are not visible or give the error, "The setup routines for driver X could not be found. Please reinstall the driver", it is likely that the wrong ODBC Administrator is being used. The following table explains which ODBC Administrator opens through various paths.
|Operating system||SQL Anywhere version*||Opened through||Which ODBC administrator|
|Win 2003 x64\Win XP x64||9,10||Sybase Central||32 bit|
|Win2003 x64\Win XP x64||9,10||Start Menu > SQL Anywhere 9/10||64 bit|
|Win 2003 x64\Win XP x64||--||Start Menu > Run > C:\Windows\System32\odbcad32.exe||64 bit|
|Win 2003 x64\Win XP x64||--||Start Menu > Run > C:\Windows\SysWOW64\odbcad32.exe||32 bit|
|Win 2003 x64\Win XP x64||--||Start Menu > Run > odbcad32||64 bit|
If you need to edit the system registry, you should note that 64 bit Windows maintains two separate registry entries for HKEY_LOCAL_MACHINE: one for each architecture. In Windows 2003 they are entirely separate, but in Windows XP the 32 bit entry is a subentry in the 64 bit registry. As with the ODBC Administrator, the 64 bit and 32 bit registry editors can be found in the system32 and sysWOW64 directories, respectively.
Finally, Windows x64 is incapable of running 16 bit applications. While 16 bit software is not very common, some installers are still 16 bit. If you are switching to Windows x64, verify that all of the applications you use, as well as their installers are compatible with Windows x64.
With more widespread use and support for 64 bit computing, upgrading is now simpler than ever. There are some user-visible differences in Windows x64 operating systems; however, in general they are very minor and using Windows x64 is very similar to 32 bit Windows. The relative simplicity of the upgrade path and the performance benefits of large memory caches mean upgrading to 64-bit computing is certainly worth considering.