Configuring data caches

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:

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.

Table 19-1: Dynamic and static sp_cacheconfig actions

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:

  1. Unbind the cache.

  2. Delete the cache.

  3. Re-create the cache using the new configuration.

  4. 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.