Timesten - Start/Stop a database

> Database > (TimesTen|TT) (In-Memory Database|IMDB)

1 - About

The concept of starting and stopping a TimesTen in-memory database is different from that of a disk-based RDBMS. For TimesTen, a database is ready for use by an application after the database is loaded into memory.

3 - Start

3.1 - Manual

  • Start the daemon

Before you can connect to a TimesTen database, the TimesTen main daemon process needs to be started with the ttDaemonAdmin utility

  • Set a ram policy

The database resides in memory until the last connection disconnects, which automatically unloads the database from memory unless a RAM policy was set to keep the database loaded.

  • Load the database in-memory

Checkpoint files are used to load the database to memory. The first connection to a TimesTen database triggers the loading of the database to memory. Before unloading a database, a final checkpoint is performed.

Advertising

3.2 - Boot

If you want the TimesTen instance to start each time the computer is rebooted, log in as user root, and run the setuproot script as root.

The setuproot script is located in the install_dir/bin directory:

# cd install_dir/bin
# setuproot -install

Syntax:

setuproot [-install] [-uninstall] [-help] [-verbose]\n";

where:

  • -install: Install TimesTen daemon startup scripts
  • -uninstall: Un-install TimesTen daemon startup scripts
  • -help: Display this help message
  • -verbose: Display extra installation/uninstallation information

The shutdown and startup script is in the directory TIMESTEN_BASE\startup. This file must reside on Linux in /etc/rc.d/init.d. In this script, if RUN_TIMESTEND is zero, it suppresses the execution of the daemon at boot time.

4 - Stopping

To shut down a TimesTen application, complete the following tasks:

  • Disconnect all user connections gracefully.
  • Shut down all replication and cache agents.
  • Unload the database from shared memory if it was manually loaded.
  • Stop the daemon with the ttDaemonAdmin utility.

ttDaemonAdmin will gracefully shutdown a TimesTen database, disconnect all applications and agent processes from the database.

Advertising