The default data cache and the procedure cache for Adaptive Server are specified using an absolute value. The first step in planning cache configuration and implementing caches is to set the max memory configuration parameter. After you set max memory, determine how much space you want to allocate for data caches on your server. The size of a data cache is limited only by access to memory on the system; however, max memory should be larger than total logical memory. You must specify an absolute value for the size of the default data cache and all other user-defined caches. For an overview of Adaptive Server memory usage, see Chapter 18, “Configuring Memory.”
You can configure data caches in two ways:
Interactively, using sp_cacheconfig and sp_poolconfig. This method is dynamic and does not require a reboot of Adaptive Server.
By editing your configuration file. This method is static and requires that you reboot Adaptive Server.
Each time you change the data cache or execute either sp_cacheconfig or sp_poolconfig, Adaptive Server writes the new cache or pool information into the configuration file and copies the old version of the file to a backup file. A message giving the backup file name is sent to the error log.
Some of the actions you perform with sp_cacheconfig are dynamic and some are static.
Dynamic sp_cacheconfig actions |
Static sp_cacheconfig actions |
---|---|
Adding a new cache |
Changing the number of cache partitions |
Adding memory to an existing cache |
Reducing a cache size |
Deleting a cache |
Changing replacement policy |
Changing a cache type |
You can reset static parameters by deleting and re-creating the cache:
Unbind the cache.
Delete the cache.
Re-create the cache using the new configuration.
Bind objects to the cache.
The following sections describe how to use sp_cacheconfig and sp_poolconfig. See “Configuring data caches with the configuration file” for information about using the configuration file.