Loading and Unloading the Database from Memory
TimesTen is an in-memory database. As such, a database must first be loaded into memory from the file system to be available for connections.
When a database is loaded into memory, the contents of the permanent memory region are read from checkpoint files stored on the file system. The temporary memory region is created when a database is loaded into memory and is destroyed when it is unloaded. See Specifying the Memory Region Sizes of a Database for more details on permanent and temporary memory.
-
In TimesTen Scaleout: The grid administrator controls how to load and unload the database using the
ttGridAdmin
utility. See ttGridAdmin in the Oracle TimesTen In-Memory Database Reference for details. -
In TimesTen Classic: RAM policies specify how and when a database is loaded into memory, including whether to automatically reload the database into memory if the database is unloaded unexpectedly. See Specifying a RAM Policy for full details on the different RAM policies.
Only the instance administrator can load a database manually. By default, TimesTen automatically loads an idle database (which is a database with no connections) into memory when a first connection is made to it. See Loading a Database into Memory for TimesTen Classic.
After a database loads into memory, you may need to explicitly start the cache and replication agents for the database, depending on the functionality you are using and on which cache and replication policies you set with the
ttAdmin
utility.
Note:
Instead of loading and unloading the database, you can detach or attach the shared memory segment leaving the shared memory segment in memory. This is significantly faster than loading and unloading a database. See Detaching, Attaching, and Freeing the Shared Memory Segment.
Loading and unloading the database from memory for TimesTen Classic is described in these sections:
Loading a Database into Memory for TimesTen Classic
Loading the database into memory for TimesTen Classic can be done automatically when
a certain ram policy is set or manually with the ttAdmin
utility.
See ttAdmin and ttDaemonAdmin in the Oracle TimesTen In-Memory Database Reference.
Unloading a Database from Memory for TimesTen Classic
In TimesTen Classic, a database remains loaded in shared memory if any applications or TimesTen agents, such as the cache agent or replication agent, are connected to it. In TimesTen Classic, a database may also be kept in shared memory for particular RAM policy setting, even when no applications or agents are connected.
Before unloading the database from memory for TimesTen Classic, you must first close the database, close all active connections to the database and then set the RAM policy of the database to manual
or inUse
.
Note:
The following steps use examples where database1
is the database
that is to be unloaded. It is assumed that it is the active master in a
replication scheme and has been configured with cache. Note that a database can
have both replication and cache configured, and a RAM policy other than
manual.
See ttAdmin in the Oracle TimesTen In-Memory Database Reference.