Skip Headers
Oracle® TimesTen In-Memory Database Operations Guide
Release 11.2.1

Part Number E13065-08
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

3 Working with the Oracle TimesTen Data Manager Daemon

The Oracle TimesTen Data Manager daemon, which is the Oracle TimesTen Data Manager service on Windows, starts when TimesTen is installed. The daemon operates continually in the background.

The TimesTen daemon performs the following functions:

Application developers do not interact with the daemon directly. No application code runs in the daemon and application developers do not generally have to be concerned with it. Application programs that access TimesTen databases communicate with the daemon transparently using TimesTen internal routines.

The following sections discuss interaction with the TimesTen daemon on various platforms:

Starting and stopping the Oracle TimesTen Data Manager service on Windows

The Oracle TimesTen Data Manager service starts when you install the Oracle TimesTen Data Manager on your Windows system. To manually start and stop the Oracle TimesTen Data Manager service, you can use the ttDaemonAdmin utility with the -start or -stop option, or the Windows Administrative Tools as follows:

  1. Open Administrative Tools:

    On Windows 2000 and XP, choose Start > Settings >Control Panel > Administrative Tools.

  2. Double-click Services. All currently available services are displayed.

  3. Select TimesTen Data Manager 11.2.1, then click the appropriate button to stop or start the service.

Note:

You must have administrative privileges to start and stop the TimesTen service.

Starting and stopping the daemon on UNIX

You must be the instance administrator to start and stop the TimesTen daemon.

The instance administrator must manually start and stop the daemon, after each system reboot, unless the setuproot script has been run. To manually start and stop the TimesTen main daemon, you can use the ttDaemonAdmin utility with the -start or -stop option.

User root can start the daemon by executing the daemon startup script. The following table shows the location of the daemon startup script by platform.

Platform Location of daemon startup script
Linux /etc/init.d/tt_instance_name
Solaris /etc/init.d/tt_instance_name
HP-UX /sbin/init.d/tt_instance_name
AIX /etc/init.d/tt_instance_name

Shutting down a TimesTen application

A TimesTen application consists of a database that has been allocated shared memory, user connections, and possibly replication and cache agents for communication with other TimesTen or Oracle databases.

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

  1. Disconnect all user connections gracefully.

  2. Shut down all replication and cache agents.

  3. Unload the database from shared memory if it was manually loaded.

  4. Stop the TimesTen daemon.

Managing TimesTen daemon options

The ttendaemon.options file contains TimesTen daemon options. During installation, the installer sets some of these options to correspond to your responses to the installation prompts.

On Windows, the ttendaemon.options file is located in the directory:

install_dir\srv\info

On UNIX, the ttendaemon.options file is located in the directory:

install_dir/info/ 

The features that the ttendaemon.options file controls are as follows:

Use the ttmodinstall utility to make changes to the ttendaemon.options file for most commonly changed options. See "ttmodinstall" in Oracle TimesTen In-Memory Database Reference. If you cannot use ttmodinstall to change a particular option and must modify the ttendaemon.options file directly, stop the TimesTen daemon before you change the file. Restart the TimesTen daemon after you have finished changing the file. To change TimesTen Server options, it is only necessary to stop the server. It is not necessary to stop the TimesTen daemon.

The rest of this section includes the following topics:

Determining the daemon listening address

By default, the TimesTen main daemon, all subdaemons and agents listen on a socket for requests, using any available address. All TimesTen utilities and agents use the loopback address to talk to the main daemon, and the main daemon uses the loopback address to talk to agents.

The -listenaddr entry in a separate line in the ttendaemon.options file tells the TimesTen daemons to listen on the specific address indicated in the value supplied. The address specified with this option can be either a host name or a numerical IP address.

The -listenaddr parameter exists for situations where a server has multiple network addresses and multiple network cards. In this case it is possible to limit the network addresses on which the TimesTen daemon is listening to a subset of the server's network addresses. This is done by making entries only for those addresses on which the daemon listens. These possibilities exist:

  • Given a situation where a server has a "public" network address that is accessible both inside and outside the local network and a "private" address that is accessible only within the local network, adding a -listenaddr entry containing only the private address blocks all communications to TimesTen coming on the public address.

  • By specifying only the local host, the TimesTen main daemon can be cut off from all communications coming from outside the server and communicate only with local clients and subdaemons.

There is no relationship between TimesTen replication and the -listenaddr parameter and there is no requirement for enabling the -listenaddr parameter when replication is enabled. If replication is going to be used in an environment where -listenaddr is enabled, then the replication nodes need to know the allowable network addresses to use. However, if no -listenaddr parameter is enabled replication still works.

To explicitly specify the address on which the daemons should listen on a separate line in the ttendaemon.options file, enter:

-listenaddr address

For example, if you want to restrict the daemon to listen to just the loopback address, you say either:

-listenaddr 127.0.0.1

or

-listenaddr localhost

This means that only processes on the local machine can communicate with the daemon. Processes from other machines would be excluded, so you would not be able to replicate to or from other machines, or grant client access from other machines.

If you have multiple ethernet cards on different subnets, you can specify -listenaddr entries to control which machines can connect to the daemon.

You can enter up to four addresses on which to listen by specifying the option and a value on up to four separate lines in the ttendaemon.options file. In addition to the addresses you specify, TimesTen always listens on the loopback address.

Listening on IPv6

By default, TimesTen uses the IPv4 protocol. To enable the daemon to listen on IPv6, you must enter on a separate line in the ttendaemon.options file:

-enableIPv6

and

-listenaddr6 address
  • You can specify an IPv6 address with the -listenaddr6 option to enable IPv6.

  • Specifying the -enableIPv6 option with one or more -listenaddr or -listenaddr6 options adds the IPv6 loopback interface to the list.

  • If you specify the -enableIPv6 option without specifying any addresses with the -listenaddr or -listenaddr6 options, then the daemon listens on any IPv6 interface as well as any IPv4 interface.

The address specified with this option can be either a host name or a numerical IP address. See "Determining the daemon listening address" for specifics on the -listenaddr option

If one or more -listenaddr options are provided, the daemons listen on the specified IPv4 interfaces, with the IPv4 loopback address being added to the list if not specified. If only -enableIPv6 is specified, the daemons listen on both the IPv4 ANY interface and the IPv6 ANY interface.

You can specify both -listenaddr and -listenaddr6 options. If you specify one or more -listenaddr6 options, the daemons listen on the specified IPv4 or IPv6 interfaces, with both the IPv4 and IPv6 loopback interfaces being added if not specified. If the name resolver returns multiple IPv4 and/or IPv6 addresses for a name, the daemons listen on all of the names.

Modifying informational messages

As the daemon operates, it generates error, warning and informational messages. These messages may be useful for TimesTen system administration and for debugging applications.

By default, informational messages are stored in the following:

  • A user error log that contains information you may need to see. Generally, these messages contain information on actions you may need to take.

  • A support log containing everything in the user error log plus information of use by TimesTen Customer Support.

The following options specify the locations and size of the support and user logs, as well as the number of files to keep stored on your system.

Option Description
-supportlog path -f path Specifies the location for the support log file. The default file is daemon_home/ttmesg.log
-maxsupportlogfiles num The TimesTen main daemon automatically rotates the files once they get to a specific size. This option specifies the number of support log files to keep. The default is 10.
-maxsupportlogsize nBytes Specifies the maximum size of the support log file. The default is 10 MB.
-userlog logfile

or

-userlog [syslog]

Specifies the location and name of the user log file. The default file is daemon_home/tterrors.log.

You may specify [syslog] on UNIX systems as the path or the Event Log on Windows, in which case the output is sent to the system [syslog] or Event Log.

-maxuserlogfiles num The TimesTen main daemon automatically rotates the files once they get to a specific size. This option specifies the number of user log files to keep. The default is 10.
-maxuserlogsize nBytes Specifies maximum size of the user log. Default is 1MB.
-showdate On UNIX systems only, indicates that the date should be prepended to all messages

If you have specified the Event Log as the location for your log messages, to view them follow these steps:

  1. Open the Event Viewer window on your Windows Desktop.

  2. From the Log menu, choose Application.

    The window changes to display only log messages generated by applications. Any messages with the word "TimesTen" in the "Source" column were generated by the Oracle TimesTen Data Manager service.

  3. To view any TimesTen message, double-click the message summary.

    The message window is displayed. You can view additional messages by clicking Next , Previous, up or down arrows, depending on your version of Windows.

Note:

You can also view messages using the ttDaemonLog utility.

To specify the syslog facility used to log TimesTen daemon and subdaemon messages on UNIX, on a separate line of the ttendaemon.options file add:

-facility name

Possible name values are: auth, cron, daemon, local0-local7, lpr, mail, news, user, or uucp.

To turn off detailed log messages, add a # before -verbose in the ttendaemon.options file.

Changing the allowable number of subdaemons

TimesTen uses subdaemons to perform the following:

  • Manage databases.

  • Flush the transaction log buffer to disk.

  • Perform periodic checkpoints.

  • Implement the aging policies of various tables.

  • Find and break deadlocks.

  • Rollback transactions for abnormally terminated direct-mode applications.

  • Perform required background processing for the database.

The main TimesTen daemon spawns subdaemons dynamically as they are needed. You can manually specify a range of subdaemons that the daemon may spawn, by specifying a minimum and maximum.

At any point in time, one subdaemon is potentially needed for TimesTen process recovery for each failed application process that is being recovered at that time.

By default, the maximum number of subdaemons is 50.

By default, TimesTen spawns a minimum of 4 subdaemons. However, you can change these settings by assigning new values to the -minsubs and -maxsubs options in the ttendaemon.options file.

Allowing database access over NFS-mounted systems

By default, TimesTen systems cannot access data across NFS-mounted systems. On Linux x86 64-bit systems, you can access checkpoint and transaction log files on NFS-mounted systems.

To enable data access on NFS-mounted systems, on a separate line of the ttendaemon.options file, add:

-allowNetworkFiles

Note:

TimesTen does not support the storage of trace files or user and support logs across NFS-mounted systems

Enabling Linux large page support

To enable Linux large page support on TimesTen, on a separate line of the ttendaemon.options file, add:

-linuxLargePageAlignment Size_in_MB

The Size_in_MB is the Hugepagesize value in /proc/meminfo, specified in MB instead of KB.

Shared memory daemon option for HP-UX ccNUMA systems

HP-UX ccNUMA systems have non-uniform memory latency depending on the data location. Accessing data in a remote cell takes longer than accessing data in a local cell. To ensure the best results for TimesTen operations, set the IPC_MEM_LOCAL and confine the TimesTen processes to the local cell.

To set the locality hint for the shared memory segment, on a separate line of the ttendaemon.options file, add:

-shmLocalityHint locality_hint

Legal values for locality_hint are:

  • IPC_MEM_LOCAL

  • IPC_MEM_INTERLEAVED

  • IPC_MEM_FIRST_TOUCH

  • IPC_MEM_STRIPED

Only one value string can be specified at a time. If specified, TimesTen attempts to create the shared memory segment for all databases in the instance with the appropriate locality hint.

Note:

This option only takes effect if the instance administrator has permission to access the memory resource.

The semantics of the hints are described in the man page for shmget. The default behavior is to create the segment without the hint. Expect the default behavior if the daemon option is not specified or if it is specified incorrectly. To see whether a segment has been created with the hint, use the HP-UX pstat facility. See the HP-UX man page for pstat.

Managing TimesTen Client/Server options

This section includes the following topics:

Modifying the TimesTen Server options

The TimesTen Server is a child process of the TimesTen daemon that operates continually in the background. To modify the TimesTen Server options, you must:

  1. Stop the TimesTen Server.

  2. Modify the options in the ttendaemon.options file as described in the following sections.

  3. Restart the TimesTen Server.

Controlling the TimesTen Server

The -server portno entry in a separate line in the ttendaemon.options file tells the TimesTen daemon to start the TimesTen Server and what port to use. The portno is the port number on which the server will listen.

If the TimesTen Server is installed, you can enable or disable the TimesTen Server:

  • To enable the TimesTen Server, remove the comment symbol '#' in front of the -server portno entry.

  • To disable the TimesTen Server, add a comment symbol '#' in front of the -server portno entry.

Prespawning TimesTen Server processes

Each TimesTen Client connection requires one server process. By default, a server process is spawned when a client requests a connection.

You can prespawn a pool of reserve server processes, making them immediately available for a client connection, thus improving client/server connection performance.

The -serverpool number entry in a separate line in the ttendaemon.options file on the Server machine tells the TimesTen Server to create number processes. If this option is not specified, no processes are prespawned and kept in the reserve pool.

When a new connection is requested, if there are no items in the server pool, a new process is spawned, as long as you have not met the operating system limit.

If you request more process than allowed by your operating system, a warning is returned. Regardless of the number of processes requested, an error does not occur unless a client requests a connection when no more are available on the system, even if there are no processes remaining in the reserve pool.

Changes to the TimesTen Server take effect when the Server is restarted.

Specifying multiple connections to the TimesTen Server

By default, TimesTen creates only one connection to a Server for each child process. You can set multiple connects to a single TimesTen Server, either by using the Server connection attributes described in the Oracle TimesTen In-Memory Database Reference or by setting the TimesTen daemon options described in this section. These options enable you to set the number of connections to a TimesTen Server, the number of servers for each DSN and the size of each connection to the server.

Note:

In the case that you have set both the Server connection attributes and these daemon options, the value of the Server connection attributes takes precedence.

Configuring the maximum number of client connections per child server process

To run a child server process in multithreaded mode so that a single server process can service multiple client connections to a database, add the following line to the ttendaemon.options file:

-maxConnsPerServer NumberOfClientConnections

The possible values of NumberOfClientConnections range from 1 to 2047, inclusive. The default value is 1, which indicates that the child server process runs in multi-process mode and, therefore, can service only one client connection.

Configuring the desired number of child server processes spawned for a server DSN

To specify the desired number of child server processes to be spawned for a particular server DSN, add the following line to the ttendaemon.options file:

-serversPerDSN NumberOfChildServerProcesses

The possible values of NumberOfChildServerProcesses range from 1 to 2047, inclusive. The default value is 1.

Client connections to a particular server DSN are evenly distributed in round-robin fashion to the child server processes that are spawned and assigned to the DSN. The number of child server processes assigned to the server DSN is greater than NumberOfChildServerProcesses if the number of client connections to the DSN is greater than the maximum number of client connections per child server process multiplied by the desired number of child server processes spawned for a server DSN.

Configuring the thread stack size of the child server processes

To set the size of the child server process thread stack for each client connection, add the following line to the ttendaemon.options file:

-serverStackSize ThreadStackSize

ThreadStackSize is specified in KB. The default is 128 KB on 32-bit systems and 256 KB on 64-bit systems. The ThreadStackSize setting is ignored if the maximum number of client connections per child server process is 1 because the sole client connection will be serviced by the main thread of the child server process.

Note:

These changes to the TimesTen Server do not occur until the TimesTen daemon is restarted.

Using shared memory for Client/Server IPC

By default, TimesTen uses TCP/IP communication between applications linked with the TimesTen Client driver and the TimesTen Server.

Where the client application resides on the same machine as the TimesTen Server, you can alternatively use shared memory for the inter-process communication (IPC).

This can be useful for performance purposes or to allow 32-bit client applications to communicate with a 64-bit database on the server. Before using shared memory as IPC verify that you have configured your system correctly. See "Installation prerequisites" in Oracle TimesTen In-Memory Database Installation Guide.

The -serverShmIpc entry in a separate line in the ttendaemon.options file tells the TimesTen Server to accept a client connection that intends to use a shared memory segment for IPC.

If this entry is missing, add this line to the ttendaemon.options file to start the TimesTen Server with shared memory IPC capability when the TimesTen daemon is restarted.

If the entry exists, add the # symbol before the line in the ttendaemon.options file to comment it out. The TimesTen Server is no longer started with shared memory IPC capability when the TimesTen daemon starts.

Note:

TimesTen supports a maximum of 16 different instances of the shared memory IPC-enabled server. If an application tries to connect to more than 16 different shared memory segments it receives an ODBC error.

Managing the size of the shared memory segment

The -serverShmSize size entry in a separate line in the ttendaemon.options file tells the TimesTen Server to create a shared memory segment of the specified size in MB.

If this entry is missing, the TimesTen Server creates a shared memory segment of 64MB.

An appropriate value for the shared memory segment depends on:

  • The expected number of concurrent client/server connections to all databases that belong to an instance of the TimesTen Server.

  • The number of concurrent allocated statements within each such connection.

  • The amount of data being transmitted for a query.

Some guidelines for determining the size of the shared memory segment include:

  • The maximum size allowed is 1 gigabyte.

  • TimesTen needs 1 MB of memory for internal use.

  • Each connection needs a fixed block of 16 KB.

  • Each statement starts with a block of 16 KB for the IPC. But this size is increased or decreased depending upon the size of the data being transmitted for a query. TimesTen increments the statement buffer size by doubling it and decreases it by halving it.

For example, if the user application anticipates a max of 100 simultaneous shared-memory-enabled client/server connections, and if each connection is anticipated to have a maximum of 50 statements, and the largest query returns 128 KB of data, use this formula to configure the serverShmSize:

serverShmSize = 1 MB + (100 * 16) KB + (100 * 50 * 128) KB
              = 1 MB + 2 MB + 625 MB = 628 MB

This is the most memory required for this example. The entire memory segment would be used only if all 100 connections have 50 statements each and each statement has a query that returns 128 KB of data in a row of the result.

In this example, if you configured the serverShmSize to 128 MB, either a new shared-memory-enabled client/server connection is refused by the TimesTen Server or a query may fail due to lack of resources within the shared memory segment.

Changing the size of the shared memory segment

Once configured, to change the value of the shared memory segment you must stop the TimesTen Server. Stopping the server detaches all existing client/server connections to any database that is associated with that instance of the TimesTen Server. The steps for modifying the value of the -serverShmSize option are:

  1. Modify the value of -serverShmSize in the ttendaemon.options file.

  2. Use the ttDaemonAdmin utility to restart the TimesTen Server. Only the instance administrator can restart the TimesTen Server.

Controlling the TimesTen Server log messages

The -noserverlog entry in a separate line in the ttendaemon.options file tells the TimesTen daemon to turn off logging of connects and disconnects from the client applications.

If the TimesTen Server is installed, you can enable or disable logging of connect and disconnect messages by:

  • To enable logging, add a comment symbol '#' before the -noserverlog entry.

  • To disable logging, remove the comment symbol '#' before the -noserverlog entry.