Loading a Database into Memory for TimesTen
Loading the database into memory for TimesTen can be done automatically
when a certain RAM policy is set or manually with the ttAdmin
utility.
- Before you try to load the database into memory for TimesTen, confirm that the
TimesTen daemon is running with the
ttStatusutility. The following output shows that the TimesTen daemon is not running.% ttStatus ttStatus: Could not connect to the TimesTen daemon. If the TimesTen daemon is not running, please start it by running "ttDaemonAdmin -start".
- Start the TimesTen daemon, if necessary.
ttDaemonAdmin -start
- The RAM policy setting is important as it specifies if, how, and when the
database is loaded or unloaded from memory. The default RAM policy for a
TimesTen database is
inUse.You can set the RAM policy before loading the database into memory. See Specifying a RAM Policy.
The following example sets the RAM policy of a TimesTen database to
manual:% ttAdmin -ramPolicy manual database1 RAM Residence Policy : manual Manually Loaded In RAM : False Replication Agent Policy : manual Replication Manually Started : False Cache Agent Policy : manual Cache Agent Manually Started : False Database state : open
- Use the
ttAdminutility to load (or reload) the database into memory, or unload the database from memory.If the RAM policy is
manualfor the databasedatabase1, then load the TimesTen database into memory with thettAdmin -ramLoadutility. The-ramLoadoption of thettAdminutility can only be used with themanualorenduringRAM policies:% ttAdmin -ramLoad database1 RAM Residence Policy : manual Manually Loaded In RAM : True Replication Agent Policy : manual Replication Manually Started : False Cache Agent Policy : manual Cache Agent Manually Started : False Database state : open
If the RAM policy is
manual, you can change it toalwaysto specify that the database is always reloaded.ttAdmin -ramPolicy always database1
If the RAM policy is
inUse, then you want the grace period to be greater than 0, so that the database will be kept in memory for that time period when idle:% ttAdmin -ramPolicy inUse -ramGrace 200 database1 RAM Residence Policy : inUse plus grace period RAM Residence Grace (Secs) : 200 Replication Agent Policy : manual Replication Manually Started : False Cache Agent Policy : manual Cache Agent Manually Started : False Database state : open
If the RAM policy is
manualfor the databasedatabase1and the database was previously closed to incoming connections, then you can both load and open the TimesTen database into memory with thettAdmin -ramload -opencommand.% ttAdmin -ramLoad -open database1 RAM Residence Policy : manual Manually Loaded In RAM : True Replication Agent Policy : manual Replication Manually Started : False Cache Agent Policy : manual Cache Agent Manually Started : False Database state : open
- If your database is configured for replication or cache for your database, run
the
ttAdminutility to start the replication and cache agents.To start the replication agent:
ttAdmin -repStart database1
To start the cache agent:
ttAdmin -cacheStart database1
See ttAdmin and ttDaemonAdmin in the Oracle TimesTen In-Memory Database Reference.