Unresponsive TimesTen Database Degrades Autorefresh Performance

Note:

Automatic recovery for TimesTen cache groups only applies to read-only and user managed cache groups that use the AUTOREFRESH cache group attribute. In this section, all references to cache groups with autorefresh are read-only and user managed cache groups that use the AUTOREFRESH cache group attribute.

If any TimesTen databases containing cache groups with autorefresh are destroyed or no longer in use, TimesTen continues to track autorefresh changes to the Oracle database tables for the TimesTen database for which the cache agent is not running. This causes automatic refresh to cache groups in active TimesTen databases to slow down.

The cache agent is responsible for detecting if a database is unresponsive or no longer in use. You can specify if and how a dead TimesTen database is to be recovered. However, you cannot recover a TimesTen database if all of the Oracle database objects have been removed.

The following sections describe how you can avoid a degraded autorefresh performance for inactive TimesTen databases:

Set Cache TimesTen Database Timeout

You can instruct TimesTen to mark the database as dead and no longer accepting updates if the cache agent has not communicated with the Oracle Database server within a specific timeout period.

Set the timeout for the TimesTen database and the recovery method for each cache group with autorefresh by setting the AgentTimeOut parameter in the ttCacheConfig built-in procedure. The timeout value applies to the all TimesTen databases that use the same cache administration user. You should set the timeout value greater than the time necessary to load the TimesTen database into memory on first connect and start the cache agent. Otherwise, the TimesTen database could be incorrectly marked as dead. For any planned maintenance for the TimesTen instance, you could temporarily set the AgentTimeOut value to zero to disable the timeout. For full details of the ttCacheConfig built-in procedure, see the ttCacheConfig in the Oracle TimesTen In-Memory Database Reference.

For example, the following sets the timeout value for the TimesTen database to 6000 seconds or 100 minutes. If the cache agent does not contact the Oracle Database server within a 100-minute period, then the TimesTen database is marked as dead.

ttIsql> call ttCacheConfig('AgentTimeOut',,,'6000');

Configure Recovery Method for Cache Groups

You can recover a TimesTen database and cache groups with autorefresh if they are not synchronizing with the Oracle database. If there is no synchronization, then updates on the Oracle database tables are not automatically refreshed to the corresponding TimesTen cache tables.

You can configure the DeadDbRecovery parameter of the ttCacheConfig built-in procedure to specify how to recover the synchronization for the TimesTen database and all cache groups with autorefresh. The setting for DeadDbRecovery applies to all TimesTen databases that use the same cache administrator user. Set the DeadDbRecovery parameter to Normal, Manual or None to describe how TimesTen is to recover the database and all cache groups with autorefresh. The DeadDbRecovery setting applies to all TimesTen databases that use the same cache administration user. While TimesTen is recovering the database and its cache groups with autorefresh, there is an autorefresh status for the TimesTen database and the cache groups with autorefresh that describes the recovery status for each of these entities. The TimesTen database can have an automatic refresh status of Alive, Dead or Recovering. The cache groups with autorefresh can have an automatic refresh status of OK, Dead or Recovering. The TimesTen database status changes are linked to changes in the status for the cache groups with autorefresh, as follows:

  • If the recovery method is set to Normal, then when TimesTen starts a full automatic refresh on an cache group with autorefresh, the cache group's status is set to Recovering and the database's status is also set to Recovering.

  • The TimesTen database's status is only set to Alive when all of the cache groups with autorefresh have either been recovered to OK or have been dropped.

  • When the database status is set to Dead, then all of its cache groups with autorefresh are also set to Dead.

Note:

You can determine the autorefresh status of the TimesTen database and cache groups with autorefresh with the ttCacheDbCgStatus built-in procedure, which is described in the ttCacheDbCgStatus in the Oracle TimesTen In-Memory Database Reference.

When communication between the cache agent and the Oracle Database server is reestablished, TimesTen determines how to recover the cache groups with autorefresh. TimesTen follows the recovery method you configured in the DeadDbRecovery parameter in the ttCacheConfig built-in procedure. This parameter can be set to one of the following:

  • Normal: This is the default. The cache groups with autorefresh will each be recovered with a full automatic refresh. After the first full refresh, the cache group is recovered and will incrementally perform autorefresh.

    The cache groups with autorefresh within the same automatic refresh interval will be transactionally consistent. Because it is a full refresh, it is not as performant as an incremental refresh.

    The autorefresh sets the status to Recovering. When the full autorefresh is completed successfully, the cache group status is set to OK.

  • Manual: You must manually refresh a cache group with autorefresh to recover it, or unload it if the cache group is dynamic.

  • None: The cache group with autorefresh will never be recovered by a TimesTen autorefresh. Drop and recreate the cache group to recover it.

The database status changes as the first cache group autorefresh status changes. If there is at least one cache group that is in the process of recovery, then the database status is set to Recovering. Once all cache groups have been recovered, the status of the TimesTen database is marked as Alive.

The following example sets the DeadDbRecovery parameter to Normal for all cache groups with autorefresh. The dead TimesTen database will be recovered when all of its cache groups with autorefresh have each been recovered with a full automatic refresh.

ttIsql> call ttCacheConfig('DeadDbRecovery',,,'Normal');

When TimesTen databases participating in an active standby pair replication scheme contains cache groups, if the autorefresh status of the active master database is Dead and the autorefresh status of the standby master database is Alive, the standby master does not automatically assume the role of the active master. The recovery requires that you manually ensure that the cache and replication agents are executing. The specifics for each situation is as follows:

Table 4-1 Recovery for cache groups involved in active standby replication pair

DeadDbRecovery Setting Active Master Standby Master Resulting Behavior

Normal

Alive

Dead

Make sure that the cache and replication agents are executing on the standby master. Once the cache agent can connect to the Oracle Database, then the status of all cache groups with autorefresh is set to Recovering. This sets the database to Recovering. Once a single cache group has received enough data to resume autorefresh, the status is set to OK. After all cache group are set to OK, the database is set to Alive.

Alternatively, you can fail the standby master and rollout a new standby master.

Normal

Dead

Alive

Make sure that the cache and replication agents are executing on the active master. Once the cache agent can connect to the Oracle Database, then the status of all cache groups with autorefresh is set to Recovering. This sets the database to Recovering. Once a single cache group has received enough data to resume autorefresh, the status is set to OK. After all cache group are set to OK, the database is set to Alive.

Alternatively, you can fail the active master, switch the standby master as the new active and then rollout a new standby master.

Normal

Dead

Dead

Make sure that the cache and replication agents are executing on both masters. Once the cache agent can connect to the Oracle Database, then the status of all cache groups with autorefresh is set to Recovering. This sets the database to Recovering. Once a single cache group has received enough data to resume autorefresh, the status is set to OK. After all cache group are set to OK, the database is set to Alive.

Alternatively, you can rollout new masters.

Manual

Alive

Dead

Make sure that the cache and replication agents are executing on the standby master. Once the cache agent can connect to the Oracle Database, then the status of all cache groups with autorefresh is set to Recovering. This sets the database to Recovering. Once a single cache group has received enough data to resume autorefresh, the status is set to OK. After all cache group are set to OK, the database is set to Alive.

Alternatively, you can fail the standby master and rollout a new standby master.

Manual

Dead

Alive

Make sure that the cache and replication agents are executing on the active master. Use a manual refresh to recover the cache groups with autorefresh on the active master. After all cache group are set to OK or have been dropped, the database is set to Alive.

Manual

Dead

Dead

Make sure that the cache and replication agents are executing on the active master. Use a manual refresh to recover the cache groups with autorefresh on the active master. After all cache group are set to OK or have been dropped, the database is set to Alive. Changes are then replicated to the standby master.

None

Alive

Dead

Mark the standby master as failed. Execute ttDestroy utility for the standby master database. Duplicate the active master by executing ttRepAdmin -duplicate utility from the active master.

None

Dead

Alive

Destroy the dead active master with the ttDestroy utility. Recover the dead active master by duplicating the standby master with the ttRepAdmin -duplicate utility.

None

Dead

Dead

Roll out new masters.