Manually Starting and Stopping the Oracle TimesTen Data Manager Daemon

This document will detail starting and stopping the Oracle TimesTen Data Manager Daemon. The document will also detail some of the TimesTen processes and tools that can be used to monitor and manage TimesTen daemon processes. If you need to install TimesTen to follow along you can use the document Oracle TimesTen In-Memory Database Installation Linux

Manually starting the daemon using ttDaemonAdmin

The TimesTen instance administrator can manually start and stop the data manager daemon using the ttDaemonAdmin utility.

[orattadmin@ora1 ~]$ ttDaemonAdmin -start
TimesTen Daemon startup OK.
[orattadmin@ora1 ~]$

Using ps we can see that main TimesTen daemon (timestend) is started along with four subdaemons (timestensubdb.)

[oracle@ora1 etc]$ ps -ef | grep timesten
911       5992     1  0 08:48 ?        00:00:00 /opt/TimesTen/tt1121/bin/timestend -initfd 13
911       5995  5992  0 08:48 ?        00:00:00 /opt/TimesTen/tt1121/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 0 -facility user
911       5998  5992  0 08:48 ?        00:00:00 /opt/TimesTen/tt1121/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 1 -facility user
911       6001  5992  0 08:48 ?        00:00:00 /opt/TimesTen/tt1121/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 2 -facility user
911       6004  5992  0 08:48 ?        00:00:00 /opt/TimesTen/tt1121/bin/timestensubd -verbose -userlog tterrors.log -supportlog ttmesg.log -id 3 -facility user
911       6008  5992  0 08:48 ?        00:00:00 /opt/TimesTen/tt1121/bin/ttcserver -verbose -userlog tterrors.log -supportlog ttmesg.log -id 4 -p 53385 -facility user -group timesten
oracle    6032  4762  0 08:48 pts/2    00:00:00 grep timesten
[oracle@ora1 etc]$

Subdaemons are spawned to perform various functions such as manage data stores, implement ageing policies on tables, checkpointing, rolling back transactions along with other required background processing for the database.

The timestend daemon spawns subdaemons dynamically as needed up the value of –maxsubs, which defaults to 50, in the ttendaemon.options file. By default the timestend daemon spawns a minimum of 4 subdaemons. This minimum number of subdaemons to spawn is controlled by the value of –minsubs, which defaults to 4, in the ttendaemon.options file.

Also started at this time is the TimesTen client/server process (ttcserver). The timestend daemon starts this one process ttcserver process by default. The ttcserver process was started because the ttendaemon.options has the –server 53385 argument.

You can verify the status of the ttcserver process with the ttStatus command.

[orattadmin@ora1 info]$ ttStatus
TimesTen status report as of Tue May  4 10:14:36 2010

Daemon pid 6225 port 53384 instance tt1121
TimesTen server pid 6239 started on port 53385
------------------------------------------------------------------------
Data store /opt/TimesTen/tt1121/info/DemoDataStore/sampledb_1121
There are no connections to the data store
Replication policy  : Manual
Cache Agent policy  : Manual
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group timesten
End of report
[orattadmin@ora1 info]$

Notice that this ttcserver process is ready to accept connections to the sampled_1121 data store but there are no connections at this time. After making a connection to the data store using ttIsql we can how the status changes with just one connection.

[orattadmin@ora1 ~]$ ttstatus
TimesTen status report as of Tue May  4 10:21:01 2010

Daemon pid 6225 port 53384 instance tt1121
TimesTen server pid 6239 started on port 53385
------------------------------------------------------------------------
Data store /opt/TimesTen/tt1121/info/DemoDataStore/sampledb_1121
There are 11 connections to the data store
Shared Memory KEY 0x060146d3 ID 458762
PL/SQL Memory KEY 0x070146d3 ID 491531 Address 0x10000000
Type            PID     Context     Connection Name              ConnID
Process         9033    0x0846fd58  sampledb_1121                     1
Subdaemon       6229    0x080f7b80  Manager                        2032
Subdaemon       6229    0x0814a510  Rollback                       2033
Subdaemon       6229    0x082134c0  Flusher                        2034
Subdaemon       6229    0x08284358  Monitor                        2040
Subdaemon       6229    0x08294d58  Deadlock Detector              2035
Subdaemon       6229    0x082e5988  Checkpoint                     2037
Subdaemon       6229    0x083365b8  Aging                          2038
Subdaemon       6229    0x083871e8  Log Marker                     2039
Subdaemon       6229    0x083d7e18  AsyncMV                        2041
Subdaemon       6229    0x083e8818  HistGC                         2036
Replication policy  : Manual
Cache Agent policy  : Manual
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group timesten
End of report
[orattadmin@ora1 ~]$

Notice how one of the subdaemons is now assigned to the data store and that subdaemon has multiple threads that each make a connection. The connection name has the name of the task in which that thread is to perform. The ttIsql connection has the name of the data store.

Manually stopping the daemon using ttDaemonAdmin

The following is the recommend procedure to shutting down TimesTen data stores.

First: Gracefully shutdown all application connections.

You can verify the connections using ttStatus.

[orattadmin@ora1 info]$ ttStatus
TimesTen status report as of Tue May  4 12:11:55 2010

Daemon pid 6225 port 53384 instance tt1121
TimesTen server pid 6239 started on port 53385
------------------------------------------------------------------------
Data store /opt/TimesTen/tt1121/info/DemoDataStore/sampledb_1121
There are 12 connections to the data store
Shared Memory KEY 0x060146d3 ID 458762
PL/SQL Memory KEY 0x070146d3 ID 491531 Address 0x10000000
Type            PID     Context     Connection Name              ConnID
Process         10065   0x09a6c520  sampledb_1121                     2
Process         9033    0x0846fd58  sampledb_1121                     1
Subdaemon       6229    0x080f7b80  Manager                        2032
Subdaemon       6229    0x0814a510  Rollback                       2033
Subdaemon       6229    0x082134c0  Flusher                        2034
Subdaemon       6229    0x08284358  Monitor                        2040
Subdaemon       6229    0x08294d58  Deadlock Detector              2035
Subdaemon       6229    0x082e5988  Checkpoint                     2037
Subdaemon       6229    0x083365b8  Aging                          2038
Subdaemon       6229    0x083871e8  Log Marker                     2039
Subdaemon       6229    0x083d7e18  AsyncMV                        2041
Subdaemon       6229    0x083e8818  HistGC                         2036
Replication policy  : Manual
Cache Agent policy  : Manual
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group timesten
End of report
[orattadmin@ora1 info]$ 

Currently there are 12 connections to the data store. 2 of the connections are application connection and the other 10 are the threads of the subdaemon. After disconnecting the two application connections the data store was unloaded and the connections from the threads of the subdaemon where closed.

[orattadmin@ora1 info]$ ttStatus
TimesTen status report as of Tue May  4 12:14:44 2010

Daemon pid 6225 port 53384 instance tt1121
TimesTen server pid 6239 started on port 53385
------------------------------------------------------------------------
Data store /opt/TimesTen/tt1121/info/DemoDataStore/sampledb_1121
There are no connections to the data store
Replication policy  : Manual
Cache Agent policy  : Manual
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group timesten
End of report
[orattadmin@ora1 info]$

Second: Shutdown replication and cache agents.

The data store used in this example does not have replication or cache agents at this time. The replication and cache agents can be shutdown in ttIsql using the ttCacheStop and ttRepStop commands. They can also be shutdown using –RepStop and –CacheStop arguments of the ttAdmin command.

Third: Unload the data store

Depending on the RAM Residence Policy for the data store simply closing all connections to the data store should be all that is needed to unload the data store. You can find the value of the RAM Residence Policy using ttAdmin .

[orattadmin@ora1 info]$ ttAdmin sampledb_1121
RAM Residence Policy            : inUse
Replication Agent Policy        : manual
Replication Manually Started    : False
Cache Agent Policy              : manual
Cache Agent Manually Started    : False
[orattadmin@ora1 info]$

Above we can see that the RAM Residence Policy for the sampledb_1121 is inUse. With a policy of inUse the data store will be unloaded after the last connection is closed. If the policy is manual you must use ttAdmin –ramunload after confirming all applications and connections are closed. If the policy is always you must first change the policy to manual or inUse using ttAdmin –rampolicy [manual|inUse] then unload using after confirming all the applications and connections are closed.

Forth: Stop the TimesTen Data Manager daemon

After verifying all connections are closed and the data store has been unloaded you can now stop the Data Manager daemon.

[orattadmin@ora1 info]$ ttDaemonAdmin -stop
TimesTen Daemon stopped.
[orattadmin@ora1 info]$

1 thought on “Manually Starting and Stopping the Oracle TimesTen Data Manager Daemon”

  1. Thank you very much for such a nice article about TimesTen internals, very much useful to understand the Timesten processes.

Leave a Reply

Your email address will not be published. Required fields are marked *