3 Built-In Procedures

TimesTen built-in procedures extend standard ODBC and JDBC functionality. You can invoke these procedures using the ODBC or JDBC procedure call interface. The procedure takes the position of the SQL statement, as illustrated in the following examples.

The following ODBC SQLExecDirect call invokes the ttOpsSetFlag built-in procedure to tell the optimizer that it should not generate temporary hash indexes when preparing commands:

SQLExecDirect (hstmt, (SQLCHAR*)
       "{CALL ttOptSetFlag ('TmpHash', 0)}", SQL_NTS);

This is the equivalent JDBC call:

CallableStatement cstmt = con.prepareCall 
          ("{CALL ttOptSetFlag ('TmpHash', 0)}");
cstmt.execute();

TimesTen built-in procedures can also be called from PL/SQL using the EXECUTE IMMEDIATE statement with CALL, as illustrated in the following example. See "Dynamic SQL in PL/SQL (EXECUTE IMMEDIATE statement)" in the Oracle TimesTen In-Memory Database PL/SQL Developer's Guide for more details on this statement.

TimesTen built-in procedures that return result sets are not supported directly through OCI. You can use PL/SQL for this purpose. For an example, see "Use of PL/SQL in OCI to call a TimesTen built-in procedure" in the Oracle TimesTen In-Memory Database C Developer's Guide.

For example, to call the built-in procedure ttConfiguration, create a PL/SQL record type and then SELECT INTO that record type. Because ttConfiguration returns multiple rows, use BULK COLLECT.

Command> DECLARE
            TYPE ttConfig_record IS RECORD
              (name varchar2(255), value varchar2 (255));
           TYPE ttConfig_table IS TABLE OF ttConfig_record;
         v_ttConfigs ttConfig_table;
         BEGIN
          EXECUTE IMMEDIATE  'CALL ttConfiguration'
           BULK COLLECT into v_ttConfigs;
          DBMS_OUTPUT.PUT_LINE ('Name: ' || v_ttConfigs(1).name
            || ' Value: ' || v_ttConfigs(1).value);
         end;
         /
 
PL/SQL procedure successfully completed.

You can also call built-in procedures from the ttIsql command line:

Command> call ttDBCompactConfig(2000,5,2000);
< 2000, 5, 2000 >
1 row found.

Note:

String parameter values for built-in procedures must be single-quoted as indicated in these examples, unless the value is NULL.

List of built-in procedures

This section lists the built-in procedures available in TimesTen

Table 3-1 TimesTen built-in procedures

Built-in Name Description TimesTen Classic Support TimesTen Scaleout Support

ttAgingLRUConfig

Sets the Least Recently Used (LRU) aging attributes on all regular tables that have been defined with an LRU aging policy.

Yes

No

ttAgingScheduleNow

Starts the aging process

Yes

No

ttApplicationContext

Sets application-defined context for the next update record to pass application specific data to XLA readers.

Yes

No

ttBackupStatus

Returns information about the current or last backup of the database.

Yes

Yes

ttBlockInfo

Provides information about perm blocks and the amount of block-level fragmentation in a database.

Yes

Yes

ttBookmark

Returns information about the TimesTen transaction log.

Yes

Yes

ttCacheADGStandbyStateGet

Returns the state for the standby Oracle database in an Active Data Guard configuration.

Yes

No

ttCacheADGStandbyStateSet

Sets the state of the standby Oracle database in an Active Data Guard configuration.

Yes

No

ttCacheADGStandbyTimeoutGet

Retrieves the timeout value of the Oracle database in an Active Data Guard configuration.

Yes

No

ttCacheADGStandbyTimeoutSet

Sets the timeout value of the standby Oracle database in an Active Data Guard configuration.

Yes

No

ttCacheAllowFlushAwtSet

Enables you to execute a FLUSH CACHE GROUP statement on an AWT cache group.

Yes

No

ttCacheAutorefIntervalStatsGet

Returns statistical information about the last 10 autorefresh cycles for a specified autorefresh interval.

Yes

No

ttCacheAutorefresh

Starts an immediate autorefresh on a set of cache groups.

Yes

No

ttCacheAutorefreshLogDefrag

Compacts the trigger log space for a cache autorefresh table.

Yes

No

ttCacheAutorefreshStatsGet

Returns information about the last 10 autorefresh transactions on the specified cache group.

Yes

No

ttCacheAutorefreshSelectLimit

Configures the incremental autorefresh on a specific number of rows.

Yes

No

ttCacheAutorefreshXactLimit

Starts an immediate autorefresh on single table cache groups within a specified autorefresh interval and commits after the specified number of operations.

Yes

No

ttCacheAWTMonitorConfig

Sets AWT cache group monitoring.

Yes

No

ttCacheAWTThresholdGet

Returns the current transaction log file threshold for databases that include AWT cache groups.

Yes

No

ttCacheAWTThresholdSet

Sets the threshold for the number of transaction log files that can accumulate before AWT is considered terminated or too far behind to catch up.

Yes

No

ttCacheCheck

Checks for missing constraints for cached tables on the Oracle database

Yes

No

ttCacheConfig

Configures timeout value and recovery policies for cache groups.

Yes

No

ttCacheConnPoolApply

Applies the cache connection pool settings.

Yes

No

ttCacheConnPoolGet

Retrieves the cache connection pool settings.

Yes

No

ttCacheConnPoolSet

Configures the cache connection pool for dynamic cache groups.

Yes

No

ttCacheDbCgStatus

Returns the automatic refresh status of the database and the specified cache group.

Yes

No

ttCacheDDLTrackingConfig

Configures tracking of DDL statements issued on cached Oracle database tables.

Yes

No

ttCachePolicyGet

Returns the current policy used to determine when the TimesTen cache agent for the connected database should run.

Yes

No

ttCachePolicySet

Sets the policy used to determine when the TimesTen cache agent for the connected database should run.

Yes

No

ttCachePropagateFlagSet

Configures propagation of committed updates to a cache group within the current transaction to the Oracle database.

Yes

No

ttCacheSqlGet

Generates the Oracle SQL statements to install or uninstall Oracle database objects for certain types of cache groups.

Yes

No

ttCacheStart

Starts the TimesTen cache agent.

Yes

No

ttCacheStop

Stops the TimesTen cache agent.

Yes

No

ttCacheUidGet

Returns the cache administration user ID.

Yes

No

ttCacheUidPwdSet

Sets the cache administration user ID and password.

Yes

No

ttCkpt

Performs a non-blocking checkpoint operation.

Yes

No

ttCkptBlocking

Performs a blocking checkpoint operation.

Yes

No

ttCkptConfig

Reconfigures the background checkpointer dynamically or returns the currently active settings of the configuration parameters.

Yes

No

ttCkptHistory

Returns information about the last eight checkpoints.

Yes

No

ttCommitBufferStats

Returns the number of commit buffer overflows and the high watermark for memory used by transaction reclaim records during transaction commit process.

Yes

Yes

ttCommitBufferStatsReset

Resets transaction commit buffer statistics to 0.

Yes

No

ttCompact

Compacts both the permanent and temporary data partitions of the database.

Yes

No

ttComputeTabSizes

Refreshes table size statistics stored in TimesTen system tables.

Yes

Yes

ttConfiguration

Returns the values for most, but not all, connection attributes for the current database connection.

Yes

Yes

ttContext

Returns the context value of the current connection.

Yes

Yes

ttDataStoreStatus

Returns the list of processes connected to a database.

Yes

Yes

ttDBCompactConfig

Sets or returns the value of a TimesTen database system parameter.

Yes

Yes

ttDBConfig

Sets or returns the value of a TimesTen database system parameter.

Yes

Yes

ttDBWriteConcurrencyModeGet

Returns information about the write concurrency mode of the database and the status of write concurrency mode operations and transitions.

Yes

No

ttDBWriteConcurrencyModeSet

Controls read optimization during periods of concurrent write operations.

Yes

No

ttDistributionProgress

Returns a progress report of an ongoing redistribution process.

No

Yes

ttDurableCommit

Sets transaction durability.

Yes

Yes

ttEpochCreate

Causes the next committed transaction in a grid to commit as an epoch transaction.

No

Yes

ttEpochSessionGet

Returns the epoch identifier of the last epoch created by the current connection.

No

Yes

ttHeapInfo

Returns information about the size and usage of heap memory.

Yes

Yes

ttHostNameGet

Returns the name of the current local host.

Yes

No

ttHostNameSet

Specifies the name of the default local host

Yes

No

ttIndexAdviceCaptureDrop

Drops existing capture data for either the current connection

Yes

Yes

ttIndexAdviceCaptureEnd

Ends either an active connection level capture from the current connection or an active database level capture

Yes

Yes

ttIndexAdviceCaptureInfoGet

Returns information for each active capture.

Yes

Yes

ttIndexAdviceCaptureOutput

Returns index recommendations from the last recorded capture at the specified level.

Yes

Yes

ttIndexAdviceCaptureStart

Enables index advice capture.

Yes

Yes

ttLatchStatsGet

Displays latch statistics.

Yes

Yes

ttLoadFromOracle

Executes a query on the Oracle database and loads the result into a TimesTen table.

Yes

Yes

ttLockLevel

Changes the lock level between row-level and database-level locking on the next transaction and for all subsequent transactions for the connection.

Yes

Yes

ttLockWait

Changes the lock timeout interval of the current connection.

Yes

Yes

ttLogHolds

Returns information about transaction log holds

Yes

Yes

ttMonitorHighWaterReset

Changes the value of the PERM_IN_USE_HIGH_WATER column in the MONITOR system table to the value of the PERM_IN_USE_SIZE and sets the value of the TEMP_IN_USE_HIGH_WATER column to the current value of TEMP_IN_USE_SIZE column.

Yes

Yes

ttOptClearStats

Clears the statistics for the specified table.

Yes

Yes

ttOptCmdCacheInvalidate

Forces a recompilation should a dependent command be invoked again, or removes the command from the cache. It must be re-prepared by the user.

Yes

Yes

ttOptEstimateStats

Updates the statistics for the specified table.

Yes

Yes

ttOptGetColStats

Returns statistics information in text format.

Yes

Yes

ttOptGetFlag

Returns the optimizer flag settings for the current transaction.

Yes

Yes

ttOptGetMaxCmdFreeListCnt

Returns the size of the free list of SQL compiled command cache.

Yes

Yes

ttOptGetOrder

Returns a single-row result set containing the join order for the current transaction.

Yes

Yes

ttOptSetColIntvlStats

Modifies the statistics for the specified columns with interval information.

Yes

Yes

ttOptSetColStats

Modifies the statistics for the specified columns.

Yes

Yes

ttOptSetFlag

Sets flags to alter the generation of execution plans by the TimesTen query optimizer.

Yes

Yes

ttOptSetMaxCmdFreeListCnt

Sets the maximum count of the free list of SQL compiled commands for regular tables.

Yes

Yes

ttOptSetMaxPriCmdFreeListCnt

Sets the maximum count of the free list of SQL compiled commands that perform materialized view maintenance.

Yes

Yes

ttOptSetOrder

Specifies the order in which tables should be joined by the optimizer.

Yes

Yes

ttOptSetTblStats

Modifies the statistics for the specified table.

Yes

Yes

ttOptShowJoinOrder

Returns the join order of the last prepared or executed SQL statement in the current transaction.

Yes

Yes

ttOptStatsExport

Returns the set of statements required to restore the table statistics to the current state.

Yes

Yes

ttOptUpdateStats

Updates the statistics for the specified table.

Yes

Yes

ttOptUseIndex

Alters the generation of execution plans by the TimesTen query optimizer.

Yes

Yes

ttPLSQLMemoryStats

Returns result statistics about PL/SQL library cache performance and activity.

Yes

Yes

ttRamPolicyAutoReloadGet

Returns the RAM autoreload policy used to determine if a database is reloaded into RAM after an invalidation.

Yes

No

ttRamPolicyAutoReloadSet

Determines the RAM autoreload policy if a database is invalidated.

Yes

No

ttRamPolicyGet

Returns the RAM policy used to determine when a database is loaded into memory.

Yes

No

ttRamPolicySet

Defines the policy used to determine when a database is loaded into memory.

Yes

No

ttRedundantIndexCheck

Scans tables to find redundant indexes.

Yes

Yes

ttRepDeactivate

Changes the state of the active database in an active standby pair from ACTIVE to IDLE.

Yes

No

ttReplicationStatus

Returns the status of one or more replication peer databases.

Yes

No

ttRepPolicyGet

Returns the replication restart policy

Yes

No

ttRepPolicySet

Specifies the replication restart policy

Yes

No

ttRepQueryThresholdGet

Returns the number of seconds that was most recently specified as the query threshold for the replication agent.

Yes

No

ttRepQueryThresholdSet

specifies the number of seconds that a query can be executed by the replication agent before TimesTen writes a warning to the daemon log.

Yes

No

ttRepStart

Starts the TimesTen replication agent for the connected database.

Yes

No

ttRepStateGet

Returns the current replication state of a database in an active standby pair.

Yes

No

ttRepStateSave

Saves the state of a remote peer database in an active standby pair to the currently connected database.

Yes

No

ttRepStateSet

Sets the replication state of a database in an active standby pair replication scheme.

Yes

No

ttRepStop

Stops the TimesTen replication agent for the connected database.

Yes

No

ttRepSubscriberStateSet

Changes a replicating subscriber's state with respect to the executing master store.

Yes

No

ttRepSubscriberWait

Causes the caller to wait until all transactions that committed before the call have been transmitted to the subscriber.

Yes

No

ttRepSyncGet

Returns static attributes associated with the caller's use of the replication- based return service.

Yes

No

ttRepSyncSet

Sets static attributes associated with the caller's use of the replication-based return service.

Yes

No

ttRepSyncSubscriberStatus

Queries a subscriber database in a replication scheme configured with a return service and a RETURN DISABLE failure policy to determine whether return service blocking for the subscriber has been disabled by the failure policy.

Yes

No

ttRepTransmitGet

Returns the status of transmission of updates to subscribers for the current transaction.

Yes

No

ttRepTransmitSet

Updates on the connection it is executed in from being replicated to any subscriber.

Yes

No

ttRepXactStatus

Checks the status of a RETURN RECEIPT or RETURN TWOSAFE replication transaction.

Yes

No

ttRepXactTokenGet

Returns a token for RETURN RECEIPT or RETURN TWOSAFE replication transactions.

Yes

No

ttSetUserColumnID

Sets the value for the user-specified column ID.

Yes

No

ttSetUserTableID

Sets the value of the user table ID.

Yes

No

ttSize

Estimates the size of a table or view and the size of indexes.

Yes

Yes

ttSQLCmdCacheInfo

Returns information about all prepared SQL statements in the TimesTen SQL command cache.

Yes

Yes

ttSQLCmdCacheInfoGet

Returns information about the commands in the TimesTen SQL command cache.

Yes

Yes

ttSQLCmdQueryPlan

Returns all detailed runtime query plans for SQL statements in the TimesTen SQL command cache.

Yes

Yes

ttSQLExecutionTimeHistogram

Returns a histogram of SQL execution times.

Yes

Yes

ttStatsConfig

Controls statistics collection and parameters for the ttStats utility.

Yes

Yes

ttStatsConfigGet

Returns parameters of the ttStats utility that you can set with the ttStatsConfig built-in procedure.

Yes

Yes

ttTableSchemaFromOraQueryGet

Evaluates a SELECT query on a table in an Oracle database and generates a CREATE TABLE SQL statement that you can choose to execute.

Yes

Yes

ttVersion

Returns TimesTen release information.

Yes

Yes

ttWarnOnLowMemory

Specifies that operations executed on the current connection should return a warning if they allocate memory and find that memory is low.

Yes

Yes

ttXactIdGet

Returns transaction ID information for interpreting lock messages.

Yes

Yes

ttXlaBookmarkCreate

Creates the specified bookmark.

Yes

No

ttXlaBookmarkDelete

Deletes the specified bookmark.

Yes

No

ttXlaSubscribe

Configures persistent XLA tracking of a table.

Yes

No

ttXlaUnsubscribe

Stops persistent XLA tracking of a table.

Yes

No


ttAgingLRUConfig

Description

This procedure sets the Least Recently Used (LRU) aging attributes on all regular tables that have been defined with an LRU aging policy. LRU aging enables you to maintain the amount of memory used in a TimesTen database within a specified threshold by deleting the least recently used data. Data is removed if the database space in-use exceeds the specified threshold values.

For cache groups, LRU aging is defined at the root table for the entire cache instance. LRU aging can be defined for all cache group types except for explicitly loaded autorefresh cache groups. LRU aging is defined by default on dynamic cache groups. For explicitly loaded cache groups, use time-based aging.

For cache tables, the aging policy is defined on the root table but applies to all tables in the cache group. The aging policy is defined on tables when they are created or altered, using the CREATE TABLE or ALTER TABLE SQL statements.

Required privilege­­

This procedure requires no privilege to query the current values. It requires the ADMIN privilege to change the current values.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttAgingLRUConfig([LowUsageThreshHold],
[HighUsageThreshHold], [AgingCycle])

Parameters

ttAgingLRUConfig has these optional parameters:

Parameter Type Description
lowUsageThreshold BINARY_FLOAT Sets, displays or resets the low end of percentage of database PermSize, specified in decimals. The bottom of the threshold range in which LRU aging should be deactivated. Default is 80 percent.
highUsageThreshold BINARY_FLOAT Sets, displays or resets the high end of percentage of database PermSize, specified in decimals. The top of the threshold range in which LRU aging should be activated. Default is 90 percent.
agingCycle TT_INTEGER Sets, displays or resets the number of minutes between aging cycles, specified in minutes. Default is 1 minute. If you use this procedure to change the aging cycle, the cycle is reset based on the time that this procedure is called. For example, if you call this procedure at 12:00 p.m. and specify a cycle of 15 minutes, aging occurs at 12:15, 12:30, 12:45, and so on.

If the cycle is set to a value of 0, aging occurs once every second.


Result set

ttAgingLRUConfig returns these results:

Column Type Description
lowUsageThreshold BINARY_FLOAT NOT NULL The current setting for the low end of percentage of database PermSize, specified in decimals.
highUsageThreshold BINARY_FLOAT NOT NULL The current setting for the high end of percentage of database PermSize, specified in decimals.
agingCycle TT_INTEGER NOT NULL The current setting for the number of minutes between aging cycles, specified in minutes.

Examples

To set the aging threshold to a low of 75 percent and a high of 95 percent and the aging cycle to 5 minutes, use:

CALL ttAgingLRUConfig (.75, .90, 5);
<.7500000, .9000000, 5>

To display the current LRU aging policy for all tables that defined with an LRU aging policy, call ttAgingLRUConfig without any parameters:

Call ttAgingLRUConfig();

If the tables are defined with the default thresholds and aging cycle, the procedure returns:

<.8000000, .9000000, 1>
1 row found.

To change the low usage threshold to 60 percent, the aging cycle to 5 minutes and to retain the previous high usage threshold, use:

Call ttAgingLRUConfig (60,,5);
< .6000000, .9000000, 5 >
1 row found.

Notes

The values of this procedure are persistent, even across system failures.

If no parameters are supplied, this procedure only returns the current LRU aging attribute settings.

ttAgingScheduleNow

Description

This procedure starts the aging process, regardless of the value of the aging cycle. The aging process begins right after the procedure is called unless there is an aging process in progress. In that case, the new aging process begins when the aging process that was in process at the time the built-in was called has completed.

Aging occurs only once when you call this procedure. This procedure does not change any aging attributes. The previous aging state is unchanged. For example, if aging state is OFF when you call ttAgingScheduleNow, the aging process starts. When aging is complete, if your aging state is OFF, aging does not continue. To continue aging, you must call ttAgingScheduleNow again or change the aging state to ON, in which case aging occurs next based on the value of the aging cycle.

For tables with aging ON, the aging cycle is reset to the time when ttAgingScheduleNow was called. For example, if you call this procedure at 12:00 p.m. and the aging cycle is 15 minutes, aging occurs immediately and again at 12:15, 12:30, 12:45, and so on.

If used in an external scheduler, such as a cron job, or executed manually, this procedure starts the aging process at the time the procedure is executed, if there is no aging process in progress, or as soon as the current aging process has completed. In the case that you want aging to occur only when the external scheduler executes the ttAgingScheduleNow procedure or you call it manually, set the aging state to OFF.

Aging is performed by a background thread that wakes up every second to check if any work must be done. Calling ttAgingScheduleNow only guarantees that the aging thread works on the specified tables within the next second, at best. If the aging thread is working on a different table at the time the built-in procedure is called, it may take some time to reach the specified table. The rows are visible until the aging thread commits the delete.

Required privilege

This procedure requires the DELETE privilege on the table being aged, or the DELETE ANY TABLE privilege when you do not specify a table.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttAgingScheduleNow ('tblname')

Parameters

ttAgingScheduleNow has the parameter:

Parameter Type Description
tblname TT_CHAR (61) The name of the table on which to start the aging process.

If tblName is omitted, the aging process is started on all tables defined with any aging policy.

Using a synonym to specify a table name is not supported.


Result set

ttAgingScheduleNow returns no results.

Examples

To schedule aging on all tables, including tables defined with both LRU aging and time-based aging, call ttAgingScheduleNow without any parameter values:

CALL ttAgingScheduleNow ();

This examples creates the table agingex with time-based aging policy and the aging state set to OFF. ttAgingScheduleNow is called, using the ttIsql utility, to start the aging process once. Rows are deleted from the table. After ttAgingScheduleNow is called, the aging state remains OFF. To continue aging, alter the table and set the aging state to OFF.

Command> CREATE TABLE agingex (col1 TT_INTEGER PRIMARY KEY NOT NULL, 
    ts TIMESTAMP NOT NULL) 
    AGING USE ts LIFETIME 1 MINUTES CYCLE 30 MINUTES OFF;

Command> DESCRIBE agingex;

Table TTUSER.AGINGEX:
Columns:
  *COL1             TT_INTEGER NOT NULL
   TS               TIMESTAMP (6) NOT NULL
Aging use TS lifetime 1 minute cycle 30 minutes off
1 table found.
(primary key columns are indicated with *)

Command> INSERT INTO agingex VALUES (1, SYSDATE);
1 row inserted.

Command> INSERT INTO agingex VALUES (2, SYSDATE);
1 row inserted.

Command> SELECT * FROM agingex;
< 1, 2011-03-25 13:06:29.000000 >
< 2, 2011-03-25 13:06:42.000000 >
2 rows found.

Command> CALL ttAgingScheduleNow ('agingex');

Command> SELECT * FROM agingex;
0 rows found.

ttApplicationContext

Description

This procedure sets application-defined context for the next update record (either an UPDATE or commit) to pass application specific data to XLA readers.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttApplicationContext (cmd)

Parameters

ttApplicationContext has the parameter:

Parameter Type Description
cmd VARBINARY(16384) NOT NULL Context information to be passed to the XLA readers.

Result set

ttApplicationContext returns no results.

Examples

CALL ttApplicationContext (0x123);

See also


"XLA Reference" in Oracle TimesTen In-Memory Database C Developer's Guide

ttBackupStatus

Description

This procedure returns a single row with information about the current or last backup of the database. If a backup is in progress, this information represents the current backup. If no backup is in progress, this information represents the last backup taken.

If no backup has been taken on the database since the last first-connect, the status field is 0 and the rest of the columns are NULL.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views:

SYS.GV$BACKUP_STATUS

SYS.V$BACKUP_STATUS

Syntax

ttBackupStatus ()

Parameters

ttBackupStatus has no parameters.

Result set

ttBackupStatus returns the results:

Column Type Description
status TT_INTEGER NOT NULL An INTEGER code representing the current progress of a backup or the completion status of the last backup. Values are:

0 - No backup has been taken on the database since the last first-connect.

1 - A backup is currently in progress.

2 - The last backup completed successfully.

3 - The last backup failed. In this case the error column contains the error code for the failure.

destination TT_INTEGER The type of backup taken. The value is NULL when no backup has been taken on the database. Value is one of:

0 - Backup is/was being written to a file.

1 - Backup is/was being written to a stream.

2 - Backup is/was taken on behalf of replication duplicate.

backupType TT_INTEGER Backup type, either full or incremental. The value is NULL when no backup has been taken on the database. Value is one of:

0 - Incremental backup.

1 - Full backup.

startTime TT_TIMESTAMP Time when the backup was started. The value is NULL when no backup has been taken on the database.
endTime TT_TIMESTAMP Time when the backup completed. If NULL and startTime is non-NULL, a backup is currently in progress.
backupLFN TT_INTEGER The transaction log file number of the backup point. The value is NULL when no backup has been taken on the database.
backupLFO TT_BIGINT The transaction log file offset of the backup point. The value is NULL when no backup has been taken on the database.
error TT_INTEGER If a backup fails, this column indicates the reason for the failure. The value is one of the TimesTen error numbers. The value is NULL when no backup has been taken on the database.
processId TT_INTEGER The ID of the process or daemon performing the backup (if known).

Examples

CALL ttBackupStatus ();
< 2, 2, 1, 2018-01-12 13:10:32.587557, 
2005-08-12 13:10:33.193269, 1, 1531840, 0, 6968 >
1 row found.

Notes

Does not return information about previous backups, other than the current or last one.

Information returned is not persistent across database startup or shutdown.

ttBlockInfo

Description

This procedure provides information about perm blocks and the amount of block-level fragmentation in a database.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

This procedure returns a row for the element from which it was called. To see information about other elements, query the SYS.GV$BLOCK_INFO system table.

Related views

This procedure has these related views.

SYS.GV$BLOCK_INFO

SYS.V$BLOCK_INFO

Syntax

ttBlockInfo()

Parameters

ttBlockInfo has no parameters.

Result set

ttBlockInfo returns the result set:

Column Type Description
TotalBlocks TT_BIGINT NOT NULL Total number of blocks in the database.
FreeBlocks TT_BIGINT NOT NULL Total number of free blocks in the database.
FreeBytes TT_BIGINT NOT NULL Total size of the free blocks.
LargestFree TT_BIGINT NOT NULL Size of the largest free block.

Examples

CALL ttBlockInfo();
< 1537, 16, 236036720, 235991352 >
1 row found.

ttBookmark

Description

This procedure returns information about the TimesTen transaction log. Records in the transaction log are identified by pairs of integers:

  • A transaction log file number.

  • An offset in that transaction log file.

Transaction log file numbers correspond to the file system names given to transaction log files. For example, the transaction log file SalesData.log29 has the transaction log file number 29.

Three log records are identified in the result row of ttBookmark:

  • The identity of the most recently written log record.

  • The identity of the log record most recently forced to the disk.

  • The replication bookmark. The replication bookmark is the oldest log record that represents an update not yet replicated to another system.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$BOOKMARK

SYS.V$BOOKMARK

Syntax

ttBookmark()

Parameters

ttBookmark has no parameters.

Result set

ttBookmark returns the result set:

Column Type Description
writeLFN TT_INTEGER Last written transaction log file.
writeLFO TT_BIGINT Last written offset in transaction log file.
forceLFN TT_INTEGER Last transaction log file forced to disk.
forceLFO TT_BIGINT Offset of last transaction log file forced to disk.
holdLFN TT_INTEGER Replication bookmark transaction log file.
holdLFO TT_BIGINT Replication bookmark log offset.

Examples

CALL ttBookmark();
<379, 60193048,  379, 60192768, -1, -1>
1 row found.

ttCacheADGStandbyStateGet

Returns the state for the standby Oracle database that was specified with the ttCacheADGStandbyStateSet built-in procedure.

Required privilege

This procedure requires no privileges.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheADGStandbyStateGet()

Parameters

ttCacheADGStandbyStateGet has no parameters.

Result set

ttCacheADGStandbyStateGet returns the state of the standby Oracle database.

Parameter Type Description
ADGStandbyState TT_VARCHAR(20) OK: The standby Oracle database in an Active Data Guard configuration is considered to be up.

FAILED: The standby Oracle database in the Active Data Guard configuration has failed. The cache agent does not try to contact the standby Oracle database and continues the autorefresh with only the primary Oracle database.


Examples

The following example shows how to call the ttCacheADGStandbyStateSet built-in procedure to set the state of the standby Oracle database in an Active Data Guard environment first to OK and then to FAILED. The ttCacheADGStandbyStateGet built-in procedure retrieves the value of the current state of the standby Oracle database.

Command> call ttCacheADGStandbyStateSet('OK');
Command> call ttCacheADGStandbyStateGet();
< OK >
1 row found.
 
Command> call ttCacheADGStandbyStateSet('FAILED');
Command> call ttCacheADGStandbyStateGet();
< FAILED >
1 row found. 

ttCacheADGStandbyStateSet

For an Active Data Guard environment, the user can call the ttCacheADGStandbyStateSet built-in procedure to inform the cache agent of the state of the standby Oracle database.

  • Set the state of the standby Oracle database to OK and the cache agent autorefreshes only those transactions that have been replicated from the primary Oracle database to the standby Oracle database.

    • If the standby Oracle database fails and if you have set a timeout with the ttCacheADGStandbyTimeoutSet built-in procedure, then the state changes to FAILED if the standby Oracle database does not respond after the timeout is reached.

    • If the standby Oracle database fails and you did not set the timeout, then autorefresh stalls until the standby Oracle database recovers (unless you set the state of the standby Oracle database to FAILED).

  • Set the state of the standby Oracle database to FAILED if you know the standby Oracle database has failed and it should not be used as part of the autorefresh. When you set the state to FAILED, the cache agent does not wait for transactions to be replicated to the standby Oracle database and continues the autorefresh with only the primary Oracle database. The cache agent does not include the standby Oracle database in the autorefresh, even if it has recovered and is currently active, until you change the state to OK.

Required privilege

This procedure requires no privileges.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheADGStandbyStateSet('[OK | FAILED]')

Parameters

ttCacheADGStandbyStateSet has the parameters:

Parameter Type Description
ADGStandbyState TT_VARCHAR(20) OK: Tells the cache agent that the standby Oracle database in an Active Data Guard configuration is active. This is the default.

FAILED: Tells the cache agent that the standby Oracle database in the Active Data Guard configuration has failed. The cache agent does not try to contact the standby Oracle database and continues the autorefresh with only the primary Oracle database.


Result set

ttCacheADGStandbyStateSet returns no results.

Examples

The following example shows how to call the ttCacheADGStandbyStateSet built-in procedure to set the state of the standby Oracle database in an Active Data Guard environment first to OK and then to FAILED. The ttCacheADGStandbyStateGet built-in procedure retrieves the value of the current state of the standby Oracle database.

Command> call ttCacheADGStandbyStateSet('OK');
Command> call ttCacheADGStandbyStateGet();
< OK >
1 row found.
 
Command> call ttCacheADGStandbyStateSet('FAILED');
Command> call ttCacheADGStandbyStateGet();
< FAILED >
1 row found. 

ttCacheADGStandbyTimeoutGet

Retrieve the timeout specified with the ttCacheADGStandbyTimeoutSet built-in procedure.

Required privilege

This procedure requires no privileges.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheADGStandbyTimeoutGet()

Parameters

ttCacheADGStandbyTimeoutGet has no parameters.

Result Set

ttCacheADGStandbyTimeoutGet returns the timeout:

Parameter Type Description
ADGStandbyTimeout TT_INTEGER The timeout in seconds on how long to wait for a response from the standby Oracle database in an Active Data Guard configuration before using only the primary Oracle database to autorefresh the cache groups.

Examples

The following example shows how to use the ttCacheADGStandbyTimeoutSet built-in procedure to set the timeout that indicates the time to wait for a response from the standby Oracle database. And then, it shows how to call the ttCacheADGStandbyTimeoutGet built-in procedure to retrieve the value of the timeout.

Command> call ttCacheADGStandbyTimeoutSet('60');
Command> call ttCacheADGStandbyTimeoutGet();
< 60 >
1 row found. 

ttCacheADGStandbyTimeoutSet

You can set a timeout with the ttCacheADGStandbyTimeoutSet built-in procedure to designate how long to wait for a response from the standby Oracle database in an Active Data Guard configuration. If the standby Oracle database does not respond after this period, then the state of the standby Oracle database is automatically changed to FAILED and the cache agent facilitates autorefresh using only the primary Oracle database.

Note:

At any time, the user can restore the standby Active Data Guard state by executing the ttCacheADGStandbyStateSet built-in procedure and set the state to OK.

Required privilege

This procedure requires no privileges.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheADGStandbyTimeoutSet(timeout)

Parameters

ttCacheADGStandbyTimeoutSet has the parameters:

Parameter Type Description
ADGStandbyTimeout TT_INTEGER NOT NULL A timeout specified in seconds on how long to wait for the standby Oracle database to respond before using only the primary Oracle database to autorefresh the cache groups.

Default is 0, which indicates that no timeout is used and the state of the standby Oracle database does not change from OK to FAILED as a result of this timeout.


Result set

ttCacheADGStandbyTimeoutSet returns no results.

Examples

The following example shows how to use the ttCacheADGStandbyTimeoutSet built-in procedure to set the timeout that indicates the time to wait for a response from the standby Oracle database. And then, it shows how to call the ttCacheADGStandbyTimeoutGet built-in procedure to retrieve the value of the timeout.

Command> call ttCacheADGStandbyTimeoutSet('60');
Command> call ttCacheADGStandbyTimeoutGet();
< 60 >
1 row found. 

ttCacheAllowFlushAwtSet

Description

The ttCacheAllowFlushAwtSet built-in procedure enables you to execute a FLUSH CACHE GROUP statement against an AWT cache group and should only be used in a specific recovery scenario, as described in "When there is unsynchronized data in the cache groups" section in the Oracle TimesTen In-Memory Database Replication Guide.

Set auto commit to off before executing the ttCacheAllowFlushAwtSet built-in procedure when setting the enableFlush parameter to 1; otherwise, this parameter automatically resets to 0 directly after executing the built-in procedure. Then, perform a commit after you execute the FLUSH CACHE GROUP statement and execute the ttCacheAllowFlushAwtSet built-in procedure to reset the enableFlush parameter back to 0.

Required privilege

This procedure requires no privileges.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheAllowFlushAwtSet (enableFlush)

Parameters

ttCacheAllowFlushAwtSet has the parameters:

Parameter Type Description
allow TT_INTEGER NOT NULL 0 - The user is prevented from executing a FLUSH CACHE GROUP statement against an AWT cache group, which is the intended restriction.

1 - The user is allowed to execute a FLUSH CACHE GROUP statement against an AWT cache group, which should only be done for recovery, as described in "When there is unsynchronized data in the cache groups" section in the Oracle TimesTen In-Memory Database Replication Guide


Result set

ttCacheAllowFlushAwtSet returns no results.

Examples

The following example shows how to execute the ttCacheAllowFlushAwtSet built-in procedure to first allow and then disallow a FLUSH CACHE GROUP statement to be executed against the marketbasket AWT cache group.

Command> set autocommit off;
         CALL ttCacheAllowFlushAwtSet(1);
         FLUSH CACHE GROUP marketbasket;
         CALL ttCacheAllowFlushAwtSet(0);
         COMMIT;

See also


"When there is unsynchronized data in the cache groups" section in the Oracle TimesTen In-Memory Database Replication Guide.

ttCacheAutorefIntervalStatsGet

Description

The ttCacheAutorefIntervalStatsGet built-in procedures returns statistical information about the last 10 autorefresh cycles for a particular autorefresh interval.

Required privilege

This procedure requires no privileges.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheAutorefIntervalStatsGet (autoRefInterval, isStatic)

Parameters

ttCacheAutorefIntervalStatsGet has the parameters:

Parameter Type Description
autoRefInterval TT_BIGINT NOT NULL The autorefreshInterval designates the cache group (the one with this autorefresh interval value) on which to gather statistics.

The integer value for the autorefresh interval (in milliseconds) is the same value that was originally specified when the autorefresh cache group was created to indicate how often autorefresh is scheduled.

isStatic TT_INTEGER Indicates if you are to retrieve information on static or dynamic cache groups with the interval value:

0 - dynamic cache groups

1 - static (non-dynamic) cache groups

The default is static.


Result set

ttCacheAutorefIntervalStatsGet returns statistical information about the last 10 autorefresh cycles for a particular autorefresh interval:

Column Type Description
autorefInterval TT_BIGINT Autorefresh interval in milliseconds.
isStatic TT_INTEGER Indicates that the information is for static or dynamic cache groups with the interval value:

0 - dynamic cache groups

1 - static (non-dynamic) cache groups

autorefNumber TT_BIGINT Autorefresh number.
startTimestamp TT_TIMESTAMP Autorefresh start time.
selectLimit TT_BIGINT Select row limit set for incremental autorefresh cache group.
numRows TT_BIGINT Number of rows refreshed.
numOps TT_BIGINT Number of SQL operations executed.
numCommits TT_BIGINT Number of commits.
commitBufSize TT_BIGINT Maximum commit buffer size in bytes.
commitBufMaxReached TT_BIGINT Amount of memory used for commit processing in bytes.
commitBufNumOverflows TT_BIGINT Number of times the commit buffer overflowed for each transaction.
totalNumRows TT_BIGINT Number of rows refreshed since the autorefresh thread was started.
totalNumOps TT_BIGINT Number of SQL operations were executed since the autorefresh thread was started.
totalNumCommits TT_BIGINT Number of commits since the autorefresh thread was started.
totalNumRollbacks TT_BIGINT Number of s since the autorefresh thread started
totalNumSnapshotOld TT_BIGINT Number of "Snapshot too old" errors received since the autorefresh thread started

Examples

The following example shows how to execute ttCacheAutorefIntervalStatsGet built-in procedure to retrieve statistics for autorefresh cache groups that have been defined as static and have the interval of seven seconds:

Command> call ttCacheAutorefIntervalStatsGet(7000,1);

< 7000, 1, 41, 2013-04-25 15:17:00.000000, 0, 0, 0, 1, 0, 0, <NULL>, 
132121, 132121, 13, 21, 0, 0, 0, 0 >
< 7000, 1, 40, 2013-04-25 15:16:53.000000, 0, 0, 0, 1, 0, 0, <NULL>, 
132121, 132121, 12, 21, 0, 0, 0, 0 >
< 7000, 1, 39, 2013-04-25 15:16:46.000000, 0, 0, 0, 1, 0, 0, <NULL>, 
132121, 132121, 11, 21, 0, 0, 0, 0 >
< 7000, 1, 38, 2013-04-25 15:16:39.000000, 0, 0, 0, 1, 0, 0, <NULL>, 
132121, 132121, 10, 21, 0, 0, 0, 0 >
< 7000, 1, 37, 2013-04-25 15:16:32.000000, 0, 6305, 6305, 1, 0, 131072, 
<NULL>, 132121, 132121, 9, 21, 0, 0, 0, 0 >
< 7000, 1, 36, 2013-04-25 15:16:24.000000, 0, 15616, 15616, 1, 0, 131072, 
<NULL>, 125816, 125816, 8, 21, 0, 0, 0, 0 >
< 7000, 1, 35, 2013-04-25 15:16:17.000000, 0, 18176, 18176, 1, 0, 131072, 
<NULL>, 110200, 110200, 7, 21, 0, 0, 0, 0 >
< 7000, 1, 34, 2013-04-25 15:16:10.000000, 0, 14336, 14336, 1, 0, 131072, 
<NULL>, 92024, 92024, 6, 21, 0, 0, 0, 0 >
< 7000, 1, 33, 2013-04-25 15:16:03.000000, 0, 15360, 15360, 1, 0, 131072, 
<NULL>, 77688, 77688, 5, 21, 0, 0, 0, 0 >
< 7000, 1, 32, 2013-04-25 15:15:56.000000, 0, 11520, 11520, 1, 0, 131072, 
<NULL>, 62328, 62328, 4, 21, 0, 0, 0, 0 >

10 rows found.

Notes

This procedure is available only for TimesTen Cache.

ttCacheAutorefresh

Description

This procedure starts an immediate autorefresh on the set of cache groups that are associated by sharing the same autorefresh interval with the specified cache group. This set of associated cache groups would normally be refreshed together automatically. The effect on the autorefresh process is the same as that of adding a new cache group with the same refresh interval as that of the specified cache group. This procedure is useful if updates have occurred on the Oracle database and you would like to refresh them on the cache group before the next scheduled autorefresh.

If there is an existing transaction with locks on table objects that belong to the set of cache groups to be autorefreshed, this procedure returns an error without taking any action. This procedure establishes a condition that requires that you commit or rollback before you can perform other work in the session.

Required privilege

This procedure requires the CACHE_MANAGER or ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheAutorefresh ('cgOwner', 'cgName', synchronous)

Parameters

ttCacheAutorefresh has the parameters:

Parameter Type Description
cgOwner VARCHAR2 (30) Name of the cache group owner.
cgName VARCHAR2 (30) NOT NULL Name of the cache group.
synchronous TT_INTEGER Species whether data is updated on synchronously or asynchronously.

0 or NULL - Asynchronous mode. The procedure returns immediately.

1 - Synchronous mode. The procedure returns after the refresh operation has completed on all associated cache groups.


Result set

ttCacheAutorefresh returns no results.

Examples

This example autorefreshes the testcache cache group and all cache groups with the same autorefresh interval. The procedure returns synchronously.

Command> call ttcacheautorefresh('user1','testcache', 1);

Notes

The specified cache group AUTOREFRESH state must be ON. While, other associated cache groups can be in any state, they are not refreshed if they are not in the autorefresh ON state.An autorefresh of the specified associated cache groups cannot be in progress.You cannot call this procedure on the standby node of an active standby pair.

This procedure is available only for TimesTen Cache.

ttCacheAutorefreshLogDefrag

Description

The ttCacheAutorefreshLogDefrag built-in procedure compact the trigger log space for a cache autorefresh table.

For usage details, see "Defragmenting change log tables in the tablespace" in the Oracle TimesTen Application-Tier Database Cache User's Guide.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheAutorefreshLogDefrag ('action')

Parameters

ttCacheAutorefreshLogDefrag has the parameters:

Parameter Type Description
action VARCHAR (50) NOT NULL Acceptable values are:

Compact - Defragments only the trigger log space.

CompactAndReclaim - Defragments the trigger log space and the transaction commit buffer (reclaim space).

NOTE: The reclaim phase takes a lock on the trigger log table for a brief moment. This can suspend the workload from writing into the base table.


Result set

ttCacheAutorefreshLogDefrag returns no results.

Examples

In this example, the call compacts or defragments only the trigger log space.

Command> call ttCacheAutorefreshLogDefrag('CompactOnly');

Notes

This procedure is available only for TimesTen Cache.

ttCacheAutorefreshStatsGet

Description

This procedure returns information about the last ten autorefresh transactions on the specified cache group. This information is only available when the AUTOREFRESH state is ON or PAUSED, and the cache agent is running.

The information returned by this built-in procedure is reset whenever:

  • The cache agent is restarted

  • The state is set to OFF and then back to ON or PAUSED

  • The cache group is dropped and recreated

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheAutorefreshStatsGet ('cgOwner', 'cgname')

Parameters

ttCacheAutorefreshStatsGet has the parameters:

Parameter Type Description
cgOwner VARCHAR2 (30) Name of the cache group owner.
cgName VARCHAR2 (30) NOT NULL Name of the cache group for which autorefresh information should be returned.

Result set

The ttCacheAutorefreshStatsGet built-in procedure returns only a subset of column information for a cache group with autorefresh mode FULL. A column value of 0 returns for information that is not available.

ttCacheAutorefreshStatsGet returns the results:

Column name Column type Description Returned for full autorefresh
cgId TT_BIGINT The cache group ID. Y
startTimestamp TT_TIMESTAMP Timestamp when autorefresh started for this interval. See "Notes" below. Y
cacheAgentUpTime TT_BIGINT Number of cache agent clock ticks in milliseconds at the time the autorefresh transaction started for this interval. This value is cumulative and is reset when the cache agent process starts. See "Notes" below. Y
autorefNumber TT_BIGINT Autorefresh number for a cache group indicates the number of times this cache group has been incrementally refreshed since the cache agent started. This number is initialized to 0 when the cache agent is started. Y
autorefDuration TT_BIGINT The number of milliseconds spent in this autorefresh transaction. Y
autorefNumRows TT_BIGINT The number of rows autorefreshed in this autorefresh. This includes all rows, including those in the root table and the child tables.

If there are cache groups with multiple tables, child table rows get updated multiple times. Therefore, the number of rows autorefreshed may be more than the number of rows updated on the Oracle database.

N
numOracleBytes TT_BIGINT The number of bytes transferred from the Oracle database in this autorefresh transaction. N
autorefNumRootTblRows TT_BIGINT The number of root table rows autorefreshed in this autorefresh transaction. Y
autorefQueryExecDuration TT_BIGINT The duration in milliseconds that it takes for the autorefresh query to execute on the Oracle database. N
autorefQueryFetchDuration TT_BIGINT The duration in milliseconds that it takes for the autorefresh query to fetch rows from the Oracle database. N
autorefTtApplyDuration TT_BIGINT The duration in milliseconds that it takes for TimesTen to apply the autorefresh. N
totalNumRows TT_BIGINT The total number of rows autorefreshed since the cache agent started.

The total number of rows autorefreshed may not be the same as number of rows updated on the Oracle database. This is because of a delay in marking the log; some updates may get autorefreshed and counted multiple times.

N
totalNumOracleBytes TT_BIGINT The total number of bytes transferred from the Oracle database since the cache agent started. N
totalNumRootTblRows TT_BIGINT The total number of root table rows autorefreshed since the cache agent started. Y
totalDuration TT_BIGINT The total autorefresh duration in milliseconds since the cache agent started. Y
status VARCHAR2 (128) A string description of the status of the current autorefresh. See "Notes" below. Supported values for this field are:

Complete

inProgress

Failed

Y
numlogrows TT_BIGINT Number of rows fetched from the Oracle database in this autorefresh. Y
totalnumlogrows TT_BIGINT The cumulative number of rows fetched from the Oracle database in this autorefresh. Y
autorefLogFragmentationPct TT_BIGINT A low-water mark for table usage by percentage. If less than the specified percent of the table is used, the table is compacted. Y
autorefLogFragmentationTs TT_TIMESTAMP The timestamp when the last utilization/ fragmentation ratio was calculated Y
autorefLogDefragGcnt TT_BIGINT The number of times the table has been compacted. Y

Examples

In this example, testcache is a READONLY cache group with one table and an incremental autorefresh interval of 10 seconds.

Command> call ttcacheautorefreshstatsget('user1','testcache');

< 1164260, 2011-07-23 15:43:52.000000, 850280, 44, 
0, 75464, 528255, 75464, 310, 110, 6800, 1890912, 
12439795, 1890912, 160020, InProgress, 2, 74 >
< 1164260, 2011-07-23 15:43:33.000000, 831700, 43, 
13550, 108544, 759808, 108544, 1030, 230, 12290, 1815448, 
11911540, 1815448, 160020, Complete, 2, 72 >
< 1164260, 2011-07-23 15:43:12.000000, 810230, 42, 
17040, 115712, 809984, 115712, 610, 330, 16090, 1706904, 
11151732, 1706904, 146470, Complete, 2, 70>
< 1164260, 2011-07-23 15:42:52.000000, 790190, 41, 
14300, 94208, 659456, 94208,560, 320, 13410, 1591192, 
10341748, 1591192, 129430, Complete, 2, 68 >
< 1164260, 2011-07-23 15:42:32.000000, 770180, 40, 
12080, 99328, 695296, 99328,450, 290, 11340, 1496984, 
9682292, 1496984, 115130, Complete, 2, 66 >
< 1164260, 2011-07-23 15:42:12.000000, 750130, 39, 
10380, 86016, 598368, 86016,430, 230, 9720, 1397656, 
8986996, 1397656, 103050, Complete, 2, 64 >
< 1164260, 2011-07-23 15:41:52.000000, 730130, 38, 
13530, 112640, 700768, 112640, 530, 220, 12780, 1311640, 
8388628, 1311640, 92670, Complete, 2, 62 >
< 1164260, 2011-07-23 15:41:32.000000, 710120, 37, 
9370, 56320, 326810, 56320, 310, 160, 8900, 1199000, 
7687860, 1199000, 79140, Complete, 2, 60 >
< 1164260, 2011-07-23 15:41:22.000000, 700120, 36, 
2120, 10240, 50330, 10240, 50, 200, 1870, 1142680, 
7361050, 1142680, 69770, Complete, 2, 58 >
< 1164260, 2011-07-23 15:41:12.000000, 690110, 35, 
0, 0, 0, 0, 0, 0, 0, 1132440, 7310720, 1132440, 
67650, Complete, 2, 56 >
10 rows found.

Notes

Most of the column values reported above are collected at the cache group level. For example, autorefDuration and autorefNumRows only include information for the specified cache group. Exceptions to this rule are column values cacheAgentUpTime, startTimestamp and autorefreshStatus. These values are reported at the autorefresh interval level.

StartTimestamp is taken at the beginning of the autorefresh for the autorefresh interval. A cache group enters the in progress state as soon as the autorefresh for the interval starts. It is not marked complete until the autorefresh for all cache groups in the interval are complete.

This procedure is available only for TimesTen Cache.

ttCacheAutorefreshSelectLimit

Description

Configuring the incremental autorefresh to join the Oracle database base table with a limited number of rows from the autorefresh change log table is known as configuring a select limit. This is accomplished with the ttCacheAutorefreshSelectLimit built-in procedure.

Required privilege

This procedure requires the ADMIN or CACHE_MANAGER privileges.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheAutorefreshSelectLimit ( autorefreshInterval, value )

Parameters

ttCacheAutorefreshSelectLimit has the parameters:

Parameter Type Description
param TT_VARCHAR2 (50)
NOT NULL
The autorefreshInterval designates the cache group (the one with this autorefresh interval value) on which to apply the value.

The integer value for the autorefresh interval (in milliseconds) is the same value that was originally specified when the autorefresh cache group was created to indicate how often autorefresh is scheduled.

value TT_VARCHAR2 (200) The value denotes a limit of the number of rows to select from the autorefresh change log file to apply to the cached table. These changes are applied incrementally until all the rows in the autorefresh change log table have been applied.

If the value changes, it takes effect at the start of the next autorefresh cycle.

The value can be one of the following:

  • 'ON': Select at most 1000 rows at a time from the autorefresh change log table to apply for every autorefresh cycle.

  • number: Select at most a user specified number of rows from the autorefresh change log table during the autorefresh cycle. If the user specified a limit size of 2000 rows, then autorefresh selects at most 2000 rows at a time from the autorefresh change log table. If you specify a negative number, an error is returned.

  • 'OFF': Disables the select limit. The incremental autorefresh selects all rows from the change log table during the autorefresh cycle.

  • NULL: If the value provided is NULL or not specified, the current setting is returned.


Result set

ttCacheAutorefreshSelectLimit returns the select limit value that has been set for a particular autorefresh interval:

Column Type Description
param TT_VARCHAR2(50) The autorefreshInterval that designates the cache group (the one with this autorefresh interval value).
value TT_VARCHAR2(200) The current value that shows the number of rows that is selected from the autorefresh change log file to apply to the cached table.

Examples

You can show the current setting by either providing a NULL value or no parameter. The following example shows the setting for incremental autorefresh cache groups with an interval value of 7 seconds.

Command> call ttCacheAutorefreshSelectLimit('7000', NULL);
< 7000, 2000 >
1 row found.
Command> call ttCacheAutorefreshSelectLimit('7000');
< 7000, 2000 >
1 row found.

The following example set a select limit to 2000 rows for incremental autorefresh cache groups with an interval value of 7 seconds.

Command> call ttCacheAutorefreshSelectLimit('7000', '2000');
< 7000, 2000 >
1 row found.

Notes

  • This procedure is available only for TimesTen Cache.

  • The ttCacheAutotrefreshSelectLimit built-in procedure can set a select limit only on an interval that is defined for a single cache group that contains one table, where the cache group is defined as a static read-only cache group with incremental autorefresh.

  • The setting for ttCacheAutorefreshSelectLimit is not replicated or duplicated. The user must execute the built-in on both the active and standby nodes.

  • The settings do not reset if you drop all cache groups for the interval.

  • The ttMigrate, ttBackup, and ttRestore built-in procedures do not preserve the setting of ttCacheAutorefreshSelectLimit.

  • If you alter the cache group autorefresh interval, it does not modify what was set previously through execution of ttCacheAutorefreshSelectLimit for the cache group. You can only alter the select limit for the cache group with the ttCacheAutorefreshSelectLimit built-in procedure.

See also


ttCacheAutorefIntervalStatsGet
"Configuring a select limit when using incremental autorefresh for read-only cache groups" in the Oracle TimesTen Application-Tier Database Cache User's Guide.

ttCacheAutorefreshXactLimit

Description

This procedure starts an immediate autorefresh on single table cache groups within a specified autorefresh interval and commits after the specified number of operations.

This procedure is useful if updates have occurred on the Oracle database and you want to refresh them on the cache group before the next scheduled autorefresh.

To modify the reclaim buffer size, use the ttDBConfig built-in procedure.

Required privilege

This procedure requires the CACHE_MANAGER or ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheAutorefreshXactLimit ('IntervalValue', 'Value')

Parameters

ttCacheAutorefreshXactLimit has the parameters:

Parameter Type Description
param VARCHAR2 (50) NOT NULL Indicates the interval at which the autorefresh cache groups are defined to occur in units of milliseconds. IntervalValue is an integer value in milliseconds that was specified when the autorefresh cache group was created on how often autorefresh is scheduled.
value VARCHAR2 (200) The Value can be one of the following:
  • 'ON' - Enables autorefresh to commit after every 256 operations.

  • 'OFF' - Disables the transaction limit for autorefresh cache groups and sets autorefresh back to using a single transaction.

  • number - Denotes when to commit after a certain number of operations. For example, if the user specifies 1024, then autorefresh commits after every 1024 operations in the transaction. If you specify a negative number, an error is returned.

  • NULL - When the value is NULL, 0 or not specified, the current setting is returned.


Result set

ttCacheAutorefreshXactLimit returns the results:

Column Type Description
param VARCHAR2 (50) NOT NULL The interval at which the autorefresh cache groups are defined to occur in units of milliseconds.
value VARCHAR2 (200) The Value can be one of the following:
  • 'ON' - Enables autorefresh to commit after every 256 operations.

  • 'OFF' - Disables the transaction limit for autorefresh cache groups and sets autorefresh back to using a single transaction.

  • number - Denotes when to commit after a certain number of operations. For example, if the user specifies 1024, then autorefresh commits after every 1024 operations in the transaction. If you specify a negative number, an error is returned.

  • NULL - When the value is NULL or not specified, the current setting is returned.


Examples

The following example sets up the transaction limit to commit after every 256 operations for all incremental autorefresh read-only cache groups that are defined with an interval value of 10 seconds.

call ttCacheAutorefreshXactLimit('10000', 'ON');

After the month end process has completed and the incremental autorefresh read-only cache groups are refreshed, disable the transaction limit for incremental autorefresh read-only cache groups that are defined with the interval value of 10 seconds.

call ttCacheAutorefreshXactLimit('10000', 'OFF');

To enable the transaction limit for incremental autorefresh read-only cache groups to commit after every 2000 operations, provide 2000 as the value as follows:

call ttCacheAutorefreshXactLimit('10000', '2000');

Notes

  • This procedure is available only for TimesTen Cache. This built-in procedure only applies for static read-only cache groups with incremental autorefresh.

  • While autorefresh is in-progress and is being applied in several small transactions, transactional consistency cannot be maintained. Once the autorefresh cycle has completed, the data is transactional consistent.

  • The setting for ttCacheAutorefreshXactLimit is not replicated or duplicated. The user must execute the built-in procedure on both the active and standby nodes.

  • The settings do not reset if you drop all cache groups for the interval.

  • The ttMigrate, ttBackup, and ttRestore built-in procedures do not preserve the setting of ttCacheAutorefreshXactLimit.

  • If you alter the cache group autorefresh interval, it does not modify the setting of ttCacheAutorefreshXactLimit.

See also


ttCacheAutorefIntervalStatsGet
"Executing large transactions with incremental autorefresh read-only cache groups" in the Oracle TimesTen Application-Tier Database Cache User's Guide.

ttCacheAWTMonitorConfig

Description

This procedure enables monitoring to determine the amount of time spent in each component of the workflow of an AWT cache group. To display the monitoring results, use the ttRepAdmin utility with the -awtmoninfo and -showstatus commands.

If the replication agent is restarted, monitoring is turned off. Setting the monitoring state to OFF resets the internal counters of the monitoring tool.

Run this procedure on the replication node that is replicating AWT changes to the Oracle database. If the active standby pair is functioning normally, the node replicating AWT changes is the standby. If the active is operating standalone, the node replicating AWT changes is the active.

If a failure occurs on the node where the active database resides, the standby node becomes the new active node. In that case you would run this procedure on the new active node.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheAWTMonitorConfig (['state'], [samplingRate])

Parameters

ttCacheAWTMonitorConfig has the optional parameters:

Parameter Type Description
state TT_CHAR(10) Enables and disables AWT monitoring. Its value can be ON or OFF. Default is OFF
samplingRate TT_INTEGER Positive integer that specifies the frequency with which the AWT workflow is sampled. If samplingRate is set to 1, every AWT operation is monitored. Greater values indicate less frequent sampling. The value recommended for accuracy and performance is 16. If state is set to ON, the default for samplingRate is 16. If state is set to OFF, the default for samplingRate is 0.

Result set

ttCacheAWTMonitorConfig returns the following result if you do not specify any parameters. It returns an error if the replication agent is not running or if an AWT cache group has not been created.

Column Type Description
state TTVARCHAR (10) NOT NULL Current state of AWT monitoring. The value can be ON or OFF.
AWTSamplingFactor TT_INTEGER NOT NULL Positive integer that specifies the frequency with which the AWT workflow is sampled.

Examples

Example 3-1

Retrieve the current state and sampling factor when monitoring is disabled.

Command> CALL ttCacheAWTMonitorConfig;
< OFF, 0 >
1 row found.

Example 3-2

Enable monitoring and set the sampling frequency to 16.

Command> CALL ttCacheAWTMonitorConfig ('ON', 16);
< ON, 16 >
1 row found.

Example 3-3

Disable monitoring.

Command> CALL ttCacheAWTMonitorConfig; ('OFF')
< OFF, 0 >
1 row found.

See also


"ttRepAdmin"

ttCacheAWTThresholdGet

Description

This procedure returns the current transaction log file threshold for databases that include AWT cache groups.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheAWTThresholdGet()

Parameters

ttCacheAWTThresholdGet has no parameters.

Result set

ttCacheAWTThresholdGet returns the result:

Column Type Description
threshold TT_INTEGER NOT NULL The number of transaction log files for all AWT cache groups associated with the database. If the result is 0, there is no set limit.

Examples

CALL ttCacheAWTThresholdGet();

Notes

This procedure is available only for TimesTen Cache.

ttCacheAWTThresholdSet

Description

This procedure sets the threshold for the number of transaction log files that can accumulate before AWT is considered either terminated or too far behind to catch up. This setting applies to all subscribers to the database. When the threshold is exceeded, updates are no longer sent to the Oracle database. If no threshold is set then the default is zero.

Using this built-in procedure, the threshold can be set after an AWT cache group has been created.

This setting can be overwritten by a CREATE REPLICATION statement that resets the Log Failure Threshold for the database.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheAWTThresholdSet(threshold)

Parameters

ttCacheAWTThresholdSet has the parameter:

Parameter Type Description
threshold TT_INTEGER Specifies the number of transaction log files for all AWT cache groups associated with the database. If the threshold is NULL, the log failure threshold is set to zero.

Result set

ttCacheAWTThresholdSet returns no results.

Examples

To set the threshold to allow 12 transaction log files to accumulate, use:

CALL ttCacheAWTThresholdSet(12);

Notes

This procedure is available for TimesTen Cache.

The user is responsible to recover when the threshold is exceeded.

ttCacheCheck

Description

The ttCacheCheck built-in procedure performs a check for missing constraints for cached tables on the Oracle database.

Any unique index, unique constraint, or foreign key constraint on columns in Oracle Database tables that are to be cached should also be created on asynchronous writethrough cache tables within TimesTen. If you have not created these constraints on the AWT cache tables and you have configured the cache group for parallel propagation, TimesTen serializes any transactions with DML operations to those tables with missing constraints.

This procedure provides information about missing constraints and the tables marked for serialized propagation.

Call ttCacheCheck to manually check for missing constraints, under these conditions:

  • After completing a series of DROP CACHE GROUP statements.

  • After creating or dropping a unique index or foreign key on the Oracle database.

  • To determine why some transactions are being serialized.

This procedure updates system tables to indicate if DML executed against a table should or should not be serialized, therefore you must commit or roll back after the ttCacheCheck built-in completes.

For more details on parallel propagation, see "Configuring parallel propagation to Oracle Database tables" in the Oracle TimesTen Application-Tier Database Cache User's Guide.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheCheck('operation', cgOwner, cgName)

Parameters

ttCacheCheck has these parameters:

Parameter Type Description
operation TT_VARCHAR(30) Specifies the constraint to be checked. Legal values are:
  • ForeignKey -Checks foreign key constraints

  • Unique - Checks unique constraints

  • Awt - Checks both foreign key and unique constraints

  • NULL - Checks both foreign key and unique constraints

cgOwner TT_VARCHAR(30) Specifies the owner of the cached Oracle database table.

If NULL, checks all asynchronous writethrough cache groups owned by the connection user.

If both cgOwner and cgName are NULL, checks all asynchronous cache groups.

cgName TT_VARCHAR(30) Specifies the name of the cached Oracle database table.

If NULL, but the cgOwner is specified checks all asynchronous writethrough cache groups owned by cgOwner.

If both cgOwner and cgName are NULL, checks all asynchronous cache groups.


Result set

ttCacheCheck returns the result set:

Column Type Value
cgOwner TT_VARCHAR(30) NOT NULL The owner of the cache group.
cgName TT_VARCHAR(30) NOT NULL The name of the cache group.
tblOwner TT_VARCHAR(30) The owner of the table.
tblName TT_VARCHAR(30) The name of the table.
objectType TT_VARCHAR(15) The type of Oracle object: unique index, constraint or foreign key.
objectOwner TT_VARCHAR(30) The owner of the Oracle object.
objectName TT_VARCHAR(30) The object name.
msgType TT_SMALLINT NOT NULL The type of message:

0 = Informational

1 = Warning

-1 = Error

msg TT_VARCHAR(100000) NOT NULL Message describing the issue.
objectDesc VARCHAR2(200000) A description of the object. If the object is AWT checking, the description is the SQL statement that describes the object.

Examples

The following example determines if there are any missing constraints for the cache group update_orders that is owned by cacheuser. A result set is returned that includes the warning message. The ordertab table in the update_orders cache group is marked for serially propagated transactions.

Command> call ttCacheCheck( NULL, 'cacheuser', 'update_orders');

< CACHEUSER, UPDATE_ORDERS, CACHEUSER, ORDERTAB, Foreign Key, CACHEUSER, 
CUST_FK, 1, Transactions updating this table will be serialized to Oracle
because: The missing foreign key connects two AWT cache groups., 
table CACHEUSER.ORDERTAB constraint CACHEUSER.CUST_FK foreign key(CUSTID) 
references CACHEUSER.ACTIVE_CUSTOMER(CUSTID) >
1 row found.

Notes

This procedure is available only for TimesTen Cache.

ttCacheConfig

Description

For all cache groups that cache data from the same Oracle instance, this procedure specifies a timeout value and recovery policies in the case that the Oracle database server is unreachable and the cache agent or database is considered terminated.

The automatic refresh state of the database and cache groups can be determined from the procedure ttCacheDbCgStatus.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheConfig(Param, tblOwner, tblName, Value)

Parameters

ttCacheConfig has these parameters:

Parameter Type Description
Param
VARCHAR2(50)
NOT NULL
Specifies the parameter to be set by Value:
  • AgentFailoverTimeout - When working in an Oracle RAC environment, sets the TAF timeout, in minutes. Configures how long TAF retries when establishing a connection. The default is four minutes.

  • AgentTimeout - Number of seconds before a database is declared terminated if the cache agent cannot connect to the Oracle database server.

  • AutoRefreshLogFragmentationWarningPCT - The percent of table usage that must occur before warning the user to compact the table. By default, value is 40.

  • AutorefreshLogMonitorInterval - Specifies the time interval (in seconds) for how often to perform the percentage calculation of the cache administration user's tablespace usage. Default value is 300 seconds.

  • AutoRefreshLogDeFragmentAction - Compaction mode for the specified tables.

  • AutoRefreshLogTblSpaceUsagePCT - Specifies the cache administration user's tablespace usage warning threshold as a percentage.

  • DeadDbRecovery - Specifies the type of autorefresh recovery when the cache agent restarts.

  • DisableFullAutorefresh - Disables or enables full autorefresh behavior. Default is 0, meaning that full autorefresh is enabled. The value of 1 indicates that full autorefresh is disabled.

  • TblSpaceFullRecovery - Specifies the action that TimesTen takes when the cached Oracle database table is updated and the cache administration user's tablespace is full.

tblOwner VARCHAR2(30) Specifies the owner of the cached Oracle database table.

This parameter is required if Param is set TblspaceFullRecovery. Do not specify tblOwner for other values of Param.

A synonym cannot be used to specify a table name.

tblName VARCHAR2(30) Specifies the name of the cached Oracle database table.

This parameter is required if Param is set TblspaceFullRecovery. Do not specify tblOwner for other values of Param.

Using a synonym to specify a table name is not supported.

Value VARCHAR2(200) Specifies the value to be set for Param.
  • When Param is AgentFailoverTimeout, it specifies the number of minutes before TAF retries when establishing a connection, when working in an Oracle RAC environment. The default is four minutes.

  • When Param is AgentTimeout, it specifies the number of seconds before a database is declared terminated if the cache agent cannot connect to the Oracle database server. The default is 0, which means that the database is never declared terminated.

  • When Param is AutoRefreshLogTblSpaceUsagePCT, the value can be 0 to 100. The default is 0, which means no warning is returned regardless of the tablespace usage.

  • When Param is AutoRefreshLogFragmentationWarningPCT, the value of the fourth parameter must be an integer between 1 and 100, representing a percentage of the table. The default is 40.

  • When Param is AutorefreshLogMonitorInterval, it specifies the interval in seconds when to calculate the percentage of usage of the cache administration user's tablespace. The default is every 300 seconds.

  • When Param is AutoRefreshLogDeFragmentAction, the value can be Manual, CompactOnly or CompactandReclaim If Manual is specified no action is taken. The user can run ttCacheAutorefreshLogDefrag built-in procedure to defragment the logs. If CompactOnly is specified trigger log space is compacted. If CompactandReclaim is specified both the trigger log space and the transaction log buffer (reclaim space) are compacted. The default is Manual.

  • When Param is DeadDbRecovery, the value can be Normal or Manual. Normal specifies a full automatic refresh. Manual specifies that REFRESH CACHE GROUP statement must be issued. The default is Normal.

  • When Param is TblSpaceFullRecovery, the value can be Reload or None. Reload specifies that rows are deleted from the change log table and a full automatic refresh is performed. None specifies that an Oracle database error is returned when the cached Oracle database table is updated. The default is None.

Or Specifies the value to be set by AwtErrorXmlOutput:

  • ASCII - A text file that contains the AWT error report. (Default)

  • XML - An XML file that contains the AWT error report and the associated DTD file.


Result set

ttCacheConfig returns no results when an application uses it to set parameter values. When it is used to return parameter settings, ttCacheConfig returns the following results.

Column Type Value
Param VARCHAR2(50) Parameter name:

AgentTimeout

AgentFailoverTimeout

AutoRefreshLogTblSpaceUsagePCT

AutoRefreshLogFragmentationWarningPCT

AutorefreshLogMonitorInterval

AutoRefreshLogDeFragmentAction

DeadDbRecovery

TblSpaceFullRecovery

tblOwner VARCHAR2(30) Owner of the cached Oracle database table.
tblName VARCHAR2(30) Name of the cached Oracle database table.

Using a synonym to specify a table name is not supported.

Value VARCHAR2(200) Specifies the value set for Param.
  • When Param is AgentTimeout, it specifies the number of seconds before a database is declared terminated if the cache agent cannot connect to the Oracle database server.

  • When Param is AutoRefreshLogTblSpaceUsagePCT, the value can be 0 to 100.

  • When Param is AutoRefreshLogFragmentationWarningPCT, the value can be 0 to 100.

  • When Param is AutorefreshLogMonitorInterval, the value can be an integer.

  • When Param is AutoRefreshLogDeFragmentAction, the value can be Manual, CompactOnly or CompactandReclaim.

  • When Param is DeadDbRecovery, the value can be Normal or Manual.

  • When Param is TblSpaceFullRecovery, the value can be Reload or None.


Examples

To set the cache agent timeout to 600 seconds (10 minutes), enter:

CALL ttCacheConfig('AgentTimeout',,,'600');

To determine the current cache agent timeout setting, enter:

CALL ttCacheConfig('AgentTimeout');
< AgentTimeout, <NULL>, <NULL>, 600 >
1 row found.

To set the recovery method to Manual for cache groups whose automatic refresh status is dead, enter:

CALL ttCacheconfig('DeadDbRecovery',,,'Manual');

Configure the TimesTen Cache to prevent an automatic full refresh and receive an Oracle database error when there is an update on a cached Oracle database table while the cache administration user's tablespace is full. The Oracle database table is terry.customer.

CALL ttCacheConfig('TblSpaceFullRecovery','terry','customer','None');

To determine the current setting for TblSpaceFullRecovery on the terry.customer cached Oracle database table, enter:

CALL ttCacheConfig('TblSpaceFullRecovery','terry','customer');
< TblSpaceFullRecovery, TERRY, CUSTOMER, none >
1 row found.

To configure a warning to be returned when the cache administration user's tablespace is 85 percent full and an update operation occurs on the cached Oracle database table, enter:

CALL ttCacheConfig('AutoRefreshLogTblSpaceUsagePCT',,,'85');

TimesTen Classic calculates the percentage of fragmentation for the change log tables as a ratio of used space to the total size of the space. If this ratio falls below a defined threshold, TimesTen alerts you of the necessity for defragmentation of the change log tables by logging a message. By default, this threshold is set to 40%. For example, to set the fragmentation threshold to 50%, perform:

Command> CALL ttCacheConfig('AutoRefreshLogFragmentationWarningPCT',,,'50');
< AutoRefreshLogFragmentationWarningPCT, <NULL>, <NULL>, 50 >
1 row found.

To set the time interval to 3600 seconds for when to calculate the fragmentation percentage of the change log tables, perform:

Command> CALL ttCacheConfig('AutorefreshLogMonitorInterval',,,'3600');
< AutorefreshLogMonitorInterval, <NULL>, <NULL>, 3600 >
1 row found.

When working in an Oracle RAC environment, the following shows how to retrieve the value of the failover timeout:

Command> call ttCacheConfig('AgentFailoverTimeout'); 
< AgentFailoverTimeout, <NULL>, <NULL>, 4 > 
1 row found. 
. 

The following sets the failover timeout to 5 minutes:

Command> call ttCacheConfig('AgentFailoverTimeout',,,5); 
< AgentFailoverTimeout, <NULL>, <NULL>, 5 > 
1 row found. 
Command>

Notes

This procedure is available only for TimesTen Cache.

You must call the ttCacheConfig built-in procedure from every node in an active standby pair.

ttCacheConnPoolApply

Description

This procedure enables you to dynamically resize the cache connection pool parameters on each child server process. After which, the cache connection pool parameters are associated with the child server process.

Use the ChildServer connection attribute to identify each child server process, where ChildServer=n and n is a number ranging from 1 to the number of running child server processes. Once connected to the child server process, you can execute the ttCacheConnPoolApply built-in procedure that is meant for a specific child server process.

For more details, see "Managing a cache connection pool to the Oracle database for dynamic load requests" in Oracle TimesTen Application-Tier Database Cache User's Guide.

Required privilege

This procedure requires TimesTen cache administration manager or Admin privileges to execute.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheConnPoolApply( )

Parameters

There are no parameters for this procedure.

Result Set

ttCacheConnPoolApply returns no results..

Examples

The following connects to the child server process identified as 1 and applies the saved cache connection pool configuration to this child server process. It does the same process for child server process 2 (given that ServersPerDSN=2).

Command> connect "DSN=cache1;ChildServer=1;";
Command> call ttCacheConnPoolApply;
Command> disconnect;

Command> connect "DSN=cache1;ChildServer=2;";
Command> call ttCacheConnPoolApply;
Command> disconnect;

Notes

This procedure is available only for TimesTen Cache.

You can only execute the ttCacheConnPoolApply built-in procedure from a multithreaded client/server connection.

If the cache connection pool fails, you can recreate the pool by executing the ttCacheConnPoolApply built-in procedure from any child server process.

ttCacheConnPoolGet

Description

This procedure retrieves the current values of the cache connection pool parameters.

The ChildServer connection attribute identifies each child server process, where ChildServer=n and n is a number ranging from 1 to the number of running child server processes. Once connected to the child server process, you can execute the ttCacheConnPoolGet('current') built-in procedure that is meant for a specific child server process.

For more details, see "Managing a cache connection pool to the Oracle database for dynamic load requests" in Oracle TimesTen Application-Tier Database Cache User's Guide.

Required privilege

This procedure requires TimesTen cache administration manager or Admin privileges to execute.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheConnPoolGet(state)

Parameters

The state parameter can be either:

  • saved: Returns the cache connection parameters that are saved on the Oracle database. When querying the saved configuration, you can execute the ttCacheConnPoolGet built-in procedure from a direct connection, a single-threaded client/server connection or a multithreaded client/server connection.

  • current: Returns the cache connection parameters that have defined the cache connection pool for this current child server process. When querying the current configuration of a specific child server process, you can execute the ttCacheConnPoolGet built-in procedure only from a multithreaded client/server connection.

Result set

ttCacheConnPoolGet returns the following values:

Table 3-2 ttCacheConnPoolGet result set

Parameter Description

MinSize

The set value for the minimum number of open connections for the cache connection pool.

MaxSize

The set value for the maximum number of open connections for the cache connection pool.

IncrSize

The set value for the increment by which the number of open connections increases when needed.

Timeout

A timeout (in seconds) for the connections in the cache connection pool. Connections that idle for more than this timeout are terminated to maintain an optimum number of open connections and returned to the cache connection pool.

ConnNoWait

A directive given whether to wait for an available connection from the cache connection pool when no connection is immediately available. Valid values are:

  • Disabled (0): Any dynamic load operations wait for an available connection in the cache connection pool before proceeding.

  • Enabled (1): Any dynamic load operations fail with an error if there is no available connection in the cache connection pool.

OpenCount

The current number of open connections in the cache connection pool. If you query the saved parameters, a -1 is displayed for this value.

BusyCount

The current number of busy connections in the cache connection pool. If you query the saved parameters, a value of -1 is displayed for this value.

LastOraErr

Displays the number of the last Oracle Database error returned (if applicable) when attempting to retrieve a connection from the cache connection pool. For example, a value of 1034 would indicate that "ORA-0134: ORACLE not available" error was the last Oracle Database error returned. When requesting current and no Oracle Database error is returned, a 0 is returned.

If you query the saved parameters, a -1 is displayed for this value.


Examples

Query the values for the cache connection pool that are saved on the Oracle database.

Command> call ttCacheConnPoolGet('saved');
< 1, 10, 1, 10, 0, -1, -1, -1>

Notes

This procedure is available only for TimesTen Cache.

ttCacheConnPoolSet

Description

This procedure sizes the cache connection pool to avoid contention for connections. This procedure saves the values of these parameters on the Oracle database, which are then used as the default values when restarting the TimesTen server.

If you are dynamically changing the sizing, you can apply the changes to each TimesTen server by executing the ttCacheConnPoolApply built-in procedure.

For more details, see "Managing a cache connection pool to the Oracle database for dynamic load requests" in Oracle TimesTen Application-Tier Database Cache User's Guide.

Required privilege

This procedure requires TimesTen cache administration manager or Admin privileges to execute.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheConnPoolSet(MinSize, MaxSize, IncrSize, Timeout, ConnNoWait)

Parameters

All parameters must be specified for the ttCacheConnPoolSet built-in procedure. You can execute the ttCacheConnPoolSet built-in procedure from a direct connection, a single-threaded client/server connection or a multithreaded client/server connection.

Table 3-3 ttCacheConnPoolSet input parameters

Parameter Description

MinSize

The minimum number of open connections for the cache connection pool. The default is 10 connections. The minimum is 1; the maximum is 2000 connections.

MaxSize

The maximum number of open connections for the cache connection pool. The default is 32 connections. The minimum is 1; the maximum is 2000 connections.

IncrSize

The increment by which the number of open connections increases when needed. The default increment is 1. The minimum is 1; the maximum is 2000 connections.

Timeout

A timeout (in seconds) for the connections in the cache connection pool. Connections that idle for more than this timeout are terminated to maintain an optimum number of open connections and returned to the cache connection pool. The default is 100 seconds. If set to 0, then the connections never time out. The minimum is 0; the maximum is 300.

ConnNoWait

A directive given whether to wait for an available connection from the cache connection pool when no connection is immediately available. Valid values are:

  • Disabled (0 - the default): Any dynamic load operations wait for an available connection in the cache connection pool before proceeding.

  • Enabled (1): Any dynamic load operations fail with an error if there is no available connection in the cache connection pool.


Examples

The following initiates the minimum and maximum number of pooled connections to be between 10 and 32 connections and the increment is 1. The maximum idle time by the client is set to 10 seconds. And all dynamic load operations will wait for an available connection from the cache connection pool.

Command> call ttCacheConnPoolSet(10, 32, 1, 10, 0);

Notes

This procedure is available only for TimesTen Cache.

ttCacheDbCgStatus

Description

This procedure returns the automatic refresh status of the database and the specified cache group. If you do not specify any values for the parameters, the procedure returns the automatic refresh status for the database.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheDbCgStatus([cgOwner], [cgName])

Parameters

ttCacheDbCgStatus has these optional parameters:

Parameter Type Description
cgOwner VARCHAR2(30) Specifies the user name of the cache group owner.
cgName VARCHAR2(30) Specifies the cache group name.

Result set

ttCacheDbCgStatus returns the result:

Column Type Value
dbStatus VARCHAR2(20) Specifies the autorefresh status of all the cache groups in the database. The status is one of:

alive - The database is active. The status of all cache groups is ok. The cache agent has been in contact with the Oracle database server.

dead - The cache agent was not able to contact the Oracle database within the timeout period. The status of all the cache groups with the AUTOREFRESH attribute is terminated.

recovering - Some or all the cache groups with the AUTOREFRESH attribute are being resynchronized with the Oracle database server. The status of at least one cache group is recovering.

cgStatus VARCHAR2(20) Specifies the autorefresh status of the specified cache group. The status is one of:

ok - The specified cache group is synchronized with the Oracle database. The cache agent has been in contact with the Oracle database server.

dead - The cache agent was not able to contact the Oracle database within the timeout period and the specified cache group may be out of sync with the Oracle database server.

recovering - The specified cache group is being resynchronized with the Oracle database server.


Examples

This example shows that the automatic refresh status of the database is alive. The automatic refresh status of the cache group is ok.

CALL ttCacheDbCgStatus ('terry', 'cgemployees');
< alive, ok >
1 row found.

To determine the automatic refresh status of the database, call ttCacheDbCgStatus with no parameters:

CALL ttCacheDbCgStatus;
< dead, <NULL> >
1 row found.

Notes

This procedure is available only for TimesTen Cache.

ttCacheDDLTrackingConfig

This procedure enables or disables tracking of DDL statements issued on cached Oracle database tables. By default, DDL statements are not tracked.

DDL tracking saves the change history for all the cached Oracle database tables. One DDL tracking table is created to store DDL statements issued on any cached Oracle database table. You can use this information to diagnose autorefresh problems.

See "Tracking DDL statements issued on cached Oracle Database tables" in Oracle TimesTen Application-Tier Database Cache User's Guide.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheDDLTrackingConfig('trackingStatus')

Parameters

ttCacheDDLTrackingConfig has the parameter:

Parameter Type Description
trackingStatus TT_VARCHAR(10) Specifies whether DDL statements issued on cached Oracle database tables are tracked. Valid values are:

enable - Enables tracking.

disable (default) - Disables tracking.


Result set

ttCacheDDLTrackingConfig returns no results.

Examples

Command> CALL ttCacheDDLTrackingConfig('enable');

ttCachePolicyGet

Description

This procedure returns the current policy used to determine when the TimesTen cache agent for the connected database should run. The policy can be either always or manual.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCachePolicyGet()

Parameters

ttCachePolicyGet has no parameters.

Result set

ttCachePolicyGet returns the result:

Column Type Value
cachePolicy TT_VARCHAR(10) Specifies the policy used to determine when the TimesTen cache agent for the database should run. Valid values are:

always - Specifies that the agent for the database is always running. This option immediately starts the TimesTen cache agent. When the TimesTen daemon restarts, TimesTen automatically restarts the cache agent.

manual (default) - Specifies that you must manually start the cache agent using either the ttCacheStart built-in procedure or the ttAdmin -cacheStart command. You must explicitly stop the cache agent using either the ttCacheStop built-in procedure or the ttAdmin -cacheStop command.


Examples

To get the current policy for the TimesTen cache agent, use:

CALL ttCachePolicyGet ();

Notes

This procedure is available only for TimesTen Cache.

ttCachePolicySet

Description

The procedure defines the policy used to determine when the TimesTen cache agent for the connected database should run. The policy can be either always or manual.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCachePolicySet('cachePolicy')

Parameters

ttCachePolicySet has these parameters:

Parameter Type Description
cachePolicy
TT_VARCHAR(10)
NOT NULL
Specifies the policy used to determine when the TimesTen cache agent for the database should run. Valid values are:

always - Specifies that the agent for the database is always running. This option immediately starts the TimesTen cache agent. When the TimesTen daemon restarts, TimesTen automatically restarts the cache agent.

manual (default) - Specifies that you must manually start the cache agent using either the ttCacheStart built-in procedure or the ttAdmin -cacheStart command. You must explicitly stop the cache agent using either the ttCacheStop built-in procedure or the ttAdmin -cacheStop command.

norestart - Specifies that the cache agent for the database is not to be restarted after a failure.


Result set

ttCachePolicySet returns no results.

Examples

To set the policy for TimesTen cache agent to always, use:

CALL ttCachePolicySet ('always');

Notes

This procedure is available only for TimesTen Cache.

Always specify the TimesTen database location as a full path. If a relative path is specified, TimesTen would look relative to the working directory of the daemon, timesten_home/info.

Successfully setting the policy to always automatically starts the cache agent if it was stopped.

ttCachePropagateFlagSet

Description

This procedure enables you to disable propagation of committed updates (the result of executing DML statements) within the current transaction to the Oracle database. Any updates from executing DML statements after the flag is set to zero are never propagated to the back-end Oracle database. Thus, these updates exist only on the TimesTen database. You can then re-enable propagation for DML statements by resetting the flag.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCachePropagateFlagSet(CommitsOn)

Parameters

ttCachePropagateFlagSet has the parameter:

Parameter Type Description
CommitsOn TT_INTEGER NOT NULL If 0, sets a flag to stop updates from being sent to the Oracle database. The flag remains set until the end of the transaction or until the procedure is set to 1.

If 1, updates are sent to the Oracle database.


Result set

ttCachePropagateFlagSet returns no results.

Notes

This procedure is available only for TimesTen Cache.

If the value of ttCachePropagateFlagSet is reenabled several times during a single transaction, the transaction is only partially propagated to the Oracle database.

ttCachePropagateFlagSet is the only built-in procedure that applications can use in the same transaction as any of the other cache group operation, such as FLUSH, LOAD, REFRESH and UNLOAD.

The propagate flag is reset after a commit or rollback.

When using this procedure, it is important to turn off AutoCommit, otherwise after the procedure is called the transaction ends and propagation to the Oracle database is turned back on.

Examples

This example sets autocommit off to prevent the propagation flag from toggling from off to on after a commit. Calls the ttCachePropagateFlagSet to turn off propagation. A row is inserted into the TimesTen Cache detail table for oratt.writetab. Then, propagation is reenabled by calling the ttCachePropagateFlagSet built-in procedure and setting the flag to one.

Command> set autocommit off;
         call ttCachePropagateFlagSet(0);
         INSERT INTO oratt.writetab VALUES (103, 'Agent');
1 row inserted.
Command> COMMIT;
Command> SELECT * FROM oratt.writetab;
< 100, Oracle >
< 101, TimesTen >
< 102, Cache >
< 103, Agent >
4 rows found.
Command> call ttCachePropagateFlagSet(1);

When you select all rows on the Oracle database, the row inserted when propagation was turned off is not present in the oratt.writetab table on Oracle.

Command> set passthrough 3;
         SELECT * FROM oratt.writetab;
< 100, Oracle >
< 101, TimesTen >
< 102, Cache >
3 rows found.

ttCacheSqlGet

Description

This procedure generates the Oracle SQL statements to install or uninstall Oracle database objects for:

  • Read-only cache groups

  • User managed cache groups with incremental autorefresh

  • Asynchronous writethrough (AWT) cache groups

This is useful when the user creating the cache group does not have adequate privilege to write on the Oracle database. The Oracle DBA can then use the script generated by this built-in procedure to create the Oracle database objects.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheSqlGet('feature_name', 'cache_group_name', install_flag)

Parameters

ttCacheSqlGet has these parameters:

Parameter Type Description
feature_name TT_VARCHAR (100) Can be specified as INCREMENTAL_AUTOREFRESH or ASYNCHRONOUS_WRITETHROUGH.
cache_group_name TT_VARCHAR (100) The name of the cache group. Specify NULL when installing objects for asynchronous writethrough cache groups or to uninstall all Oracle database objects in the autorefresh user's account.
install_flag TT_INTEGER NOT NULL If install_flag is 1, ttCacheSqlGet returns Oracle SQL to install the autorefresh or asynchronous writethrough Oracle database objects.

If install_flag is 0, ttCacheSqlGet returns SQL to uninstall the previously created objects.


Result set

ttCacheSqlGet returns the result set:

Column Type Description
retval TT_VARCHAR (4096) NOT NULL The Oracle SQL statement to uninstall or install autorefresh or asynchronous writethrough Oracle database objects.
continueFlag TT_SMALLINT NOT NULL nonzero only if the Oracle SQL statement in the retval result column exceeds 4096 bytes and must be continued into the next result row.

Examples

CALL ttCacheSqlGet('INCREMENTAL_AUTOREFRESH', 'westernCustomers', 1);

To remove all Oracle database objects in the autorefresh user's account, use:

CALL ttCacheSqlGet('INCREMENTAL_AUTOREFRESH', NULL, 0);

Notes

This procedure is available only for TimesTen Cache.

Each returned retval field contains a separate Oracle SQL statement that may be directly executed on the Oracle database. A row may end in the middle of a statement, as indicated by the continueFlag field. In this case, the statement must be concatenated with the previous row to produce a usable SQL statement.

The script output of this procedure is not compatible with Oracle's SQL*Plus utility. However, you can use the ttIsql cachesqlget command to generate a script that is compatible with the SQL*Plus utility.

You can specify NULL for the cache_group_name option to generate Oracle SQL to clean up Oracle database objects after a database has been destroyed by the ttDestroy utility.

ttCacheStart

Description

This procedure starts the TimesTen cache agent for the connected database.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheStart()

Parameters

ttCacheStart has no parameters.

Result set

ttCacheStart returns no results.

Examples

To start the TimesTen cache agent, use:

CALL ttCacheStart ();

Notes

This procedure is available only for TimesTen Cache.

The cache administration user ID and password must be set with the ttCacheUidPwdSet built-in procedure before starting the cache agent when there are or might be autorefresh or asynchronous writethrough cache groups in the database.

If you attempt to start the TimesTen cache agent (by changing the policy from manual to always) for a database with a relative path, TimesTen looks for the database relative to where the TimesTen Data Manager is running, and fails. For example, on Windows, if you specify the path for the database as DataStore=./payroll and attempt to start the TimesTen cache agent with this built-in procedure, the agent is not started because TimesTen Data Manager looks for the database in the \srv directory.

When using this procedure, no application, including the application making the call, can be holding a connection that specifies database-level locking (LockLevel=1).

ttCacheStop

Description

This procedure stops the TimesTen cache agent for the connected database.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheStop(timeout)

Parameters

ttCacheStop has the parameter:

Parameter Type Description
timeout TT_INTEGER Specifies that the TimesTen daemon should stop the cache agent if it does not stop within timeout seconds. If set to 0, the daemon waits forever for the cache agent. The default value is 100.

Result set

ttCacheStop returns no results.

Examples

To stop the TimesTen cache agent, use:

CALL ttCacheStop();

Notes

This procedure is available only for TimesTen Cache.

Do not shut down the cache agent immediately after dropping or altering a cache group. Instead, wait for at least two minutes. Otherwise, the cache agent may not get a chance to clean up the Oracle database objects that were used by the AUTOREFRESH feature.

When using this procedure, no application, including the application making the call, can be holding a connection that specifies database-level locking (LockLevel=1).

ttCacheUidGet

Description

This procedure returns the cache administration user ID for the database. If the cache administration user ID and password have not been set for the database with the ttCacheUidPwdSet built-in procedure, ttCacheUidGet returns NULL.

Required privilege

This procedure requires CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheUidGet()

Parameters

ttCacheUidGet has no parameters.

Result set

ttCacheUidGet returns the results:

Column Type Description
UID TT_VARCHAR (30) The current cache administration user ID, used for autorefresh and asynchronous writethrough cache groups.

Examples

CALL ttCacheUidGet();

Notes

This procedure is available only for TimesTen Cache.

ttCacheUidPwdSet

Description

This procedure sets the cache administration user ID and password. You only need to specify the cache administration user ID and password once for each new database. The cache administration password can be changed at any time.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCacheUidPwdSet('UID', 'PWD')

Parameters

ttCacheUidPwdSet has these parameters:

Parameter Type Description
UID TT_VARCHAR (30) The cache administration user ID, used for autorefresh and asynchronous writethrough cache groups.
PWD TT_VARCHAR (30) The password for the cache administration user.

Result set

ttCacheUidPwdSet returns no results.

Examples

CALL ttCacheUidPwdSet('myid', 'mypwd');

Notes

This procedure cannot be called from an unencrypted Client/Server connection.

This procedure is available only for TimesTen Cache.

For all levels of DDLReplicationLevel, you can set the cache administration user ID and password while the cache or replication agents are running. For more details on changing the cache administration user ID or password, see "Changing cache user names and passwords" in the Oracle TimesTen Application-Tier Database Cache User's Guide.

The cache administration user ID cannot be reset while there are cache groups on the database. The cache administration password can be changed at any time.

ttCkpt

Description

This procedure performs a nonblocking checkpoint operation. For information on blocking checkpoints, see "ttCkptBlocking". A checkpoint operation makes a record of the current state of the database on disk and to purge transaction log files. A nonblocking checkpoint does not require any locks on the database.

Applications should checkpoint databases periodically either by setting the background checkpointing attributes (CkptFrequency and CkptLogVolume) or by explicitly calling this procedure. Applications can call this procedure asynchronously to any other application running on the database.

By default, TimesTen performs background checkpoints at regular intervals.

In the case that your application attempts to perform a checkpoint operation while a backup is in process, the backup waits until the checkpoint finishes. Regardless of whether the checkpoint is a background checkpoint or an application-requested checkpoint, the behavior is:

  • If a backup or checkpoint is running and you try to do a backup, it waits for the running backup or checkpoint to finish.

  • If a backup or checkpoint is running and you try to do a checkpoint, it does not wait. It returns an error immediately.

To turn off background checkpointing, set CkptFrequency=0 and CkptLogVolume=0.

When a database crashes, and the checkpoints on disk are nonblocking checkpoints, TimesTen uses the log to recover.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCkpt([timeout], [retries])

Parameters

ttCkpt has these optional parameters:

Parameter Type Description
timeout TT_INTEGER The time (in seconds) that ttCkpt should wait to get a database lock before timing out. The value of timeout can be between 0 and one million, inclusively. If not specified, the checkpoint never times out.
retries TT_INTEGER The number of times that ttCkpt should attempt to get a database lock, if timeouts occur. The value of retries can be between 0 and 10, inclusive. If not specified, defaults to zero.

Result set

ttCkpt returns no results.

Examples

CALL ttCkpt();

Notes

For a description of checkpoints, see "Transaction Management" in Oracle TimesTen In-Memory Database Operations Guide.

ttCkptBlocking

Description

This procedure performs a blocking checkpoint operation. A checkpoint operation makes a record of the current state of the database on disk, and to purge transaction log files. This checkpoint requires exclusive access to the database, and so may cause other applications to be blocked from the database while the checkpoint is in progress.

To perform a nonblocking checkpoint, use the ttCkpt procedure.

No log is needed to recover when blocking checkpoints are used. TimesTen uses the log, if present, to bring the database up to date after recovery.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttCkptBlocking([timeout], [retries])

Parameters

ttCkptBlocking has these optional parameters:

Parameter Type Description
timeout TT_INTEGER The time (in seconds) that ttCkptBlocking should wait to get a database lock before timing out. The value of timeout can be between 0 and one million, inclusively. If not specified, the checkpoint never times out.
retries TT_INTEGER The number of times that ttCkptBlocking should attempt to get a database lock, if timeouts occur. The value of retries can be between 0 and 10, inclusive. If not specified, defaults to zero.

Result set

ttCkptBlocking returns no results.

Examples

CALL ttCkptBlocking();
CALL ttCkptBlocking(1,10);

Notes

Because the checkpoint takes place at commit or rollback, the call to ttCkptBlocking always succeed. At commit or rollback, any problems with the checkpoint operation, such as a lack of disk space or a timeout, result in a warning being returned to the application. Checkpoint problems are not reflected as errors, since the commit or rollback of which they are a part can succeed even if the checkpoint fails. Warnings are reflected in ODBC with the return code SQL_SUCCESS_WITH_INFO.

For more information on checkpoints, see "Transaction Management" in Oracle TimesTen In-Memory Database Operations Guide.

ttCkptConfig

Description

This procedure reconfigures the background checkpointer dynamically or returns the currently active settings of the configuration parameters. Changes made using ttCkptConfig become effective immediately. Thus, changes to ckptRate can take effect on a checkpoint that is currently in progress.

Changes made to the background checkpointer using ttCkptConfig are persistent. Subsequent loads of the database retain the new settings, unless the CkptFrequency and CkptLogVolume connection attributes are specified in the DSN or connection string, in which case the attribute values are used instead.

Required privilege

This procedure requires no privilege to query the current values. It requires the ADMIN privilege to change the current values.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure returns a row for the element from which it was called.

Related views

This procedure has these related views.

SYS.GV$CKPT_CONFIG

SYS.V$CKPT_CONFIG

Syntax

ttCkptConfig(ckptFrequency, ckptLogVolume, ckptRate)

Parameters

ttCkptConfig has these parameters:

Parameter Type Description
ckptFrequency TT_INTEGER Checkpoint frequency in seconds. Values from 0 to MAXINT are allowed. A value of 0 means that checkpoint frequency is not considered when scheduling checkpoints.
ckptLogVolume TT_INTEGER Log volume between checkpoints in megabytes. Values from 0 to MAXINT are allowed. A value of 0 means that checkpoint log volume is not considered when scheduling checkpoints.
ckptRate TT_INTEGER Specifies the rate in MB per second at which a checkpoint should be written to disk.

A value of 0 indicates that the rate should not be limited, a value of NULL means that the rate should be left unchanged. Changes to this parameter take effect even on a checkpoint that is currently in-progress.


Result set

ttCkptConfig returns the following results.

Column Type Description
ckptFrequency TT_INTEGER NOT NULL Currently active setting for checkpoint frequency in seconds.
ckptLogVolume TT_INTEGER NOT NULL Currently active setting for log volume between checkpoints in MB.
ckptRate TT_INTEGER NOT NULL Current rate at which TimesTen writes checkpoints to disk.

Examples

To view the current settings of the background checkpointer configuration parameters, use:

CALL ttCkptConfig;
< 600, 32, 0 >
1 row found.

To stop the background checkpointer from initiating checkpoints unless the log reaches its limit, use:

CALL ttCkptConfig(0);
< 0, 32, 0 >
1 row found.

To stop the background checkpointer from initiating checkpoints, use:

CALL ttCkptConfig(0, 0);
< 0, 0, 0 >
1 row found.

To set the background checkpointer configuration to initiate a checkpoint every 600 seconds or to checkpoint when the log reaches 32 MB (whichever comes first), use:

CALL ttCkptConfig(600, 32);
< 600, 32, 0 >
1 row found.

Notes

By default, TimesTen performs background checkpoints at regular intervals.

In the case that your application attempts to perform a checkpoint operation while a backup is in process, the backup waits until the checkpoint finishes. Regardless of whether the checkpoint is a background checkpoint or an application-requested checkpoint, the behavior is:

  • If a backup or checkpoint is running and you try to do a backup, it waits for the running backup or checkpoint to finish.

  • If a backup or checkpoint is running and you try to do a checkpoint, it does not wait. It returns an error immediately.

To turn off background checkpointing, set CkptFrequency=0 and CkptLogVolume=0.

ttCkptHistory

Description

This procedure returns information about the last eight checkpoints of any type.

Also see "Displaying checkpoint history and status" in Oracle TimesTen In-Memory Database Operations Guide.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout this procedure returns a row for the element from which it was called.

Related views

This procedure has these related views.

SYS.GV$CKPT_HISTORY

SYS.V$CKPT_HISTORY

Syntax

ttCkptHistory( )

Parameters

ttCkptHistory has no parameters.

Result set

ttCkptHistory returns the result set:

Column Type Description
startTime TT_TIMESTAMP NOT NULL Time when the checkpoint was begun.
endTime TT_TIMESTAMP Time when the checkpoint completed.
type TT_CHAR (16) NOT NULL The type of checkpoint taken. Value is one of:

Static - Automatically taken at database creation and at last disconnect.

Blocking - Transaction-consistent checkpoint.

Fuzzy - nonblocking checkpoint. The background checkpointer performs this type if possible.

None - For temporary databases, which have no checkpoint files.

status TT_CHAR (16) NOT NULL Result status of the checkpoint operation. Value is one of:

In Progress - The checkpoint is currently in progress. Only the most recent result row can have this status.

Completed - The checkpoint completed successfully.

Failed - The checkpoint failed. Only the most recent result row can have this status. In this case the error column indicates the reason for the failure.

initiator TT_CHAR (16) NOT NULL The source of the checkpoint request. Value is one of:

User - A user-level application. This includes TimesTen utilities such as ttIsql.

Checkpointer - The background checkpointer.

Subdaemon - The managing subdaemon of the database. For a shared database, the final disconnect checkpoint is taken by the subdaemon.

reason TT_CHAR (16) NOT NULL The reason for this checkpoint. For example: after database creation, after recovery, final checkpoint after shutdown, after the user runs a built-in procedure, or after a flush operation.
error TT_INTEGER If a checkpoint fails, this column indicates the reason for the failure. The value is one of the TimesTen error numbers.
ckptFileNum TT_INTEGER NOT NULL The database file number used by the checkpoint. This corresponds to the number in the checkpoint file extension datastore.ds0 or datastore.ds1.
ckptLFN TT_INTEGER The transaction log file number of the checkpoint log record.
ckptLFO TT_BIGINT The transaction log file offset of the checkpoint log record.
blksTotal TT_BIGINT The number of permanent blocks currently allocated in the database. These blocks are subject to consideration for checkpointing.
bytesTotal TT_BIGINT The number of bytes occupied by blksTotal.
blksInUse TT_BIGINT Of blksTotal, the number of blocks currently in use.
bytesInUse TT_BIGINT The number of bytes occupied by blksInUse.
blksDirty TT_BIGINT The number of dirty blocks written by this checkpoint.
bytesDirty TT_BIGINT The number of bytes occupied by blksDirty.
bytesWritten TT_BIGINT The total number of bytes written by this checkpoint.
Percent_Complete TT_INTEGER If there is an in-progress checkpoint, indicates the percentage of the checkpoint that has been completed. If no checkpoint is in-progress, the value is NULL. The returned value is calculated by comparing the block ID of the last-written block against the database's PermSize. The value does not necessarily indicate the precise time remaining to complete the checkpoint, although it does give some indication of the remaining time needed to complete the disk write. The field shows only the progress of the writing of dirty blocks and does not include additional bookkeeping at the end of the checkpoint. The value is non-NULL if you call this procedure while a checkpoint is in progress.
ckptVNo TT_INTEGER NOT NULL The checkpoint sequence number that is incremented for each checkpoint.
logsPurged TT_BIGINT The number of log files purged by this checkpoint.
bookmarkName TT_VARCHAR (30) INLINE The name of the log hold up to which this checkpoint purged log records. For example: Backup, Checkpoint, or Oldest Transaction Undo.
additional_details TT_VARCHAR (1000) Additional information provided for this checkpoint, such as error codes and timestamps for multiple failed checkpoints.

Examples

This example shows a checkpoint in progress:

< 2019-02-05 16:56:34.169520, <NULL>, 
Fuzzy           , In Progress     , User            , 
BuiltIn         , <NULL>, 
0, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, 
<NULL>, <NULL>, <NULL>, 13, 6, 0, <NULL>, <NULL> >
 
< 2019-02-05 16:55:47.703199, 2019-02-05 16:55:48.188764, 
Fuzzy           , Completed       , Checkpointer    , 
Background      , <NULL>, 
1, 0, 8964304, 294, 33554432, 291, 5677288, 27, 1019512, 
1065408, <NULL>, 5, 0, Checkpoint, <NULL> >
 
< 2019-02-05 16:54:47.106110, 2019-02-05 16:54:47.723379, 
Static          , Completed       , Subdaemon       , 
FinalCkpt       , <NULL>, 
0, 0, 8960328, 294, 33554432, 291, 5677288, 256, 33157172, 
5321548, <NULL>, 4, 0, Checkpoint, <NULL> >
 
< 2019-02-05 16:54:41.633792, 2019-02-05 16:54:42.568469, 
Blocking        , Completed       , User            , 
BuiltIn         , <NULL>, 
1, 0, 8958160, 294, 33554432, 291, 5677288, 31, 1162112, 
6604976, <NULL>, 3, 0, Checkpoint, <NULL> >
 
< 2019-02-05 16:54:37.438827, 2019-02-05 16:54:37.977301, 
Static          , Completed       , User            ,
DbCreate        , <NULL>, 
0, 0, 1611984, 93, 33554432, 92, 1853848, 93, 33554432, 
1854052, <NULL>, 2, 0, Checkpoint, <NULL> >
 
< 2019-02-05 16:54:36.861728, 2019-02-05 16:54:37.438376, 
Static          , Completed       , User            , 
DbCreate        , <NULL>, 
1, 0, 1609936, 93, 33554432, 92, 1853848, 93, 33554432, 
1854052, <NULL>, 1, 0, Checkpoint, <NULL> >

This example shows that an error occurred during the most recent checkpoint attempt, which was a user-initiated checkpoint:

< 2019-02-05 16:57:14.476860, 2019-02-05 16:57:14.477957, 
Fuzzy           , Failed , User            , 
BuiltIn         , 847, 
1, <NULL>, <NULL>, 0, 0, 0, 0, 0, 0, 0, <NULL>, 7, 0, <NULL>, 
Errors   1: TT0847: 16:57:14 (2019-02-05) >
 
< 2019-02-05 16:56:34.169520, 2019-02-05 16:56:59.715451, 
Fuzzy           , Completed       , User            , 
BuiltIn         , <NULL>, 
0, 0, 8966472, 294, 33554432, 291, 5677288, 5, 522000, 
532928, <NULL>, 6, 0, Checkpoint, <NULL> >
 
< 2019-02-05 16:55:47.703199, 2019-02-05 16:55:48.188764, 
Fuzzy           , Completed       , Checkpointer    , 
Background      , <NULL>, 
1, 0, 8964304, 294, 33554432, 291, 5677288, 27, 1019512, 
1065408, <NULL>, 5, 0, Checkpoint, <NULL> >
 
< 2019-02-05 16:54:47.106110, 2019-02-05 16:54:47.723379, 
Static          , Completed       , Subdaemon       , 
FinalCkpt       , <NULL>, 
0, 0, 8960328, 294, 33554432, 291, 5677288, 256, 33157172, 
5321548, <NULL>, 4, 0, Checkpoint, <NULL> >
 
< 2019-02-05 16:54:41.633792, 2019-02-05 16:54:42.568469, 
Blocking        , Completed       , User            , 
BuiltIn         , <NULL>, 
1, 0, 8958160, 294, 33554432, 291, 5677288, 31, 1162112, 
6604976, <NULL>, 3, 0, Checkpoint, <NULL> >
 
< 2019-02-05 16:54:37.438827, 2019-02-05 16:54:37.977301, 
Static          , Completed       , User            ,
DbCreate        , <NULL>, 
0, 0, 1611984, 93, 33554432, 92, 1853848, 93, 33554432, 
1854052, <NULL>, 2, 0, Checkpoint, <NULL> >
 
< 2019-02-05 16:54:36.861728, 2019-02-05 16:54:37.438376, 
Static          , Completed       , User            , 
DbCreate        , <NULL>, 
1, 0, 1609936, 93, 33554432, 92, 1853848, 93, 33554432, 
1854052, <NULL>, 1, 0, Checkpoint, <NULL> >

This example selects specific columns from the checkpoint history:

select type, reason, bookmarkname, logsPurged from ttCkptHistory;
< Fuzzy           , BuiltIn         , Oldest Transaction Undo, 0 >
< Static          , FinalCkpt       , Checkpoint, 6 >
< Blocking        , BuiltIn         , Checkpoint, 0 >
< Blocking        , BuiltIn         , Checkpoint, 0 >
< Blocking        , BuiltIn         , Checkpoint, 0 >
< Blocking        , BuiltIn         , Backup, 5 >
< Blocking        , BuiltIn         , Backup, 0 >
< Blocking        , BuiltIn         , Backup, 0 >

The bottom (oldest) checkpoints could not purge log files because there was a log hold set by incremental backup, but eventually the log hold moved and five log files could be purged.

Notes

Results are ordered by start time, with the most recent first.

A failed row is overwritten by the next checkpoint attempt.

ttCommitBufferStats

Description

This built-in procedure returns the number of commit buffer overflows and the high watermark for memory used by transaction reclaim records during transaction commit process.

The information provided by the results of this procedure call is useful information when you want to explicitly set the maximum size of commit buffer, using the CommitBufferSizeMax connection attribute or the ALTER SESSION SQL statement, described in Oracle TimesTen In-Memory Database SQL Reference. This procedure helps you choose the right size for the reclaim buffer, based on the number of overflows and the maximum memory used by the reclaim records.

If there are buffer overflows, you may consider increasing the commit buffer maximum size. If there are no overflows and the highest amount of memory usage is well under the commit buffer maximum size, you may consider decreasing the maximum size.

For more information on reclaim operations, including details about setting the commit buffer size, see "Transaction reclaim operations" in the Oracle TimesTen In-Memory Database Operations Guide.

Required privilege

This procedure requires no privileges.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure returns a row for the element from which it was called. To see information about other elements, query the SYS.GV$COMMIT_BUFFER_STATS system table.

Related views

This procedure has these related views.

SYS.GV$COMMIT_BUFFER_STATS

SYS.V$COMMIT_BUFFER_STATS

Syntax

ttCommitBufferStats( )

Parameters

ttCommitBufferStats takes no parameters.

Result set

ttCommitBufferStats returns these results:

Column Type Description
overflows TT_BIGINT NOT NULL Total number of commit buffer overflows.
maxReached TT_BIGINT NOT NULL The currently used maximum for the transaction commit buffer in bytes.

Examples

This shows the result for a session where there have been no commit buffer overflows and the transaction commit buffer is set to 500 MB.

Command> ALTER SESSION SET COMMIT_BUFFER_SIZE_MAX = 500;
Session altered.
Command> CALL ttCommitBufferStats( );
< 0, 524288000 >
1 row found

For a session where there have been 10 commit buffer overflows and the transaction commit buffer is set to 2 MB, the output of this procedure is:

Command> ALTER SESSION SET COMMIT_BUFFER_SIZE_MAX = 2;
Session altered.
Command> CALL ttCommitBufferStats( );
< 10, 2097152 >
1 row found

Notes

When you call the built-in procedure ttCommitBufferStatsReset, the commit buffer statistics are expressed in bytes. However, the ttConfiguration output and the value set by the connection attribute CommitBufferSizeMax are expressed in MB.

ttCommitBufferStatsReset

Description

The ttCommitBufferStatsReset procedure resets transaction commit buffer statistics to 0. This is useful, for example, if you have set a new value for the commit buffer maximum size and want to restart the statistics.

For more information on reclaim operations, including details about setting the commit buffer size, see "Transaction reclaim operations" in the Oracle TimesTen In-Memory Database Operations Guide.

Required privilege

This procedure requires no privileges.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has these related views.

SYS.GV$CONFIGURATION

SYS.V$CONFIGURATION

Syntax

ttCommitBufferStatsReset()

Parameters

ttCommitBufferStatsReset takes no parameters.

Result set

ttCommitBufferStatsReset returns no result set.

Examples

CALL ttCommitBufferStatsReset;

ttCompact

Description

This procedure compacts both the permanent and temporary data partitions of the database.

ttCompact merges adjacent blocks of free space, but does not move any items that are allocated. Therefore, fragmentation that is caused by small unallocated blocks of memory surrounded by allocated blocks of memory is not eliminated by using ttCompact.'

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Related views

This procedure has no related views.

Syntax

ttCompact()

Parameters

ttCompact has no parameters.

Result set

ttCompact returns no results.

Examples

CALL ttCompact;

Notes

Compacting data does not modify result addresses.

ttComputeTabSizes

Description

The ttComputeTabSizes built-in procedure refreshes table size statistics stored in TimesTen system tables. After calling this built-in procedure, you can review the statistics updates by querying the DBA_TAB_SIZES, USER_TAB_SIZES or ALL_TAB_SIZES view.

This procedure computes the different types of storage allocated for the specified table, such as the amount of storage allocated for inline row storage, dictionary tables, out-of-line buffers and system usage. If no table is specified, the procedure computes the sizes for all tables on which the user has SELECT privileges.The execution of this built-in behaves like a DDL statement: the transaction commits just before the procedure begins and commits again upon its successful termination.

Required privilege

This procedure requires the SELECT privilege on the specified table.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Related views

This procedure has no related views.

Syntax

ttComputeTabSizes (['tblName'], [includeOutOfLine])

Parameters

ttComputeTabSizes has the parameters:

Parameter Type Description
tblName TT_CHAR(61) Name of an application table. Can include the table owner. If a value of NULL or an empty string is provided, updates the statistics for all the current tables.

The type of tables that can be estimated are:

  • User tables, including cache group tables

  • Materialized views

  • System tables

includeOutOfLine TT_INTEGER 0 (no) or 1 (yes). Default is 1 (yes).

If value is 0 (no), the procedure does not compute the size of out-of-line values for any table that has out-of-line columns. The out-of-line fields are displayed as NULL.

Avoiding the computation of out-of-line values significantly decreases the latency of this procedure.


Result set

ttComputeTabSizes returns no results.

Examples

To compute the size of my_table without including out-of-line columns, use:

CALL ttComputeTabSizes ('my_table', 0);

Notes

The built-in procedure allows concurrent insertions while ttComputeTabSizes is executing. For this reason, the size computed by ttComputeTabSizes for each table is any value between the minimum size of the table during the computation and the maximum size of the table during the computation. For example, if the size of a table is 250 MB when ttComputeTabSizes is executed, and a transaction running concurrently raises the size of the table to 300 MB, ttComputeTabSizes estimates a value between 250 and 300 MB.

See also


ttSize

ttConfiguration

Description

The ttConfiguration built-in procedure returns the values for most, but not all, connection attributes and some options for the current database connection.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$CONFIGURATION

SYS.V$CONFIGURATION

Syntax

ttConfiguration(['paramName'])

Parameters

ttConfiguration has the optional parameter:

Parameter Type Description
paramName TT_VARCHAR (30) The name of a connection attribute or option for which you want this procedure to return the value.

Result set

ttConfiguration returns the result set:

Column Type Description
paramName
TT_VARCHAR (30) 
NOT NULL
The names of the connection attributes specified in the connection string, returned in alphabetical order.
paramValue TT_VARCHAR (1024) The values of the connection attributes specified in the connection string.

Examples

To see the value of the QueryThreshold connection attribute, use

CALL ttConfiguration('querythreshold');
<QueryThreshold, 0>
1 row found

To see the values of all attributes, use:

CALL ttConfiguration();
< CkptFrequency, 600 >
< CkptLogVolume, 0 >
. . .

Notes

The values of client driver attributes are not returned by this procedure.

The values of some attributes, such as ForceConnect, may not be returned by this procedure, as well.

ttContext

Description

This procedure returns the context value of the current connection as a BINARY(8) value. You can use the context to correlate a unique connection to a database from the list of connections presented by the ttStatus utility and the ttDataStoreStatus built-in procedure.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$CONTEXT

SYS.V$CONTEXT

Syntax

ttContext()

Parameters

ttContext has no parameters.

Result set

ttContext returns the result set:

Column Type Description
context BINARY(8) Current connection context value.

Examples

CALL ttContext;

Notes

The context value numbers are unique only within a process. The context value number is not unique within the entire database. Therefore you may see the same context value number for different processes.

See also


"ttStatus"

ttDataStoreStatus

Description

This procedure returns the list of processes connected to a database. If the dataStore parameter is specified as NULL, then the status of all active databases is returned.

The result set is similar to the printed output of the ttStatus utility.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$DATASTORE_STATUS

SYS.V$DATASTORE_STATUS

Syntax

ttDataStoreStatus('dataStore')

Parameters

ttDataStoreStatus has the parameter:

Parameter Type Description
dataStore TT_VARCHAR (256) Full path name of desired database or NULL for all databases.

Result set

ttDataStoreStatus returns the result set:

Column Type Description
dataStore TT_VARCHAR (256) NOT NULL Full path name of database.
PID TT_INTEGER NOT NULL Process ID.
Context BINARY(8) NOT NULL Context value of connection.
conType
TT_CHAR (16)
NOT NULL
Type of process connected. The result can be one of the following:

application - An ordinary application is connected.

replication - A replication agent is connected.

subdaemon - A subdaemon is connected.

oracleagent - An cache agent is connected.

ShmID
TT_VARCHAR (260)
NOT NULL
A printable version of the shared memory ID that the database occupies.
connection_Name
TT_CHAR (30)
NOT NULL
The symbolic name of the database connection.
connID TT_INTEGER NOT NULL The numeric ID of the database connection.

Examples

CALL ttDataStoreStatus('/data/Purchasing');

ttDBCompactConfig

Description

The ttDBCompactConfig built-in procedure turns on automatic database compaction. By default, TimesTen does not compact databases automatically.

Required privilege

This procedure requires ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$DB_COMPACT_CONFIG

SYS.V$DB_COMPACT_CONFIG

Syntax

ttDBCompactConfig([[value][,[value]][,[value]]])

Parameters

ttDBCompactConfig has the parameters:

Parameter Type Description
quantum TT_INTEGER Specifies the number of data blocks to be compacted. Values from 0 to 100000 are allowed. A value of 0 means that automatic database compaction is disabled.
compactsPerSecond TT_INTEGER Number of compaction operations that can occur per second. Values from 0 to 100 are allowed. A value of 0 means that automatic database compaction is disabled.
threshold TT_INTEGER Specifies the minimum amount of the database that needs to be compacted, before automatic database compaction occurs. The units are the same as for parameter quantum. Values from 0 to 100000 (100k) are allowed. A value of 0 means that the compaction operations executes whenever there is anything to compact in the database.

Result set

ttDBCompactConfig returns the result set:

Column Type Description
quantum TT_INTEGER NOT NULL Currently active setting for quantum.
compactsPerSecond TT_INTEGER NOT NULL Currently active setting for compactsPerSecond.
threshold TT_INTEGER NOT NULL Currently active setting for threshold.

Examples

To view the current settings for automatic database compaction, use:

Call ttDbCompactConfig;
< 0,0,0 >
1 row found.

Note: These are the default settings. Automatic database compaction is disabled if either of the first two parameters is 0.

To enable automatic database compaction on 1,000 blocks once a second, use:

Call ttDbCompactConfig (1000,1,0);
< 1000,1,0 >
1 row found.

To enable automatic database compaction on 5,000 blocks ten times a second, use:

Call ttDbCompactConfig (5000,10,0);
< 5000,10,0 >
1 row found.

To enable automatic database compaction on 2,000 blocks five times a second, but only perform compaction when there is at least this much to compact, use:

Call ttDbCompactConfig (2000,5,2000);
< 2000,5,2000 >
1 row found.

To stop automatic database compaction from doing further compaction, after it was turned on (note that it is off by default), use:

Call ttDbCompactConfig (0,0,0);

You can set just one or two values at a time, using commas as placeholders:

call ttDBCompactConfig(2000,5,2000);
< 2000, 5, 2000 >
1 row found.
call ttDBCompactConfig(3000);
< 3000, 5, 2000 >
1 row found.
call ttDBCompactConfig(,10);
< 3000, 10, 2000 >
1 row found.
call ttDBCompactConfig(,,2500);
< 3000, 10, 2500 >
1 row found.
call ttDBCompactConfig(3500,,3000);
< 3500, 10, 3000 >
1 row found.

Notes

After using this built-in procedure to set a parameter value, initiate a checkpoint to ensure the persistence of the parameter change. See details about the ttCkpt procedure in "Checkpoint operations" in the Oracle TimesTen In-Memory Database Operations Guide. For details about the checkpoint built-in procedure, see "ttCkpt" in this chapter.

You can specify one, two, or three input values, using commas as placeholders, or no input to see the current values.

Changes to parameter values made by ttDBCompactConfig cannot be rolled back.

See Also

ttDBConfig

ttDBConfig

Description

The ttDBConfig built-in enables users to set or view the value of a TimesTen database system parameter.

Required privilege

This procedure requires ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$DB_CONFIG

SYS.V$DB_CONFIG

Syntax

ttDBConfig(['param'[,'value']])

Parameters

ttDBConfig has the parameters:

Parameter Type Description
param VARCHAR2(30) .A system parameter for which you either want to set a value or see the current value. Accepted values for this argument are:

CacheAgentCommitBufSize

CacheAwtMethod

CacheParAwtBatchSize

DynamicLoadReduceContention

ParReplMaxDrift

PLSQL_OPEN_CURSORS

RepAgentCommitBufSize

value VARCHAR2(200) The value of the system parameter.

If you do not specify a value, this procedure returns the current value of the specified parameter.


Parameter / Value Pairs

These name/value pairs can be returned in the result set:

Name Value Description
CacheAgentCommitBufSize Size in MB Specifies the reclaim buffer maximum size for the cache agent. The cache agent periodically checks to see if the value has changed. The size cannot be greater than the temporary partition size.

For more details, see "Improving performance when reclaiming memory during autorefresh operations" in the Oracle TimesTen Application-Tier Database Cache User's Guide.

CacheAwtMethod 0 - SQL Array execution method

1 - PL/SQL Execution method

Determines whether PL/SQL execution method or SQL array execution method is used for AWT propagation to apply changes to the Oracle database server.

See the description of the CacheAWTMethod connection attribute for details.

If set with this built-in procedure, overrides the connection attribute value.

CacheParAwtBatchSize Number of rows in a batch Configures a threshold value for the number of rows included in a single batch. Once the maximum number of rows is reached, TimesTen includes the rest of the rows in the transaction (TimesTen does not break up any transactions), but does not add any more transactions to the batch.

NOTE: You should not change the value of this parameter unless advised by Oracle TimesTen technical support.

DynamicLoadReduceContention 0 - Disabled. Default.

1 - Enabled.

If enabled, changes the way that autorefresh and dynamic load operations coordinate, which results in reduced contention between autorefresh and dynamic load operations.
  • Dynamic load operations are never blocked by autorefresh operations (due to additional synchronization).

  • Autorefresh operations are not completely delayed by dynamic load operations.

For more details, see "Reducing contention on TimesTen for dynamic read-only cache groups with incremental autorefresh" in the Oracle TimesTen Application-Tier Database Cache User's Guide.

ParReplMaxDrift Number of seconds Specifies the number of seconds of drift to allow between the parallel replication tracks. When you use automatic parallel replication with disabled commit dependencies, some of the tracks may move ahead of the others. Once this threshold is passed, TimesTen synchronizes all replication tracks so that they catch up to each other. By default, this is set to zero, which means that checking for drift between tracks is disabled.
PLSQL_OPEN_CURSORS Maximum number of PL/SQL cursors Specifies the maximum number of PL/SQL cursors that can be open in a session at one time, a value from 1 to 65535, inclusive. Use this to prevent a session from opening an excessive number of cursors. Default is 50 PL/SQL cursors.

For more details see the description of the PLSQL_OPEN_CURSORS first connection attribute.

RepAgentCommitBufSize Size in MB Specifies the reclaim buffer maximum size for the replication agent. The replication agent periodically checks to see if the value has changed. The size cannot be greater than the temporary partition size.

For more details, see "Improving performance when reclaiming memory during autorefresh operations" in the Oracle TimesTen Application-Tier Database Cache User's Guide.


Result set

ttDBConfig returns the result set:

Column Type Description
param VARCHAR2(30) The name of the specified parameter.
value VARCHAR2(200) The current value of the specified parameter. This is the new value, if you specified a value.

Examples

To retrieve the current value of the CacheParAwtBatchSize, use:

CALL ttDBConfig('CacheParAwtBatchSize');
<CACHEPARAWTBATCHSIZE, 125>
1 row found.

To set the value of the RepAgentCommitBufSize to 50 MB, use:

CALL ttDBConfig('RepAgentCommitBufSize', '50');
 <REPAGENTCOMMITBUFSIZE, 50>
 1 row found.

To set the current value of the CacheAgentCommitBufSize to 100, use:

Command> call ttDBConfig('CacheAgentCommitBufSize', '100');
 < CACHEAGENTCOMMITBUFSIZE, 100 >
1 row found.

The following example sets DynamicLoadReduceContention=1:

call ttDbConfig('DynamicLoadReduceContention','1');

Notes

After using this built-in procedure to set a parameter value, initiate a checkpoint to ensure the persistence of the parameter change. See details about the ttCkpt procedure in "Checkpoint operations" in the Oracle TimesTen In-Memory Database Operations Guide. For details about the checkpoint built-in procedure, see "ttCkpt" in this chapter.

Changes to parameter values made by ttDBConfig cannot be rolled back.

If you call ttDBConfig without an input parameter, it will return names and values of all supported parameters.

ttDBWriteConcurrencyModeGet

Description

The ttDBWriteConcurrencyModeGet built-in returns information about the write concurrency mode of the database and the status of write concurrency mode operations and transactions.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has these related views.

SYS.GV$DB_WRTE_CONCURRENCY_MODE

SYS.V$DB_WRTE_CONCURRENCY_MODE

Syntax

ttDBWriteConcurrencyModeGet()

Parameters

ttDBWriteConcurrencyModeGet has no parameters:

Result set

ttDBWriteConcurrencyModeGet returns the result set:

Column Type Description
ts TIMESTAMP NOT NULL Time at which the status information was collected.
mode TT_INTEGER NOT NULL The write concurrency mode:

0 - Optimize according to hints and standard optimization techniques.

1- Optimize for concurrent write operations.

operation VARCHAR2 (50) The transition status of the write concurrency mode. Either:

NULL - Not in transition.

TRANSITIONING TO MODE=n where n= 0 or 1.

status VARCHAR2 (100) NOT NULL The status of the write concurrency mode transition. Either:

IN TRANSITION or COMPLETE.

msg VARCHAR2 (5000) NULL or a status explanation message.

Examples

The following example shows how to determine if your database is optimized for concurrent write operations:

Command> CALL ttDBWriteConcurrencyModeGet();

< 2013-09-23 13:48:21.207599, 1, <NULL>, COMPLETE, <NULL> >
1 row found.

The results indicate that at approximately 1:48 pm on September 23, 2013 the database was optimized for concurrent write operations. The mode was not in transition.

ttDBWriteConcurrencyModeSet

Description

The ttDBWriteConcurrencyModeSet built-in enables control over read optimization during periods of concurrent write operations.

Set the mode to one (1) to enable the enhanced write concurrency mode and disable read optimization. Set the mode to zero (0) to disable the enhanced write concurrency mode and re-enable read optimization.When the mode is set to one (1), all transaction and statement table lock hints are suppressed. This affects hint-triggered Sn table locks for SELECT statements and subqueries and also hint-triggered W table locks for DML statements. Suppression of the table lock hint also suppresses other table-lock hint driven execution plans such as star joins. Regardless of the mode setting, table locks that are not triggered by table-lock hints are not affected.

Required privilege

This procedure requires ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Related views

This procedure has no related views.

Syntax

ttDBWriteConcurrencyModeSet(mode, wait)

Parameters

ttDBWriteConcurrencyModeSet has these parameters:

Parameter Type Description
mode TT_INTEGER NOT NULL The write concurrency mode:

0 - Optimize according to hints and standard optimization techniques.

1 - Optimize for concurrent write operations.

wait TT_INTEGER NOT NULL 0 - Return immediately after starting mode transition.

1 - Wait until mode transition is complete before returning. This can be useful when setting the mode to a nonzero value. When setting the mode to zero, it is typically not necessary to specify wait to 1.


Result set

ttDBWriteConcurrencyModeSet returns no result set:

Examples

The following example shows how to enable standard optimization techniques and return immediately after starting the operation:

Command> CALL ttDBWriteConcurrencyModeSet(0,0);

Notes

When the mode is set to one (1), all transaction and statement table lock hints are suppressed. This affects hint-triggered Sn table locks for SELECT statements and subqueries and also hint-triggered W table locks for DML statements. Suppression of the table lock hint also suppresses other table-lock hint driven execution plans such as star joins. Regardless of the mode setting, table locks that are not triggered by table-lock hints are not affected.

ttDistributionProgress

Description

This built-in procedure provides a progress report of an ongoing redistribution process.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is not supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

This procedure returns a row for the element from which it was called.

Related views

This procedure has no related views.

Syntax

ttDistributionProgress()

Parameters

ttDistributionProgress has no parameters.

Result set

ttDistributionProgress returns the result:

Column Type Description
timestamp TT_TIMESTAMP Time at which the status information was collected.
elementId TT_INTEGER Element ID of the local element.
ptVersion TT_INTEGER Version number of the partition table.
threadId TT_INTEGER Thread ID.
phase VARCHAR2 (32) Current phase of the redistribution process. The redistribution process has the following phases:
  • Data Distribution

  • Data Checkpoint

  • Data Checkpoint Done

  • Reclaim Phase 1

  • Reclaim Checkpoint

  • Reclaim Phase 2

  • Reclaim Done

tblName VARCHAR2 (64) Name of the table currently being processed, if available.
processedTblRows TT_BIGINI Number of rows already processed of the current table, if available.
insertedTblRows TT_BIGINT Number of rows already inserted to the current table in the local element, if available.
deletedTblRows TT_BIGINT Number of rows already deleted from the current table in the local element, if available.
totalTblRows TT_BIGINT Total number of rows in the table, if available.
processedRows TT_BIGINT Number of rows already processed for the element.
insertedRows TT_BIGINT Number of rows already inserted to the element.
deletedRows TT_BIGINT Number of rows already deleted from the element.
totalRows TT_BIGINT Total number of rows in the element for all tables.
processedTbls TT_INTEGER Number of tables already processed.
totalTbls TT_INTEGER Total number of tables in the database.

Examples

The following example shows an example result set for a call to the ttDistributionProgress built-in procedure.

Command> CALL ttDistributionProgress();
< 2018-12-04 14:49:41.065122, 1, 2, 1, Data Distribution, <NULL>, <NULL>, <NULL>,
 <NULL>, <NULL>, 1910, 0, 176, 1910, 8, 8 >
1 row found.

ttDurableCommit

Description

This procedure specifies that the current transaction should be made durable when it is committed. It only has an effect if the application is connected to the database with DurableCommits disabled.

Calling ttDurableCommit also makes durable the current transaction and any previously committed delayed durability transactions. There is no effect on other transactions that are committed after calling ttDurableCommit. ttDurableCommit does not commit transactions. The application must do the commit, for example with a call to SQLTransact.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttDurableCommit()

Parameters

ttDurableCommit has no parameters.

Result set

ttDurableCommit returns no results.

Examples

CALL ttDurableCommit;

Notes

Some controllers or drivers may only write data into cache memory in the controller or may write to disk some time after the operating system is told that the write is done. In these cases, a power failure may mean that some information you thought was durably committed does not survive the power failure. To avoid this loss of data, configure your disk to write all the way to the recording media before reporting completion or you can use an Uninterruptable Power Supply (UPS).

ttEpochCreate

Description

This procedure causes the next committed transaction to commit as an epoch transaction. An epoch is a transaction that marks a globally consistent point in time across all elements of the database. An epoch is durably committed in every replica set of a grid.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is not supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Restrictions with TimesTen Classic

TimesTen Classic applications cannot call this built-in procedure.

Related views

This procedure has no related views.

Syntax

ttEpochCreate()

Parameters

ttEpochCreate has no parameters.

Result set

ttEpochCreate returns no results.

Examples

CALL ttEpochCreate;

ttEpochSessionGet

Description

This procedure returns the epoch identifier of the last epoch created by the current connection, if one is available.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is not supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Restrictions with TimesTen Classic

TimesTen Classic applications cannot call this built-in procedure.

Related views

This procedure has these related views.

SYS.GV$EPOCH_SESSION

SYS.V$EPOCH_SESSION

Syntax

ttEpochSessionGet()

Parameters

ttEpochSessionGet has no parameters.

Result set

ttEpochSessionGet returns the result set:

Column Type Description
epoch TT_VARCHAR (50) The epoch session ID, if available.

Examples

CALL ttEpochSessionGet();
< 1023 >

Notes

ttHeapInfo

Description

This procedure reports heap memory usage in the database. For each heap in the database, it displays the allocated size, size in use, high water mark (the maximum amount of size in use) and the number of deferred free buffers.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$HEAP_INFO

SYS.V$HEAP_INFO

Syntax

ttHeapInfo('name')

Result set

ttHeapInfo has the parameter:

Column Type Description
name TT_CHAR (30) Name of the heap for which you would like information

Result set

ttHeapInfo returns the result:

Column Type Description
name TT_CHAR (30) NOT NULL Name of the database for which the heap memory info is being returned.
size TT_BIGINT NOT NULL The allocated sizes of the heap memory.
inUse TT_BIGINT NOT NULL The amount of heap memory in use.
highWater TT_BIGINT NOT NULL The maximum amount of heap memory used.
freeDeferred TT_BIGINT NOT NULL The number of deferred freed heap memory buffers.

Examples

CALL ttHeapInfo ('sampledb1');
< PERMANENT_0, 2515656, 2404112, 2582856, 0>
< PERMANENT_1, 1024, 1024, 1024, 0>
...
< INDEX_SNAPSHOT_VALUE_CONFIG_I, 2048, 776, 776, 0>
156 rows found

ttHostNameGet

Description

This procedure returns the name of the current local host for the database. The value returned is only for the current session. It is not a systemwide setting and does not persist after the current session has been disconnected.

Use this procedure to check whether a particular store name in a scheme refers to the current host. This can be helpful when configuring replication schemes.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

This procedure returns a row for the element from which it was called.

Related views

This procedure has these related views.

SYS.GV$HOST_NAME

SYS.V$HOST_NAME

Syntax

ttHostnameGet()

Parameters

ttHostNameGet has no parameters.

Result set

ttHostNameGet returns the result:

Column Type Description
hostName TT_VARCHAR (200) The current default local host setting for the database. If a default has not been supplied then the current host name is returned.

Examples

CALL ttHostNameGet ();
< myhost >
1 row found.

See also


ttHostNameSet

ttHostNameSet

Description

This procedure specifies the name of the default local host for the current database. The value is only used in the current session, it is not a systemwide setting and does not persist after the current session has been disconnected.

To configure master/subscriber relationships and replication object permissions correctly, Replication DDL processing relies on being able to determine whether a host name used in a replication scheme refers to the computer on which the script is currently being run. This procedure enables an application to set a default host name for the current session that Replication DDL processing uses whenever there is a need to establish the name of the current host.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttHostnameSet('hostName')

Parameters

ttHostNameSet has the parameter:

Parameter Type Description
hostName TT_VARCHAR (200) The required default name for the local computer. To clear the default value, specify NULL.

Result set

ttHostNameSet returns no results.

Examples

CALL ttHostNameSet ('alias1');

Notes

The legal value of hostName can be any host name or IP address string except 'localhost', '127.0.0.1' or '::1'. You cannot set the default host name to a value that is different from a local host name used in an existing replication scheme.

See also


ttHostNameGet

ttIndexAdviceCaptureDrop

Description

This procedure drops existing capture data for either the current connection or for the database. Subsequent calls to ttIndexAdviceCaptureOutput at that level return no rows.

This procedure and the procedures related to it are referred to as the Index Advisor. For details on using these procedures, see "Using the Index Advisor to recommend indexes" in the Oracle TimesTen In-Memory Database Operations Guide.

Required privilege

This procedure requires no privileges to drop a connection level capture.

This procedure requires ADMIN privileges to drop a database level capture.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttIndexAdviceCaptureDrop([captureLevel])

Parameters

ttIndexAdviceCaptureDrop has this optional parameter:

Parameter Type Description
captureLevel TT_INTEGER Legal values for the capture level are:

0 - Index advice capture is dropped at the connection level for the current connection. This is the default.

1 - Index advice capture is dropped at the database level.


Result set

ttIndexAdviceCaptureDrop returns no results.

Examples

CALL ttIndexAdviceCaptureDrop;

Notes

To drop both connection level and database level captures, invoke the command twice, once for each capture level.

It is an error to call this command while a capture is in progress at the level you are attempting to drop.

ttIndexAdviceCaptureEnd

Description

This procedure ends either an active connection level capture from the current connection or an active database level capture.

This procedure and the procedures related to it are referred to as the Index Advisor. For details on using these procedures, see "Using the Index Advisor to recommend indexes" in the Oracle TimesTen In-Memory Database Operations Guide.

Required privilege

This procedure requires no privilege to end a connection level capture.

This procedure requires ADMIN privileges to end a database level capture.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttIndexAdviceCaptureEnd([captureLevel])

Parameters

ttIndexAdviceCaptureEnd has this optional parameter:

Parameter Type Description
captureLevel TT_INTEGER Legal values for the capture level are:

0 - Ends index advice capture at the connection level for the current connection. This is the default.

1 - Ends index advice capture at the database level.


Result set

ttIndexAdviceCaptureEnd returns no results.

Examples

The following example ends the collection for the connection level capture:

Call ttIndexAdviceCaptureEnd(0)

Notes

To end both connection level and database level captures, invoke the command twice, once for each capture level.

It is an error to call this procedure without first starting a capture at the specified level by calling the ttIndexAdviceCaptureStart procedure.

ttIndexAdviceCaptureInfoGet

Description

This procedure returns a row for each active capture. A capture is active if it has started capturing index advice or if it has stopped capturing index advice, but the capture data is still available.

One row relates to a connection level capture, if one exists. Another row relates to a database level capture, if one exists. At most there is one connection level and one database capture.

If no capture is in progress or no data exists, this procedure does not return any rows.

This procedure and the procedures related to it are referred to as the Index Advisor. For details on using these procedures, see "Using the Index Advisor to recommend indexes" in the Oracle TimesTen In-Memory Database Operations Guide.

Required privilege

This procedure requires no privilege to get information on a connection level capture.

This procedure requires ADMIN privileges to get information on a database level capture.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttIndexAdviceCaptureInfoGet()

Parameters

ttIndexAdviceCaptureInfoGet has no parameters.

Result set

ttIndexAdviceCaptureInfoGet returns the result set:

Columns Type Description
captureState TT_INTEGER NOT NULL The state of the capture:

0 - A capture is not in progress.

1 - A capture is in progress.

connID TT_INTEGER The connection ID of the connection that initiated the last capture, or the current capture if one is in progress.

This row is not returned if no capture has been initiated.

captureLevel TT_INTEGER The level of the most recent capture.

This row is not returned if no capture has been initiated.

captureMode TT_INTEGER The mode of the most recent capture.

This row is not returned if no capture has been initiated.

numPrepared TT_INTEGER The number of prepared statements during the capture period.

This value is NULL if no capture has been initiated.

numExecuted TT_INTEGER The number of executed statements during the capture period.

This value is NULL if no capture has been initiated.

captureStartTime TT_TIMESTAMP The time stamp taken at the start of the capture period.

This row is not returned if no capture has been initiated.

captureEndTime TT_TIMESTAMP The time stamp taken at the end of the capture period.

This value is NULL if no capture is still in progress.


Examples

This example shows capture information for a completed connection level capture for 363 prepared statements and 369 executed statements:

Command> CALL ttIndexAdviceCaptureInfoGet();
< 0, 1, 0, 0, 363, 369, 2018-02-27 11:44:08.136833, 
2018-02-27 12:07:35.410993 >
1 row found.

Notes

If there is an active database level capture and you call this procedure on a connection that does not have ADMIN privilege, TimesTen returns an error.

ttIndexAdviceCaptureOutput

Description

This built-in returns a list of index recommendations from the last recorded capture at the specified level. It also returns an executable CREATE INDEX SQL statement for creating the recommended index.

This procedure and the procedures related to it are referred to as the Index Advisor. For details on using these procedures, see "Using the Index Advisor to recommend indexes" in the Oracle TimesTen In-Memory Database Operations Guide.

For a connection level capture, run this procedure in the same connection that initiated the capture. For a database level capture, run this procedure in a connection with ADMIN privileges.

Required privilege

This procedure requires no privilege to get output on a connection level capture.

This procedure requires ADMIN privileges to get output on a database level capture.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$INDEX_ADVICE_OUTPUT

SYS.V$INDEX_ADVICE_OUTPUT

Syntax

ttIndexAdviceCaptureOutput([captureLevel])

Parameters

ttIndexAdviceCaptureOutput has this optional parameter:

Parameter Type Description
captureLevel TT_INTEGER Legal values for the capture level are:

0 - Outputs index advice at the connection level for the current connection. This is the default value.

1 - Outputs index advice at the database level.


Result set

ttIndexAdviceCaptureOutput returns the result set:

Column Type Description
stmtCount TT_INTEGER The number of statements in the captured workload that would have benefited from this index if it were present.
createStmt TT_VARCHAR (8300) NOT NULL The executable statement that can create the recommended index.

Examples

The following example provides the CREATE INDEX statement for an index called PURCHASE_i1 on the HR.PURCHASE table. There are four distinct statements that would benefit from the index in this SQL workload.

CALL ttIndexAdviceCaptureOutput();
< 4, create index PURCHASE_i1 on HR.PURCHASE(AMOUNT); >
1 row found. 

Notes

All names returned are fully schema qualified.

ttIndexAdviceCaptureStart

Description

This procedure enables index advice capture. It is recommended that statistics be updated before you call this procedure, using ttOptEstimateStats and setting the 'invalidate' parameter set to 'yes'. Updating the statistics in this way ensures statistics are up to date and forces statements to be re-prepared during the capture. To set statistics to known values instead, call ttOptSetTblStats with the 'invalidate' parameter set to 'yes'.

This procedure and the procedures related to it are referred to as the Index Advisor. For details on using these procedures, see "Using the Index Advisor to recommend indexes" in the Oracle TimesTen In-Memory Database Operations Guide.

Required privilege

This procedure requires no privilege to start a connection level capture.

This procedure requires ADMIN privileges to start a database level capture.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttIndexAdviceCaptureStart([captureLevel], [captureMode])

Parameters

ttIndexAdviceCaptureStart has these optional parameters:

Parameter Type Description
captureLevel TT_INTEGER Legal values for the capture level are:

0 - Outputs index advice at the connection level for the current connection. This is the default value.

1 - Outputs index advice at the database level.

captureMode TT_INTEGER Legal values for the capture mode are:

0 - Provides complete capture of index advice including execution of the SQL statements. This is the default.

31 - Capture is based only on the computed statistics and plan analysis. Queries (SELECT statements only) are prepared but not executed. This mode can only be used with connection level captures (captureLevel=0).


Result set

ttIndexAdviceCaptureStart returns no results

Examples

The following example starts a collection for the Index Advisor at the connection-level.

Call ttIndexAdviceCaptureStart(0,0);

Notes

It is an error to call this procedure if index advice is already being captured at the level specified by the captureLevel parameter or at the connection level if no level is specified. Connection level captures can be issued concurrently on independent connections without conflict. Outstanding connection level captures that are in progress when a database level capture begins complete as intended.

ttLatchStatsGet

Description

This procedure displays latch statistics. Statistics are useful for determining areas of contention in a running system.

This procedure is primarily meant to be used when requested by TimesTen technical support.

Required privilege

This procedure requires ADMIN privileges to show all active connections or database level statistics. No privileges are required to show the current connection's latch statistics.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttLatchStatsGet (level, operation)

Parameters

ttLatchStatsGet has these parameters:

Parameter Type Description
level TT_CHAR (16) The level controls the number of connections for which the stats are printed. Valid values are:

db - All the active connections on the database.

conn - The current connection. This is the default.

connid - An specific connection (specified by connid).

operation TT_CHAR (16) This value controls the verbosity level of the output. Valid values are:

show - Only show the contention points that have a high contention level

showall - Show the contention points that have contention

showallandtell - Show all the contention points


Result set

Results sets are are divided into two types: contention point and statistics.

ttLatchStatsGet returns the result set for contention points. These describe the location of contention.

Column Type Description
callerName TT_VARCHAR(40) NOT NULL Function name containing the contention point.
fileName TT_VARCHAR(30) NOT NULL The file that contains the callerName function.
lineNo TT_INTEGER NOT NULL The line number of the fileName file.
description TT_VARCHAR(100) NOT NULL Description of this contention point.

ttLatchStatsGet returns the result set for statistics. These describe detailed statistics about this contention point:

Column Type Description
connName TT_VARCHAR(40)
NOT NULL
The name of the connection experiencing contention.
spinCount TT_BIGINT NOT NULL The number of times the connName connection has spun on this contention point.
access TT_BIGINT NOT NULL The number of times the connName connection has used this contention point.
sleepCnt TT_INTEGER NOT NULL The number of times the connName connection has slept on this contention point.
firstTry TT_INTEGER NOT NULL The number of times the connName connection has used this contention point without experiencing contention.
collisions TT_INTEGER NOT NULL The number of times the connName connection has used this contention point and experienced contention.
avgSpin TT_BIGINT NOT NULL The average number of times the connName connection has spun on this contention point.

Examples

The following example shows an example result set for a call to ttLatchStatsGet.

Command> CALL ttLatchStatsGet 
< getSmallMed, heap.c 2675, Generic description, sampledb1, 
  1, 0, 1, 0, -1, -1, 0 >
< sbhpallocAttempt, heap.c 3712, Generic description, 
  sampledb1, 1, 0, 1, 0, -1, -1, 0 >

See also


"ttXactAdmin"

ttLoadFromOracle

Description

This procedure takes a TimesTen table name, an Oracle SELECT statement and the number of threads for parallel load. It executes the query on the Oracle database and loads the result set into the specified TimesTen table. While performing the load, an implicit commit is executed after every 256 rows inserted into the TimesTen database.

No character set conversion is performed when loading data from an Oracle database into a TimesTen table. The TimesTen database and the Oracle database must use the same character set.

The procedure requires the connection attribute UID, the connection attribute OraclePWD and the connection attribute OracleNetServiceName to be specified. You must commit after calling this procedure.

For more details and usage information, see "Loading data from an Oracle database into a TimesTen table" in the Oracle TimesTen In-Memory Database Operations Guide.

Required privilege

This procedure requires INSERT privileges to the table to be loaded.The session must have all the required privileges to execute the query on the Oracle database.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttLoadFromOracle(['tblOwner'], 'tblName', 'Query' [,numThreads], 'Options')

Parameters

ttLoadFromOracle has these parameters:

Parameter Type Description
tblOwner TT_CHAR (30) TimesTen table owner (optional). If not provided, the connection ID is used.
tblName TT_CHAR (30) NOT NULL Name of the table to be loaded with data from the Oracle database. You can use the built-in procedure ttTableSchemaFromOraQueryGet to get a schema with which to build the table, if one does not already exist.

The specified TimesTen table cannot be a system table, a synonym, a view, a materialized view or a detail table of a materialized view, a global temporary table or a cache group table.

SelectSQL TT_VARCHAR (409600) NOT NULL A SELECT query on an Oracle database to derive the table column definition.

The query on an Oracle database cannot have any parameter bindings. Provide any expressions in the SELECT list with a column alias. Otherwise, an implementation dependent column name is assumed and the expression is not evaluated.

numThreads TT_INTEGER Number of threads for parallel load (optional). If NULL, defaults to 4.

Provides parallel loading for tables. Specifies the number of loading threads to run concurrently. One thread performs the bulk fetch from the Oracle database and the other threads perform the inserts into TimesTen. Each thread uses its own connection or transaction.

The minimum value for NumThreads is 2. The maximum value is 10. If you specify a value greater than 10, TimesTen assigns the value 10.

You can also use the readers option to specify the total number of threads from the numThreads parameter to use for bulk fetching from the Oracle database.

Options TT_VARCHAR (1000) Option string, specified as key=value pairs. For legal values, see "Options string".

Defaults to NULL.

See the table below for more information.


Options string

The options are specified as key = value pairs and the pairs are separated by semi-colons.

Option parameter Value Description
localOnly Y or N This option only loads rows from a specific instance. Load a specific instance in the grid and use this option. When you use this option, ttLoadFromOracle selects all rows from the table, but ignores any rows that are not hashed to the specific instance.

This option is only supported in TimesTen Scaleout.

The default value is N.

ErrorThreshold value > 0 This option sets the error threshold for which the built-in procedure returns an error messages.

The default value is 1. When the ttLoadFromOracle built-in procedure encounters an error, the built-in procedure stops and returns an error message.

IgnoreDuplicates Y or N This option makes the ttLoadFromOracle built-in procedure ignore uniqueness constraint violations, which results in duplicates being ignored. You can only use this option if the TimesTen table has a uniqueness constraint on it.

The default value is N.

ResumeFromSCN scn_of_last_load This option resumes the load operation from the specific SCN. When the resumeFromSCN option is enabled, it automatically ignores duplicates.

The default value is the latest SCN.

DirectLoad Y or N This option enables a bulk insert mode which has performance benefits.

This option is only supported in TimesTen IMDB.

The default value is N.

readers numThreads > value > 0 This option specifies the total number of threads from the numThreads parameter to use for bulk fetching from the Oracle database.

For example, if you specify a numThreads parameter of 8 and a readers option of 3, 3 threads bulk fetch data from the Oracle database and 5 threads load data into the TimesTen database.


Result set

ttLoadFromOracle returns the result set:

Column Type Description
numRows TT_BIGINT Number of rows loaded.
numErrors TT_BIGINT Number of rows with errors.
errCode TT_INTEGER TimesTen error code, one of:

0 - Load completed successfully without errors

-1 - Load completed successfully with errors

-2 - Load terminated early with errors

-3 - Load terminated early with a fatal error, for example, an out-of-space error, a loss of connection or an invalidation.

errMsg TT_VARCHAR(4000) Error message, containing:
  • Start and end time of load

  • Statement

  • SCN used to query the data

  • Number of rows with errors

  • Number of rows loaded


Examples

The following example selects loads the TimesTen table about employees from the Oracle database HR.EMPLOYEES table and loads it into the TimesTen HR.EMPLOYEES table. In this example an error is returned.In this example, the column STATE is a TT_TINYINT.

Command> CALL ttLoadFromOracle ('HR','EMPLOYEES',
'SELECT * FROM HR.EMPLOYEES');
< 99, 0, 0, 'Started=2014-08-01 13:48:21; Ended=2014-08-01 13:48:23;
 Statement=ttLoadFromOracle('HR', 'SELECT * FROM HR.EMPLOYEES'); SCN=1234567;
 Errors=1; Rows Loaded=99' >
<  NULL, NULL, 2614,'Value outside of range supported by integral type. Column
 STATE=-1' >

Notes

TimesTen does not empty the table before the load. The target table does not require a primary key.TimesTen returns an error if the query output cannot be converted to rows in the target table due to a mismatch of column types or number of columns.Loading data into TimesTen LOB columns is not supported. If the query on the Oracle database has LOB output, it is mapped to a VAR type.

The load process does not check that the column data types and sizes in the TimesTen table match the data types and sizes of the result set. Instead, the insert is attempted and if the column data types cannot be mapped or the Oracle Database data from the SQL query exceeds the TimesTen column size, TimesTen returns an error. LOB columns are truncated to 4 MB.

When a table is altered to add columns, secondary partitions are added. Loading a table with multiple partitions is not supported by ttLoadFromOracle.

ttLockLevel

Description

Changes the lock level between row-level and database-level locking on the next transaction and for all subsequent transactions for this connection. Applications can change the lock level again by calling ttLockLevel again. The initial value depends on the LockLevel connection attribute. See "LockLevel" for full details of the different locking levels.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttLockLevel('lockLevel')

Parameters

ttLockLevel has the parameter:

Parameter Type Description
lockLevel TT_CHAR (20) NOT NULL Locking level for the connection.

The value of lockLevel may be one of two case-insensitive strings:

Row: Locking should be set to row-level locking.

DS: Locking should be set to database-level locking.

Result set

ttLockLevel returns no results.

Examples

CALL ttLockLevel ('Row');

Notes

This procedure does not affect the current transaction.

Row-level locking is required when caching tables from an Oracle database.

This procedure must be called from within a transaction. It has the effect of setting the locking level for subsequent transactions for the connection that invoked it. The new lock level does not affect the current transaction. It takes effect at the beginning of the next transaction.

See also


ttLockWait

ttLockWait

Description

This procedure enables an application to change the lock timeout interval of the current connection. The change takes effect immediately and applies to all subsequent statements in the current transaction and all subsequent transactions on the connection.

The lock wait interval is the number of seconds to wait for a lock when there is contention on it. You can also indicate a fraction of a second.

Lock wait intervals are imprecise, and may be exceeded, generally by no more than 100 milliseconds, due to the scheduling of the agent that detects timeouts. This imprecision does not apply to zero second timeouts, which are always reported immediately.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Related views

This procedure has no related views.

Syntax

ttLockWait(seconds)

Parameters

ttLockWait has the required parameters:

Parameter Type Description
seconds NUMBER (8,1) NOT NULL Number of seconds to wait for a lock when there is contention on it. You can also specify fractions of a second. Valid values are 0.0 to 1000000.0 inclusive.

Result set

ttLockWait returns no results.

Examples

To indicate a six second lock wait, use:

CALL ttLockWait (6);

To indicate a tenth of a second lock wait, use:

CALL ttLockWait (0.1);

Notes

When a lock is not immediately available to a TimesTen transaction, it waits a predetermined amount of time to try to get the lock. After that it times out the lock request and returns error TT6003 to the application. By default, TimesTen uses a value of 10 seconds for lock timeouts. If a value of 0 is specified, transactions do not wait for any unavailable locks.

ttLogHolds

Description

This procedure returns information about transaction log holds, including those created on behalf of incremental backups, replication peers, active standby pairs (and any subscribers), AWT cache groups, persistent XLA subscribers, XA, long-running transactions and checkpoints. This procedure can help diagnose situations where it appears that checkpoint operations are not purging all unneeded transaction log files.

Applications should monitor log holds and the accumulation of log files. For more information, see "Show replicated log records" in the Oracle TimesTen In-Memory Database Replication Guide and "Monitoring accumulation of transaction log files" in the Oracle TimesTen In-Memory Database Operations Guide.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

This procedure returns a row for the element from which it was called. To see information about other elements, query the SYS.GV$LOG_HOLDS system table.

Related views

This procedure has these related views.

SYS.GV$LOG_HOLDS

SYS.V$LOG_HOLDS

Syntax

ttLogHolds()

Parameters

ttLogHolds has no parameters.

Result set

ttLogHolds returns the result set:

Column Type Description
HoldLFN TT_INTEGER NOT NULL Returns the transaction log file number of the hold.
HoldLFO TT_BIGINT NOT NULL Returns the transaction log file offset of the hold.
type TT_CHAR (30) NOT NULL Returns the type of hold, one of:

Checkpoint

Replication

Backup

XLA

Long-Running Transaction

Long-Running XA Transaction

TTGrid Replica

Element Duplicate

description TT_VARCHAR (1024) NOT NULL Describes the type-specific object for which the hold was created. Each description corresponds with the Type returned. Descriptions are one of:
  • The name of the checkpoint file

  • The name of the standby master

  • The name of the replication subscriber

  • _ORACLE when tracking AWT cache group propagation

  • The parallel replication track ID used by the subscriber

  • The backup path

  • The name of the persistent XLA subscription and the process ID of the last process to open it, if it is open

  • The XID (transaction ID) of the XA transaction

  • The TimesTen transaction ID of the long-running transaction

  • The index of the replica in the partition table, the replica id, the index of the local element, the version of partition table for the replica log hold, and the index for the loop of the list of replicas.

  • The string Log hold of Element Duplicate used by LBCU.


Examples

CALL ttLogHolds();
< 0, 1148544, Long-Running XA Transaction , 
0x1-476c6f62616c-5861637431 >
< 0, 1149752, Long-Running Transaction, 4.2 >
< 0, 1149992, Checkpoint , sample.ds1 >
< 0, 1150168, Checkpoint , sample.ds0 >

The following example shows the output of ttLogHolds built-in procedure for an active standby pair replication scheme, where the active master is master1 and the standby master is master2 with a single subscriber, subscriber1.

Command> call ttLogHolds;
< 0, 3569664, Checkpoint                    , master1.ds0 >
< 0, 15742976, Checkpoint                    , master1.ds1 >
< 0, 16351496, Replication                   , ADC6160529:SUBSCRIBER1 >
< 0, 16351640, Replication                   , ADC6160529:MASTER2 >
4 rows found.

The following example shows the progress of the asynchronous propagation for an AWT cache group to the Oracle database. The description field contains "_ORACLE" to identify the transaction log hold for the AWT cache group propagation.

Command> call ttLogHolds();
< 0, 18958336, Checkpoint                    , cachealone1.ds0 >
< 0, 19048448, Checkpoint                    , cachealone1.ds1 >
< 0, 19050904, Replication                   , ADC6160529:_ORACLE >
3 rows found.

ttMonitorHighWaterReset

Description

This procedures sets the value of PERM_IN_USE_HIGH_WATER column in the MONITOR table to the current value of the PERM_IN_USE_SIZE column and sets the value of the TEMP_IN_USE_HIGH_WATER column in the MONITOR table to the current value of TEMP_IN_USE_SIZE column. These columns are useful for sizing databases during application development and deployment.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Related views

This procedure has no related views.

Syntax

ttMonitorHighWaterReset()

Parameters

ttMonitorHighWaterReset has no parameters.

Result set

ttMonitorHighWaterReset returns no results.

Examples

CALL ttMonitorHighWaterReset();

ttOptClearStats

Description

This procedure clears the statistics for the specified table, causing the TimesTen query optimizer to use estimates or default values for subsequent queries involving the table. The procedure is useful if statistics are assumed to be out of date and an application wants to use built-in default values. This procedure removes all rows from the TBL_STATS and COL_STATS system tables that pertain to the specified tables. See "SYS.TBL_STATS" and "SYS.COL_STATS" in Oracle TimesTen In-Memory Database System Tables and Views Reference.

Required privilege

This procedure requires no privilege for the table owner. This procedure requires no privilege if tblName is not specified, because the procedure operates on the current user's tables if tblName is not specified.

This procedure requires the ALTER ANY TABLE privilege if user is not the table owner.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttOptClearStats('tblName', invalidate)

Parameters

ttOptClearStats has these parameters:

Parameter Type Description
tblName TT_CHAR (61) Name of an application table. Can include table owner. If tblName is the empty string or is not specified, statistics are cleared for all the current user's tables in the database.

Using a synonym to specify a table name is not supported.

invalidate TT_INTEGER 0 (no) or 1 (yes). Default is 0.

If invalidate is 1, all commands that reference the affected tables are reprepared automatically when they are re-executed, including commands prepared by other users.

If invalidate is 0, the statistics are not considered modified and existing commands are not reprepared.


Result set

ttOptClearStats returns no results.

Examples

CALL ttOptClearStats ( 'SALLY.ACCTS', 1 );

Clears the statistics for the SALLY.ACCTS table and reprepares all commands that affect the ACCTS table.

CALL ttOptClearStats();

Clears the statistics for all the current user's tables and reprepares all commands that affect these tables.

CALL ttOptClearStats('', 0);

Clears the statistics for all the current user's tables without repreparing commands that reference these tables.

ttOptCmdCacheInvalidate

Description

This built-in procedure either forces a recompilation should a dependent command be invoked again, or removes such command from the cache and it must be re-prepared by the user.

Scenarios in which you may want to call this procedure include:

  • After all needed statistics have been collected.

  • When table cardinalities have been changed significantly.

The procedure either marks a command as needing recompilation or as invalidated.

Neither option stops execution of a command.

Required privilege

This procedure requires the DDL privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttOptCmdCacheInvalidate('tblName', invalidate)

Parameters

ttOptCmdCacheInvalidate has these parameters:

Parameter Type Description
tblname TT_CHAR(61) The name of the table for which the dependent commands should be invalidated or recompiled.
invalidate TT_INTEGER Forces recompilation or invalidates the dependent commands.

1 - Indicates that the commands should be recompiled. The command is recompiled during its first use after calling this built-in procedure. (default)

2 - Indicates that the commands should be invalidated. The command is not reused or recompiled again. If you call the command after you have marked it for invalidation, TimesTen returns an error.


Result set

ttOptCmdCacheInvalidate returns no results.

Examples

To recompile dependent commands on the table tab1, use:

CALL ttOptCmdCacheInvalidate ('tab1', 1);

To invalidate the dependent commands on table tab1, use:.

CALL ttOptCmdCacheInvalidate ('tab1', 2);

ttOptEstimateStats

Description

The ttOptEstimateStats procedure updates the statistics for the specified table. This procedure estimates statistics by looking at a random sample of the rows in the specified table(s). The sample size is the number of rows specified (if sampleStr has the form 'n ROWS') or a percentage of the total number of rows (if sampleStr has the form 'p PERCENT').

The procedure operates on all tables owned by the current user if tblName is not specified. If the user is the instance administrator, only tables owned by the instance administrator are updated. If the tables are not owned by the user, the user can qualify the table name with their own user name to update stats for the current user.

To determine if your stats are updated, look at the system tables, SYS.COL_STATS and SYS.TBL_STATS, before and after you perform this operation.

Required privilege

This procedure requires no privilege if the user is the table owner, or if tblName is not specified.This procedure requires the ALTER ANY TABLE privilege if the user is not the table owner.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Related views

This procedure has these related views.

SYS.GV$OPT_COL_STATS

SYS.V$OPT_COL_STATS

Syntax

ttOptEstimateStats(['tblName'], [invalidate], 'sampleStr')

Parameters

ttOptEstimateStats has these parameters:

Parameter Type Description
tblName TT_CHAR(61) Name of an application table. Can include table owner. If tblName is an empty string, statistics are estimated for all the current user's tables in the database.

Using a synonym to specify a table name is not supported.

invalidate TT_INTEGER 0 (no) or 1 (yes). If invalidate is 1, all commands that reference the affected tables are automatically prepared again when re-executed, including commands prepared by other users. If invalidate is 0, the statistics are not considered to have been modified and existing commands are not reprepared.

The invalidate parameter is optional and defaults to 0.

sampleStr TT_VARCHAR (255) NOT NULL String of the form 'n ROWS', where n is an INTEGER greater than zero; or 'p PERCENT', where p is a floating point number between 0.0 and 100.0 inclusive.

Result set

ttOptEstimateStats returns no results.

Examples

CALL ttOptEstimateStats ( 'ACCTS', 1, '5 PERCENT' );

CALL ttOptEstimateStats ( 'ACCTS', 1, '75 ROWS' );

Notes

The TimesTen statistics include the number of rows in each table, the number of unique values in each column, and the minimum and maximum values in each column. TimesTen assumes a uniform distribution of column values.

This procedure only runs faster than ttOptUpdateStats when you sample less than 50 percent of the rows in the table.

Estimates are not computed on columns that are longer than 2,048 bytes, and statistics for these columns are not updated. To update statistics on columns longer than 2,048 bytes, use the ttOptUpdateStats built-in procedure. (For varying length columns, this procedure updates statistics only if the column has a maximum length of 2,048 bytes or less.)

If a very small value is chosen for the sampleStr parameter, this procedure runs quickly but may result in suboptimal execution plans. For "good" distributions of data, a 10 percent selection is a good choice for computing statistics quickly without sacrificing plan accuracy. If the number of rows specified is large or the table in question is small, to improve performance TimesTen computes exact statistics on all columns that have a length of 2,048 bytes or less. For example, the only difference between

ttOptEstimateStats ('ACCTS', 1, '100 PERCENT' )

and

ttOptUpdateStats( 'ACCTS', 1 )

is that the former does not compute statistics for long columns.

The statistics are stored in the TBL_STATS and COL_STATS system tables.

For performance reasons, ttOptEstimateStats does not hold a lock on tables or rows when computing statistics. Computing statistics can still slow performance. Estimating statistics generally provides better performance than computing exact statistics.

If you estimate or update statistics with an empty table list, statistics on system tables are updated also, if you have privileges to update the system tables.

ttOptGetColStats

Description

This procedure returns statistics information in text format.

Required privilege

This procedure requires the SELECT privilege on the specified tables.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$OPT_COL_STATS

SYS.V$OPT_COL_STATS

Syntax

ttOptGetColStats('tblName', 'colName')

Parameters

ttOptGetColStats has these parameters:

Parameter Type Description
tblName TT_CHAR (61) Name of the table whose statistics are to be returned. If NULL is passed, then values for all tables are returned.

Using a synonym to specify a table name is not supported.

colName TT_CHAR (30) Name of the column for which statistics should be returned. If NULL is passed, statistics for all columns in the specified table are returned.

Result set

ttOptGetColStats returns the result set:

Column Type Description
tblName TT_CHAR (30) Name of the table.

Using a synonym to specify a table name is not supported.

colName TT_CHAR (30) Name of the column.
stats TT_VARCHAR (409600) NOT NULL Statistics in text form.

Examples

CALL ttOptGetColStats ();
< T1 , X1, (2, 10, 10, 100 (,4, 40, 10 ,1, 10, 5) ,
(4, 20, 20 ,11, 20, 15) )>

ttOptGetFlag

Description

This procedure returns the optimizer flag settings for the current transaction. The results are returned as a result set that can be retrieved using the ODBC SQLFetch function or the JDBC ResultSet.getXXX() method, just like the result of a SQL SELECT statement. Applications can request the value of a specific optimizer flag by passing the flag name to ttOptGetFlag. Alternatively, applications can request the values of all the optimizer flags by passing NULL. The optimizer flags and their meanings are described under the ttOptSetFlag built-in procedure.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttOptGetFlag('flagName')

Parameters

ttOptGetFlag has the parameter:

Parameter Type Description
flagName TT_CHAR (32) Name of the flag whose value is to be returned. If NULL is passed, the values of all flags are returned.

Result set

ttOptGetFlag returns the result set:

Column Type Description
flagName TT_VARCHAR (32) NOT NULL Name of the flag. See "ttOptSetFlag" for a description of possible flag values.
value TT_INTEGER NOT NULL Current flag value, either 0 or 1.

Examples

CALL ttOptGetFlag('TmpHash');

See also


ttOptSetFlag

ttOptGetMaxCmdFreeListCnt

Description

This procedure returns the size of the free list of SQL compiled command cache. To reset the size of the cache, use ttOptSetMaxPriCmdFreeListCnt for materialized views and ttOptSetMaxCmdFreeListCnt for regular tables.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$OPT_MAX_CMD_FREELIST_CNT

SYS.V$OPT_MAX_CMD_FREELIST_CNT

Syntax

ttOptGetMaxCmdFreeListCnt()

Parameters

ttOptGetMaxCmdFreeListCnt has no parameters.

Result set

ttOptGetMaxCmdFreeListCnt returns the results.

Column Type Description
retVal TT_VARCHAR (200) NOT NULL The size of the SQL compiled command cache.

Examples

CALL ttOptGetMaxCmdFreeListCnt( );

ttOptGetOrder

Description

This procedure returns a single-row result set containing the join order for the current transaction. This result set can be retrieved using the ODBC SQLFetch function or the JDBC ResultSet.getXXX() method, just like the result of a SQL SELECT statement. Join orders are described under the ttOptSetOrder built-in procedure.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is supported in TimesTen Scaleout.

This procedure returns a row for the element from which it was called. To see information about other elements, query the SYS.GV$OPT_ORDER system table.

Related views

This procedure has these related views.

SYS.GV$OPT_ORDER

SYS.V$OPT_ORDER

Syntax

ttOptGetOrder( )

Parameters

ttOptGetOrder has no parameters.

Result set

ttOptGetOrder returns the result set:

Column Type Description
joinOrder TT_VARCHAR(1024) NOT NULL Optimizer join order for the current transaction.

Examples

CALL ttOptGetOrder;

See also


ttOptSetOrder

ttOptSetColIntvlStats

Description

This procedure modifies the statistics for the specified columns with interval information. This procedure enables an application to set statistics manually rather than have TimesTen automatically compute them. This feature is useful for preparing commands before the data has been inserted or for seeing how table characteristics can affect the choice of execution plan. This procedure modifies the relevant row(s) in the COL_STATS system table. Modifying interval statistics for a column that is not currently indexed has no effect.

Because this procedure can be used before any data is in the table, the values specified do not need to bear any relation to the actual values, although some basic validity checking is performed.

Required privilege

This procedure requires no privilege (if owner) or ALTER ANY TABLE privilege (if not owner).

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Related views

This procedure has no related views.

Syntax

ttOptSetColIntvlStats('tblName', 'colName', invalidate, (stats))

Parameters

ttOptSetColIntvlStats has these parameters:

Parameter Type Description
tblName TT_CHAR(61) NOT NULL Name of an application table. Can include table owner. Using a synonym to specify a table name is not supported.
colName TT_CHAR(30) NOT NULL Name of a column in that table.
invalidate TT_INTEGER 0 (no) or 1 (yes). If invalidate is 1, all commands that reference the affected tables are automatically prepared again when re-executed. This includes commands prepared by other users. If invalidate is 0, the statistics are not considered to have been modified and existing commands are not reprepared.
stats VARBINARY (409600) NOT NULL Sets stats for the column, using the format:

(numInterval integer, numNull integer, totUniq integer, totTups integer,

/* information for interval 1 */

(numUniq integer, numTups integer, frequency of most occurred value integer, minVal, maxVal, modalVal),

/* information for interval 2 */...)

The modal value (modalVal) is the value that occurs most often in a specified interval.

Because this parameter is a compound structure it cannot be parameterized using ODBC functions or described using the ttIsql describe command. For example, a statement like the following fails: SQLPrepare(hstmt, "call ttOptSetColIntvlStats('t1', 'c1', 1, ?)", SQL_NTS)).


Result set

ttOptSetColIntvlStats returns no results.

Examples

To set the following statistics for column t1.x1:

  • Two intervals

  • Integer type

  • 10 rows with null value

  • 10 unique value

  • 100 rows

  • Interval 1 (4 unique values besides the most frequently occurring value, 40 rows with values other than most frequently occurring value, 10 rows with most frequently occurring value, min = 1, max = 10, mod = 5)

  • Interval 2 (4 unique values besides the most frequently occurring value, 20 rows with values other than most frequently occurring, 20 rows with most frequently occurring value, min = 11, max = 20, mod = 15)

Use the statement:

CALL ttOptSetColIntvlStats('t1', 'x1', 1, (2, 10, 10, 100, 
(4, 40, 10, 1, 10, 5), (4, 20, 20, 11, 20, 15)));

Notes

You must specify the minimum and maximum values in the interval as VARBINARY. NULL values are not permitted as minimum or maximum values. The value is stored in the platform-specific endian format.

ttOptSetColStats

Description

This procedure modifies the statistics for the specified columns. This procedure enables an application to set statistics manually rather than have TimesTen automatically compute them. This feature is useful for preparing commands before the data has been inserted or for seeing how table characteristics can affect the choice of execution plan. This procedure modifies the relevant row(s) in the COL_STATS system table.

Because this procedure can be used before the table is populated with data, the values specified do not need to bear any relation to the actual values, although some basic validity checking is performed.

Required privilege

This procedure requires no privilege (if owner) or ALTER ANY TABLE privilege (if not owner).

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Related views

This procedure has no related views.

Syntax

ttOptSetColStats('tblName', 'colName', numUniq, minVal,maxVal, 
 invalidate, numNull)

Parameters

ttOptSetColStats has these parameters:

Parameter Type Description
tblName TT_CHAR(61) NOT NULL Name of an application table. Can include table owner.

Using a synonym to specify a table name is not supported.

colName TT_CHAR(30) NOT NULL Name of a column in that table.
num_Uniq TT_INTEGER NOT NULL Number of unique values in the column.
minVal VARBINARY(1024) NOT NULL Minimum value in the column (possibly truncated).
maxVal VARBINARY(1024) NOT NULL Maximum value in the column (possibly truncated).
invalidate TT_INTEGER 0 (no) or 1 (yes). If invalidate is 1, all commands that reference the affected tables are automatically prepared again when re-executed. This includes commands prepared by other users. If invalidate is 0, the statistics are not considered to have been modified and existing commands are not reprepared.
num_Null TT_INTEGER Indicates the total number of NULLs in the column.

Result set

ttOptSetColStats returns no results.

Examples

CALL ttOptSetColStats ('SALLY.ACCTS, 'BALANCE, 400, 
0x00001388, 0x000186A0, 1, 0);

Notes

You must specify the minimum and maximum values as VARBINARY. NULL values are not permitted as minimum or maximum values. The value is stored in the platform-specific endian format.

The statistics are treated as a single interval of column values that are uniformly distributed between the minimum value and the maximum value.

ttOptSetFlag

Description

This procedure resets all optimizer flags to their default values when the transaction has been committed or rolled back. This alters the generation of execution plans by the TimesTen query optimizer. It sets flags to enable or disable the use of various access methods. The changes made by this call take effect during preparation of statements and affect all subsequent calls to the ODBC functions SQLPrepare and SQLExecDirect or the JDBC methods Connection.prepareCall and Statement.execute in the current transaction. If optimizer flags are set while AutoCommit is on, they are ignored.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$OPT_FLAG

SYS.V$OPT_FLAG

Syntax

ttOptSetFlag('optFlag', optVal)

Parameters

ttOptSetFlag has these parameters:

Parameter Type Description
optFlag TT_CHAR(32) NOT NULL Name of optimizer flag.
optVal TT_INTEGER NOT NULL The value of the optimizer flag. The value is generally 0 (disable/disallow) or 1 (enable/allow), except as described under "Optimizer flags" below.

Optimizer flags

When setting the optimizer flags, use the following character strings, which are not case sensitive:

Flag Description
BranchAndBound Enables or disables branch and bound optimization. If enabled, TimesTen calculates the maximum cost of the query plan during a "zero phase," at the very beginning of the optimization process. If disabled, TimesTen does not perform this cost analysis.
DynamicLoadEnable Enables or disables dynamic load of data from an Oracle database to a TimesTen dynamic cache group. By default, dynamic load of data from an Oracle database is enabled.
DynamicLoadErrorMode Enables or disables dynamic load error mode. It controls output of error messages upon failure of a transparent load operation on a TimesTen dynamic cache group. Disabled by default.
FirstRow Enables or disables first row optimization in a SELECT, UPDATE or DELETE statement. If the SQL keyword FIRST is used in the SQL statement, it takes precedence over this optimizer hint. The FIRST keyword enables first row optimization.
ForceCompile Enables or disables forced compilation. If enabled, TimesTen recompiles the query and regenerates the query plan each time. If disabled, TimesTen does not compile the query plan even if it is available.
GenPlan Enables or disables the creation of entries in the PLAN table for the rest of the transaction.

For an example, see "Instruct TimesTen to store the plan in the system PLAN table" in Oracle TimesTen In-Memory Database Operations Guide.

Hash Enables or disables the use of existing hash indexes in indexed table scans.
HashGb Enables or disables the use of hash groups.
IndexedOR Enables or disables serialized table scans. If disabled, TimesTen uses serialized table scans for IN...list conditions, else TimesTen uses multiple index scans for an OR condition.
MergeJoin Enables or disables the use of merge joins.
NestedLoop Refers to a common way of joining two tables.
NoRemRowIdOpt Enables or disables internal generation of RowIDs. If enabled, RowIDs are not internally generated for optimization purposes. If disabled, RowIDs may be internally generated, even if the row is not in the SELECT list.
PassThrough Temporarily changes the pass through level for TimesTen Cache applications. The pass through level can be set at any time and takes effect immediately. Legal values for this flag are:

0 - (default) - SQL statements are executed only on TimesTen.

1 - INSERT, UPDATE and DELETE statements are executed on TimesTen unless they reference one or more tables that are not in TimesTen. If they reference one or more tables not in TimesTen, they are passed through to the Oracle database. DDL statements are executed on TimesTen. Other statements are passed through to the Oracle database if they generate a syntax error in TimesTen or if one or more tables referenced within the statement are not in TimesTen.

2 - INSERT, UPDATE and DELETE statements performed on tables in read-only cache groups or user managed cache groups with the READONLY cache table attribute are passed through to the Oracle database. Passthrough behavior for other cache group types is the same as PassThrough=1.

3 - All statements are passed through to the Oracle database for execution.

Range Enables or disables the use of existing range indexes in indexed table scans.
Rowid Enables or disables the use of Row IDs.
RowLock Allows or disallows the optimizer to consider using row locks.
Scan Refers to full table scans.
ShowJoinOrder Shows the join order of the tables in an optimizer scan.
TblLock Enables or disables the optimizer to consider using table locks.
TmpHash Enables or disables the use of a temporary hash scan. This is an index that is created during execution for use in evaluating the statement. Though index creation is time-consuming, it can save time when evaluating join predicates.
TmpRange Performs a temporary range scan. Can also be used so that values are sorted for a merge join. Though index creation is time-consuming, it can save time when evaluating join predicates.
TmpTable Stores intermediate results into a temporary table. This operation is sometimes chosen to avoid repeated evaluation of predicates in join queries or sometimes just to allow faster scans of intermediate results in joins.
UseBoyerMooreStringSearch Enables or disables the Boyer-Moore string search algorithm. If enabled, Boyer-Moore string search algorithm is enabled. This can improve performance of LIKE operations.

In addition, you can use the string AllFlags to refer to all optimizer flags, and the string Default to refer to the default flags. Default excludes the GenPlan flag but includes all other optimizer flags.

Flag description

The value of each flag can be 1 or 0:

  • If 1, the operation is enabled

  • If 0, the operation is disabled unless absolutely necessary

Initially, all the flag values except GenPlan are 1 (all operations are permitted).

For example, an application can prevent the optimizer from choosing a plan that stores intermediate results:

ttOptSetFlag ( 'TmpTable', 0 )

Similarly, an application can specify a preference for MergeJoin:

ttOptSetFlag ( 'MergeJoin', 0 )

In the second example, the optimizer may still choose a nested loop join if a merge join is impossible (for example, if there is no merge-join predicate). Similarly, the optimizer may occasionally not be able to satisfy an application request to avoid table scans (when the Scan flag is set to 0).

You cannot specify that a particular operation is prohibited only at a certain step of a plan or that a particular join method always be done between two specific tables. Similarly, there is no way to specify that certain indexes be used or that a hash index be used to evaluate a specific predicate. Each operation is either fully permitted or fully restricted.

When a command is prepared, the current optimizer flags, index hints and join order are maintained in the structure of the compiled form of the command and are used if the command is ever reprepared by the system. See "The TimesTen Query Optimizer" in Oracle TimesTen In-Memory Database Operations Guide for an example of reprepared statements.

If both RowLock and TblLock are disabled, TimesTen uses row-locking. If both RowLock and TblLock are enabled, TimesTen uses the locking scheme that is most likely to have better performance:

TblLock status RowLock status Effect on the optimizer
Disabled Disabled Use row-level locking.
Enabled Disabled Use table-level locking.
Disabled Enabled Use row-level locking.
Enabled Enabled Optimizer chooses row-level or table-level locking.

In general, table-level locking is useful when a query accesses a significant portion of the rows of a table or when there are very few concurrent transactions accessing the table.

Result set

ttOptSetFlag returns no results.

Examples

CALL ttOptSetFlag ('TmpHash', 1);

Notes

You can also set the join order using statement level optimizer hints in certain SQL statements. For details, see "Statement level optimizer hints" in the Oracle TimesTen In-Memory Database SQL Reference. Specifically, see the table, "Summary of statement, transaction, and connection level optimizer hints" in the Oracle TimesTen In-Memory Database SQL Reference to understand the behavior of each style of hint.

ttOptSetMaxCmdFreeListCnt

Description

This procedure sets the maximum count of the free list of SQL compiled commands for regular tables. To get the current setting use the ttOptGetMaxCmdFreeListCnt procedure.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Syntax

ttOptSetMaxCmdFreeListCnt(maxCnt)

Parameters

ttOptSetMaxCmdFreeListCnt has the required parameter:

Parameter Type Description
maxCnt TT_INTEGER NOT NULL The max number of free SQL compiled commands for regular tables.

Result set

ttOptSetMaxCmdFreeListCnt returns no results.

Examples

CALL ttOptSetMaxCmdFreeListCnt(40);

ttOptSetMaxPriCmdFreeListCnt

Description

This procedure sets the maximum count of the free list of SQL compiled commands that perform materialized view maintenance.

When this command is set, freeable materialized view compiled commands are counted separately from those of regular tables. If this command is not set, materialized view compiled commands are counted as regular commands.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Related views

This procedure has no related views.

Syntax

ttOptSetMaxPriCmdFreeListCnt(maxCnt)

Parameters

ttOptSetMaxPriCmdFreeListCnt has the required parameter:

Parameter Type Description
maxCnt TT_INTEGER NOT NULL The size of the SQL compiled command cache.

Result set

ttOptSetMaxPriCmdFreeListCnt returns no results.

Examples

CALL ttOptSetMaxPriCmdFreeListCnt(40);

ttOptSetOrder

Description

This procedure specifies the order in which tables should be joined by the optimizer. The character string is a list of table names or table correlation names referenced in the query or a subquery, separated by spaces (not commas). The table listed first is scanned first by the plan. (It is outermost in a nested loop join, for example.) A correlation name is a shortcut or alias for a qualified table name. AutoCommit must be set to OFF when running this built-in procedure.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttOptSetOrder('joinOrder')

Parameters

ttOptSetOrder has the required parameter:

Parameter Type Description
join_Order TT_VARCHAR(1024) List of space-separated table or table correlation names. If an owner is required to distinguish the table name, use a table correlation name. If the joinOrder is not specified the query optimizer reverts to its default behavior.

Result set

ttOptSetOrder returns no results.

Examples

CALL ttOptSetOrder ('EMPS DEPTS ACCTS');

If an application makes the call:

call ttOptSetOrder('ORDERS CUSTOMERS');

The optimizer scans the ORDERS table before scanning the CUSTOMERS when evaluating the following query that lists all the customers who have at least one unshipped order:

SELECT CUSTOMERS.NAME
FROM CUSTOMERS
WHERE EXISTS (SELECT 1
        FROM  ORDERS
        WHERE CUSTOMERS.ID = ORDERS.CUSTID
        AND  ORDER.STATUS ='UN-SHIPPED');

Consider an application that makes the following call.

ttOptSetOrder('DEPTS EMPS ACCTS');

The optimizer is prevented from executing a join between DEPTS and ACCTS when evaluating the number of employees working on a specific account:

SELECT COUNT(DISTINCT EMPS.ID)
FROM  ACCTS, DEPTS, EMPS
WHERE ACCTS.DEPTS = DEPTS.ID
AND  EMPS.DEPTS = DEPTS.ID
AND  ACCTS.NUM = :AcctNum

If the application does not reset the join order and tries to prepare a command that does not reference each of the three tables (and no others), the optimizer issues warning number 965. The specified join order is not applicable. TimesTen considers valid join orders and ignores the specified join order when preparing the command.

Notes

A table alias name for a derived table is not supported in the join order. If you specify a table alias name, TimesTen returns the warning message 965 that indicates the order cannot be honored.

The string length is limited to 1,024 bytes. If a string exceeds this length, it is truncated and a warning is issued.

When correlation names referenced in subqueries are in included in the order, TimesTen may internally change the isolation mode.

When a command is prepared, the current optimizer flags, index hints, and join order are maintained in the structure of the compiled form of the command and are used if the command is ever reprepared by the system. See "The TimesTen Query Optimizer" in Oracle TimesTen In-Memory Database Operations Guide for an example of reprepared statements.

The changes made by this call take effect immediately and affect all subsequent calls to the ODBC function SQLPrepare or the JDBC method Connection.prepareCall in the current transaction. The query optimizer reverts to its default behavior for subsequent transactions.

The tables referenced by a query must exactly match the names given if the join order is to be used (the comparisons are not case sensitive). A complete ordering must be specified; there is no mechanism for specifying partial orders. If the query has a subquery then the join order should also reference the correlation names in the subquery. In essence, the join order should reference all the correlation names referenced in the query. The TimesTen optimizer internally implements a subquery as a special kind of join query with a GROUP BY. For the join order to be applicable it should reference all the correlation names. If there is a discrepancy, Times issues a warning and ignores the specified join order completely.

You can also set the join order using statement level optimizer hints in certain SQL statements. For details, see "Statement level optimizer hints" in the Oracle TimesTen In-Memory Database SQL Reference. Specifically, see the section, "Summary of statement, transaction, and connection level optimizer hints" in the Oracle TimesTen In-Memory Database SQL Reference to understand the behavior of each style of hint.

ttOptSetTblStats

Description

This procedure modifies the statistics for the specified table. This procedure enables an application to set statistics explicitly rather than have TimesTen automatically compute them.

Required privilege

This procedure requires no privilege (if owner) or ALTER ANY TABLE privilege (if not owner).

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Related views

This procedure has no related views.

Syntax

ttOptSetTblStats('tblName', numRows, invalidate)

Parameters

ttOptSetTblStats has these parameters:

Parameter Type Description
tblName TT_CHAR(61) NOT NULL Name of an application table. Can include table owner.

Using a synonym to specify a table name is not supported.

num_Rows TT_INTEGER NOT NULL Number of rows in the table.
invalidate TT_INTEGER 0 (no) or 1 (yes). If invalidate is 1, all commands that reference the affected tables are automatically prepared again when re-executed, including commands prepared by other users. If invalidate is 0, the statistics are not considered to have been modified and existing commands are not reprepared.

Result set

ttOptSetTblStats returns no results.

Examples

CALL ttOptSetTblStats ( 'ACCTS', 10000, 0 );

Notes

This feature is useful for preparing commands before the data has been inserted or for seeing how table size can affect the choice of an execution plan. Because the command can be used before any data is in the table, the values specified do not need to bear any relation to the actual values. This procedure modifies the relevant row(s) in the TBL_STATS system table. See "SYS.TBL_STATS" in Oracle TimesTen In-Memory Database System Tables and Views Reference.

ttOptShowJoinOrder

Description

This procedure returns the join order of the last prepared or executed SQL statement (SELECT, UPDATE, DELETE, and INSERT SELECT) in the current transaction. For a join order to be collected, use ttOptSetFlag('ShowJoinOrder', 1) or set the ttIsql ShowJoinOrder command to ON (1) first in the same transaction. AUTOCOMMIT must be off when using either of these commands. The join order is represented by the order of the table names.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$OPT_JOIN_ORDER

SYS.V$OPT_JOIN_ORDER

Syntax

ttOptShowJoinOrder()

Parameters

ttOptShowJoinOrder has no parameters.

Result set

ttOptShowJoinOrder returns the result:

Column Type Description
joinOrder TT VARCHAR (4096) NOT NULL Table names, including owner name quantifiers and correlation name for each table if specified. Table names are returned in parentheses.

Using a synonym to specify a table name is not supported.


Examples

Command> AUTOCOMMIT 0;
         CALL ttOptSetFlag ('ShowJoinOrder', 1);
         PREPARE SELECT * FROM t1;
         CALL ttOptShowJoinOrder();
         ( T1 )

Notes

You must call ttOptSetFlag('ShowJoinOrder', 1) or set the ttIsql ShowJoinOrder command to ON (1) before using this procedure.

This procedure works within one transaction and is not persistent across transactions.

ttOptStatsExport

Description

This procedure returns the set of statements required to restore the table statistics to the current state. If no table is specified, it returns the set of statements required to restore the table statistics for all user tables that the calling user has permission to access.

Required privilege

This procedure requires ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Grid applications can call this built-in procedure.In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$OPT_STATS

SYS.V$OPT_STATS

Syntax

ttOptStatsExport('tblName')

Parameters

ttOptStatsExport has the parameter:

Parameter Type Description
tblName TT_CHAR (61) NOT NULL Name of the table whose statistics are to be returned. If NULL is passed, then values for all tables are returned.

Using a synonym to specify a table name is not supported.


Result set

ttOptStatsExport returns the result set:

Column Type Description
stmt TT_VARCHAR (8300) NOT NULL The set of statements required to restore the table(s) statistics to the current state.

Examples

CALL ttOptStatsExport('MyTable');

See also


"Create script to regenerate current table statistics" in the Oracle TimesTen In-Memory Database Operations Guide.

ttOptUpdateStats

Description

This procedure updates the statistics for the specified table. TimesTen looks at the data in the table and updates the TBL_STATS and COL_STATS system tables. If the table is large, this process can take some time. Statistics are not computed automatically as rows are updated; an application must compute them explicitly by calling this procedure.

The procedure operates on all tables owned by the current user if tblName is not specified. If the user is the instance administrator, only tables owned by the instance administrator are updated. If the tables are not owned by the user, the user can qualify the table name with their own user name to update stats for the current user.

To determine if your stats are updated, look at the system tables, SYS.COL_STATS and SYS.TBL_STATS, before and after you perform this operation.

Required privilege

This procedure requires no privilege if the user is the table owner, or if tblName is not specified. This procedure requires the ALTER ANY TABLE privilege if the user is not the table owner.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes on all elements in the grid.

Related views

This procedure has no related views.

Syntax

ttOptUpdateStats(['tblName'], [invalidate], [option])

Parameters

ttOptUpdateStats has these parameters:

Parameter Type Description
tblName TT_CHAR(61) Name of an application table. Can include table owner. If a value of NULL or an empty string is provided, the statistics for all the current user's tables are updated.

Using a synonym to specify a table name is not supported.

invalidate TT_INTEGER 0 (no) or 1 (yes). If invalidate is 1, marks all commands for reprepare on next execution except ALTER TABLE DROP TABLE, and the ALTER TABLE ADD COLUMN FOR SELECT * FROM TABLE statements. These exceptions require manual reprepare. If invalidate is 0, the statistics are not considered to have been modified and existing commands are not reprepared.

The invalidate parameter is optional and defaults to 0.

option TT_INTEGER Specifies whether to collect complete interval statistics information. Valid values for this option are:

NULL or 0 - Collect complete interval statistics only if a range index exists on the column. If a range index does not exist, only single interval statistics are collected.

1 - Do not collect complete interval statistics. Only single interval statistics are collected.

The option parameter is optional and defaults to 0.

See the notes below for more information.


Result set

ttOptUpdateStats returns no results.

Examples

CALL ttOptUpdateStats ( 'ACCTS', 1 );

Updates the ACCTS table and causes all commands that reference the ACCTS table to be re-prepared when they are next executed.

CALL ttOptUpdateStats('', 1);

Updates all the current user's tables and causes commands on those tables to be reprepared when they are next executed.

CALL ttOptUpdateStats('ACCTS', 0, 1);

Forces single interval statistics to be collected.

Notes

If the table name specified is an empty string, statistics are updated for all the current user's tables.

When complete interval statistics are collected, the total number of rows in the table is divided into 20 or less intervals and the distribution of each interval is recorded in the statistics. The new statistics contain the information:

  • Number of intervals

  • Total number of NULL values in the column

  • Total number of NON NULL UNIQUE values in the column

  • Total number of rows in the table

  • Interval information, where each interval contains:

    • The minimum value

    • The maximum value

    • The most frequently occurring value

    • The number of times the most frequent value occurred

    • The number of rows that have different values than the most frequent value

    • The number of unique values besides the most frequent value

Collection of complete interval statistics requires the data to be sorted.

If complete interval statistics are not selected, then statistics are collected by treating the entire distribution as a single interval.

For performance reasons, TimesTen does not hold a lock on tables or rows when computing statistics. However, computing statistics can still slow performance. Estimating statistics generally provides better performance than computing exact statistics. See "ttOptEstimateStats" for information on estimating statistics.

If you estimate or update statistics with an empty table list, statistics on system tables are updated also, if you have privileges to update the system tables.

ttOptUseIndex

Description

This procedure enables applications to alter the generation of execution plans by the TimesTen query optimizer. Applications can call this procedure to disable the use of a set of indexes or enable the consideration of only a set of indexes for each correlation used in a query. Enabling the consideration of an index does not guarantee that the plan generated uses the index. Depending on the estimated cost, the optimizer might choose to use a serialization scan or a materialization scan to access the associated correlation if these scans resulted in a better plan than the ones that use the specified index.

The changes made by this call take effect immediately and affect all subsequent calls to the ODBC functions SQLPrepare and SQLExecDirect or the JDBC methods Connection.prepareCall and Statement.execute in the current transaction until the applications explicitly issue a call to clear it. The setting is cleared whenever a new transaction is started.

AutoCommit must be set to OFF when running this built-in procedure.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttOptUseIndex('IndexName, CorrelationName, 0 | 1 [;...]')

Parameters

ttOptUseIndex has a single comma-delimited string parameter, indOption, of type TT_VARCHAR(1024) with these components:

Component Description
IndexName The name of the user-defined index or '_TMPRANGE' for temporary range index or '_TMPHASH' for temporary hash index. If index name is omitted, the setting applies to all indexes of the specified correlation.
CorrelationName The correlation name of the table. If a table is defined with a correlation name in the FROM clause, use this correlation name instead of the table name when specifying the index hint for this table. If correlation name is omitted for an entry, the setting affects all tables with the specified index name.
0 | 1 Disables(0) or enables (1) the use of the index specified by IndexName.

Result set

ttOptUseIndex returns no results.

Examples

CALL ttOptUseIndex('"3456"."1234", t1, 0');

CALL ttOptUseIndex('data1.i1, data1.t1, 0');

CALL ttOptUseIndex('i1, t1, 0');

Notes

If ttOptUseIndex is called without a parameter or with a NULL value, TimesTen clears the previous index hint.

ttPLSQLMemoryStats

Description

This procedure returns result statistics about PL/SQL library cache performance and activity.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

This procedure returns a row for the element from which it was called. To see information about other elements, query the SYS.GV$PLSQL_MEMORY_STATS system table.

Related views

This procedure has these related views.

SYS.GV$PLSQL_MEMORY_STATS

SYS.V$PLSQL_MEMORY_STATS

Syntax

ttPLSQLMemoryStats( )

Parameters

ttPLSQLMemoryStats takes no parameters.

Result Set

ttPLSQLMemoryStats returns the results in the following columns:

Columns Type Description
paramName TT_VARCHAR(30) NOT NULL The name of the result statistic returned in this row.
paramValue BINARY_FLOAT NOT NULL The value of the result statistic returned in this row.

The following statistics are returned:

  • Gets: Number of times a lock was requested for a PL/SQL object.

  • GetHits: Number of times a PL/SQL object's handle was found in memory.

  • GetHitRatio: Ratio of GetHits to Gets.

  • Pins: Number of times a PIN was requested for PL/SQL objects.

  • PinHits: Number of times all the metadata pieces of the library object were found in memory.

  • PinHitRatio: Ratio of PinHits to Pins.

  • Reloads: Any PIN of an object that is not the first PIN performed since the object handle was created, and which requires loading the object from the database.

  • Invalidations: Total number of times objects in this namespace were marked invalid because a dependent object was modified.

  • CurrentConnectionMemory: The total amount of heap memory, in MB, allocated to PL/SQL on this database connection.

  • DeferredCleanups: Total number of times a deferred cleanup occurred.

Examples

connect "DSN=sample";
Connection successful:
DSN=sample;UID=timesten;DataStore=/scratch/timesten/sample;
DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=AL32UTF8;
PermSize=128;PLSQL_MEMORY_SIZE=32;
PLSQL_MEMORY_ADDRESS=20000000;PLSQL=1;(Default setting AutoCommit=1)
Command> create procedure hello is begin 
dbms_output.put_line('Hello, World!');
end;
    > /
Procedure created.
Command> call ttPlsqlMemoryStats; 
< Gets, 485.00000 >
< GetHits, 444.000000 >
< GetHitRatio, .9154639 >
< Pins, 260.00000 >
< PinHits, 178.000000 >
< PinHitRatio, .6846154 >
< Reloads, 4.000000 >
< Invalidations, 0.000000e+00 >
< CurrentConnectionMemory, 56.00000 >
9 rows found.

ttRamPolicyAutoReloadGet

Description

This procedure returns the RAM autoreload policy used to determine if a database is reloaded into RAM after an invalidation. The policy can be either autoreload or noautoreload.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRamPolicyAutoReloadGet()

Parameters

ttRamPolicyAutoReloadGet has no parameters.

Result set

ttRamPolicyAutoReloadGet returns the results:

Column Type Description
flag TT_INTEGER The policy used to determine if the database is reloaded into RAM after an invalidation. Valid values are:

0 - The database is not automatically reloaded into memory after an invalidation. This is the equivalent of the command ttAdmin -noAutoReload.

1 - The database is automatically reloaded into memory after an invalidation. This is the equivalent of the command ttAdmin -autoReload. This is the default autoreload policy.


Examples

To view the RAM autoreload policy, use:

CALL ttRamPolicyAutoReloadGet();

ttRamPolicyAutoReloadSet

Description

This procedure determines the RAM autoreload policy if a database is invalidated. The policy can be either autoreload or noautoreload.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRamPolicyAutoReloadSet(flag)

Parameters

ttRamPolicyAutoReloadSet has the parameters:

Parameter Type Description
flag TT_INTEGER NOT NULL The policy used to determine if the database is reloaded into RAM after an invalidation. Valid values are:

0 - The database is not automatically reloaded into memory after an invalidation. This is the equivalent of the command ttAdmin -noAutoReload.

1 - The database is automatically reloaded into memory after an invalidation. This is the equivalent of the command ttAdmin -autoReload. This is the default autoreload policy.


Result set

ttRamPolicyAutoReloadSet returns no results.

Examples

To automatically reload a database into RAM after an invalidation, use:

CALL ttRamPolicyAutoReloadSet(1);

ttRamPolicyGet

Description

This procedure returns the RAM policy used to determine when a database is loaded into memory. The policy can be either always, manual, or inUse.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRamPolicyGet()

Parameters

ttRamPolicyGet has no parameters.

Result set

ttRamPolicyGet returns the results:

Column Type Description
ramPolicy TT_VARCHAR (10) The policy used to determine when the database is loaded into system RAM. Valid values are:

always - Specifies that the database should remain in system RAM all the time.

manual - Specifies that the database is only to be loaded in system RAM when explicitly loaded by the user, using the ttAdmin -ramLoad command.

inUse (default) - Specifies that the database is only loaded in system RAM when in use (when applications are connected). This option cannot be used with temporary databases. TimesTen only allows a temporary database to be loaded into RAM manually. Trying to set the policy generates a warning. This policy is not supported in TimesTen Scaleout.

ramGrace TT_INTEGER If the ramPolicy is inUse, this field reports the number of seconds the database is kept in RAM after the last application has disconnected. Otherwise, this field is NULL.

Parameters

ttRamPolicyGet has no parameters.

Examples

To view the RAM policy, use:

CALL ttRamPolicyGet();

See also


ttRamPolicySet
"ttAdmin"
"Specifying a RAM policy" in Oracle TimesTen In-Memory Database Operations Guide

ttRamPolicySet

Description

This procedure defines the policy used to determine when a database is loaded into memory. The policy can be either always, manual, or inUse.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRamPolicySet('ramPolicy', [ramGrace])

Parameters

ttRamPolicySet has the parameters:

Parameter Type Description
ramPolicy TT_VARCHAR (10) NOT NULL The policy used to determine when the database is loaded into system RAM. Valid values are:

always - Specifies that the database should remain in system RAM all the time.

manual - Specifies that the database is only to be loaded in system RAM when explicitly loaded by the user, using the ttAdmin -ramLoad command.

inUse - Specifies that the database is only loaded in system RAM when in use (when applications are connected). This option cannot be used with temporary databases. TimesTen only allows a temporary database to be loaded into RAM manually. Trying to set the policy generates a warning.

ramGrace TT_INTEGER Sets the number of seconds the database is kept in RAM after the last application has disconnected. This number is only effective if ramPoliy is inUse. This parameter is optional, and when omitted or set to NULL, the existing ramGrace period is left unchanged.

Result set

ttRamPolicySet returns no results.

Examples

To set the policy for loading a database into RAM to be inUse and for the database to kept in RAM for 10 seconds after the last application has disconnected, use:

CALL ttRamPolicySet('inUse', 10);

See also


ttRamPolicyGet
"ttAdmin"
"Specifying a RAM policy" in Oracle TimesTen In-Memory Database Operations Guide

ttRedundantIndexCheck

Description

This procedure scans the indicated table (or all the current user's tables) to find redundant indexes. It returns the names of the redundant indexes and a suggestion for which to drop.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$REDUNDANT_INDEX

SYS.V$REDUNDANT_INDEX

Syntax

ttRedundantIndexCheck('tblname')

Parameters

ttRedundantIndexCheck has the parameter:

Parameter Type Description
tblName TT_CHAR(61) Name of an application table. Can include table owner. If a value of NULL or an empty string is provided, the redundant indexes for all the current user's tables.

Using a synonym to specify a table name is not supported.


Result Set

ttRedundantIndexCheck returns the result:

Column Type Description
redundancy TT_VARCHAR (1024) NOT NULL The names of redundant indexes and a suggestion for which index to drop.

Examples

Create table y with a primary key. Then create index i. TimesTen returns a warning that a redundant index is being created. Create another index, i1. The command fails and TimesTen returns an error. Call this procedure to show the warnings.

CREATE TABLE y (ID tt_integer primary key);
CREATE INDEX i ON y (id);

Warning 2240: New non-unique index I has the same key 
columns as existing unique index Y; consider dropping index I

CREATE INDEX i1 ON y (id);

2231: New index I1 would be identical to existing index I 
The command failed.

CALL ttredundantindexcheck ('y');

< Non-unique index SCOTT.Y.I has the same key columns 
as unique index SCOTT.Y.Y;
consider dropping index SCOTT.Y.I >
1 row found.

ttRepDeactivate

Description

This procedure changes the state of the active database in an active standby pair from ACTIVE to IDLE. Use this procedure when reversing the roles of the master databases in an active standby pair.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepDeactivate()

Parameters

ttRepDeactivate has no parameters.

Result set

ttRepDeactivate returns no results.

Examples

To deactivate the active database in an active standby pair, use:

CALL ttRepDeactivate();

ttReplicationStatus

Description

This procedure returns the status of one or more replication peer databases.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttReplicationStatus(['subscriber'], ['hostname'])

Parameters

ttReplicationStatus has the optional parameters:

Parameter Type Description
subscriber TT_VARCHAR (200) Subscriber of interest or NULL for all subscribers. If the parameter is provided, then it names a replication subscriber about which information is sought. If the parameter is not provided, then information on replication subscribers defined for the current database is returned.
hostname TT_VARCHAR (200) The host name of one or more stores that are configured to receive updates from the executing store; if NULL, then receiving stores are identified by subscriber alone. If both receiver and host name are NULL, then all receiving stores are selected.

Result set

ttReplicationStatus returns the result set:

Column Type Description
subscriber TT_VARCHAR(200) NOT NULL Subscriber name.
hostName TT_VARCHAR(200) NOT NULL Name of the system that hosts the subscriber.
port TT_INTEGER NOT NULL TCP/IP port used by the subscriber agent to receive updates from the master. A value of 0 indicates replication has automatically assigned the port.
pState TT_CHAR(10) NOT NULL Current replication state of the subscriber with respect to its master database. The values of the result column are:

start - Replication is enabled to this peer.

pause - Replication is temporarily paused to this peer. TimesTen preserves updates. See "Set the replication state of subscribers" in Oracle TimesTen In-Memory Database Replication Guide for more information.

stop - Replication updates are NOT being collected for this peer.

failed - Replication to a subscriber is considered failed because the threshold limit (log data) has been exceeded. This state is set by the system.

logs TT_INTEGER NOT NULL Number of transaction log files the master database is retaining for a subscriber.
lastMsg TT_INTEGER Seconds since last interaction or NULL.
replicationName TT_CHAR(30) NOT NULL Name of replication scheme.
replicationOwner TT_CHAR(30) NOT NULL Owner of replication scheme.

Examples

Command> call ttReplicationStatus();
< MASTER2, HOST1, 0, start     , 1, 257142, \
     _ACTIVESTANDBY         , TTREP       >
1 row found.

Command> call ttReplicationStatus('master2', 'host1');
< MASTER2, HOST1, 0, start     , 1, 266439, \
     _ACTIVESTANDBY                , TTREP                          >
1 row found.

Notes

If the receiver parameter is not NULL, only the status of the given receiver is returned. If the receiver parameter is NULL, the status of all subscribers is returned.

This procedure is supported only for TimesTen Data Manager ODBC applications. It is not supported for TimesTen Client or JDBC applications.

ttRepPolicyGet

Description

This procedure returns the replication restart policy used to determine when the TimesTen for the connected database should run. The policy can be always, manual, or norestart.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepPolicyGet()

Parameters

ttRepPolicyGet has no parameters.

Result set

ttRepPolicyGet returns the results:

Column Type Description
repPolicy TT_VARCHAR (10) The policy used to determine when the TimesTen replication agent for the database should run. Valid values are:

always - Specifies that the replication agent for the database is always running. This option immediately starts the TimesTen replication agent. When the TimesTen daemon restarts, TimesTen automatically restarts the replication agent.

manual - Specifies that you must manually start the replication agent using either the ttRepStart built-in procedure or the ttAdmin -repStart command. You must explicitly stop the replication agent using either the ttRepStop built-in procedure or the ttAdmin -repStop command.

norestart - Specifies that the replication agent for the database is not to be restarted after a failure.


Examples

To set the policy for TimesTen replication agent to always, use:

CALL ttRepPolicyGet();

ttRepPolicySet

Description

This procedure defines the replication restart policy used to determine when the TimesTen for the connected database should run. The policy can be either always, manual, or norestart.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepPolicySet('repPolicy')

Parameters

ttRepPolicySet has this parameter:

Parameter Type Description
repPolicy TT_VARCHAR (10) NOT NULL Specifies the policy used to determine when the TimesTen replication agent for the database should run. Valid values are:

always - Specifies that the replication agent for the database is always running. This option immediately starts the TimesTen replication agent. When the TimesTen daemon restarts, TimesTen automatically restarts the replication agent.

manual - Specifies that you must manually start the using either the ttRepStart built-in procedure or the ttAdmin -repStart command. You must explicitly stop the replication agent using either the ttRepStop built-in procedure or the ttAdmin -repStop command.

norestart - Specifies that the replication agent for the database is not to be restarted after a failure.


Result set

ttRepPolicySet returns no results.

Examples

To set the policy for TimesTen replication agent to always, use the following.

CALL ttRepPolicySet('always');

ttRepQueryThresholdGet

Description

This procedure returns the number of seconds that was most recently specified as the query threshold for the replication agent. The number of seconds returned may not be the same as the query threshold in effect. Setting a new value for the query threshold takes effect the next time the replication agent is started.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepQueryThresholdGet()

Parameters

ttRepQueryThresholdGet has no parameters.

Result set

ttRepQueryThresholdGet returns the result:

Column Type Description
repQueryThreshold TT_INTEGER The number of seconds that a replication query executes before returning an error.

Examples

To get the replication query threshold value, use:

CALL ttRepQueryThresholdGet;
< 4 >
1 row found.

ttRepQueryThresholdSet

Description

This procedure specifies the number of seconds that a query can be executed by the replication agent before TimesTen writes a warning to the daemon log. The specified value takes effect the next time the replication agent is started. The query threshold for the replication agent applies to SQL execution on detail tables of materialized views, ON DELETE CASCADE operations and some internal operations that execute SQL statements.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepQueryThresholdSet(seconds);

Parameters

ttRepQueryThresholdSet has the parameter:

Parameter Type Description
seconds TT_INTEGER NOT NULL Number of seconds a SQL statement can be executed by the replication agent before TimesTen writes a warning to the daemon log. The value must be greater than or equal to 0. Default is 0 and indicates that TimesTen does not write any warnings.

Result set

ttRepQueryThresholdSet returns no results.

Examples

To set the replication query threshold value to four seconds, use:

CALL ttRepQueryThresholdSet(4);

ttRepStart

Description

This procedure starts the TimesTen replication agent for the connected database.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepStart()

Parameters

ttRepStart has no parameters.

Result set

ttRepStart returns no results.

Examples

To start the replication agent, use:

CALL ttRepStart();

Notes

The replication agent does not start if the database does not participate in any replication scheme.

When using this procedure, no application, including the application making the call, can be holding a connection that specifies database-level locking (LockLevel=1).

ttRepStateGet

Description

This procedure returns the current replication state of a database in an active standby pair.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepStateGet()

Parameters

ttRepStateGet has no parameters.

Result set

ttRepStateGet returns the result:

Column Type Description
state TT_VARCHAR (20) NOT NULL The current replication state of the database. One of:

ACTIVE - The database is currently the active master database. Applications may update its replicated tables.

STANDBY - The database is the standby master database. Applications may only update its non-replicated tables.

FAILED - The database is a failed master database. No updates are replicated to it.

IDLE - The database has not yet been assigned its role in the active standby pair. It cannot be updated by applications or replication. Every store comes up in the IDLE state.

RECOVERING - The store is in the process of synchronizing updates with the active store after a failure.


Examples

To determine the replication state of the active standby pair, use:

Call ttRepStateGet();
<STANDBY>
 
Call ttRepStateGet();
<ACTIVE>
 
Call ttRepStateGet();
<FAILED>
 

ttRepStateSave

Description

This procedure saves the state of a remote peer database in an active standby pair to the currently connected database. Currently, may only be used to indicate to the active database that the standby database, storeName on hostName, has failed, and that all updates on the active database should be replicated directly to the read-only subscribers.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepStateSave('state', 'storeName', 'hostName')

Parameters

ttRepStateSave has these parameters:

Parameter Type Description
state TT_VARCHAR (20) NOT NULL The replication state of the indicated database. May only be specified as FAILED in this release. Recording that a standby database has failed indicates that all replicated updates are to be sent directly from the active database to the read-only subscribers.
storeName TT_VARCHAR (200) NOT NULL Name of the database for which the state is indicated.
hostName TT_VARCHAR (200) Name of the host where the database resides.

Result set

ttRepStateSave returns no results.

Examples

To indicate to the active database that the standby database standby on host backup1 has failed, use:

ttRepStateSave('FAILED', 'standby', 'backup1');

ttRepStateSet

Description

This procedure sets the replication state of a database in an active standby pair replication scheme. Currently, ttRepStateSet may only be used to set the state of a database to ACTIVE, indicating that it is to take the active role in an active standby pair. ttRepStateSet may only be executed in the following situations:

  • A database has had a CREATE ACTIVE STANDBY PAIR command executed and no failures have occurred since.

  • A database is currently in the STANDBY state, and the other database in the active standby pair has had its state changed from ACTIVE to IDLE using the ttRepDeactivate procedure.

  • A database has just recovered from the local transaction log and was in the ACTIVE state before it went down.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepStateSet('state')

Parameters

ttRepStateSet has the parameter:

Parameter Type Description
state TT_VARCHAR (20) NOT NULL The replication state of the database. Must be ACTIVE, in this release. Setting a store to ACTIVE designates it as the active database in an active standby pair.

Result set

ttRepStateSet returns no results.

Examples

To set the replication state of the database to ACTIVE, use:

CALL ttRepStateSet('ACTIVE');

ttRepStop

Description

This procedure stops the TimesTen replication agent for the connected database.

Required privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepStop()

Parameters

ttRepStop has no parameters.

Result set

ttRepStop returns no results.

Examples

To stop the replication agent, use:

CALL ttRepStop();

Notes

When using this procedure, no application, including the application making the call, can be holding a connection that specifies database-level locking (LockLevel=1).

ttRepSubscriberStateSet

Description

This procedure changes a replicating subscriber's state with respect to the executing master store.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepSubscriberStateSet('replicationName', 'replicationOwner',
 'subscriberStoreName', 'subscriberHostName', newStateCode)

Parameters

ttRepSubscriberStateSet has these parameters:

Parameter Type Description
replicationName TT_CHAR (30) The name of the replication scheme on which to operate. May be NULL to indicate all replication schemes.
replicationOwner TT_CHAR (30) The owner of the replication scheme. May be NULL to indicate all replication scheme owners.
subscriberStoreName TT_VARCHAR (200) The name of the subscribing database whose state is to be set. May be NULL to indicate all stores on host subscriberHostName.
subscriberHostName TT_VARCHAR (200) The subscriber's host. May be NULL to indicate all hosts of subscribing peers.
newStateCode TT_INTEGER An integer code representing the specified subscriber's new state:

0/NULL - Start (default). Starts replication to the subscriber.

1 - Pause. Pauses the replication agent, preserving updates.

2 - Stop. Stops replication to the subscriber, discarding updates.

All other state codes are disallowed. (This procedure cannot set a subscriber state to "failed.") "Set the replication state of subscribers" in the Oracle TimesTen In-Memory Database Replication Guide for more information.


Result set

ttRepSubscriberStateSet returns no results.

Examples

For the replication scheme named REPL.REPSCHEME, the following directs the master database to set the state of the subscriber database (SUBSCRIBERDS ON SYSTEM1) to Stop (2):

CALL ttRepSubscriberStateSet('REPSCHEME', 'REPL', 
'SUBSCRIBERDS','SYSTEM1', 2);

To direct the master database to set the state of all its subscribers to Pause (1), use:

CALL ttRepSubscriberStateSet( , , , , 1 );

Leaving a parameter empty is equivalent to using NULL.

ttRepSubscriberWait

Description

This procedure causes the caller to wait until all transactions that committed before the call have been transmitted to the subscriber subscriberStoreName. It also waits until the subscriber has acknowledged that the updates have been durably committed at the subscriber database.

Call this procedure in a separate transaction, when no other transaction is pending on the active database. This call returns an error if any transactions on the active database are open.

If you set the waitTime parameter to -1 and the subscriberStoreName parameter to NULL, the ttRepSubscriberWait procedure does not return until all updates committed up until the time of the procedure call have been transmitted to all subscribers, and all subscribers have acknowledged that the updates have been durably committed.

The ttRepSubscriberWait procedure should not be used when an urgent response is required. Instead, you should use the return receipt service.

Procedure is working expected for transient error scenarios.

Note:

If this procedure is called after all write transaction activity is quiesced at a store (there are no active transactions and no transactions have started), it may take 60 seconds or longer before the subscriber sends the acknowledgment that all updates have been durably committed at the subscriber.

The procedure does not return any failure output ( 01 value) for permanent error scenarios.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepSubscriberWait('replicationName', 'replicationOwner', 
'subscriberStoreName', 'subscriberHostName', waitTime)

Parameters

ttRepSubscriberWait has these parameters:

Parameter Type Description
replicationName TT_CHAR (30) The name of the replication scheme on which to operate. May be NULL to indicate all replication schemes.
replicationOwner TT_CHAR (30) The owner of the replication scheme. May be NULL to indicate all replication scheme owners.
subscriberStoreName TT_VARCHAR (200) The name of the subscribing database whose state is to be set. May be NULL to indicate all stores on host subscriberHostName.
subscriberHostName TT_VARCHAR(200) The subscriber's host. May be NULL to indicate all hosts of subscribing peers.
waitTime TT_INTEGER NOT NULL Number of seconds to wait for the specified subscriber(s). A value of -1 indicates to wait forever. This parameter is required and may not be NULL.

Result Set

ttRepSubscriberWait returns the result set:

Column Type Description
timeOut BINARY(1) 0x00 - The wait succeeded within the allotted waitTime; the specified subscribers are up to date at the time this procedure was called. TimesTen returns 0x01 if not enough time has been granted.

Examples

If there is one defined replication scheme REPOWNER.REPSCHEME, to direct the transmitting database to wait ten minutes for subscriber REP2 on SERVER2 to catch up, use:

CALL ttRepSubscriberWait('REPSCHEME','REPOWNER', 
'REP2', 'SERVER2', 600);

ttRepSyncGet

Description

This procedure returns static attributes associated with the caller's use of the replication- based return service. This procedure operates with either the RETURN RECEIPT or RETURN TWOSAFE service.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepSyncGet()

Parameters

ttRepSyncGet has no parameters.

Result set

ttRepSyncGet returns the result set:

Column Type Description
requestReturn BINARY(1) 0 (default) - Don't wait for return notification configured with the RETURN RECEIPT BY REQUEST or RETURN TWOSAFE BY REQUEST option.

1 - Wait for the return notification. Commit resets this attribute to its default value of 0 ("off").

returnWait TT_INTEGER Specifies the number of seconds to wait for return service acknowledgment. The default value is 10 seconds. A value of `0' means that there is no wait time.This attribute persists across transaction boundaries and applies to all RETURN services independent of the BY REQUEST option.
localAction TT_INTEGER The current LOCAL ACTION configuration for RETURN services.

1 (default) - NO ACTION. When a COMMIT times out, it returns the application unblocked, leaving the transaction in the same state it was when the COMMIT began. The application may only reissue the COMMIT.

2 - COMMIT. When the COMMIT times out, the transaction is committed locally. No more operations are possible on this transaction, and the replicated databases diverge.This attribute persists across transactions and for the life of the connection.


Examples

To retrieve the caller's requestReturn value, use:

SQLCHAR requestReturn[1];
SQLINTEGER    len;
rc = SQLExecDirect   ( hstmt
                , (SQLCHAR *) "{CALL ttRepSyncGet( NULL )}"
                , SQL_NTS )
rc = SQLBindCol     ( hstmt
                , /* ColumnNumber */      1
                , /* Tarype */      SQL_C_BINARY )
                , /* TargetValuePtr */     requestReturn
                ,./* BufferLength */      sizeof requestReturn
                , /* StrLen_ */         &len );
rc = SQLFetch( hstmt );
if ( requestReturn[0] ) {
...
}

Notes

When called within a standalone transaction, ttRepSyncGet always returns the default value for requestReturn.

Applications can call ttRepSyncGet at any point within a transaction in which it is used to request the BY REQUEST return service for that transaction.

If you call ttRepSyncGet in a transaction that does not update any RETURN RECEIPT BY REQUEST or RETURN TWOSAFE BY REQUEST replication elements, the call has no external effect.

ttRepSyncSet

Description

This procedure sets static attributes associated with the caller's use of the replication-based return service. This procedure operates with either the RETURN RECEIPT or RETURN TWOSAFE service.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepSyncSet([requestReturn], [returnWait], [localAction])

Parameters

ttRepSyncSet has these optional parameters:

Parameter Type Description
requestReturn BINARY(1) 0x00 - Turn off the return service for the current transaction.

0x01 - Turn on return services for the current transaction. Committing the transaction resets this attribute to its default value of 0 ("off").

You can use this parameter to turn on or turn off return services only when the replication subscribers have been configured with RETURN RECEIPT BY REQUEST or RETURN TWOSAFE BY REQUEST.

returnWait TT_INTEGER Specifies the number of seconds to wait for return service acknowledgment. The default value is 10. A value of 0 means there is no wait time.

This timeout value overrides the value set by the RETURN WAIT TIME attribute in the CREATE REPLICATION or ALTER REPLICATION statement.

The timeout set by this parameter persists across transaction boundaries and applies to all return services independent of the BY REQUEST option.

localAction TT_INTEGER Action to be performed in the event the subscriber cannot acknowledge commit of the transaction within the timeout period specified by returnWait. This parameter can only be used for return twosafe transactions. Set to NULL when using the RETURN service.

1 (default) - NO ACTION. When a COMMIT times out, it returns the application unblocked, leaving the transaction in the same state it was when the COMMIT began,. The application may only reissue the COMMIT.

2 - COMMIT. When the COMMIT times out, the transaction is committed locally. No more operations are possible on this transaction, and the replicated databases diverge.This attribute persists across transactions and for the life of the connection.


Result set

ttRepSyncSet has no result set.

Examples

To enable the return receipt service in the current transaction for all the replication elements configured with RETURN RECEIPT BY REQUEST or RETURN TWOSAFE BY REQUEST, use:

rc = SQLExecDirect ( hstmt,
 (SQLCHAR *)"{CALL ttRepSyncSet( 0x01 )}",
                     SQL_NTS )

Notes

The call to enable the return receipt service must be part of the transaction (AutoCommit must be off).

ttRepSyncSubscriberStatus

Description

This procedure queries a subscriber database in a replication scheme configured with a return service and a RETURN DISABLE failure policy to determine whether return service blocking for the subscriber has been disabled by the failure policy.

The ttRepSyncSubscriberStatus procedure returns the failure status of the subscriber database with the specified name on the specified host. You can specify only the storeName. However, an error is generated if the replication scheme contains multiple subscribers with the same name on different hosts.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepSyncSubscriberStatus('subscriber', 'hostName')

Parameters

ttRepSyncSubscriberStatus has these parameters:

Parameter Type Description
subscriber TT_VARCHAR (200) NOT NULL The name of the subscribing database to be queried.
hostName TT_VARCHAR (200) The host name of one or more stores that are configured to receive updates from the executing store; if NULL, then receiving stores are identified by receiver alone. If both receiver and host name are NULL, then all receiving stores are selected.

Result set

ttRepSyncSubscriberStatus returns:

Column Type Description
disabled TT_INTEGER Value is either:

1 - The return service has been disabled on the subscriber database.

0 - The return service is still enabled on the subscriber database.


Notes

If the replication scheme specifies DISABLE RETURN ALL, then you must use ttRepSyncSubscriberStatus to query the status of each individual subscriber in the replication scheme.

ttRepTransmitGet

Description

This procedure returns the status of transmission of updates to subscribers for the current transaction. The corresponding ttRepSyncSet built-in procedure enables you to stop transmission of updates to subscribers for the length of a transaction.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepTransmitGet()

Parameters

ttRepTransmitGet has no parameters.

Result set

ttRepTransmitGet returns the result:

Column Type Description
transmit TT_INTEGER 0 - Updates are not being transmitted to any subscribers for the remainder of the transaction on the connection.

1 (default) - Updates are being transmitted to subscribers on the connection.


Examples

To return the transmit status on the active database in an active standby pair, use:

CALL ttRepTransmitGet();

ttRepTransmitSet

Description

This procedure stops subsequent updates on the connection it is executed in from being replicated to any subscriber. Use this procedure with care since it could easily lead to transactional inconsistency of remote stores if partial transactions are replicated. If updates are disallowed from getting replicated, the subscriber stores diverge from the master store.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepTransmitSet(transmit)

Parameters

ttRepTransmitSet has the parameter:

Parameter Type Description
transmit TT_INTEGER NOT NULL When set to 1, updates are transmitted to subscribers on the connection after the built-in is executed. (This is the default.)

When set to 0, updates are not transmitted to any subscribers for the remainder of the transaction in which this call was issued on the connection that issued it.


Result set

ttRepTransmitSet returns no results.

Examples

To activate the active database in an active standby pair, use:

CALL ttRepTransmitSet(1);

To deactivate the active database in an active standby pair, use:

CALL ttRepTransmitSet(0);

ttRepXactStatus

Description

This procedure checks on the status of a RETURN RECEIPT or RETURN TWOSAFE replication transaction. Using the built-in procedure ttRepXactTokenGet, you can get the token of a RETURN RECEIPT or RETURN TWOSAFE transaction. This is then passed as an input parameter to this built-in procedure. Only a token received from ttRepXactTokenGet may be used. The procedure returns a list of rows each of which have three parameters, a subscriber name, the replication status with respect to the subscriber and an error string that is only returned if a RETURN TWOSAFE replication transaction began but did not complete commit processing.

Note:

The error parameter is only returned for RETURN TWOSAFE transactions.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepXactStatus(xactID)

Parameters

ttRepXactStatus has the parameter:

Parameter Type Description
xactID VARBINARY (10000) If no parameter is specified, status is returned for one of the following:
  • If called in a transaction that has begun, but not completed, commit processing, it returns the status of the transaction.

  • If called at any other time, it returns status for the most recently committed transaction on the connection that was in RETURN RECEIPT or RETURN TWOSAFE mode.


Result set

ttRepXactStatus returns the result set:

Column Type Description
subscriberName TT_CHAR (61) The name of the database that subscribes to tables updated in the transaction. The name returns as: store_name@host_name.
state TT_CHAR (2) The state of the transaction with respect to the subscribing database. The return values are one of the following:

'NS' - Transaction not sent to the subscriber.

'RC' - Transaction received by the subscriber agent.

'CT' - Transaction applied at the subscriber store. (Does not convey whether the transaction ran into an error when being applied.)

'AP' - Transaction has been durably applied on the subscriber.

errorString TT_VARCHAR (2000) Error string retuned by the subscriber agent describing the error it encountered when applying the twosafe transaction. If no error is encountered, this parameter is NULL. Non-null values are only returned when this procedure is called inside a twosafe replication transaction that has begun, but has not yet completed, processing a commit.

ttRepXactTokenGet

Description

This procedure returns a token for RETURN RECEIPT or RETURN TWOSAFE replication transactions. Depending on the input parameter, type, it returns either:

  • A token to the most recently committed RETURN RECEIPT transaction on the connection handle in which it is invoked.

  • A token to the most recent transaction on the connection handle in which it is invoked that has begun commit processing on a transaction in RETURN TWOSAFE mode.

This procedure can be executed in any subsequent transaction or in the same transaction after commit processing has begun for a transaction in RETURN TWOSAFE replication.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttRepXactTokenGet('typ')

Parameters

ttRepXactTokenGet has these parameters:

Parameter Type Description
typ TT_CHAR (2) NOT NULL The type of transaction desired:

'RR' - Return receipt.

'R2' - Return twosafe.


Result set

ttRepXactTokenGet returns the result set:

Column Type Description
token VARBINARY (10000) A VARBINARY token used to represent the transaction desired.

ttSetUserColumnID

Description

This procedure explicitly sets the value for the user-specified column ID. Updates presented to the application by the Transaction Log API may contain information about the columns of a table. This column information contains a system-specified column number and a user-specified column identifier. The user-specified column ID has the value 0 until set explicitly by this call.

The system assigns an ID to each column during a CREATE TABLE or ALTER TABLE operation. Setting a user-assigned value for the column ID enables you to have a unique set of column numbers across the entire database or a specific column numbering system for a given table.

Required privilege

This procedure requires the XLA privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttSetUserColumnID('tblName', 'colName', repID)

Parameters

ttSetUserColumnID has these parameters:

Parameter Type Description
tblName TT_CHAR(61) NOT NULL Table name.

Using a synonym to specify a table name is not supported.

colName TT_CHAR(30) NOT NULL Column name.
repID TT_INTEGER NOT NULL Integer identifier.

Result set

ttSetUserColumnID returns no results.

Examples

CALL ttSetUserColumnID('APP.SESSION', 'SESSIONID', 15);

ttSetUserTableID

Description

This procedure explicitly sets the value of the user table ID. The table that each row is associated with is expressed with two codes: an application-supplied code called the user table ID and a system-provided code called the system table ID. Updates are presented to the application by the Transaction Log API in the form of complete rows. The user table ID has the value zero until explicitly set with the ttSetUserTableID procedure.

Required privilege

This procedure requires the XLA privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttSetUserTableID('tblName', repID)

Parameters

ttSetUserTableID has these parameters:

Parameter Type Description
tblName TT_CHAR (61) NOT NULL Table name.

Using a synonym to specify a table name is not supported.

repID BINARY(8) NOT NULL Integer identifier.

Result set

ttSetUserTableID returns no results.

Examples

CALL ttSetUserTableID('APP.SESSION', 0x123456);

ttSize

Description

This procedure estimates the size of a table or view and the size of indexes. It returns a single row with a single DOUBLE column with the estimated number of bytes for the table. The table can be specified as either a table name or a fully qualified table name. A non-NULL nrows parameter causes the table size to be estimated assuming the statistics of the current table scaled up to the specified number of rows. If the nrows parameter is NULL, the size of the table is estimated with the current number of rows.

The current contents of the table are scanned to determine the average size of each VARBINARY and VARCHAR column. If the table is empty, the average size of each VARBINARY and VARCHAR column is estimated to be one-half its declared maximum size. The estimates computed by ttSize include storage for the table itself, VARBINARY and VARCHAR columns and all declared indexes on the table.

The table is scanned when this built-in procedure is called. The scan of the table can be avoided by specifying a non-NULL frac value, which should be between 0 and 1. This value estimates the average size of varying-length columns. The maximum size of each varying-length column is multiplied by the frac value to compute the estimated average size of VARBINARY or VARCHAR columns. If the frac parameter is not given, the existing rows in the table are scanned and the average length of the varying-length columns in the existing rows is used. If frac is omitted and the table has no rows in it, then frac is assumed to have the value 0.5.

Required privilege

This procedure requires the SELECT privilege on the specified table.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

This procedure returns a row for the element from which it was called. To see information about other elements, query the SYS.GV$TABLE_SIZES system table.

Related views

This procedure has no related views.

Syntax

ttSize(['tblName'], [nRows], frac)

Parameters

ttSize has these parameters:

Parameter Type Description
tblName TT_CHAR(61) NOT NULL Name of an application table. Can include table owner. This parameter is optional. If not specified all table sizes are returned.

Using a synonym to specify a table name is not supported.

nRows TT_INTEGER Number of rows to estimate in a table. This parameter is optional.
frac BINARY_DOUBLE Estimated average fraction of VARBINARY or VARCHAR column sizes. This parameter is optional.

Result set

ttSize returns the following result set.

Column Type Description
size BINARY_DOUBLE NOT NULL Estimated size of the table, in bytes.

Examples

CALL ttSize('ACCTS', 1000000, NULL);

CALL ttSize('ACCTS', 30000, 0.8);

CALL ttSize('SALES.FORECAST', NULL, NULL);

When using ttSize, you must first execute the command and then fetch the results. For example:

ODBC

double size;
SQLLEN len;

rc = SQLExecDirect(hstmt, "call ttSize('SalesData', 250000, 
0.75)", SQL_NTS);
rc = SQLBindColumn(hstmt, 1, SQL_C_DOUBLE, &size, sizeof double, 
&len);
rc = SQLFetch(hstmt);
rc = SQLFreeStmt(hstmt, SQL_CLOSE);

JDBC

. . . . . .
String URL="jdbc:timesten:MyDataStore";
Connection con;
double tblSize=0;
. . . . . .
con = DriverManager.getConnection(URL);
CallableStatement cStmt = con.prepareCall("
{CALL ttSize('SalesData', 250000, 0.75) }");
if( cStmt.execute() ) 
  {
   rs=cStmt.getResultSet();
   if (rs.next()) {
    tblSize=rs.getDouble(1);
   }
   rs.close();
  }
cStmt.close();
con.close();

. . . . . .

Notes

The ttSize procedure enables you to estimate how large a table will be with its full population of rows based on a small sample. For the best results, populate the table with at least 1,000 typical rows.

ttSQLCmdCacheInfo

Description

This procedure returns information about all prepared SQL statements in the TimesTen SQL command cache.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$SQL_CMD_CACHE

SYS.V$SQL_CMD_CACHE

Syntax

ttSQLCmdCacheInfo([sqlCmdID])

Parameters

ttSQLCmdCacheInfo has the optional parameter:

Parameter Type Description
sqlCmdID TT_BIGINT The unique identifier of a SQL command in the TimesTen command cache. If no value is supplied, information is displayed for all commands.

Result set

ttSQLCmdCacheInfo returns the result set:

Column Type Description
sqlCmdID TT_BIGINT NOT NULL The unique identifier of a command.
privateCommandConnectionID TT_INTEGER If the command is private, this is the connection ID of the connection where it was prepared. If not a private command, this value is -1.
executions TT_BIGINT

NOT NULL

Counts the number of executions of the command.
prepares TT_BIGINT NOT NULL Counts the number of prepares for the command.
reprepares TT_BIGINT NOT NULL Counts the number of reprepares for the command.
freeable TT_TINYINT NOT NULL Indicates whether this command can be garbage collected by the subdaemon.

1 - Indicates freeable.

0 - Indicates non-freeable.

size TT_INTEGER NOT NULL The total space (bytes) allocated for this command in the command cache.
owner TT_CHAR(31) NOT NULL The user who created the command.
queryText TT_VARCHAR (409600) NOT NULL The full SQL text for the current command.
fetchCount TT_BIGINT NOT NULL The total number of fetch executions done for this statement. The number of fetches depends on TT_PREFETCH_COUNT. The pre-fetch count has a default value of 5 in Read Committed isolation mode and a default of 128 in Serializable mode.
startTime TT_TIMESTAMP The time when the statement was last executed. The value is in the form: YYYY-MM-DD HH:MI:SS.FFF
maxExecuteTime NUMBER The maximum wall clock execute time in seconds for this statement.
lastExecuteTime NUMBER Last measured execution time in seconds of the command.
minExecuteTime NUMBER If SqlCmdSampleFactor > 0, minimum execute time in seconds, otherwise 0.0.
execloc TT_TINYINT NOT NULL  
gridCmdId TT_VARCHAR (64)  
tempSpaceUsage TT_BIGINT  
maxTempSpaceUsage TT_BIGINT  

Examples

To display command information in ttIsql for all the current valid commands, use:

Command> call ttsqlcmdcacheinfo;
< 43428992, 2048, 5, 5, 0, 1, 2800, SYS                            , select sys.
objectSequence.nextval from dual >
< 51629120, 2048, 12, 12, 0, 1, 3040, SYS                            , delete fr
om sys.idl_char$ where obj#=:1 and part=:2 >
< 51641192, 2048, 2, 2, 0, 1, 2112, BWAF4EVR                       , create tabl
e tab1 (c1 number not null, c2 number) >
< 43442488, 2048, 5, 5, 0, 1, 4616, SYS                            , insert into
 sys.obj$(owner#,name,namespace,obj#,type#,ctime,mtime,stime,status,flags) value
s(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10) >
< 51632072, 2048, 12, 12, 0, 1, 3040, SYS                            , delete fr
om sys.idl_ub2$ where obj#=:1 and part=:2 >
< 49375216, 2048, 0, 1, 0, 0, 4232, SYS                            , select 1 fr
om sys.sysauth$ s where (s.grantee# = :userid or s.grantee# = 1) and (s.privileg
e# = :priv or s.privilege# = 67) >
< 51626304, 2048, 12, 12, 0, 1, 3040, SYS                            , delete fr
om sys.idl_ub1$ where obj#=:1 and part=:2 >
< 51645776, 2048, 1, 1, 0, 1, 2344, BWAF4EVR                       , create tabl
e tab1 (c1 number primary key not null, col2 number) >
< 51623232, 2048, 4, 4, 0, 1, 2704, SYS                            , delete from
 sys.source$ where obj#=:1 >
32 rows found.

To display the information formatted vertically in ttIsql, use:

Command> vertical call ttSQLCmdCacheInfo;
...

To display the information vertically in ttIsql for sqlCmdID 51623232, use:

Command> vertical call ttsqlcmdcacheinfo(51623232);
 
  SQLCMDID:                        51623232
  PRIVATE_COMMAND_CONNECTION_ID:   2048
  EXECUTIONS:                      4
  PREPARES:                        4
  REPREPARES:                      0
  FREEABLE:                        1
  SIZE:                            2704
  OWNER:                           SYS
  QUERYTEXT:                       delete from sys.source$ where obj#=:
  FETCHCOUNT:                      
  STARTTIME:                       
  MAXEXECUTETIME:                  
  LASTEXECUTETIME:                 
  MINEXECUTETIME:                  
 
1 row found.

ttSQLCmdCacheInfoGet

Description

This procedure displays information about the commands in the TimesTen SQL command cache.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$SQL_CMD_CACHE_INFO

SYS.V$SQL_CMD_CACHE_INFO

Syntax

ttSQLCmdCacheInfoGet()

Parameters

ttSQLCmdCacheInfoGet has no parameters.

Result set

ttSQLCmdCacheInfoGet returns the result set:

Column Type Description
cmdCount TT_INTEGER NOT NULL Number of commands in the cache.
freeableCount TT_INTEGER NOT NULL Count of number of freeable commands that can be garbage collected by the subdaemon at that moment. This number is obtained by examining the command information.
size TT_BIGINT NOT NULL The current total space allocated to store all the cached commands, in bytes.

Examples

To display the command count, freeable command count, and total space allocated to the command cache, use:

Command> call ttSQLCmdCacheInfoGet;
< 5,4,12316 >
1 row found

ttSQLCmdQueryPlan

Description

This procedure returns all detailed runtime query plans for SQL statements in the TimesTen SQL command cache. If no argument is supplied, this procedure displays the query plan for all valid commands in the TimesTen cache. For invalid commands, an error is returned that displays the text of the query and the syntax problems.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$SQL_CMD_QUERY_PLAN

SYS.V$SQL_CMD_QUERY_PLAN

Syntax

ttSQLCmdQueryPlan([sqlCmdID])

Parameters

ttSQLCmdQueryPlan has the optional parameter:

Parameter Type Description
sqlCmdID TT_BIGINT The unique identifier of a SQL command in the TimesTen command cache. If no value is supplied displays the query plan for all valid commands in the TimesTen cache.

Result set

ttSQLCmdQueryPlan returns the result set:

Column Type Description
sqlCmdID TT_BIGINT NOT NULL The unique identifier of a command in the TimesTen command cache.
queryText TT_VARCHAR(409600) The first 1024 characters of the SQL text for the current command.
step TT_INTEGER The step number of current operation in this run-time query plan.
level TT_INTEGER The level number of current operation in this run-time query plan.
operation TT_CHAR(127) The operation name of the current step in this run-time query plan.
tblName TT_CHAR(31) Name of the table used in this step, if any.

Using a synonym to specify a table name is not supported.

tblOwnerName TT_CHAR(31) Name of the owner of the table used in this step, if any.
indexName TT_CHAR(31) Name of the index used in this step, if any.
indexedPred TTVARCHAR(1024) In this step, if an index is used, the indexed predicate is printed if available. Not all expressions can be printed out and the output may be fragmented and truncated. "..." represents the unfinished portion of the expression.
nonIndexedPred TT_VARCHAR(1024) In this step, if a non-indexed predicate is used, the non-indexed predicate is printed if available. Not all expressions can be printed out and the output may be fragmented and truncated. "..." represents the unfinished portion of the expression.
miscellaneous TT_VARCHAR (65536) The type of constraint and other information about the constraint. Constraint type can be one of:

ForeignKeyInsert - To insert foreign key.

ForeignKeyDelete - To delete foreign key.

UniqueKeyInsert - To insert unique key.

ForeignKeyOrphanChild - To handle case where parent is lost in case of foreign key constraint.

ForeignKeyCascadeDelete - To delete corresponding row for cascade delete.

ForeignKeySyncCascadeDelete - To delete corresponding row for cascade delete from sync replica.


Examples

To display the query plan for SQLCmdID 528078576:

Command> call ttSqlCmdQueryPlan(528078576);
< 528078576, select * from t1 where 1=2 or (x1 in 
(select x2 from t2, t5 where y2 in (select y3 from t3)) 
and y1 in (select x4 from t4)), <NULL>, <NULL>, <NULL>,
 <NULL>, <NULL>, <NULL>, <NULL>, <NULL> >
< 528078576, <NULL>, 0, 4, RowLkSerialScan , T1 , TTUSER , , , >
< 528078576, <NULL>, 1, 7, RowLkRangeScan , T2 , TTUSER , I2 , , >
< 528078576, <NULL>, 2, 7, RowLkRangeScan , T5 , TTUSER , I2 , , >
< 528078576, <NULL>, 3, 6, NestedLoop , , , , , >
< 528078576, <NULL>, 4, 6, RowLkRangeScan , T3 , TTUSER , I1 , 
( (Y3=Y2; ) ) , >
< 528078576, <NULL>, 5, 5, NestedLoop , , , , , >
< 528078576, <NULL>, 6, 4, Filter , , , , , X1 = X2; >
< 528078576, <NULL>, 7, 3, NestedLoop(Left OuterJoin) , , , , , >
< 528078576, <NULL>, 8, 2, Filter , , , , , >
< 528078576, <NULL>, 9, 2, RowLkRangeScan , T4 , TTUSER , I2 , , 
Y1 = X4; >
< 528078576, <NULL>, 10, 1, NestedLoop(Left OuterJoin) , , , , , >
< 528078576, <NULL>, 11, 0, Filter , , , , , >
13 rows found.

To display query plans for all valid queries, omit the argument for ttSqlCmdQueryPlan:

< 528079360, select * from t7 where x7 is not null 
or exists (select 1 from t2,t3 where not 'tuf' like 'abc'), 
<NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL> >
< 528079360, <NULL>, 1, 3, RowLkRangeScan  , T2 
 , TTUSER  , I2 , , NOT(LIKE( tuf ,abc ,NULL )) >
< 528079360, <NULL>, 2, 3, RowLkRangeScan  , T3  , TTUSER  , 
I2  , , >
< 528079360, <NULL>, 3, 2, NestedLoop  ,  ,  ,  , , >
< 528079360, <NULL>, 4, 1, NestedLoop(Left OuterJoin) ,    ,    ,    , , >
< 528079360, <NULL>, 5, 0, Filter    ,    ,    ,    , , X7 >
< 527576540, call ttSqlCmdQueryPlan(527973892), <NULL>, <NULL>, 
<NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL> >
< 527576540, <NULL>, 0, 0, Procedure Call  ,  ,  ,  , , >
< 528054656, create table t2(x2 int,y2 int, z2 int), <NULL>, 
<NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL> >
< 528066648, insert into t2 select * from t1, <NULL>, <NULL>, 
<NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL> >
< 528066648, <NULL>, 0, 0, Insert  , T2  , TTUSER  ,  , , >
< 528013192, select * from t1 where exists (
select * from t2 where x1=x2) or y1=1,
<NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL> >
< 528061248, create index i1 on t3(y3), <NULL>, <NULL>, <NULL>, 
<NULL>, <NULL>, <NULL>, <NULL>, <NULL> >
< 528070368, call ttOptSetOrder('t3 t4 t2 t1'), <NULL>, <NULL>, 
<NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL> >
< 528070368, <NULL>, 0, 0, Procedure Call  ,  ,  ,  , , >
< 528018856, insert into t2 select * from t1, <NULL>, <NULL>, 
<NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL> >
< 527573452, call ttsqlCmdCacheInfo(527973892), <NULL>, <NULL>, 
<NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL> >
< 527573452, <NULL>, 0, 0, Procedure Call   ,    ,    ,    , , >
….. /* more rows here */

ttSQLExecutionTimeHistogram

Description

The ttSQLExecutionTimeHistogram built-in procedure returns a histogram of SQL execution times for either a single SQL command or all SQL commands if command cache sampling is enabled.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$EXECUTION_TIME_HISTOGRAM

SYS.V$EXECUTION_TIME_HISTOGRAM

Syntax

ttSQLExecutionTimeHistogram(sqlCmdID)

Parameters

ttSQLExecutionTimeHistogram has the optional parameter:

Parameter Type Description
sqlCmdID TT_BIGINT The unique identifier of a SQL command in the TimesTen command cache. If no value is supplied displays information about all current commands in the TimesTen command cache.

Result set

ttSQLExecutionTimeHistogram returns the result set:

Column Type Description
histogramSamples TT_BIGINT The number of SQL command execution time operations have been measured since either the database was started or the ttStatsConfig built-in procedure was used to reset the statistics.
totalExecuteTime NUMBER The accumulated wall clock execution time when sampling in seconds.
bucketUpperBound NUMBER The upper limit in seconds of execution time.
count TT_BIGINT The number of SQL commands with time less than or equal to ExecutionTimeLimit and greater than ExecutionTimeLimit from the previous row or 0.

Examples

The following example shows the output for the ttSQLExecutionTimeHistogram built-in procedure:

The following example of the ttSQLExecutionTimeHistogram built-in procedure shows that a total of 1919 statements executed. The total time for all 1919 statements to execute was 1.090751 seconds. This example shows that SQL statements ran in the following time frames:

  • 278 statements executed in a time frame that was less than or equal to 0.00001562 seconds.

  • 1484 statements executed in a time frame that was greater than 0.00001562 seconds and less than or equal to 0.000125 seconds.

  • 35 statements executed in a time frame that was greater than 0.000125 seconds and less than or equal to 0.001 seconds.

  • 62 statements executed in a time frame that was greater than 0.001 seconds and less than or equal to 0.008 seconds.

  • 60 statements executed in a time frame that was greater than 0.008 seconds and less than or equal to 0.064 seconds.

Command> call ttSQLExecutionTimeHistogram;
< 1919, 1.090751, .00001562, 278 >
< 1919, 1.090751, .000125, 1484 >
< 1919, 1.090751, .001, 35 >
< 1919, 1.090751, .008, 62 >
< 1919, 1.090751, .064, 60 >
< 1919, 1.090751, .512, 0 >
< 1919, 1.090751, 4.096, 0 >
< 1919, 1.090751, 32.768, 0 >
< 1919, 1.090751, 262.144, 0 >
< 1919, 1.090751, 9.999999999E+125, 0 >
10 rows found.

See also


ttStatsConfig

ttStatsConfig

Description

The ttStatsConfig built-in procedure controls statistics collection and parameters for the ttStats utility. This procedure takes a name/value pair as input and outputs a single row result set corresponding to the name/value pair parameters.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is supported in TimesTen Scaleout, but supports different parameter/value pairs than in TimesTen Classic.

In TimesTen Scaleout, this procedure broadcasts changes to all elements.

Related views

This procedure has no related views.

Syntax

ttStatsConfig("param", [value], [value])

Parameters

ttStatsConfig has the parameters:

Parameter Type Description
param VARCHAR2(50) NOT NULL The name of the parameter to configure.
value VARCHAR2(200) The value of the specified parameter. If no value is supplied, the built-in procedure displays the current value for the specified parameter.
option VARCHAR2 (200)  

Parameter / Value Pairs

The supported parameter/value pairs in TimesTen Classic and TimesTen Scaleout are different. These are the supported parameter/value pairs:

TimesTen Classic

These parameter/value pairs can be set with TimesTen Classic:

Parameter Value Description
ConnSampleFactor C,S

0<=C<=Connections

0<=S<=60000

The unique identifier of a SQL command in the TimesTen command cache. If you do not supply a value, TimesTen displays the current value of the command.
LatchStats scope,level

scope=conn|db|con_id

level=NONE|TYPICAL|

ALL|BASIC

Specifies the scope, scope, and the level, level, for collection for latch statistics.

The scope value determines at what level TimesTen should collect latch statistics:

  • conn - Collects latch statistics for your current connection.

  • db - Collects latch statistics for your database.

  • con_id - Collects latch statistics for the connection name that you specify.

The level value determines the level at which TimesTen collects statistics:

  • NONE - Disables the collection of latch statistics.

  • TYPICAL - Ensures the collection of major useful latch statistics.

  • ALL - Additional statistics are added to the set of statistics collected with the TYPICAL setting. The additional statistics include internal and debugging statistics.

  • BASIC - Disables the collection of many of the important latch statistics.

If latch statistics are enabled, TimesTen allocates around 100KB from temporary memory to store these statistics.

Once you have configured the LatchStats parameter, you can use the ttLatchStatsGet built-in procedure to view latch statistics. See "ttLatchStatsGet" for more information.

SQLCmdHistogramReset 0 or not The existing SQL execution time statistics are reset if the specified value is nonzero.
SQLCmdSampleFactor 0 <= value <= 60000 The frequency at which a SQL command sample is taken. The default is 0. A value of 0 indicates that sampling is turned off. A value greater than 0 indicates that a sample is taken at that interval of SQL statements. For example, a value of 10 indicates that for every 10th SQL statement executed, the wall clock time of that execution is captured.
StatsLevel NONE

TYPICAL

ALL

BASIC

Specifies the level of collection for database statistics. TimesTen stores theses statistics in system tables.

Setting the StatsLevel parameter to NONE disables the collection of system statistics.

The default setting of TYPICAL ensures collection of major useful statistics and should be adequate for most environments.

When the StatsLevel parameter is set to ALL, additional statistics are added to the set of statistics collected with the TYPICAL setting. The additional statistics include internal and debugging statistics.

Setting the StatsLevel parameter to BASIC disables the collection of many of the important statistics required by many TimesTen features.


TimesTen Scaleout

These parameter/value pairs can be set with TimesTen Scaleout:

Parameter Value Description
pollSec 0

10 <= value <= 60

The polling interval, in seconds, at which the ttStats daemon captures snapshots of the TimesTen Scaleout. A value of 0 disables the ttStats daemon from capturing metrics.

The value of the polling interval does not affect the performance of the TimesTen Scaleout. However, a polling interval of 60 seconds tends to use six times more space than a polling interval of 10 seconds. Ensure that you have sufficient PermSize to support the desired polling interval.

The default value is 30 seconds.

retainMinutes 15<= value <= 1440 The time, in minutes, that the ttStats daemon waits before aggregating and purging raw metrics. If you use a larger value for retainMinutes, the ttStats daemon stores more metrics in the system tables.

The default value is 120 minutes.

retentionDays 1 < value < 730 The retention time interval, in days, at which the ttStats daemon drops ttStats snapshots of the TimesTen Scaleout. For example, if the retention time interval is 62 days, the ttStats daemon drops the 1st day's snapshot on the 63rd day.

Ensure that you have sufficient PermSize to support the desired retention time interval. In most cases, a day's worth of data takes up around 20 MB of space. These metrics are stored in SYS tables and survive database bounces.

The default value is 62 days.


Result set

ttStatsConfig returns the result set:

Column Type Description
param VARCHAR2(50) NOT NULL The name of the parameter that was configured.
value VARCHAR2(200) The value of the specified parameter. If no value is supplied, the built-in procedure displays the current value for the specified parameter.

Examples

Since TimesTen and TimesTen Scaleout support different parameter/value pairs, there are also different examples. These are supported examples:

TimesTen Classic

Sample every command:

Command> call ttStatsConfig('SqlCmdSampleFactor',1);
< SQLCMDSAMPLEFACTOR, 1 >
1 row found.

Check sampling:

Command> call ttStatsConfig('SqlCmdSampleFactor');
< SQLCMDSAMPLEFACTOR, 1 >
1 row found.
 

Sample every fifth statement on connection 1.

Command> call ttStatsConfig('ConnSampleFactor', '1,5');
< CONNSAMPLEFACTOR, 1,5 >
1 row found.

Turn off sampling on connection 1.

Command> call ttStatsConfig('ConnSampleFactor', '1,0');
< CONNSAMPLEFACTOR, 1,0 >
1 row found.
 

Check data store statistics collection level.

Command> call ttstatsconfig('StatsLevel');
< STATSLEVEL, TYPICAL >
1 row found.
 

Turn off data store statistics collection.

Command> call ttstatsconfig('StatsLevel','None');
< STATSLEVEL, NONE >
1 row found.

TimesTen Scaleout

Sets the polling interval of statistics to 45 seconds. Therefore, the ttStats daemon aggregates statics every 45 seconds:

Command> call ttStatsConfig('pollsec', 45);
< POLLSEC, 45 >
1 row found.

Sets the time interval when the ttStats daemon purges raw metrics to 60 minutes:

Command> call ttStatsConfig('retainMinutes', 60);
< RETAINMINUTES, 60 >
1 row found.

Sets the retention time interval for statistics to 30 days:

Command> call ttStatsConfig('retentionDays', 30);
< RETENTIONDAYS, 30 >
1 row found.

ttStatsConfigGet

Description

The ttStatsConfigGet built-in procedure returns parameters of the ttStats utility that you can set with the ttStatsConfig built-in procedure. This procedure does not take any input and outputs a multiple row result set with name/value pair parameters.

Required privilege

This procedure requires the ADMIN privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is supported in TimesTen Scaleout, but supports different parameter/value pairs than in TimesTen Classic.

In TimesTen Scaleout, this procedure returns a row for the element from which it was called. To see information about other elements, query the SYS.GV$STATS_CONFIG system table.

Related views

This procedure has these related views.

SYS.GV$STATS_CONFIG

SYS.V$STATS_CONFIG

Syntax

ttStatsConfigGet()

Parameters

ttStatsConfigGet has no parameters:

Result set

ttStatsConfigGet returns the result set:

Column Type Description
param VARCHAR2(50) The name of the parameter.
value VARCHAR2(200) The current value of the parameter.

Parameter / Value Pairs

The supported return parameter/value pairs in TimesTen and TimesTen Scaleout are different. These are the return parameter/value pairs:

TimesTen Classic

These parameter/value pairs can be returned in the result set in TimesTen Classic:

Parameter Description
SQLCmdSampleFactor The frequency at which a SQL command sample is taken. The default is 0. A value of 0 indicates that sampling is turned off. A value greater than 0 indicates that a sample is taken at that interval of SQL statements. For example, a value of 10 indicates that for every 10th SQL statement executed, the wall clock time of that execution is captured.
ConnSampleFactor The unique identifier of a SQL command in the TimesTen command cache. If you do not supply a value, TimesTen displays the current value of the command.
StatsLevel The existing SQL execution time statistics are reset if the specified value is nonzero.

TimesTen Scaleout

These parameter/value pairs can be returned in the result set in TimesTen Scaleout:

Parameter Description
pollSec The polling interval, in seconds, at which the ttStats daemon captures snapshots of the TimesTen Scaleout. A value of 0 disables the ttStats daemon from capturing metrics.
retainMinutes The time, in minutes, that the ttStats daemon waits before aggregating and purging raw metrics.
retentionDays The retention time interval, in days, at which the ttStats daemon drops ttStats snapshots of the TimesTen Scaleout. For example, if the retention time interval is 62 days, the ttStats daemon drops the 1st day's snapshot on the 63rd day.

Examples

Since TimesTen and TimesTen Scaleout support different name/value pair results, there are also different examples. These are supported examples:

TimesTen

View the configuration settings of ttStatsConfig:

Command> call ttStatsConfigGet();
< SQLCMDSAMPLEFACTOR, 1 >
< CONNSAMPLEFACTOR, 2047,0 >
< STATSLEVEL, TYPICAL >
3 rows found.

TimesTen Scaleout

View the configuration settings of ttStatsConfig:

Command> call ttStatsConfigGet();
< POLLSEC, 10 >
< RETAINMINUTES, 120 >
< RETENTIONDAYS, 62 >
3 rows found.

ttTableSchemaFromOraQueryGet

Description

This built-in procedure evaluates a SELECT query on a table in an Oracle database and generates a CREATE TABLE SQL statement that you can choose to execute. The TimesTen CREATE TABLE statement matches the result set column names and types.

This procedure does not create the TimesTen table, it only returns a statement that identifies the table schema.

For more details and usage information, see "Loading data from an Oracle database into a TimesTen table" in the Oracle TimesTen In-Memory Database Operations Guide.

Required privilege

This procedure requires no privileges. The session user must have all required privileges to execute the query on the Oracle database.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttTableSchemaFromOraQueryGet(['tblOwner'], 'tblName', 'selectSQL')

Parameters

ttTableSchemaFromOraQueryGet has the parameters:

Parameter Type Description
tblOwner TT_CHAR (30) TimesTen table owner (optional). If not provided, the connection ID is used.
tblName TT_CHAR (30) NOT NULL Table name for the CREATE TABLE statement.

The specified TimesTen table cannot be a system table, a synonym, a view, a materialized view or a detail table of a materialized view, a global temporary table or a cache group table.

selectSQL TT_VARCHAR (409600) NOT NULL A SELECT query on an Oracle database to derive the table column definition.

Any expressions in the SELECT list should be provided with a column alias; otherwise, an implementation dependent column name is assumed and the expression is not evaluated.


Result set

ttTableSchemaFromOraQueryGet returns the result set:

Column Type Description
createSQL TT_VARCHAR (409600) NOT NULL A CREATE TABLE statement that matches the result set of the SELECT query on an Oracle database.

Examples

This example, returns the CREATE TABLE statement to create the TimesTen HR.EMPLOYEES table with all columns found in the Oracle database HR.EMPLOYEES table.

Command> call ttTableSchemaFromOraQueryGet('hr','employees',
 'SELECT * FROM hr.employees');
< CREATE TABLE "HR"."EMPLOYEES" (
"EMPLOYEE_ID" number(6,0) NOT NULL,
"FIRST_NAME" varchar2(20 byte),
"LAST_NAME" varchar2(25 byte) NOT NULL,
"EMAIL" varchar2(25 byte) NOT NULL,
"PHONE_NUMBER" varchar2(20 byte),
"HIRE_DATE" date NOT NULL,
"JOB_ID" varchar2(10 byte) NOT NULL,
"SALARY" number(8,2),
"COMMISSION_PCT" number(2,2),
"MANAGER_ID" number(6,0),
"DEPARTMENT_ID" number(4,0)
 ) >
1 row found.

Notes

The query on the Oracle database cannot have any parameter bindings.

TimesTen returns an error if the query cannot be described on the Oracle database, for example, if there is a syntax error.

If an output column type does not have a matching type in TimesTen, TimesTen outputs a warning and the following line for the column definition: >>>>column_name column_type /* reason */

If the query on the Oracle database outputs types not supported by TimesTen, you can add a CAST clause in the SELECT list to explicitly change the output to a TimesTen supported type. Column aliases can be specified for expressions in the SELECT list.

If the query on the Oracle database has LOB output, it is mapped to a VAR type.

ttVersion

Description

The ttVersion built-in procedure returns the five parts of the TimesTen release number.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$VERSION

SYS.V$VERSION

Syntax

ttVersion()

Parameters

ttVersion has no parameters.

Result set

ttVersion returns the result set:

Column Type Description
major1 TT_INTEGER NOT NULL The first part of the five-part release number (18 for release 18.1.2.1.0), indicating the last two digits of the year of the major release.

A change in major1 indicates major infrastructure and functionality changes.

major2 TT_INTEGER NOT NULL The second part of the five-part release number (1 for release 18.1.2.1.0).

A change in only major2 indicates a version with new functionality and possibly some infrastructure changes.

Releases with the same major1.major2 are patch-compatible. Data can be unloaded from a database from one release and loaded into a database from the other without the migration process.

patchset TT_INTEGER NOT NULL The third part of the five-part release number (2 for release 18.1.2.1.0).

A change in only patchset indicates a release that contains bug fixes and possibly some feature enhancements.

patch TT_INTEGER NOT NULL The fourth part of the five-part release number (1 for release 18.1.2.1.0).

A change in only patch indicates a release with only critical bug fixes.

reserved TT_INTEGER NOT NULL The fifth part of the five-part release number (0 for release 18.1.2.1.0). Reserved for future use.

Examples

Return for release 18.1.2.1.0:

Command>  call ttVersion();
< 18, 1, 2, 1, 0 >
1 row found.

ttWarnOnLowMemory

Description

This procedure enables applications to specify that operations executed on the current connection should return a warning if they allocate memory and find that memory is low. If the value is set, a warning is returned for any operation that does an allocation and finds total memory in use to be above the connection's threshold value as specified by the PermWarnThreshold and TempWarnThreshold connection attributes.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has no related views.

Syntax

ttWarnOnLowMemory(permanent, temporary)

Parameters

ttWarnOnLowMemory has these parameters:

Parameter Type Description
permanent TT_INTEGER NOT NULL 1- Enable warnings for the permanent data partition

0 - Disable warnings for the permanent data partition

temporary TT_INTEGER NOT NULL 1- Enable warnings for the permanent data partition

0 - Disable warnings for the permanent data partition


Result set

ttWarnOnLowMemory returns no results.

Examples

CALL ttWarnOnLowMemory(1, 0);

Enables low memory warnings for the permanent data partition only.

Notes

By default, TimesTen does not issue low memory warnings for either partition. Applications that want to receive these warnings must call this procedure. This procedure is connection specific, and so you must issue it for each connection upon which warnings are desired. Also, the current setting does not persist to subsequent connections.

ttXactIdGet

Description

This procedure returns transaction ID information for interpreting lock messages. The two result columns of ttXactIdGet are used in combination to uniquely identify a transaction in a database. Taken individually, the columns are not interesting. The result should only be used to correlate with other sources of transaction information. The numbers may not follow a strict pattern.

Required privilege

This procedure requires no privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

TimesTen Scaleout applications can call this built-in procedure.

In TimesTen Scaleout, this procedure executes locally on the element from which it is called.

Related views

This procedure has these related views.

SYS.GV$XACT_ID

SYS.V$XACT_ID

Syntax

ttXactIdGet()

Parameters

ttXactIdGet has no parameters.

Result set

ttXactIdGet returns the result set:

Column Type Description
xactID TT_INTEGER Connection ID.
counter TT_BIGINT An increasing number that distinguish successive transactions of the same transaction ID.

Examples

Command > automcommit 0;
Command > call ttXactIdGet;
<2,11>
1 row found
Command > commit;
Command > call ttXactIdGet
<3, 12>
1 row found

Notes

The output correlates to the values printed in lock error messages and ttXactAdmin lock information output.

See also


ttXactAdmin
"ttXactIdRollback" in the Oracle TimesTen In-Memory Database C Developer's Guide

ttXlaBookmarkCreate

Description

This procedure creates the specified bookmark.

Required privilege

This procedure requires the XLA privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttXlaBookmarkCreate('bookmark', 'replicated')

Parameters

ttXlaBookmarkCreate has the parameters:

Parameter Type Description
bookmark TT_CHAR (31) NOT NULL The name of the bookmark to be created.
replicated BINARY(1) 0x00 or NULL (equivalent) for non-replicated bookmarks (default setting).

0x01 for replicated bookmarks.

If NULL, non-replicated bookmarks are used.


Result set

ttXlaBookmarkCreate returns no results.

Examples

For non-replicated bookmark, execute the following:

Command > call ttXlaBookmarkCreate('mybookmark');

or:

Command> call ttxlabookmarkcreate('mybkmk2',0x00);

For a replicated bookmark, execute the following:

Command > call ttXlaBookmarkCreate('mybookmark', 0x01);

For more details on XLA bookmarks, including replicated XLA bookmarks, see "About XLA bookmarks" in the Oracle TimesTen In-Memory Database C Developer's Guide.

Notes

You can also create a bookmark when you call ttXlaPersistOpen function to initialize an XLA handle. See "Creating or reusing a bookmark" in Oracle TimesTen In-Memory Database C Developer's Guide.

ttXlaBookmarkDelete

Description

This procedure deletes the specified bookmark. The bookmark cannot be deleted while it is in use.

Required privilege

This procedure requires the XLA privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttXlaBookmarkDelete('bookmark')

Parameters

ttXlaBookmarkDelete has the parameter:

Parameter Type Description
bookmark TT_CHAR (31) NOT NULL The name of the bookmark to be deleted.

Result set

ttXlaBookmarkDelete returns no results.

Examples

Command > call ttXlaBookmarkDelete('mybookmark');

Notes

Before dropping a table that is subscribed to by an XLA bookmark, you must first drop all XLA bookmarks or unsubscribe from XLA tracking.

ttXlaSubscribe

Description

This procedure configures persistent XLA tracking of a table. This procedure cannot be executed when the specified bookmark is in use.

Required privilege

This procedure requires the XLA privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic.

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttXlaSubscribe('tblName', 'bookmark') 

Parameters

ttXlaSubscribe has the parameters:

Parameter Type Description
tblName TT_CHAR (61) NOT NULL The name of the table to be tracked.

Using a synonym to specify a table name is not supported.

bookmark TT_CHAR (31) NOT NULL The name of the bookmark that the application uses to track this table.

Result set

ttXlaSubscribe returns no results.

Examples

Command > call ttXlaSubscribe ('SALLY.ACCTS', mybookmark);

Notes

Alternatively, the ttXlaTableStatus function subscribes the current bookmark to updates to the specified table, or determines whether the current bookmark is already monitoring DML records associated with the table. See "Specifying which tables to monitor for updates" in Oracle TimesTen In-Memory Database C Developer's Guide

ttXlaUnsubscribe

Description

This procedure stops persistent XLA tracking of a table. This procedure cannot be executed when the specified bookmark is in use.

Required privilege

This procedure requires the XLA privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is not supported in TimesTen Scaleout.

Related views

This procedure has no related views.

Syntax

ttXlaUnsubscribe('tblName', 'bookmark')

Parameters

ttXlaUnsubscribe has the parameters:

Parameter Type Description
tblName TT_CHAR (61) NOT NULL The name of the table on which XLA tracking should be stopped.

Using a synonym to specify a table name is not supported.

bookmark TT_CHAR (31) NOT NULL The name of the bookmark that the application uses to track this table.

Result set

ttXlaSubscribe returns no results.

Examples

Command > call ttXlaUnsubscribe ('SALLY.ACCTS', mybookmark);

Notes

Before dropping a table that is subscribed to by an XLA bookmark, you must first drop all XLA bookmarks or unsubscribe from XLA tracking.