Caches that host in-memory databases must be large enough to contain the entire database, and every page in the database must reside in the cache, without any buffer replacement or I/O to disk. You cannot use caches that have been created:
To host in-memory databases to bind other databases or other objects.
For binding other databases or objects to host in-memory databases. Named caches used to host an in-memory database use a different structure, and are dedicated to in-memory databases.
Use sp_cacheconfig to create the cache for the in-memory database. Use disk init to divide the cache into in-memory devices, which are similar to disk devices, and support segments. You can bind one or more logical segments to in-memory devices, allowing you to bind objects to individual segments.
Consider the following before you bind any objects to a cache for in-memory or relaxed durability databases:
Use named caches to bind entire relaxed-durability or full durability database. You may bind
Individual objects in an relaxed-durability database to a named cache, similar to binding individual objects in a regular database
Relaxed-durability database to a named cache (for example, the default data cache)
In-memory storage caches are similar to named caches, but are configured for efficient in-memory access. Individual objects in the relaxed-durability database to different caches
Caching behavior for in-memory storage caches is similar to the caching behavior for regular caches.
Use the same monitoring tools and tuning techniques you use to improve the performance of named caches to improve the performance of relaxed-durability databases bound to named caches.
Because a single in-memory storage cache hosts the entire database, you do not bind a database or object to individual caches. Most existing cache manager monitoring and tuning apply to in-memory caches. See Chapter 2, “Monitoring Performance with sp_sysmon,” in Performance and Tuning Series: Monitoring Adaptive Server with sp_sysmon.
In-memory databases must be hosted by a single cache, but can reside on multiple in-memory devices created from that cache. Figure 1-2 shows imdb_cache cache, which contains a single in-memory storage device, imdb_dev:
Figure 1-2: Single cache hosting a single device
Figure 1-3 shows imdb_cache2 cache, which includes two in-memory data devices, imdb_dev1 and imdb_dev2, and a log device, imdb_logdev1:
Figure 1-3: Single cache hosting multiple devices
Use create inmemory database to create the in-memory database directly on the logical devices. If your installation does not use segments to limit space for objects, create the database on the in-memory device to be used for the entire in-memory storage cache. For finer granularity in space management for individual objects and threshold procedure support, create the database and log on separate in-memory devices.
Use ddlgen to generate database and object definitions for in-memory and relaxed-durability databases. See the Utility Guide.
Use alter database to change the layout of existing in-memory databases. See the Reference Manual: Commands.