5 Utilities

This chapter provides reference information for most TimesTen utilities beginning with the following introductory sections:

For information about utilities that are only supported in TimesTen Scaleout see Chapter 4, "TimesTen Scaleout Utilities".

Overview

The options for TimesTen utilities are generally not case sensitive, except for single character options. You can use -connstr or -connStr interchangeably. However -v and -V are each unique options.

All utilities return 0 for success and nonzero if an error occurs.

Note:

The utility name and options listed in this chapter are case-insensitive. They appear in mixed case to make the examples and syntax descriptions easier to read.

Utilities List

Utilities listed in Table 5-1 are described in Chapter 4, "TimesTen Scaleout Utilities".

Utilities listed in Table 5-2 are described in this chapter.

Table 5-1 Utilities supported only in TimesTen Scaleout descriptions

Name Description

ttGridAdmin

Administers a TimesTen Scaleout grid.

ttGridRollout

Creates a new grid and database.


Table 5-2 Other utilities descriptions

Name Description Usage with TimesTen Scaleout

ttAdmin

Specifies or changes database policies.

No

ttAdoptStores

Moves databases from a TimesTen installation to a new TimesTen installation of the same major release, but a different minor release.

No

ttBackup

Creates a backup copy of a database that can be restored at a later time using the ttRestore utility.

No

ttBulkCp

Copies data between TimesTen tables and ASCII files.

No

ttCapture

Captures information about the state of TimesTen.

No

ttCheck

Performs internal consistency checking within a TimesTen database.

No

ttCWAdmin

Manages TimesTen active standby pairs that take advantage of the high availability framework of Oracle Clusterware.

No

ttDaemonAdmin

Starts and stops the TimesTen main daemon and Server.

No

ttDaemonLog

Controls and displays daemon log messages.

No

ttDestroy

Destroys a database including all checkpoint files, transaction logs and daemon catalog entries.

No

ttInstallationCheck

Examines all files in an installation of TimesTen and generates a signature for the installation,

Yes

ttInstallDSN

Generates a Windows client DSN for one or more entries listed in the provided input file and installs them into the ODBC Panel as a System DSN.

Yes

ttInstanceCreate

Create a new TimesTen instance.

Yes

ttInstanceDestroy

Destroys an existing TimesTen instance.

Yes

ttInstanceModify

Modifies certain attributes of an instance.

Yes

ttIsql

Executes SQL statements interactively.

Yes

ttMigrate

Saves and restores TimesTen objects.

Yes, only for migrating from TimesTen Classic to TimesTen Scaleout.

ttRepAdmin

Displays, sets, modifies and monitors existing replication definitions and status.

No

ttRestore

Creates a database from a backup that has been created using the ttBackup utility.

No

ttSchema

Prints out the schema, or selected objects, of a database.

Yes

ttSize

Estimates the amount of space that a given table, including any views in the database will consume when the table grows to include a specified number of rows.

Yes

ttStats

Monitors database metrics or takes and compares snapshots of metrics.

Yes

ttStatus

Displays information that describes the current state of TimesTen.

No

ttTail

Fetches TimesTen internal trace information from a database and displays it to stdout.

No

ttTraceMon

Enables and disables the TimesTen internal tracing facilities.

No

ttUser

Prompts for a password and returns an encrypted password.

None

ttVersion

lists the TimesTen release information.

Yes

ttXactAdmin

Lists ownership, status, log and lock information for each outstanding transaction.

No

ttXactLog

Displays a formatted dump of the contents of a TimesTen transaction log.

No


ttAdmin

Description

This utility enables you to:

  • Get information about ttAdmin options, version, and settings. See "Help, version, and query options".

  • Specify settings for database loading and RAM loading policies. See "Set database loading policies".

  • Open or close a database to user connections. See "Open or close a database".

  • Execute a forced disconnect operation for existing database connections. See "Force disconnect".

  • Start and stop TimesTen cache agents for caching data from Oracle Database tables. The cache agent is a process that handles Oracle Database access on behalf of a TimesTen database. It also handles the aging and autorefresh of the cache groups in the TimesTen database. See "Set cache policies".

  • Specify settings to automatically or manually start and stop replication agents for specified databases. See "Set replication policies".

Required privilege

This utility requires no privileges to query the database.

Open and close options require the instance administrator privilege.

Replication options require the ADMIN privilege.

Cache options require the CACHE_MANAGER privilege.

All other options require the ADMIN privilege.

Usage with TimesTen Scaleout

This utility is not supported in TimesTen Scaleout.

Syntax

ttAdmin {-h | -help | -?}
ttAdmin {-V | -version}
ttAdmin -query {-connStr connection_string | DSN} 

ttAdmin [-ramPolicy always | manual | inUse [-ramGrace secs]]
[-ramLoad | -ramUnload]
[-autoreload | -noautoreload]
{-connStr connection_string | DSN}

ttAdmin [-open | -close] 
[-ramLoad] 
{-connStr connection_string | DSN}

ttAdmin [-disconnect urgency [granularity]] {-connStr connection_string | DSN} 
 urgency:     -transactional | -immediate | -abort
 granularity: -users | -unload 

ttAdmin [-repPolicy always | manual | norestart]
[-repStart | -repStop]
[-repQueryThresholdSet secs]
[-repQueryThresholdGet]
{-connStr connection_string | DSN}

ttAdmin [
[-cacheUidGet] |
[-cacheUidPwdSet -cacheUid uid [-cachePwd pwd]] |
[-cachePolicy always | manual | norestart] |
[-cacheStart] | [-cacheStop [-stopTimeout secs]]
]
{-connStr connection_string | DSN}

Notes

These notes apply to all modes of ttAdmin usage.

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.

For details on environment variables that you may want to set, see "Environment variables" in Oracle TimesTen In-Memory Database Installation, Migration, and Upgrade Guide.

This utility is supported only for TimesTen Data Manager DSNs. It is not supported for TimesTen Client DSNs.

Help, version, and query options

Options

ttAdmin has these options for help, version, and settings information:

Option Description
-h -help

-?

Prints usage information, syntax, and option descriptions.
-V | -version Prints the TimesTen release number of ttAdmin and exits.
-query Displays a summary of the policy settings for the specified database.
-connStr connection_string For -query, an ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN For -query, an ODBC data source name of the database to be administered.

Examples

To get the version of ttAdmin:

% ttAdmin -version
TimesTen Release 18.1.4.1.0

To get help for ttAdmin:

% ttAdmin -help
Usage:
  ttAdmin [-h | -help | -?]
  ttAdmin [-V | -version]
  ttAdmin [-ramUnload | -ramLoad [-open | -close]]
          [-ramPolicy always | manual | inUse [-ramGrace <secs>]]
          [-autoreload | -noautoreload]
          [-disconnect { -transactional | -immediate | -abort }
            [-users | -unload]
          ]
          [-repPolicy always | manual | norestart]
          [-repStart | -repStop]
          [-repQueryThresholdSet <seconds>]
          [-repQueryThresholdGet]
          [
            [-cacheUidGet] |
            [-cacheUidPwdSet -cacheUid <uid> [-cachePwd <pwd>]] |
            [-cachePolicy always | manual | norestart] |
            [-cacheStart] |
            [-cacheStop [-stopTimeout <secs>]]
          ]
          [-query]
          {<DSN> | [-connstr] <connStr>}
 
options:
[...Option descriptions not shown...]

To display a summary of the policy settings for the database1 DSN:

% ttAdmin -query database1
RAM Residence Policy            : inUse
Replication Agent Policy        : manual
Replication Manually Started    : False
Cache Agent Policy              : manual
Cache Agent Manually Started    : False
Database State                  : Open

Set database loading policies

Options

ttAdmin has these options for database loading and RAM loading:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN An ODBC data source name of the database to be administered.
-autoreload | -noautoreload If set to -autoreload (default), TimesTen reloads the database after an invalidation.

if set to -noautoreload, TimesTen does not automatically reload the database after an invalidation.

-ramGrace secs Only effective if -ramPolicy is inUse. If nonzero, the database is kept in RAM for secs seconds before being unloaded after the last application disconnects from the database.
-ramLoad Valid only when -ramPolicy is manual. Causes the database to be loaded into RAM.
-ramPolicy policy Defines the policy used to determine when the database is loaded into system RAM.

manual - Specifies that the database is only to be loaded in system RAM when explicitly loaded by the user (using the ramLoad option). This is the recommended RAM policy, because it avoids unnecessary database loading or unloading.

inUse (default) - Specifies that the database is loaded in system RAM only when in use (when applications are connected). The -ramGrace option may be used to modify the behavior of this policy. 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.

always - Specifies that the database should remain in system RAM all the time.

-ramUnload Valid only when -ramPolicy is set to manual. Causes the database to be unloaded from RAM.

Examples

To manually control whether database1 is loaded into RAM and to load it now, use the following.

% ttAdmin -ramPolicy manual -ramLoad database1

The database1 database is typically always resident in RAM. However, it is not being used at a given time and should be loaded only when applications are connected to it. To change the RAM policy:

ttAdmin -ramPolicy inUse database1

Now assume database1 is not always in use. Permanently loading it into RAM would unnecessarily use memory. This database is idle for long periods, but when it is in use multiple users connect to it in rapid succession. To improve performance, it may be best to keep the database in RAM when applications are connected to it and to keep it in RAM for 5 minutes (300 seconds) after the last user disconnects. With this RAM policy, the database remains in RAM if applications are connected to the database. To set this policy:

% ttAdmin -ramPolicy inUse -ramGrace 300 History

Some performance-sensitive applications use a database referred to by DSN database1. So that applications do not have to wait for the database to be loaded from disk into RAM, this database must always remain in RAM. To accomplish this:

% ttAdmin -ramPolicy always database1

Notes

Setting RAM policy to inUse for production systems with large databases may cause performance issues having the database unload and reload unexpectedly.

The only -ramPolicy value supported for temporary databases is -ramPolicy manual with the -ramLoad option specified at the same time.

If ttAdmin is used with the -ramPolicy always option, a persistent system connection is created on the database.

RAM policy always conflicts with forced disconnect granularity unload, described in "Force disconnect". Using both simultaneously results in an error and the disconnect request being ignored.

The always RAM policy should be used with caution. When failures occur, it may not be beneficial to have your database automatically reload. In addition, it may affect system startup performance if all databases load at the same time when your system boots.

See "Specifying a RAM policy" in the Oracle TimesTen In-Memory Database Operations Guide for more details.

Open or close a database

Options

ttAdmin has these options for opening or closing a database:

Option Description
-close Closes a database to user connections.

When a database is closed to user connections, new connection attempts will fail, but existing connections are unaffected.

-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN An ODBC data source name of the database to be administered.
-open Opens a database to user connections.

A database is open to user connections by default upon creation.

-ramLoad Valid only when -ramPolicy is manual. Causes the database to be loaded into RAM.

Examples

To open the database1 DSN:

% ttAdmin -open database1

To load and open the database1 DSN from an unloaded and closed state:

% ttAdmin -ramLoad -open database1

To close the database1 DSN:

% ttAdmin -close database1

To load and close the database1 DSN from an unloaded and open state:

% ttAdmin -ramLoad -close database1

Notes

A database remains closed or open to user connections regardless of its loaded state or RAM policy, unless its closed or open state is modified through ttAdmin or other utilities like ttRestore or ttRepAdmin.

If the -open or -close options are used in conjunction with any option other than -ramLoad, ttAdmin returns an error.

Trying to close a closed database or open an open database returns an error.

Force disconnect

Options

ttAdmin has these options for forced disconnect:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN An ODBC data source name of the database to be administered.
-disconnect urgency [granularity] Asynchronously disconnects connected applications from the database, optionally including those that are idle or unresponsive.

Acceptable values for urgency (required) are:

-transactional - Allows any open transactions to be committed or rolled back before disconnecting. Does not affect idle connections.

-immediate - Rolls back any open transactions before immediately disconnecting. This also disconnects idle connections.

-abort - Aborts all direct mode application processes and client/server processes (ttcserver) in order to disconnect them.

Note: A recommended best practice is to run -disconnect twice, as necessary. First run it in transactional urgency level. Then, after allowing some time, if not all connections have been closed yet, run it in immediate urgency level. Use ttStatus to confirm whether connections have been closed.

Use abort urgency level only as a last resort if transactional and immediate levels do not result in all connections being closed. Abort may result in loss of data. Abort abruptly causes every user and ttcserver process connected to the database to exit. This may result in lost transactions.

Acceptable values for granularity are:

-users (default) - Disconnects every user connection to the database. This is useful for administrators who want to perform database maintenance.

-unload - Disconnects every connection to the database, including the subdaemon. This cleanly unloads the database.

Note: RAM policy always, described in "Set database loading policies", conflicts with forced disconnect granularity unload. Using both simultaneously results in an error and the disconnect request being ignored.


Examples

This sample script uses -disconnect to disconnect all connections to database1, first using transactional urgency level then immediate urgency level.

#!/bin/sh
 
# close the databae
ttAdmin -close database1
 
# disconnect users and unload the database
ttAdmin -disconnect -transactional -unload database1
 
# wait 10 seconds for the disconnects to finish
COUNT = 0
while [ ttStatus | grep "pending disconnection" ] || [ $COUNT -ne 10 ]
do
  sleep 1
  COUNT=$((COUNT+1))
done
 
# increase urgency to immediate
if [ ttStatus | grep "pending disconnection" ]; then
  ttAdmin -disconnect -immediate -unload database1
fi

Use ttStatus to check progress. During forced disconnect, output indicates the pending disconnections:

TimesTen status report as of Wed Jul 18 09:55:20 2018
 
Daemon pid 10457 port 6627 instance user1
TimesTen server pid 10464 started on port 6629
------------------------------------------------------------------------
------------------------------------------------------------------------
Closed to user connections
Data store /databases/database1
Daemon pid 10457 port 6627 instance user1
TimesTen server pid 10464 started on port 6629
There are 14 connections to the data store, ***14 pending disconnection***
Shared Memory KEY 0x0210679b ID 949092358
PL/SQL Memory KEY 0x0310679b ID 949125127 Address 0x5000000000
Type            PID     Context             Connection Name              ConnID
Process         10484   0x00007f3ddfeb4010  database1 1
...

Notes

To enable the capability for forced disconnect, use the TimesTen connection attribute setting ForceDisconnectEnabled=1. See "ForceDisconnectEnabled".

The -disconnect option is asynchronous. Control will quickly return to the command prompt, but the force disconnect operation may take multiple seconds or even minutes to complete. This is why the scripts above use ttStatus to monitor the status of the force disconnect operation.

The users granularity level includes all connections aside from the subdaemon. For example, in addition to user connections, this includes connections for ttcserver and ttstats.

Close the database before attempting a forced disconnect process. Any new connection request is rejected by the main daemon during the forced disconnect process. However, after completion of forced disconnect, connection requests are accepted again if the database is not in a closed state.

Set cache policies

Options

ttAdmin has these options for cache:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN An ODBC data source name of the database to be administered.
-cachePolicy Defines the policy used to determine when the cache agent for the database should run.

manual (default) - Specifies that the cache agent must be manually started and stopped.

always - Specifies that the cache agent should always be running for the database. This option immediately starts the cache agent and. When the daemon restarts, the cache agent is restarted.

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

-cacheStart Starts a cache agent for the database.
-cacheStop Stops a cache agent for the database. You should 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.
-cachePwd The password associated with the cache administration user ID that manages autorefresh cache groups and asynchronous writethrough cache groups. The cache administration user has extended privileges. See "Grant privileges to the Oracle database users" in Oracle TimesTen Application-Tier Database Cache User's Guide for more details.
-cacheUid The cache administration user ID. The cache administration user manages autorefresh cache groups and asynchronous writethrough cache groups. The cache administration user has extended privileges.

See "Grant privileges to the Oracle database users" in the Oracle TimesTen Application-Tier Database Cache User's Guide for more details.

-cacheUidGet Gets the current cache administration user ID for the specified database.
-cacheUidPwdSet Sets the cache administration user name and password for the specified database, using the -cacheUid and -cachePwd options. Note the following:
  • You only need to specify the cache administration user ID and password once for each new database.

  • For all levels of DDLReplicationLevel, you can set the cache administration user name and password with the -cacheUidPwdSet option while the cache or replication agents are running. For more details, see "Making DDL changes in an active standby pair" in the Oracle TimesTen In-Memory Database Replication 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.

-stopTimeout secs Specifies that the TimesTen daemon should stop the cache agent if it does not stop within secs seconds.

If set to 0, the daemon potentially waits forever for the cache agent. The default value is 100 seconds.


Examples

A database referred to by DSN database1 contains data cached from an Oracle database. Use the following ttAdmin command to start the cache agent for database1:

% ttAdmin -cacheStart database1

You can also use the -cachePolicy option to ask the TimesTen data manager daemon to start the cache agent every time the data manager is started:

% ttAdmin -cachePolicy always database1

To turn off the automatic start of cache agent:

% ttAdmin -cachePolicy manual database1

To set the cache administration user ID and password, use -cacheUidPwdSet with -cacheUid and -cachePwd. For example:

% ttAdmin -cacheUidPwdSet -cacheUid scott -cachePwd tiger database1

To get the current cache administration user ID for database1:

% ttAdmin -cacheUidGet database1

Notes

Before using any cache features, you must start the cache agent. Cache options require that you specify a value for the OracleNetServiceName in the DSN.

When using autorefresh or asynchronous writethrough cache groups, you must specify the cache administration user ID and password. This user account performs autorefresh and asynchronous writethrough operations.

To load data from an Oracle database, the TimesTen cache agent must be running. This requires that the ORACLE_HOME environment variable be set to the path of the Oracle installation. See "Managing the cache agent" in Oracle TimesTen Application-Tier Database Cache User's Guide for more details.

Set replication policies

Options

ttAdmin has these options for replication:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN An ODBC data source name of the database to be administered.
-repPolicy Defines the policy used to determine when the replication agent starts.

manual (default) - Specifies that the replication agent must be manually started and stopped.

always - Specifies that the agent should always be running for the database. This option immediately starts the replication agent. When the daemon restarts, the replication agent is restarted.

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

-repQueryThresholdGet Returns the number of seconds that a query can be executed by the replication agent before TimesTen writes a warning to the daemon log. A value of 0 indicates that no warning is sent.
-repQueryThresholdSet secs This option 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 starts. 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.

The value must be greater than or equal to 0.

Default is 0 and indicates that no warning is sent.

-repStart Starts the replication agent.
-repStop Stops the replication agent.

Examples

These examples show use of replication options.

% ttAdmin -repPolicy always rep1
RAM Residence Policy            : inUse
Replication Agent Policy        : always
Cache Agent Policy              : manual
Cache Agent Manually Started    : False
Database State                  : Open
 
% ttAdmin -repPolicy manual rep1
RAM Residence Policy            : inUse
Replication Agent Policy        : manual
Replication Manually Started    : True
Cache Agent Policy              : manual
Cache Agent Manually Started    : False
Database State                  : Open
 
% ttAdmin -repPolicy norestart rep1
RAM Residence Policy            : inUse
Replication Agent Policy        : norestart
Replication Manually Started    : True
Cache Agent Policy              : manual
Cache Agent Manually Started    : False
Database State                  : Open
 
% ttAdmin -repQueryThresholdSet 100 rep1
RAM Residence Policy            : inUse
Replication Agent Policy        : norestart
Replication Manually Started    : True
Cache Agent Policy              : manual
Cache Agent Manually Started    : False
Database State                  : Open
 
% ttAdmin -repQueryThresholdGet rep1
QueryThreshold in seconds : 100
RAM Residence Policy            : inUse
Replication Agent Policy        : norestart
Replication Manually Started    : True
Cache Agent Policy              : manual
Cache Agent Manually Started    : False
Database State                  : Open

Notes

If ttAdmin is used with -repStart and a replication definition is not found, the replication agent is not started and ttAdmin prints out an error message. For example:

% ttAdmin -repstart repl1
*** [TimesTen][TimesTen 18.1.1.0 ODBC Driver][TimesTen]TT8191: 
This store (repl1 on my_host) is not involved in a replication scheme -- 
file "eeProc.c", lineno 11016, procedure "RepAdmin()"
*** ODBC Error = S1000, TimesTen Error = 8191

If ttAdmin is used with -repPolicy manual (the default) or -repPolicy always, then the -ramPolicy always option should also be used. This ensures that the replication agent begins recovery after a failure as quickly as possible.

ttAdoptStores

Description

On UNIX and Linux systems, use this utility to move databases from a TimesTen instance to a new TimesTen instance that is of the same major release, but of a different patchset or patch release. For example, you can move a database from TimesTen 18.1.1.1.0 to TimesTen 18.1.2.1.0.

Note:

A major release refers to the first two parts of the release number (18.1 above). A patchset release refers to the third part of the release number.

This utility is useful for testing a patchset or patch release of Times with an existing database. You can install the new release of TimesTen and move one or more databases to the new release without uninstalling the old TimesTen release.

You must run the ttAdoptStores utility from the destination instance.

Required privilege

This utility must be run by the TimesTen Instance Administrator. The instance administrator must be the same user for both the old and new TimesTen instance.

Usage with TimesTen Scaleout

This utility is not supported in TimesTen Scaleout.

Syntax

ttadoptstores {-h | -help | -?}
ttadoptstores {-V | -version}
ttadoptstores [-quiet] -dspath path
ttadoptstores [-quiet] -instpath path

Options

ttAdoptStores has the options:

Option Description
-dspath path Adopts a single database. The path argument must be the path to the database files (without any file extensions).
-h

-help

?

Prints a usage message and exits.
-instpath path Adopts all databases for an instance. The path argument must be the path to the daemon working directory (the info directory).

If any databases are in use, the utility fails without making any modifications. No new connections to any database are allowed in the source instance until the entire operation has completed.

-quiet Do not return verbose messages.
-V | -version Prints the release number of ttAdoptStores and exits.

Examples

To adopt the database /my/data/stores/ds, use:

% ttadoptstores -dspath /my/data/stores/ds

To adopt all the databases in the directory /opt/TimesTen/ instance1, use:

% ttadoptstores -instpath /opt/TimesTen/instance1

Notes

You cannot adopt temporary databases.

If an instance being adopted is part of a replication scheme, port numbers must match on each side of the replication scheme, unless a port number was specified as the value of the -remoteDaemonPort option during a ttRepAdmin -duplicate operation. Generally, all instances involved in the replication scheme must be updated at the same time.

This utility does not copy any sys.odbc.ini entries. You must move these files manually.

ttBackup

Description

Creates a backup copy of a database that can be restored at a later time using the ttRestore utility.

For an overview of the TimesTen backup and restore facility, see "Backup, Restore, and Migrate Data in TimesTen Classic" in Oracle TimesTen In-Memory Database Installation, Migration, and Upgrade Guide.

Required privilege

This utility requires the ADMIN privilege.

If authentication information is not supplied in the connection string or DSN, this utility prompts for a user ID and password before continuing.

Usage with TimesTen Scaleout

This utility is not supported in TimesTen Scaleout.

Syntax

ttBackup {-h | -help | -?}
ttBackup {-V | -version}
ttBackup -dir directory [-type backupType]
[-fname fileprefix] [-force]
{-connStr connection_string | DSN} 

Options

ttBackup has the options:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN Specifies an ODBC data source name of the database to be backed up.
-dir directory Specifies the directory where the backup files should be stored.
-fname fileprefix Specifies the file prefix for the backup files in the backup directory. The default value for this option is the file name portion of the DataStore parameter of the database's ODBC definition.
-force Forces the backup into the specified directory. If a backup exists in that directory, ttBackup overwrites it. If this option is not specified, and you are creating a backup from a database other than the one previously backed up in the specified directory, ttBackup terminates with an end message without overwriting existing files.
-h -help -? Prints a usage message and exits.
-type backupType Specifies the type of backup to be performed. Valid values are:

fileFull (default) - Performs a full file backup to the backup path specified by the directory and fileprefix parameters. The resulting backup is not enabled for incremental backup.

fileFullEnable - Performs a full file backup to the backup path specified by the directory and fileprefix parameters. The resulting backup is enabled for incremental backup.

fileIncremental - Performs an incremental file backup to the backup path specified by the directory and fileprefix parameters, if that backup path contains an incremental-enabled backup of the database. Otherwise, an error is returned.

fileIncrOrFull - Performs an incremental file backup to the backup path specified by the directory and fileprefix parameters if that backup path contains an incremental-enabled backup of the database. Otherwise, it performs a full file backup of the database and marks it incremental enabled.

streamFull - Performs a stream backup to standard out

incrementalStop - Does not perform a backup. Disables incremental backups for the backup path specified by the directory and fileprefix parameters. This prevents transaction log files from accumulating for an incremental backup.

-V | -version Prints the release number of ttBackup and exits.

Examples

To perform a full file backup of the FastIns database to the backup directory in/users/pat/TimesTen/backups, use:

% ttBackup -type fileFullEnable -dir /users/pat/TimesTen/backups FastIns

To copy the FastIns database to the file FastIns.back, use:

% ttBackup -type streamFull FastIns > FastIns.back

On UNIX and Linux systems, to save the FastIns database to a backup tape, use:

% ttBackup -type streamFull FastIns | dd bs=64k of=/dev/rmt0

To back up a database named origDSN to the directory /users/rob/tmp and restore it to the database named restoredDSN, use:

% ttBackup -type fileFull -dir /users/rob/tmp -fname restored origDSN
ttRestore -dir /users/rob/tmp -fname restored restoredDSN

Notes

The ttBackup utility and the ttRestore utility backup and restore databases only when the two parts of the TimesTen release and the platform are the same. For example, you can back up and restore files between TimesTen releases 18.1.1.1.0 and 18.1.2.10. You cannot backup and restore files between releases 11.2.2.8.35 and 18.1.2.1.0. You can use the ttBulkCp or CS (UNIX and Linux only) utility to migrate databases across major releases or operating systems.

When an incremental backup has been enabled, TimesTen creates a backup hold in the transaction log file. Call the ttLogHolds built-in procedure to see information about this hold. The backup hold determines which log records should be backed up upon subsequent incremental backups. Only changes since the last incremental backup are updated. A side effect to creating the backup hold is that it prevents transaction log files from being purged upon a checkpoint operation until the hold is advanced by performing another incremental backup or removed by disabling incremental backups.

Transactions that commit after the start of the backup operation are not reflected in the backup.

Up to one checkpoint and one backup may be active at the same time, with these limitations:

  • A backup never needs to wait for a checkpoint to complete.

  • A backup may need to wait for another backup to complete.

  • A checkpoint may need to wait for a backup to complete.

Databases containing cache groups can be backed up as normal with the ttBackup utility. However, when restoring such a backup, special consideration is required as the restored data within the cache groups may be out of date or out of sync with the data in the back end Oracle database. See the section on "Backing up and restoring a database with cache groups" in the Oracle TimesTen Application-Tier Database Cache User's Guide for details.

You cannot back up temporary databases.

ttBulkCp

Description

Copies data between TimesTen tables and ASCII files. ttBulkCp has two modes:

  • In copy-in mode (ttBulkCp -i), rows are copied into an existing TimesTen table from one or more ASCII files (or stdin).

  • In copy-out mode (ttBulkCp -o), an entire TimesTen table is copied to a single ASCII output file (or stdout).

On UNIX and Linux systems, this utility is supported for TimesTen Data Manager DSNs. For Client DSNs, use the utility ttBulkCpCS.

This utility only copies out the objects owned by the user executing the utility, and those objects for which the owner has SELECT privileges. If the owner executing the utility has the ADMIN privilege, ttBulkCp copies out all objects.

Required privilege

This utility requires the INSERT privilege on the tables it copies information into. It requires the SELECT privilege on the tables it copies information from.

If authentication information is not supplied in the connection string or DSN, this utility prompts for a user ID and password before continuing.

Usage with TimesTen Scaleout

This utility is supported in TimesTen Scaleout.

Syntax

ttBulkCp {-h | -help | -? | -helpfull}

ttBulkCp {-V | -version}

ttBulkCp -i [-cp numTrans | final] [-d errLevel] 
[-e errorFile] [-m maxErrs] [-sc] [-t errLevel]
[-u errLevel] [-v 0|1] [-xp numRows | rollback] 
[-Cc | -Cnone] [-tformat timeFormat] [-tsformat timeStampFormat]
[-dformat | -D dateFormat] [-F firstRow] [-L lastRow] 
[-N ncharEncoding] [-Q 0|1] [-S errLevel] [-dateMode dateMode]
[-[no]tblLock] [-localOnly] {-connStr connection_string | DSN} 
[owner.]tableName [dataFile ...]

ttBulkCp -directLoad [-cp numTrans|final] [-d errLevel] [-e errorFile]
[-m maxErrs] [-sc] [-t errLevel] [-u errLevel]
[-v 0|1] [-xp numRows|rollback] [-Cc | -Cnone]
[-dformat formatStr] [-tformat formatStr]
[-tsformat formatStr] [-F firstRow] [-L lastRow]
[-N ncharEncoding] [-Q 0|1] [-S errLevel] [-dateMode mode]
{DSN | [-connstr] connection_string}
[owner.]tblName [dataFile ...]

ttBulkCp -o [-sc] [-v 0|1] [-A 0|1] [-Cc | -Cnone] 
[-nullFormat formatStr] [-localOnly]
[-tformat timeFormat] [-tsformat timeStampFormat] 
[-dateMode dateMode] [-dformat | -D dateFormat]
[-N ncharEncoding] [-noForceSerializable | -forceSerializable]
[-tsprec precision] [-Q 0|1] [-localOnly] 
{-connStr connection_string | DSN} [owner.]tblName 
[dataFile]

Options

ttBulkCp has the options:

Option Description
-Cnone

-Cc

-Cnone disables the use of comments in the output file.-Cc sets the default comment character to c. If no default comment character is specified, the pound character (#) is used. The -C option takes the values: \t (tab) or any of the characters:~ ! @ # % ^ & * ( ) = : ; | < > ? , / This option overrides the COMMENTCHAR file attribute.
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN Specifies an ODBC data source name of the database to be copied.
-D | -dformat

dateFormat

Sets the date format. For a list of legal fixed values, see "Date, time and timestamp values". This option overrides the DFORMAT file attribute. The default is ODBC.

See also: -tformat and -tsformat.

dataFile For copy-in mode, specifies the path name(s) of one or more ASCII files containing rows to be inserted into the table. If no files are given, the standard input is used. A single hyphen (-) is understood to mean the standard input.

For copy-out mode, specifies the path name of the file into which rows should be copied. If no file is given, the standard output is used. A single hyphen (-) is understood to mean the standard output.

-dateMode dateMode Specifies whether ttBulkCp treats an Oracle database DATE type as a simple date (without hour, minute and second fields) or as a timestamp (with hour, minute and second fields).

For copy-in mode, the default behavior for input is date.

For copy-out mode, the default behavior for output is timestamp.

TimesTen truncates the data and issues a warning if you select -dateMode date in output mode and one or more date columns have a time component that is not 12:00:00 am.

This option overrides the DATEMODE file attribute.

-directLoad Selects copy-in mode that copies data from an ASCII file into a database table, but can only be used by a client using a direct connection. Avoids some of the overhead required when using a client/server connection, which provides better performance than the -i mode. Can only be used with TimesTen Classic.
-h -help

-?

Prints a short usage message and exits.
-helpfull Prints a longer usage message and exits.
-i Selects copy-in mode that copies data from an ASCII file into a database table. Can be used by a client using either a direct connection or a client/server connection.
-localonly 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, ttBulkCP 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.

-N ncharEncoding Specifies the input and output character encoding for NCHAR types. Valid values are UTF8, UTF-8 or ASCII.
-o Selects copy-out mode.
owner Specifies the owner of the table to be saved or loaded. If owner is omitted, TimesTen looks for the table under the user's name and then under the user name SYS. This parameter is case-insensitive.
-Q [0 | 1] Indicates whether character-string values should be enclosed in double quotes.

0 - Indicates that strings should not be quoted. This document refers to this mode as "no quote mode."

1 (default) - Indicates that strings should be quoted.This option overrides the QUOTES file attribute. This document refers to this mode as "quote mode."

-s c Sets the default field-separator character to c. If no default field-separator is specified, a comma (,) is used. The -s option takes the values \t (tab) or any of the characters:~ ! @ # % ^ & * ( ) = : ; | < > ? , / This option overrides the FSEP file attribute.
tableName Specifies the name of the table to be saved or loaded. This parameter is case-insensitive.
-tformat

timeFormat

Sets the time format. For a list of legal fixed values, see "Date, time and timestamp values". The default value is ODBC. This option overrides the TSFORMAT file attribute.

See also: -D | -dformat and -tsformat.

-tsformat

timestampFormat

Sets the timestamp format. For a list of legal fixed values, see "Date, time and timestamp values". The default value is DF*TF+FF, which is the concatenation of the date format, the time format and fractional seconds. This option overrides the TFORMAT file attribute.

See also: -D | -dformat and -tformat.

-V | -version Prints the release number of ttBulkCp and exits.
-v [0 | 1] Sets the verbosity level.

0 - Suppresses the summary.

1 (default) - Prints a summary of rows copied upon completion.


Use the following options in copy-out (-o) mode only. You must have SELECT privileges on the specified tables.

Option Description
-A [0 | 1] Indicates whether ttBulkCp should suppress attribute lines in the output file.

0 (default) - ttBulkCp may write attribute lines into the output file.

1 - Suppresses output of attribute lines.

-forceSerializable -noForceSerializable The -forceSerializable option indicates that ttBulkCp should use serializable isolation regardless of the DSN or connection string settings. This is the default behavior.

-noForceSerializable indicates that ttBulkCp should honor the isolation level in the DSN or connection string.

If you specify the -noForceSerializable option and the DSN or connection string indicates a non-serializable isolation mode, a warning is included in the output:

Warning: This output was produced using a
non-serializable isolation level. It may therefore not
reflect a transaction-consistent state of the table.

For more information on isolation modes, see "Transaction isolation levels" in Oracle TimesTen In-Memory Database Operations Guide.

-nullFormat formatStr Specifies the format in which NULL values are printed. Valid values are:

null (default) - The word NULL is printed for null fields.

empty - Nothing is printed for null fields.

An empty LOB is printed as NULL in no-quotes mode and as " " in quote mode. When copied in, both NULL and " " are interpreted as a NULL LOB.

-tsprec precision When used with the -o option, truncates timestamp values to precision. ttBulkCp allows up to 6 digits in the fraction of a second field. Truncation may be necessary when copying timestamps using other RDBMS.

Use the following options in copy-in (-i) and directload (-directload) modes only. You must have INSERT privileges on the specified tables.

Option Description
-cp numTrans

-cp final

Sets the checkpoint policy for the copy in.

A value of 0 indicates that ttBulkCp should never checkpoint the database, even after the entire copy is complete.

A nonzero value indicates that ttBulkCp should checkpoint the database after every numTrans transactions, and again after the entire load is complete.

A value of final indicates that ttBulkCp should checkpoint the database only when the entire copy is complete.

The default value is 0.

Periodic checkpoints can only be enabled if periodic commits are also enabled. See the -xp option.

NOTE: This option is not supported in TimesTen Scaleout.

-d error

-d warn

-d ignore

By default, ttBulkCp does not consider rows that are rejected because of constraint violations in a unique column or index to be errors.

-d error - Specifies that constraint violations should be considered errors. Duplicate rows are then counted against maxErrs (see -m) and placed into the error file (see -e).

-d warn - Specifies that ttBulkCp should copy the offending rows into the error file but should not count them as errors.

-d ignore (default) - Specifies that ttBulkCp should silently ignore duplicate rows.

Regardless of the setting of -d, the duplicate rows are not inserted into the table.

-e errFile Indicates the name of the file in which ttBulkCp should place information about rows that cannot be copied into the TimesTen table because of errors. These errors include parsing errors, type-conversion errors and constraint violations. The value of errFile defaults to stderr. The format of the error file is the same as the format of the input file (see "Data file format"), so it should be possible to correct the errors in the error file and use the corrected error file as an input file for a subsequent run of ttBulkCp.
-F firstRow Indicates the number of the first row that should be copied. Use this option (optionally with -L) to copy a subset of rows into the TimesTen table. Rows are numbered starting at 1. If more than one input file is specified, rows are numbered consecutively throughout all the files. The default value is 1.
-L lastRow Indicates the number of the last row that should be copied. See the description of -F. A value of 0 specifies the last row of the last input file. The default value is 0.
-m maxErrors Specifies the maximum number of errors to report.

The default is 1.

If set to 0, ttBulkCp returns all error messages. There is no maximum limit.

-S error

-S warn

-S ignore

By default, ttBulkCp issues an error when it encounters a value that exceeds its maximum scale. This error can be generated for a decimal value whose scale exceeds the maximum scale of its column or for a TIMESTAMP value with more than 6 decimal places of fractional seconds (sub-microsecond granularity).

-S error (default) - Specifies that ttBulkCp should not insert a row containing a value that exceeds its maximum scale into the table and that it should place an error into the error file.

-S warn - Specifies that ttBulkCp should right-truncate the value to its maximum scale before inserting the row into the table and that it should place a warning into the error file.

-S ignore - Specifies that ttBulkCp should silently right-truncate the value to its maximum scale before inserting the row into the table.

-t error

-t warn

-t ignore

By default, ttBulkCp issues an error when a CHAR, VARCHAR2, NCHAR, NVARCHAR2, BINARY, VARBINARY, BLOB, CLOB, or NLOB value is longer than its maximum column width.

-t error (default) - Specifies that rows containing long string or binary attributes should not be inserted into the TimesTen table and that an error should be placed into the error file.

-t warn - Specifies that long string or binary attributes should be truncated to the maximum column length before being inserted into the table but that a warning should be placed into the error file.

-t ignore - Specifies that long string or binary attributes should be silently truncated to the maximum column length before being inserted into the table.

-[no]tblLock Specifies whether to use table-level or row-level locking, when copying rows into a TimesTen table.

-tblLock - Indicates table-level locking. This is the default.

-notblLock - Indicates row-level locking.

For a single input stream into a table, using -tblLock is most efficient. Using -notblLock provides some performance benefit if you use multiple concurrent ttBulkCp sessions to insert into a single table in parallel.

-u error

-u warn

-u ignore

By default, ttBulkCp issues an error when a real, float or double attribute underflows. Underflow occurs when a floating point number is so small that it is rounded to zero.

-u error (default) - Specifies that rows containing a real, float or double value that underflow should not be inserted into the TimesTen table and that an error should be placed into the error file.

-u warn - Specifies that 0.0 should be inserted for real, float or double attributes that underflow, but that a warning should be placed into the error file.

-u ignore - Specifies that 0.0 should be silently inserted for real, float or double attributes that underflow.

-xp numRows

-xp rollback

Sets the transaction policy for the load. A value of 0 indicates that ttBulkCp should perform the entire load as a single transaction and should commit that transaction whether the load succeeds or fails.

A value of rollback indicates that ttBulkCp should perform the entire load as a single transaction and should roll that transaction back if the load fails.

A nonzero value indicates that ttBulkCp should commit after every numRows processed rows.

The default value is 1024.

Use the -xp option with the -cp option to enable periodic checkpointing of the database.


Data file format

This section describes the format the dataFile parameter.

Each line of a ttBulkCp input file is either a blank line, a comment line, an attribute line or a data line.

  • Blank lines are lines with no characters at all, including whitespace characters (space and tab). Blank lines are ignored by ttBulkCp.

  • Comment lines begin with the comment character. The default comment character is #; this default can be overridden with the -C command-line option or the COMMENTCHAR file attribute (see "File attribute line format"). The comment character must be the first character on the line. Comment lines are ignored by ttBulkCp. Comments at the end of data lines are not supported.

  • File attribute lines are used for setting file attributes that control the formatting of the data file. Attribute lines begin with the ten-character sequence ##ttBulkCp. The section "File attribute line format" describes the full syntax for attribute lines. Attribute lines can appear anywhere in the data file.

  • Data lines contain the rows of the table being copied. Data lines in the data file and rows of the table correspond one-to-one; that is, each data line completely describes exactly one row. Each data line consists of a list of column values separated by the field separator character. The default field separator is a comma (,). This default can be overridden by the -s command-line option or the FSEP file attribute. The section "Data line format" describes the full syntax for data lines.

File attribute line format

The format of an attribute line is:

##ttBulkCp[:attribute=value]...

Attribute lines always begin with the ten-character sequence ##ttBulkCp, even if the comment character is not #. This sequence is followed by zero or more file attribute settings, each preceded by a colon.

File attribute settings remain in effect until the end of the input file or until they are changed by another attribute line in the same input file. The values of any file attributes that are omitted in an attribute line are left unchanged.

Most command line options take precedence over the values in the file attributes that are supported by ttBulkCp. The CHARACTERSET attribute is the only file attribute that overrides command line options.

The file attributes are:

  • CHARACTERSET: Specifies the character set to be used to interpret the data file. If the file attribute is not set, the character set used to interpret the file is the one specified in the ConnectionCharacterSet connection attribute. For best performance, the value of the DatabaseCharacterSet connection attribute should match either the ConnectionCharacterSet connection attribute or this file attribute. If the character set supplied in ConnectionCharacterSet connection attribute or in this file attribute is different than the actual character set of the file, ttBulkCp may interpret data incorrectly.

  • VERSION: Specifies the version of the file format used in the file, expressed as major.minor. The only supported version is 1.0.

  • DATEMODE: Specifies whether an Oracle database DATE type is specified as simple date or as timestamp.

  • FSEP: Specifies the field separator character used in the file. The field separator can be set to \t (tab) or any of the characters: ~ ! @ # $ % ^ & * ( ) = : ; | < > ? , / .

  • QUOTES: Indicates whether character string values in the file are enclosed in double quotes. The value can be 0, to indicate that strings are not quoted, or 1, to indicate that strings are quoted. This value can be overridden with the -Q option.

  • COMMENTCHAR: Specifies the comment character used in the file. The comment character can be set to \t (tab) or any of the characters: ~ ! @ # $ % ^ & * ( ) = : ; | < > ? , / .

The comment character can also be set to the value none, which disables the use of comments in the data file.

  • DFORMAT: Sets the date format. For a list of legal values, see "Date, time and timestamp values". When a custom format is used, it should be enclosed in single quotes. This value can be overridden with the -D/-dformat command-line option. See also: TFORMAT and TSFORMAT.

  • NCHARENCODING: Indicates the encoding to be used for the NCHAR and NVARCHAR2 data types. The value may be either ASCII or UTF-8.

  • TFORMAT: Indicates the time format. For a list of legal values, see "Date, time and timestamp values". When a custom format is used, it should be enclosed in single quotes. This value can be overridden with the -tformat command-line option. See also: DFORMAT and TSFORMAT.

  • TSFORMAT: Sets the timestamp format. For a list of legal values, see "Date, time and timestamp values". When a custom format is used, it should be enclosed in single quotes. This value can be overridden with the -tsformat command-line option. See also: DFORMAT and TFORMAT.

Examples

The following header line sets the field separator character to $ and disables quoting of character strings:

##ttBulkCp:FSEP=$:QUOTES=0

The following header line disables comments and sets the date format to the Oracle format:

##ttBulkCp:COMMENTCHAR=none:DFORMAT=Oracle

The following header line set the date format to a custom format:

##ttBulkCp:DFORMAT='Mon DD, YYYY'

Data line format

Data lines contain the row data of the table being copied. Each data line corresponds to a row of the table; rows cannot span input-file lines. A data line consists of a list of column values separated by the field separator character. Unnecessary whitespace characters should not be placed either before or after the field separator. The format of each value is determined by its type.

NULL values

NULL values can either be expressed as NULL (all capitals, no quotes) or as empty fields.

Character and unicode strings

CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, NCLOB: If quoting of character strings is enabled (the default), then strings and characters must be enclosed in double quotes. If quoting of character strings is disabled, then any double-quote characters in the string are considered to be part of the string itself. ttBulkCp recognizes the following backslash escapes inside a character string, regardless of whether quoting of strings is enabled:

  • \" The double-quote character. If character-string quoting is enabled, then all double quote characters in the string must be escaped with a backslash. If character-string quoting is disabled, then it is permissible, but not necessary, to use the backslash.

  • \t The tab character.

  • \n The newline character.

  • \r The carriage return character.

  • \\ The backslash character.

  • \xyz (CHAR and VARCHAR2 only) The character whose ASCII value is xyz, where xyz is a three-character octal number, as in \033.

  • \uxyzw (NCHAR and NVARCHAR2 only) The character whose unicode value is xyzw, where xyzw is a four-digit hexadecimal number, as in\ufe4a. The \uxyzw notation is supported in both UTF-8 and ASCII encoding modes.

In addition, any of the ~ ! @ # $ % ^ & * ( ) = : ; | < > ? , / characters can be escaped with a backslash. Although it is unnecessary to escape these characters usually, doing so prevents them from being mistaken for a comment character or a field separator when character-string quoting is disabled.

If character-string quoting is enabled, the empty string (represented as " ") is distinct from NULL. If character-string quoting is disabled, then empty strings cannot be represented, as they cannot be distinguished from NULL.

For unicode strings, unicode characters encoded using UTF-8 multibyte sequences are supported in the UTF-8 encoding mode only. If these sequences are used with the ASCII encoding mode, ttBulkCp interprets each byte in the sequence as a separate character.

For fixed-length CHAR and NCHAR fields, strings that are shorter than the field length are padded with blanks. For VARCHAR2 and NVARCHAR2 fields, the string is entered into TimesTen exactly as given in the data file. Trailing blanks are neither added nor removed.

Binary values

BINARY, VARBINARY, BLOB: If quoting of character strings is enabled (the default), binary values are delimited by curly braces ({...}). If quoting of character strings is disabled, then curly braces should not be used. Whether character-string quoting is enabled or disabled, binary values may start with an optional 0x or 0X.

Each byte of binary data is expressed as two hexadecimal digits. For example, the four-byte binary string:

01101000 11001010 01001001 11101111

would be expressed as the eight-character hexadecimal string:

68CA49EF

Digits represented by the letters A through F can either be upper- or lower-case. The hexadecimal string cannot contain white spaces. Because each pair of characters in the hexadecimal string is converted to a single binary byte, the hexadecimal string must contain an even number of characters. For fixed-length binary fields, if the given value is shorter than the column length, the value is padded with zeros on the right. For VARBINARY values, the binary value is inserted into TimesTen exactly as given in the data file.

If character-string quoting is enabled, a zero-length binary value (represented as { }) is distinct from NULL. If character-string quoting is disabled, then zero-length binary values cannot be represented, as they cannot be distinguished from NULL.

Integer values

TINYINT, SMALLINT, INTEGER, BIGINT: Integer values consist of an optional sign followed by one or more digits. Integer values may not use E-notation. Examples:

-14 98765 +186

Floating-point values

REAL, FLOAT, DOUBLE: Floating-point values can be expressed with or without decimal points and may use E-notation. Examples:

3.1415
-0.00004
1.1e-3
5e3
.56
-682
-.62E-4
170.

Fixed-point values

DECIMAL, NUMERIC: Decimal values can be expressed with or without decimal points. Decimal values may not use E-notation. Examples:

5
-19.5
-11
000
-.1234
45.
-57.0
0.8888

Inf, -Inf and NaN values

Inf, -Inf and Nan values: Infinity and Not a Number values can be represented as strings to represent the corresponding constant value (all are case insensitive):

String Value
NAN NaN
[+]INF Inf
-INF -Inf

TimesTen outputs the values as: NAN, INF and -Inf.

Date, time and timestamp values

Formats for date, time and timestamp values can be specified either by selecting a fixed datetime format or by defining a custom datetime format. The custom datetime formats are defined using format specifiers similar to those used by the TO_DATE and TO_CHAR SQL functions, as described in the following table.

In many cases, it is not necessary to define the timestamp format, even when a custom date or time format is used, because the default TimesTen format (DF*TF+FF) is defined in terms of the date and time formats. Therefore, setting the date format sets not only the format for date values, but also for the date portion of timestamp values. Similarly, setting the timestamp format affects both time values and the time portion of the timestamp values.

Specifier Descriptions and restrictions
Q Quarter. Cannot be used in copy-in mode.
YYYY Year (four digits).
Y,YYY Year (with comma as shown).
YYY Year (last three digits). Cannot be used in copy-in mode.
Y Year (last digit). Cannot be used in copy-in mode.
MONTH Month (full name, blank-padded to 9 characters, case-insensitive).
MON Month (three character prefix, case-insensitive).
MM Month (01 through 12).
DD Day of the month (01 through 31).
HH24 Hour (00 through 23).
HH12 Hour (01 through 12). Must be used with AM/PM for copy-in mode.
HH Hour (01 through 12). Must be used with AM/PM for copy-in mode.
MI Minute (00 through 59).
SS Second (00 through 59).
FF Fractional seconds.Six digits, unless overridden with the -tsprec option.
FFn Fractional seconds (number of digits specified by n).
+FF In copy-in mode, matches, optional decimal point plus one or more fractional seconds. In copy-out mode, same as .FF.
+FFn In copy-in mode, same as +FF. In copy-out mode, same as .FFn.
AM PM Meridian indicator without dots. In copy-in mode, this must be used with HH or HH12, but not HH24.
A.M.

P.M.

Meridian indicator with dots. In copy-in mode, this must be used with HH or HH12, but not HH24.
DF Current date format (can only be used in timestamp format).
TF Current time format (can only be used in timestamp format).
- / ; : Punctuation that are matched in copy-in mode or output in copy-out mode.
"text" Text that is matched in input mode or output in copy-out mode.
* Matches 0 or more whitespace characters (space or tab) in copy-in mode or outputs 1 space in copy-out mode.

Fixed date, time and timestamp formats

For date values, the fixed formats are:

Format Description
ODBC YYYY-MM-DD

Example: 2011-01-03

(default value)

Oracle DD-Mon-YYYY

Example: 03-Jan-2011

SYBASE1 MM/DD/YYYY

Example: 01/03/2011

SYBASE2 DD-MM-YYYY

Example: 03-01-2011

SYBASE3 Mon*DD*YYYY

Example: Jan 03 2011


For time values, the only fixed format is ODBC:

Format Description
ODBC HH24:MI:SS

Example: 07:47:23


For timestamp values, the fixed formats are:

Format Description
ODBC YYYY-MM-DD*HH24:MI:SS+FF

Example: 2011-01-03 07:47:23

Oracle DD-Mon-YYYY*HH24:MI:SS+FF

Example: 03-Jan-2011 07:47:23

SYBASE1 MM/DD/YYYY*HH24:MI:SS+FF

Example: 01/03/2011 07:47:23

SYBASE2 DD-MM-YYYY*HH24:MI:SS+FF

Example: 03-01-2011 07:47:23

SYBASE3 Mon*DD*YYYY*HH24:MI:SS+FF

Example: Jan 03 2011 07:47:23


The default timestamp value is: 'DF*TF+FF'

Examples

The following input file is for a table with five columns: two char columns, a double column, an integer column and a VARBINARY column. In the "Mountain View" line, the last three columns have NULL values.

##ttBulkCp
# This is a comment.
###### So is this.
# The following line is a blank line.

"New York","New York",-345.09,12,{12EF87A4E5}
"Milan","Italy",0,0,{0x458F}
"Paris","France",1.4E12,NULL,{F009}
"Tokyo","Japan",-4.5E-18,26,{0x00}
"Mountain View","California",,,

Here is an equivalent input file in which quotes are disabled, the comment character is '$' and the field separator is '|':

##ttBulkCp:QUOTES=0:COMMENTCHAR=$:FSEP=|
$ This is a comment.
$$$$$$ So is this.
$ The following line is a blank line.

New York|New York|-345.09|12|12EF87A4E5
Milan|Italy|0|0|0x458F
Paris|France|1.4E12|NULL|F009
Tokyo|Japan|-4.5E-18|26|0x00
Mountain View|California|||

The following command dumps the contents of table mytbl from database mystore into a file called mytbl.dump.

% ttBulkCp -o mystore mytbl mytbl.dump

The following command loads the rows listed in file mytbl.dump into a table called mytbl on database mystore, placing any error messages into the file mytbl.err.

% ttBulkCp -i -e mytbl.err mystore mytbl mytbl.dump

The above command terminates after the first error occurs. To force the copy to continue until the end of the input file (or a irrecoverable error), use -m 0, as in:

% ttBulkCp -i -e mytbl.err -m 0 mystore mytbl mytbl.dump

To ignore errors caused by constraint violations, use -d ignore, as follows.

% ttBulkCp -i -e mytbl.err -d ignore mystore mytbl mytbl.dump

Notes

ttBulkCp explicitly sets the Overwrite connection attribute to 0, to prevent accidental destruction of a database. For more information, see "Overwrite".

Real, float or double values may be rounded to zero when the floating point number is small.

The connection attribute PassThrough with a nonzero value is not supported in this utility and returns an error.

When specifying date, time and timestamp formats, incomplete or redundant formats are not allowed in input mode. Specifiers that reference fields that are not present in the data type (for example a minute specifier in a date format) return errors in copy-out mode. In copy-in mode, the values of those specifiers are ignored.

The following caveats apply when disabling quoted strings in the ttBulkCp data file:

  • Empty strings and zero-length binary values cannot be expressed, as they cannot be distinguished from NULL.

  • If the field separator character appears inside a character string, it must be escaped with a backslash or else it is treated as an actual field separator.

  • If a data line begins with a character string and that string begins with the comment character, that character must be escaped with a backslash or else the line is treated as a comment. If there are no actual comments in the file, set the comment character to none to avoid characters from being misread as comment characters.

For UTF-8, NCHAR are converted to UTF-8 encoding and then output. UTF-8 input is converted to NCHAR.

For ASCII, those NCHAR values that correspond to ASCII characters are output as ASCII. For those NCHAR values outside of the ASCII range, the escaped Unicode format is used.

On Windows, this utility is supported for all TimesTen Data Manager and Client DSNs.

It is recommended that you do not run DDL SQL commands while running ttBulkCp to avoid lock contention issues for your application.

ttCapture

Description

Captures information about the state of TimesTen at the time the command is used. This information may be useful in diagnosing problems. Sometimes TimesTen Customer Support must make repeated incremental requests for information to diagnose a customer's problem in the field.

The information captured by this utility may be requested by TimesTen Customer Support and may be sent with your support email.

The utility does not interpret errors. It only collects information about the state of things and sends output to the ttcapture.date.number.log file in the directory from which you invoke the ttCapture utility. This utility collects general information that is usually relevant to support cases.

Note:

You should always enclose directory and file names in double quotes, in case there are spaces in them.

Required privilege

This utility requires the instance administrator privilege.

If authentication information is not supplied in the connection string or DSN, this utility prompts for a user ID and password before continuing.

Usage with TimesTen Scaleout

This utility is supported in TimesTen Scaleout.

Syntax

ttCapture {-h | -help | -?}
ttCapture {-V | -version}
ttCapture [-noinstinfo] [-nosysinfo] [-stdout | -dest dir] [-logdir dir] 
 [dspath | DSN]
ttCapture [-noinstinfo] [-nosysinfo] [-stdout | -dest dir] [-logdir dir] 
 [-noconnect] [dspath | DSN]
ttCapture -noconnect [dspath | DSN]

Options

ttCapture has the options:

Option Description
-dest dir Writes the output file to the designated directory.
DSN Specifies an ODBC data source name of the database to be checked.
dspath Specifies the fully qualified name of the database to be evaluated. This is not the DSN associated with the connection but the fully qualified database path name associated with the database as specified in the DataStore= parameter of the database's ODBC definition.

For example, for a database consisting of files/home/payroll/2011.ds0, /home/payroll/2011.ds1, and several transaction log files /home/payroll/2011.logn, dspath is /home/payroll/2011.

NOTE: The DSN and dspath options are mutually exclusive. If you do not supply either option, ttCapture does not provide any database information.

-h

-help

-?

Prints a usage message and exits.
-logdir dir Specifies the location of the log directory. Must be used with the -dspath option. If not specified, the log directory may not be available.
-noconnect Specifies that the utility should capture information on the DSN without connecting to it.

If specified, some information, such as ttConfiguration output and replication schemes, is not included in the output.

This option is useful if you do not want to load a large database or if you are reporting a problem where connections are failing.

-noinstinfo Indicates that ttCapture should not capture any installation information.
-nosysinfo Indicates that ttCapture should not capture any system information.
-stdout On UNIX and Linux systems, ttCapture writes all output to stdout, instead of writing the output to a file. On Windows, ttCapture writes to a Command prompt.
-V | -version Prints the release number of ttCapture and exits.

Examples

To capture data on the test_db database and write the database checkpoint files to the directory D:\my_data\recover\test_db, use:

% ttCapture -dest "D:\my_data\recover\test_db" test_db

Notes

This utility is supported only where the TimesTen Data Manager is installed.

ttCheck

Description

Performs internal consistency checking within a TimesTen database. You can specify a specific structure to be checked and a desired level of checking.

Required privilege

This utility requires the ADMIN privilege.

If authentication information is not supplied in the connection string or DSN, this utility prompts for a user ID and password before continuing.

Usage with TimesTen Scaleout

This utility is supported in TimesTen Scaleout.

Syntax

ttCheck {-h | -help | -?}
ttCheck {-V | -version}
ttCheck [ [-blkDir] [-compHeap] [-header] [-heap] [-indexHeap] [-log]
[-permBlkDir] [-permHeap] [-tempBlkDir] [-tmpHeap]
[-tables tblName [...]] [-users userName [...]]
[-level levelNum] ] [...]
[-m maxErrors] [-f outFile] [-v verbosity]
{DSN | [-connstr] connection_string | dspath}

Options

ttCheck has the options:

Option Description
-blkDir Checks all the block directories.
-compHeap Checks the compilation heap structure.
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN Specifies an ODBC data source name of the database to be checked.
dspath The fully qualified name of the database to be checked. This is not the DSN associated with the connection. It is the fully qualified database path name associated with the database as specified in the DataStore= parameter connection attribute in the database's DSN.

For example, for a database consisting of files/home/payroll/2011.ds0, /home/payroll/2011.ds1, and several transaction log files /home/payroll/2011.logn,dspath is/home/payroll/2011.

-f outFile Specifies the output file name; defaults to stdout.
-h

-help

-?

Prints a usage message and exits.
-header Checks the content of the database header.
-heap Checks all heap structures.
-indexHeap Checks the index heap structure.
-level levelNum Indicates the level of checking for header, block directory, heap and table. Different structures can be checked using different levels in a same command. A level specification is applied to all structures specified to its left in the command string that do not have a level specification. A level specification is applied to all structures if no structure is specified in the command string.

1 - Checks sanity bytes and simple fields. For example, counts enums for validity in all high-level structures.

2 - Does all checks in level 1, plus checks the validity of structures, referenced by fields in other structures.

3 - Does all checks in level 2, plus checks each table row for column values. For example, checks valid VARCHAR2 and FLOAT sizes.

4 (default) - Does all checks in level 3, plus checks index/table mapping for each row and each index.

-log Checks the log buffer.
-m maxErrors Maximum number of errors to report. Default is 10; a few extra related errors may be reported. If 0, the utility only connects, then returns.
-permBlkDir Checks the permanent partition block directory.
-permHeap Checks the permanent heap structure.
-tables tblName [...] Checks table(s) specified by tblName.
-tempBlkDir Checks the temporary partition block directory.
-tmpHeap Checks the temporary heap structure.
-users userName [...] Checks tables belonging to the user(s) specified by userName.
-V | -version Prints the release number of ttCheck and exits.
-v verbosity 0 - No output (program's exit status indicates if an error was found).

1 (default) - Enable error output only.

2 - Error output and a progress report.


Examples

To perform a check of all structures in the test_db database, use:

% ttCheck test_db

To perform a sanity check of all structures in the test_db database, use:

% ttCheck -level 1 test_db

To perform a check of all tables in the test_db database, use:

% ttCheck -tables test_db

To check the physical structures and row contents of all tables in the test_db database, use:

% ttCheck -tables -level 3 test_db

To perform a sanity check of all heap structures, row contents and indexes of all tables in the test_db database, use the following.

% ttCheck -heap -level 1 -tables -level 4 test_db

To check the physical structures and row contents of tables tab1 and tab2 in the test_db database, use:

% ttCheck -tables tab1 tab2 -level 3 test_db

Notes

While primarily intended for use by TimesTen customer support to diagnose problems with internal data structures of a TimesTen database, the information returned by ttCheck may be useful to system administrators and developers.

The ttCheck utility should be run when there are no active transactions on the system.

The ttCheck utility checks views in the same manner as other tables in a database. The utility cannot verify that the contents of a view matches view query's result.

If no structures are specified, ttCheck checks all structures. No errors are returned if a specified table's name or user is not found.

This utility may take some time to run. Verbosity level 2 enables you to print a progress report.

This utility is supported only where the TimesTen Data Manager is installed.

ttCWAdmin

Description

Manages TimesTen active standby pairs that take advantage of the high availability framework of Oracle Clusterware. This utility starts administrative processes, generates scripts and performs other functions to administer active standby pairs and the corresponding Clusterware resources.

For more information, see "Using Oracle Clusterware to Manage Active Standby Pairs" in Oracle TimesTen In-Memory Database Replication Guide.

These commands are available only with advanced high availability:

  • ttCWAdmin -addMasterHosts

  • ttCWAdmin -addSubscriberHosts

  • ttCWAdmin -createVIPs

  • ttCWAdmin -delMasterHosts

  • ttCWAdmin -delSubscriberHosts

  • ttCWAdmin -dropVIPs

These commands fail with basic high availability.

Required privilege

On Windows, any user with Administrators privileges can execute all commands in this utility.

On UNIX and Linux systems, the root user can execute all commands in this utility. These commands must be executed by the root user:

  • ttCWAdmin -addMasterHosts

  • ttCWAdmin -addSubscriberHosts

  • ttCWAdmin -createVIPs

  • ttCWAdmin -delMasterHosts

  • ttCWAdmin -delSubscriberHosts

  • ttCWAdmin -ocrConfig

  • ttCWAdmin -dropVIPs

The administrator user can execute all other commands in this utility.

If authentication information is not supplied in the connection string or DSN, this utility prompts for a user ID and password before continuing.

Usage with TimesTen Scaleout

This utility is not supported in TimesTen Scaleout.

Syntax

ttCWAdmin {-h | -help | -?}

ttCWAdmin {-V | -version}

ttCWAdmin -init [-hosts "host_name1, host_name2[, ...]"]

ttCWAdmin {-createVIPs | -dropVIPs | -create | -drop | -restore | -start |
           -stop | -status} [-ttclusterini path] [-dsn DSN]

ttCWAdmin - [-timeout seconds] -dsn DSN

ttCWAdmin -relocate -dsn DSN

ttCWAdmin -reauthenticate -dsn DSN

ttCWAdmin -ocrConfig

ttCWAdmin -beginAlterSchema -dsn DSN

ttCWAdmin -endAlterSchema -dsn DSN

ttCWAdmin -addMasterHosts [-hosts "host_name1, host_name2[, ...]"] -dsn DSN

ttCWAdmin -delMasterHosts [-hosts "host_name1, host_name2[, ...]"] -dsn DSN

ttCWAdmin -addSubscriberHosts [-hosts "host_name1, host_name2[, ...]"] -dsn DSN

ttCWAdmin -delSubscriberHosts [-hosts "host_name1, host_name2[, ...]"] -dsn DSN

ttCWAdmin -start [-noapp] -dsn DSN

ttCWAdmin -stop -dsn DSN

ttCWAdmin -startapps -dsn DSN

ttCWAdmin -stopapps -dsn DSN

ttCWAdmin -shutdown [-noderegister] [-hosts "host_name1, host_name2[, ...]"]

Options

ttCWAdmin has these options:

Option Description
-addMasterHosts Adds spare hosts to the pool of master hosts dynamically, when high availability is employed. On the command line, separate multiple host names by commas.

On UNIX and Linux systems, only the root user can execute this command.

-addSubscriberHosts Adds spare hosts to the pool of subscriber hosts dynamically, when high availability is employed. On the command line, separate multiple host names by commas.

On UNIX and Linux systems, only the root user can execute this command.

-beginAlterSchema Enables manual alteration, addition or dropping of cache groups to the active standby pair replication scheme when automatic include of new schema objects in the active standby pair scheme is not possible. Also, enables creation of PL/SQL procedures, sequences materialized views and indexes on tables with data. Enables addition of a read-only subscriber that is not managed by Oracle Clusterware. While adding objects to the schema, the active standby pair is brought down.

See also: -endAlterSchema.

-create Creates the active standby pair replication scheme for the specified DSN and creates the associated action scripts.

This command:

  • Prompts for the name of a TimesTen internal user with ADMIN privileges. TimesTen uses this internal user to create the active standby pair. If cache groups are being managed by Oracle Clusterware (if the attribute CacheConnect=Y in the cluster.oracle.ini), enter the TimesTen cache manager user name.

  • Prompts for the TimesTen password for the previously entered user name.

  • If cache groups are being used, prompts for the password for the Oracle database user that has the same name as the cache manager. This password is provided in the OraclePWD connection attribute when the cache manager user connects. This Oracle database user is used to set the autorefresh states for cache groups.

  • Prompts for a random string used to encrypt the above information.

-createVIPs Creates virtual IP addresses for the active standby pair. If no DSN is specified, displays the information of all active standby pairs managed under the same TimesTen instance administrator and TimesTen instance name managed by Oracle Clusterware.
-delMasterHosts Deletes spare hosts to the pool of master hosts dynamically, when high availability is employed. On the command line, separate multiple host names by commas.

The command fails if the indicated hosts are not spare hosts.

On UNIX and Linux systems, only the root user can execute this command.

-delSubscriberHosts Deletes spare hosts to the pool of subscriber hosts dynamically, when high availability is employed. On the command line, separate multiple host names by commas.

The command fails if the indicated hosts are not spare hosts.

On UNIX and Linux systems, only the root user can execute this command.

-drop Drops the active standby pair replication scheme and deletes its action scripts.
-dropVIPs Drops the virtual IP addresses for the active standby pair.
-endAlterSchema Issued this option after an operation using the -beginAlterSchema option. Rolls out the active standby pair after objects have been added to the schema, while recording the new replication checksum. The old standby is being destroyed and recreated through duplicate
-h

-help

-?

Prints a usage message and exits.
-init Starts the TimesTen cluster agent.
-noderegister Used with ttCWAdmin -shutdown command. This command option tells the shutdown process to keep registered all TimesTen processes that are registered as Clusterware resources for the cluster agent and TimesTen daemon monitors for Clusterware.
-ocrConfig TimesTen cluster information is stored in the Oracle Cluster Registry (OCR). This option registers the admin user in the OCR. You must register the admin user once before performing any of the cluster initialization steps.

On UNIX and Linux systems, login as the root user and run this command from any host in the system before creating any clusters.

On Windows systems, login as the instance administrator to run this command.

You do not need to perform this step when starting an existing cluster that you have shutdown.

-reauthenticate This command reauthenticates the user names and passwords after any of them have been modified. Even if only a single password is changed, this command still prompts for all user names and passwords.
  • Prompts for the name of a TimesTen internal user with ADMIN privileges. TimesTen uses this internal user to create the active standby pair. If cache groups are being managed by Oracle Clusterware (if the attribute CacheConnect=Y in the cluster.oracle.ini), enter the TimesTen cache manager user name.

  • Prompts for the TimesTen password for the previously entered user name.

  • If cache groups are being used, prompts for the password for the Oracle database user that has the same name as the cache manager. This password is provided in the OraclePWD connection attribute when the cache manager user connects. This Oracle database user is used to set the autorefresh states for cache groups.

  • Prompts for a random string used to encrypt the above information.

For more details, see "Changing user names or passwords when using Oracle Clusterware" in the Oracle TimesTen In-Memory Database Replication Guide.

-relocate Relocates the database from the local host to the next available spare host specified in the MasterHosts attribute in the cluster.oracle.ini configuration file. If no spare host is available, an error is returned.

If the database on the local host is active, roles are first reversed so that the remote standby store of the same cluster becomes active. The newly migrated database on the spare host always comes up as the standby database.This is useful to forcefully relocate a database if you must take the host offline, when high availability is employed. This command fails when basic High Availability (HA) is deployed for the same cluster.

-restore Restores the active master database from the backup specified by RepBackupDir. Do not use this command when AutoRecover is enabled.
-shutdown Stops the TimesTen daemon, cluster agent, and the replication agent (if the replication agent is still up) on the set of hosts either specifically mentioned with the optional -hosts argument or defined within the ttcrsagent.options file. Also, if this command does not include the -noderegister option, then the default behavior is to deregister from Clusterware all TimesTen processes that are registered as Clusterware resources for cluster agents and TimesTen daemon monitors.
-start [-noapp] Starts the cluster active standby pair. This results in starting all of the agents on the active database, creation of the standby database and the subscriber databases (if they exist) through duplicate if necessary, and subsequent starting of all agents on those databases. If you specify -noapp, the applications are not started. You can use the -startapps option to start the applications later.
-startapps Starts the applications in the cluster.
-stopapps Stops the applications in the cluster.
-status Obtains the status of resources in the cluster.
-stop Stops the replication agent and the cache agent and disconnects the application from both databases of an active standby pair.
- Reverses the role of an active standby pair in a cluster. The standby database becomes the new active, while the existing active database becomes the standby database.
-timeout seconds Specifies a timeout value for the - option. Specify an integer value greater than 0. The default is 900 seconds.

If you enter an invalid value, TimesTen uses the default value of 900 seconds.

If the timeout expires, TimesTen returns an error message and fails to verify the standby database.

-dsn DSN Specifies the DSN for the active standby pair.
-hosts "host_name1, host_name2[, ...]" Specifies the hosts on which to start or shut down the TimesTen cluster agent. If this option is not specified, the TimesTen cluster agent is started or stopped on all hosts.
-ttclusterini path Specifies the full path name of the cluster.oracle.ini file. The default location is in the daemon home directory. The default location is recommended.
-V | -version Prints the release number of ttCWAdmin and exits.

Examples

To create and start an active standby pair managed by Oracle Clusterware, using the clusterDSN DSN, enter:

% ttCWAdmin -create -dsn clusterDSN
% ttCWAdmin -start -dsn clusterDSN

To stop and drop an active standby pair managed by Oracle Clusterware, using the clusterDSN DSN, enter:

% ttCWAdmin -stop -dsn clusterDSN
% ttCWAdmin -drop -dsn clusterDSN

Notes

When you use Oracle Clusterware with TimesTen, you cannot use these commands and SQL statements:

  • CREATE ACTIVE STANDBY PAIR, ALTER ACTIVE STANDBY PAIR and DROP ACTIVE STANDBY PAIR SQL statements.

  • The -cacheStart and -cacheStop options of the ttAdmin utility after the active standby pair has been created.

  • The -duplicate option of the ttRepAdmin utility.

  • The ttRepStart and ttRepStop built-in procedures.

  • The -repStart and -repStop options of the ttAdmin utility.

In addition, do not call ttDaemonAdmin -stop before calling ttCWAdmin -shutdown.

The TimesTen integration with Oracle Clusterware accomplishes these operations with the ttCWAdmin utility and the attributes in the cluster.oracle.ini file.

ttDaemonAdmin

Description

Starts and stops the TimesTen main daemon and Server.

Required privilege

This utility requires the instance administrator privilege.

Usage with TimesTen Scaleout

This utility is not supported in TimesTen Scaleout.

Syntax

ttDaemonAdmin {-h | -help | -?}
ttDaemonAdmin {-V | -version}
ttDaemonAdmin [-force] {-start | -stop | -restart}
ttDaemonAdmin [-startserver | -restartserver]
ttDaemonAdmin [-force] -stopserver
ttDaemonAdmin -verbose

Options

ttDaemonAdmin has the options:

Option Description
-h

-help

-?

Prints a usage message and exits.
-force Starts or stops the TimesTen main daemon, even when warnings are returned or with -stopserver immediately stops the server processes.
-restart Restarts the TimesTen main daemon.
-restartserver Restarts the TimesTen Server.
-start Starts the TimesTen main daemon.
-startserver Starts the TimesTen Server daemon.
-stop Stops the TimesTen main daemon.
-stopserver Stops the TimesTen Server daemon.

Without the -force option, client/server connections to TimesTen databases are gracefully disconnected after completing any request they may be processing, and then the server exits.

With the -force option, client/server connections to TimesTen databases are forcefully and immediately terminated, and then the server exits.

-V | -version Prints the release number of ttDaemonAdmin and exits.

Notes

Changes to the TimesTen Server options are temporary. To permanently set or disable the TimesTen Server options, you must change the options in the timesten.conf file.

Use the -force option with caution, as it may leave databases in a state where you must perform recovery procedures.

When you use this utility on Windows, you must be running with Windows Administrative privileges.When you stop the daemon (ttDaemonAdmin -stop), first stop all application connections to the database. This includes stopping the replication agent and the cache agent, if they are running. This decreases startup time when the daemon is restarted. In addition, not stopping application connections or agents can result in the database becoming in validated.

If the Oracle Clusterware agent is running, you must stop it on the local host before stopping the TimesTen main daemon (ttDaemonAdmin -stop). If you do not stop the Clusterware agent, the main daemon stops temporarily with this command, but then restarts. To stop the Oracle Clusterware agent, use:

ttCWAdmin -shutdown -hosts localhost

When you use this utility to restart the server, the TimesTen daemon reads the timesten.conf files to see if it has been changed since it was last read. If the file has been changed, TimesTen checks for the values of the timesten.conf options:

server_port server_shmipc server_shmsize noserverlog

See also


For a description of all daemon options and instructions for changing the timesten.conf file, see Chapter 1, "TimesTen Instance Configuration File" in this reference and "Managing TimesTen daemon attributes" in the Oracle TimesTen In-Memory Database Operations Guide.

ttDaemonLog

Description

The TimesTen daemon (referred to as the TimesTen Data Manager Service on Windows) and its subdaemons and agents write error and status messages to the following daemon logs:

  • A user error log that contains information you should be aware of, including actions you may need to take

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

The ttDaemonLog utility enables you to do the following:

  • Control the types of events and categories of messages that are reported in the user error log.

  • Display all messages or selected categories of messages from the log to the standard output.

Required privilege

This utility requires the instance administrator privilege.

Usage with TimesTen Scaleout

This utility is supported in TimesTen Scaleout.

Syntax

ttDaemonLog {-h | -help | -?}
ttDaemonLog {-V | -version}
ttDaemonLog [-show type] [-b | -r | -s] [-f] [-maxlines]
[-loglevel level [DSN | -connstr connection_string]]
[-[no]logcomponent component [DSN | -connstr connection_string]]
[-logreset] [-msg messagestring] [-setquiet | -setverbose]
[-file filename] [-facility name]
[-n computer]

Notes:

  • The -file and -facility options apply only on UNIX and Linux.

  • The -n option applies only on Windows and is not relevant in typical usage.

Options

ttDaemonLog has the options:

Option Description
-b Prints all TimesTen-generated log entries.
-f When the end of the log is reached, ttDaemonLog does not terminate but continues to execute, periodically polling the log to retrieve and display additional TimesTen log records. This is useful, for example, for generating a display of log data that is updated in real time.
-facility name Specifies the syslog facility name being used.

Note: This option applies only on UNIX.and Linux.

-file filename Specifies the file into which TimesTen logs messages.

If not specified, examine the system's syslog configuration to determine where TimesTen messages are being logged.

Note: This option applies only on UNIX and Linux.

-h

-help

-?

Shows ttDaemonLog usage information and exits.
-maxlines Maximum number of lines at end of the log to display Defaults to 40 lines if -f is specified. If 0 is specified, there is no maximum.
-logcomponent component

-nologcomponent component

By default, all categories of messages are logged, but you can use -logcomponent to specify a category to be logged, or -nologcomponent to specify a category to not be logged. You can specify only a single component, but can run ttDaemonLog with these options multiple times to determine the desired set of messages.

If a DSN or connection string is specified, the option applies only to the specified database. You can run ttDaemonLog multiple times to set these options for multiple databases.

Supported categories are:

ALL (default): For all messages.

CACHE: For messages from the cache agent, designated by CAC

DAEMON: For messages from the main daemon and subdaemons

DAEMONDBG: For additional information from the main daemon and subdaemons

GADMIN: For messages from grid administrator

GADMINCS: For messages from grid administrator client server

GCWRKR: For messages from grid client worker

GRID: For messages from a TimesTen Grid

GRWKR: For messages from the grid worker

REPLICATION: For messages from the replication agent, designated by REP

TTSTATS: For messages from ttStats

-loglevel level Specifies a cutoff for the level of messages that are logged in the daemon log. A lower value results in fewer messages. (For example, if you specify level 5, messages of level 1, 2, 3, 4, or 5 would be logged.) This option is typically relevant only for Customer Support use.

If a DSN or connection string is specified, the option applies only to that database.

-logreset Resets event logging parameters.
-msg messagestring Inserts the specified text into the TimesTen user log.
-n computer Displays the log from a different computer. Specify the Universal Naming Convention (UNC) name of the target computer.

Note: This option applies only on Windows and only if you are using the Windows Event Log for TimesTen logging, which is not typical usage.

-r Prints only the TimesTen replication agent log. (Same as -show replication.)
-s Prints only the TimesTen Server log. (Same as -show server.)
-setverbose

-setquiet

Enables (-setverbose) or disables (-setquiet) TimesTen verbose logging.
-show type When you use ttDaemonLog to display log messages to the standard output, you can use the -show option with one of the following types to limit the displayed log messages to that type only:

all (default): Shows all messages.

replication: Shows only log messages from replication agents. (Same as -r option.)

cache: Shows only log messages from cache agents.

server: Shows only log messages from TimesTen Server. (Same as -s option.)

Note: You cannot show a category whose logging has been disabled through -[no]logcomponent.

-V | -version Prints the release number of ttDaemonLog and exits.

Examples

By default, the ttDaemonLog utility logs messages and errors from all the TimesTen components. You can narrow the scope of what is written to the log by setting the -nologcomponent option. This option can be applied to selected databases or all databases.

To display all the output from the TimesTen daemon and server on your local computer:

% ttDaemonLog

To prevent messages and errors related to replication for all databases from being written to the log:

% ttDaemonLog -nologcomponent replication

To prevent messages and errors related to replication for the masterdsn database from being written to the log:

% ttDaemonLog -nologcomponent replication masterdsn

To prevent both replication and TimesTen Cache errors and messages from being written:

% ttDaemonLog -nologcomponent replication
% ttDaemonLog -nologcomponent cache

If, after disabling a component through the -nologcomponent option, you want to re-enable it, you can use the -logcomponent option. For example, after disabling messages for replication and TimesTen Cache as shown in the preceding example, you can re-enable replication messages as follows:

% ttDaemonLog -logcomponent replication

To re-enable logging for all TimesTen components, use the -logreset option:

% ttDaemonLog -logreset

The TimesTen Server generates a message each time an application connects to or disconnects from a client DSN if these messages were specified to be generated during installation. To display just the server log messages:

% ttDaemonLog -show server

To display just the replication agent messages:

% ttDaemonLog -show replication

To display just the cache agent messages:

% ttDaemonLog -show cache

To display all messages from the TimesTen processes:

% ttDaemonLog -show all

On UNIX and Linux systems, to direct logging to the local7 facility:

% ttDaemonLog -facility local7

Notes

While primarily intended for use by TimesTen Customer Support, this information may be useful to system administrators and developers.

This utility is supported only where the TimesTen Data Manager is installed.

To permanently set or disable verbose logging, change the options in the timesten.conf file. See "Error, warning, and informational messages" in the Oracle TimesTen In-Memory Database Operations Guide.

ttDestroy

Description

Destroys a database including all checkpoint files, transaction logs and daemon catalog entries (though not the DSNs).

Required privilege

This utility requires the instance administrator privilege.

Usage with TimesTen Scaleout

This utility is not supported in TimesTen Scaleout.

Syntax

ttDestroy {-h | -help | -?}
ttDestroy {-V | -version}
ttDestroy [[-wait] [-timeout secs]] [-force] {-connStr connection_string | 
 DSN | dspath}

Options

ttDestroy has the options:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN Specifies an ODBC data source name of the database to be destroyed.
dspath The fully qualified name of the database to be destroyed.

This is not the DSN associated with the connection but the fully qualified database path name associated with the database as specified in the DataStore= parameter of the database's ODBC definition.

For example, for a database consisting of files/home/payroll/2011.ds0, /home/payroll/2011.ds1, and several transaction log files /home/payroll/2011.logn,dspath is /home/payroll/2011.

-h

-help

-?

Prints a usage message and exits.
-force Destroy even if files are from an incompatible version or a different instance of TimesTen.
-timeout seconds Indicates the time in seconds that ttDestroy should wait. If no timeout value is supplied, TimesTen waits five seconds before retrying the destroy operation.
-V | -version Prints the release number of ttDestroy and exits.
-wait Causes ttDestroy to continually retry the destroy operation until it is successful, in those situations where the destroy fails due to some temporary condition, such as when the database is in use.

Examples

% ttDestroy /users/pat/TimesTen/Daily/F112697

Notes

Using ttDestroy is the only way to delete a database completely and safely. Do not remove database checkpoint or transaction log files manually.

This utility is supported only where the TimesTen Data Manager is installed.

ttDestroy does not perform cleanup of Oracle database objects from autorefresh or AWT cache groups. If there are autorefresh or AWT cache groups in the database, execute the cachecleanup.sql script to clean up the cache objects in the Oracle database for that particular database, to generate Oracle SQL to perform cleanup after the database has been destroyed.

ttInstallationCheck

Description

The ttInstallationCheck utility examines all files in an installation of TimesTen and will generate a signature for the installation. The signatures from two installations can be compared; if there are any differences in the installations the signatures differ.

If any of the following have occurred, the signature reported is different:

  • Contents of any file have changed

  • Name of any file has changed

  • New files are present in the installation

  • Files have been removed from the installation

  • Files have incorrect permissions

Required privilege

This utility requires the instance administrator privilege.

Usage with TimesTen Scaleout

This utility is supported in TimesTen Scaleout.

Syntax

ttInstallationCheck [-h | -help | -?]
ttInstallationCheck [-v | -verbose | -?]

ttInstallationCheck [-install_dir path] [-generate]

Options

ttInstallationCheck has the options:

Option Description
-h

-help

-?

Displays help information.
-generate Generate and print the checksum for the installation, but do not verify.
-install_dir path Specifies the directory in which TimesTen is installed.
-v | -verbose Displays extra installation information.

ttInstallDSN

Description

The ttInstallDSN utility, for TimesTen Scaleout, generates a Windows client DSN for each of one or more entries in the provided input file and installs them into the ODBC control panel as system DSNs. Use the ttGridAdmin gridClientExport command to generate the input file.

Required privilege

This utility requires the instance administrator privilege.

Usage with TimesTen Scaleout

This utility is for use with TimesTen Scaleout.

Syntax

ttInstallDSN [-h | -help | -?]

ttInstallDSN [-f file] [Client_DSN_Name | -a | -l] [-force]

Options

ttInstallDSN has the options:

Option Description
-h

-help

-?

Displays help information.
-f file
[Client_DSN_Name | -a | -l]
Specifies the full path and name of a file (generated by ttGridAdmin gridClientExport) containing one or more DSN definitions. Also typically provide one of the following:
  • The name of the DSN you want to install from the input file.

  • The -a option to install all DSNs from the input file.

  • The -l option to simply list all the DSNs in the input file. None is installed.

If you do not specify -f, the default file is sys.odbc.ini in the current directory.

If you do not specify one of the three items listed above, the default behavior is to list the DSNs in the file and ask which you want to install.

-force If there are already DSNs in the Windows registry, this allows them to be overridden by the specified DSNs.

Without this option, if there are already DSNs in the Windows registry, the utility issues a warning and cannot install new ones.


Examples

In this example, there are already DSNs in the Windows registry. The user first tries without -force and is issued a warning, so then uses -force.

C:\mydir> ttinstalldsn.bat -f c:\temp\sys.odbc.ini
--------------------------------
.ini File: c:\temp\sys.odbc.ini
--------------------------------
Found the following DSNs in available 'c:\temp\sys.odbc.ini'.
0 : database1CS
[ Please select the DSN to be imported: ]
0
Warning: The following DSNs already existed and were not added:
        database1CS

C:\mydir> ttinstalldsn.bat -f c:\temp\sys.odbc.ini -force
--------------------------------
.ini File: c:\temp\sys.odbc.ini
--------------------------------
Found the following DSNs in available 'c:\temp\sys.odbc.ini'.
0 : database1CS
[ Please select the DSN to be imported: ]
0
Modifying DSN 'database1CS'.

ttInstanceCreate

Description

The ttInstanceCreate utility creates a new TimesTen instance.

You can specify options in one of these ways:

  • On the command line.

  • In a file.

  • Interactively as the utility runs.

If you do not specify options on the command line, or if the only options used are -record and/or -verbose, ttInstanceCreate runs in an interactive mode, prompting the Instance Administrator for information.

If you specify the -batch option on the command line, ttInstanceCreate runs in interactive mode, and attempts to answer any questions by fetching the answers from a recorded batch file, generated by a previous run that specified the -record option. If the answer to a question is not present in the batch file, the utility prompts the Instance Administrator to answer the question interactively.

If you specify other options on the command line, they are used as the source of information. The ttInstanceCreate utility does not prompt the user for unknown values.

Usage with TimesTen Scaleout

This utility is supported in TimesTen Scaleout but is used only to create the first management instance. (Create additional instances using ttGridAdmin instanceCreate.)

Required privilege

This utility requires the instance administrator privilege.

Syntax

ttInstanceCreate {-h | -help | -?} [-verbose]

To create an instance for TimesTen Classic, use:

ttInstanceCreate [-name name] [-location path] [-daemonport port] [-csport port]
 [-start] [-tnsadmin path] [-force] [-record filename] [-strict] [-verbose]

To create the first management instance for a grid in TimesTen Scaleout, use:

ttInstanceCreate [-name name] [-location path] [-daemonport port] [-csport port]
 [-grid] [-force] [-record filename] [-strict] [-verbose]

To create a client-only instance, use:

ttInstanceCreate [-name name] [-location path] [-clientonly] [-serverhost host]
 [-force] [-record filename] [-strict] [-verbose]
ttInstanceCreate [-batch [filename]]

Options

ttInstanceCreate has the options:

Option Description
-h

-help

-?

Displays help information.
-name name Specifies the name of the instance to be created.
-location path Specifies the path of the directory in which the instance is to be created. This directory must already exist. A new directory is created in the existing directory. The name of the new directory is specified in the -name option. This new directory is the new instance home.
-force Specifies that an instance directory specified with the -instance option is to be overwritten if it already exists. The directory is overwritten only if:

1. The specified instance directory is empty, or

2. The specified instance directory contains a conf/timesten.conf file.

-record filename Records responses to installation questions into the file specified by filename. The file then can be specified as the parameter to the -batch option.
-batch [filename] Specifies the file to be used to provide input to the ttInstanceCreate utility. If not specified, no input file is used.
-strict Ensures that the platform running the command is supported and prevents the instance creation if it is not.
-tnsadmin location If using Cache, this option configures the location to be used for the TNS_ADMIN setting.
-verbose Displays additional information during the operation of the utility.
-grid Indicates that the instance should be configured for use with TimesTen Scaleout.
-clientonly Specifies that the instance is client only. Most other arguments are not supported for a client only instance.

Use these options for full instances with client and server capabilities:

Option Description
-daemonport daemon_port The port number on which the TimesTen daemon process (timestend) for this instance listens. This port must not already be in use by any other application or instance on the system.
-csport port The value to be used for the TimesTen client/server port number for this instance. If not specified, the default is daemonport + 1.

Use this option for instances intended for TimesTen Classic:

Option Description
-start Specifies that the instance should be started after it is created.

Use this option for client-only instances:

Option Description
-serverhost host For TimesTen Client, specify the host for the TimesTen Server. The value is the logical name, domain name, or IP address of the computer where the TimesTen Server is running. For a full instance, this defaults to the host where you are creating the instance.

ttInstanceDestroy

Description

Use the ttInstanceDestroy utility to destroy an existing instance.

The instance to be destroyed is chosen based on the current setting of the TIMESTEN_HOME environment variable.

Required privilege

This utility requires the instance administrator privilege.

Usage with TimesTen Scaleout

This utility is supported in TimesTen Scaleout., but in most circumstances use ttGridAdmin instanceDelete.

Syntax

ttInstanceDestroy {-h | -help | -?} [-verbose]

ttInstanceDestroy [-force]

Options

ttInstanceDestroy has the options:

Option Description
-h

-help

-?

Displays help information.
-force If specified, you are not asked to confirm operations.

If -force is not specified:

  • You are reminded that if you installed the startup scripts for this instance as root, you must uninstall them as root with the setuproot -uninstall command.

  • You are asked for confirmation to destroy the instance.

  • You are asked for confirmation to remove the info and conf directories.

-verbose Displays additional TimesTen installation information.

ttInstanceModify

Description

Use the ttInstanceModify utility to modify certain attributes of an instance, including:

  • The installation associated with this instance.

  • The daemon and server port numbers.

  • The TNS_ADMIN for the instance

  • The configuration of TimesTen Replication with Oracle Clusterware for this instance.

The instance that is modified is the one that $TIMESTEN_HOME references.

If you do not specify any options for this utility, ttInstanceModify displays the current value of each attribute and a prompt that allows you to keep the value or change it.

If you change any of the settings, the utility:

  • Shuts down the TimesTen daemon for the instance.

  • Edits the timesten.conf file in the timesten_home/conf directory.

  • Starts the TimesTen main daemon for the instance.

Required privilege

This utility requires the instance administrator privilege.

Usage with TimesTen Scaleout

This utility is supported in TimesTen Scaleout, but in most circumstances use ttGridAdmin instanceModify.

Syntax

ttInstanceModify [-h | -help | -?] [-verbose]

ttInstanceModify [-port daemonport] [-serverport cs_port] [-tnsadmin location] [-crs] [-install installation_dir]

Options

ttInstanceModify has the options:

Option Description
-h

-help

-?

Displays help information.
-daemonport daemonport Updates the TimesTen main daemon port number.
-crs Creates or modifies the instance's Oracle Clusterware configuration.
-install installation_dir Changes the installation that the instance uses.

You can use the -install option to associate the instance with a different TimesTen installation. Typically, this is used to upgrade the instance to a new maintenance or patch release.

This option cannot be used to upgrade to a new major release, for example to upgrade from 11.2.2. to 18.1.

-tnsadmin location Updates the instance's TNS_ADMIN setting (for cache).

ttIsql

Description

You can execute SQL statements and call TimesTen built-in procedures from ttIsql. You can execute SQL interactively from the command line. For a detailed description on running SQL from ttIsql, use the -helpfull option. In addition, you can call a TimesTen built-in procedure with call procedure-name.

The ttIsql command attempts to cancel an ongoing ODBC function when the user presses Ctrl-C.

On UNIX and Linux systems, this utility is supported for TimesTen Data Manager DSNs. Use ttIsqlCS for client/server DSNs.

The ttIsql utility starts with AUTOCOMMIT turned on, even when running a script. You can turn AUTOCOMMIT off and back on as necessary.

For more details on the ttIsql utility, see the chapter "Using the ttIsql Utility" in the Oracle TimesTen In-Memory Database Operations Guide

Required privilege

This utility requires no privileges.

Usage with TimesTen Scaleout

This utility is supported in TimesTen Scaleout.

Syntax

ttIsql {-h | -help | -? | -helpcmds | - helpfull}
ttIsql {-V | -version}
ttIsql [-f inputFile] [-v verbosity] [-e commands | sql_statement] 
[-interactive] [-N ncharEncoding] [-wait] {-connStr connection_string | DSN}

Options

ttIsql has the options:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN Specifies an ODBC data source name of the database to be connected.
-e commands Specifies a semicolon separated list of ttIsql commands to execute on startup.
-f filename Read SQL statements from filename.
-h

-help

-?

Prints a usage message and exits.
-helpcmds Prints a short list of the interactive commands.
-helpfull Prints a full description of the interactive commands.
-interactive Forces interactive mode. This is useful when running from an emacs comint buffer.
-N ncharEncoding Specifies the character encoding method for NCHAR output.

Valid values are LOCALE or ASCII. LOCALE (the default) sets the output format to the locale-based setting.

If no value is specified, TimesTen uses the system's native language characters.

-V | -version Prints the release number of ttIsql and exits.
-v verbosity Specifies the verbosity level. One of:

0 - Shows error information only. If all commands succeed, there is no output.

1 - The basic output generated by commands is displayed.

2 (default) - Same as level 1, plus it shows more detailed results of commands.At this level simplified SQL error and information messages are displayed. In addition, ttIsql commands that are read from an external file are echoed to the display.

3 - Same as level 2, with more detailed error and information messages.

4 - Same as level 3, plus complete error and information messages are displayed. Also displayed are messages about prepared commands, "success" messages for each command that succeeded and content of XLA records.

-wait Waits until successful connect.

Commands

Also see the list of ttIsql "Set/show attributes".

Boolean commands can accept the values "ON" and "OFF" or "1" and "0".

ttIsql has the commands:

Command Description
accept variable[NUM[BER]| CHAR |BINARY_FLOAT | BINARY_DOUBLE] [DEF[AULT]default_value] [PROMPT prompt_text | NOPR[OMPT]] [HIDE] Gets input from a user and DEFINES the variable. If a type is specified then it validates for that type. The default (enclosed in quotes) is assigned if the user just presses enter. The prompt is displayed before waiting for input (or can be suppressed). The HIDE option stops the terminal from displaying the entered text (for passwords).

The prompt is displayed before waiting for input, if specified without the HIDE option. The HIDE option stops the terminal from displaying the entered text.

allfunctions [[owner_name_pattern.] table_name_pattern] Lists, in a single column, the names of all the PL/SQL functions that match the given pattern selected from SYS.ALL_OBJECTS. When a pattern is missing, the pattern defaults to "%".

If passthrough is enabled, lists PL/SQL functions matching the pattern in the Oracle database.

See the functions command.

allindexes [[owner_name_pattern.] table_name_pattern] Describes the indexes that it finds on the tables that match the input pattern selected from SYS.ALL_OBJECTS. When a pattern is missing, the patterns default to "%".

If passthrough is enabled, lists indexes on tables matching the pattern in the Oracle database.

See the indexes command.

allpackages [[owner_name_pattern.] table_name_pattern] Lists, in a single column, the names of all the PL/SQL packages that match the given pattern selected from SYS.ALL_OBJECTS. When a pattern is missing, the patterns default to "%".

If passthrough is enabled, lists PL/SQL packages matching the pattern in the Oracle database.

See the packages command.

allprocedures [[owner_name_pattern.] procedure_name_ pattern] Lists, in a single column, the names of all the PL/SQL procedures that match the given pattern selected from SYS.ALL_OBJECTS. When a pattern is missing, the pattern defaults to "%".

If passthrough is enabled, lists PL/SQL procedures matching the pattern in the Oracle database.

See the procedures command.

allsequences [[owner_name_pattern.] table_name_pattern]] Lists, in a single column, the names of all the sequences that match the given pattern selected from SYS.ALL_OBJECTS. When a pattern is missing, the pattern defaults to "%".

If passthrough is enabled, lists sequences on tables matching the pattern in the Oracle database.

See the sequences command.

allsynonyms [[schema_pattern.] object_pattern]] Lists, in a single column, the names of all synonyms that match the given pattern. When a pattern is missing, the pattern defaults to "%".

If passthrough is enabled, lists synonyms on tables matching the pattern in the Oracle database.

See the synonyms command.

alltables [[owner_name_pattern.] table_name_pattern]] Lists, in a single column, the names of all the tables that match the given pattern selected from SYS.ALL_OBJECTS. When a pattern is missing, the pattern defaults to "%".

If passthrough is enabled, lists tables matching the pattern in the Oracle database.

See the tables command.

allviews [[owner_name_pattern.] view_name_pattern]] Lists, in a single column, the names of all the views that match the specified pattern selected from SYS.ALL_OBJECTS. When a pattern is missing, the pattern defaults to "%".

If passthrough is enabled, lists views matching the pattern in the Oracle database.

builtins [builtin_name_ pattern] Lists, in a single column, the names of all the TimesTen built-in procedures that match the given pattern. When the pattern is missing, the pattern defaults to "%".

See the procedures command.

bye

exit

Exits ttIsql.
cachegroups [[cache_group_owner_pattern. cache_group_name_pattern]] Reports information on cache groups defined in the currently connected data source, including the state of any terminated databases that contain autorefresh cache groups.

If the optional argument is not specified then information on all cache groups in the current data source is reported.

cachesqlget

[ASYNCONOUS_WRITETOUGH | INCREMENTAL_AUTOREFRESH] [[cache_group_owner.]cache_group_name] {INSTALL | UNINSTALL} [filename]

Generates an Oracle SQL*Plus compatible script for the installation or uninstallation of Oracle database objects associated with a readonly cache group, a user managed cache group with incremental autorefresh or an AWT cache group.

If INSTALL is specified, the Oracle SQL statement to install the Oracle database objects is generated.

If UNINSTALL is specified, the Oracle SQL statement used to remove the Oracle objects is generated. If a cache group is not specified with UNINSTALL, a SQL statement to remove all Oracle database objects in the autorefresh user's account is generated.

If the optional filename argument is included, the generated SQL statement is saved to the specified external file. If the external file exists, its contents are destroyed before writing to the file.

cd directory Changes the current directory.

This is the equivalent of the cd command in interactive shells.

After changing to the directory directory, the define alias _CWD is be set to this directory.

Subsequent commands that rely on relative paths will use this directory as the starting point.

Examples of affected commands are spool, run, savehistory, host, and edit

clearhistory Clears the history buffer. Also see history and savehistory.
clienttimeout

[timeeout seconds]

Sets the client timeout value in seconds for the current connection. If no value is specified, displays the current value.

See "Choose SQL and PL/SQL timeout values" in Oracle TimesTen In-Memory Database Operations Guide for information about the relationship between the client timeout, SQL timeout, and PL/SQL timeout.

close [connect_id.] command_id]

closeall

Closes the prepared command identified by connection name connect_id and command ID command_id. If command_id is not specified, closes the most recent command. If closeall is selected, closes all currently open prepared commands.

Use prepare to create the prepared command.

cmdcache [[by {sqlcmdid |querytext|owner}] query_subsstring] Displays the contents of the TimesTen SQL command cache.

Specify the sqlcmdid, querytext or owner column and query substring to search for a specific portion of a SQL query. If no column is specified, searches the querytext column.

If passthrough is enabled, the command ID is not passed through to the Oracle database.

commit Commits the current transaction (durably if Durability=1 for the connection).
commitdurable Commits the current transaction durably.
compact Compacts the database.
compare varA VarB Compares the values of two variables and reports if they are different. The first difference is reported.
connect[connection_string |[[DSN][as]connid [adding] [connection_string | DSN][as connid] Connects to the database with the specified ODBC connection_string.

If no password is supplied in this format, ttIsql prompts for the password.

If no user is given, ttIsql attempts to connect using the user name of the current user as indicated by the operating system.

If as connid is specified, you can explicitly name the connection. The connid must be only alphanumeric characters, is case sensitive, must start with an alpha character and can only be a maximum of 30 characters in length. The name of connid is automatically supplied to the ConnectionName general connection attribute. If the connect fails, the current connection is set to a special reserved connection named "none," which is never connected to anything.

When adding is specified, it refers to creating a new connection to the DSN specified by DSN or by the connection string.

createandloadfromoraquery [owner_name.]table_name [num_threads] query Takes a table name, the number of threads for parallel load and an Oracle SELECT statement.

Creates the table in TimesTen if the table does not exist. Then, loads the table with the query result from the Oracle database. If the command creates the table, the table column names and types are derived from the query result.

Notes:

  • 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.

  • The query cannot have any parameter bindings.

  • Any unsupported column types result in a warning being logged. The output issues a comment for the unsupported column data type.

  • If you do not supply a value for num_threads, defaults to four threads.

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

  • You must rollback or commit after executing this operation.

  • Also see the NOTES section in the description of the built-in procedure ttLoadFromOracle.

Required Privileges:

Requires INSERT privilege on the table specified. Also, requires the CREATE TABLE privilege if the table does not exist. The Oracle session user must have all required privileges to execute the query on the Oracle database.

define name [= value] Defines a string substitution alias.

If no value is provided, ttIsql displays the current definition for the specified name.

You must set define on to enable command substitution. See "Set/show attributes".

describe [[owner_pattern.] name_pattern | procedure_name_pattern |sql_statement | [connect_id.]command_id |*] List information on tables, synonyms, views, materialized views, sequences, cache groups, PL/SQL functions, PL/SQL procedures, PL/SQL packages and TimesTen built-in procedures in that order when the argument is [owner_pattern.]name_pattern. Otherwise lists the specific objects that match the given pattern.

Describes the parameters and results columns when the argument is sql_statement.

If passthrough is set to 3, lists information about the same types of objects in the Oracle database.

If * is specified, reports the prepared statements for all connections.

If the table or materialized view being described is in a TimesTen Scaleout database, this command reports the distribution scheme.

When describing cache groups, reports information on cache groups defined in the currently connected data source, including the state of any terminated databases that contain autorefresh cache groups.

If the command is describing a sequence in a TimesTen Scaleout database, displays the batch field.

The command alias is desc.

Use free to release the prepared command.

disconnect [all] Disconnects from the database. If all is specified, disconnects and closes all connections. When disconnect finishes, the current connection is set to the reserved connection named "none."
dssize [k|m|g|t] Prints size information in KB, MB, GB or TB. For TimesTen Scaleout, provides the size of the element.

The default is MB. The output indicates the unit returned.

e: msg

PROMPT msg

Echoes the specified messages, terminated by the end of the line. A semicolon is not required to end the line. Messages are not echoed if verbosity is set to 0.
edit [ file | !history_search_command ] You can use the ttIsql edit command to edit a file or edit ttIsql commands in a text editor. The ttIsql edit command starts a text editor such as emacs, gedit, or vi.

If TimesTen does not find an exact file match for the specified file parameter, it searches for file.sql. If neither file exists, ttIsql starts the editor with the file file.

You can edit a SQL statement that is stored in the history list of the current ttIsql session. When calling the ttIsql edit command specify the ! character followed by the number of the command or a search string.

If you execute the ttIsql edit command with a history_search_command parameter, ttIsql executes the contents of the file after you exit the text editor. The contents of the file are executed as a single ttIsql command. If you do not want to execute the contents of the file, delete the contents of the file and save the file before you exit the editor.

You can only use one parameter at a time. The history_search_command parameter is defined as the ! character followed by the number of the command or a search string. If you do not specify a ! character, the ttIsql edit command interprets the parameter as file. If you do not specify a parameter or specify !!, the last ttIsql command is edited.

You can specify the default editor by defining the ttIsql _EDITOR define alias. The following example sets the default editor to vi:

Command> DEFINE _EDITOR=vi

If you do not define the _EDITOR define alias, ttIsql uses the editor specified by the VISUAL environment variable. If the _EDITOR define alias and the VISUAL environment variables are not set, ttIsql uses the editor specified by the EDITOR environment variable. When _EDITOR, VISUAL, and EDITOR are not set, vi is used for UNIX and Linux systems and notepad.exe is used for Windows.

For more details, see "Using the ttIsql edit command" in the Oracle TimesTen In-Memory Database Operations Guide.

exec [connect_id.] command_id] | PLSQLSTMT Executes the prepared command command_id o

n connection connect_id or executes a PL/SQL statement.

The connect_id optionally names a ttIsql connection and command_id is an integer from 1 to 255.If PLSQLSTMT is supplied, ttIsql prepends the statement with BEGIN and appends the statement with END, thus allowing the PL/SQL statement to execute.

If no argument is supplied, executes the most recent command.

Use free to release the prepared command.

execandfetch [connect_id.]command_id] Executes and fetches all results from prepared command command_id on connection connect_id. If command_id is not specified, executes and fetches all results from the most recent command.

Use free to release the prepared command.

explain [plan for] {[ Connid.]ttisqlcmdid | sqlcmdid sqlcmdid | sqlstmt |!history} Explains the plan for the specified SQL statement, including prepared ttIsql statements, specified in the ttisqlcmdid argument, or the sqlcmdid argument.

A digit that is not qualified with the sqlcmdid argument, is interpreted as a ttIsql prepared statement ID.

If passthrough is enabled, the command ID is not passed through to the Oracle database.

fetchall [connect_id.]command_id] Fetches all results from prepared command command_id on connection connect_id.

If command_id is not specified, fetches all results from the most recent command. The command must already have been executed using exec.

Use free to release the prepared command.

fetchnext num_rows
[
connect_id.]command_id]
Fetches up to num_rows rows from prepared command command_id on connection connect_id.

If command_id is not specified, fetches num_rows rows from the most recent command. The command must already have been executed using exec.

Use free to release the prepared command.

fetchone [connect_id.]command_id] Fetches one result from prepared command command_id on connection connect_id.

If command_id is not specified, fetches one result from the most recent command. The command must already have been executed using exec.

Use free to release the prepared command.

free [[connect_name.]connect_id.] command_id] Frees prepared command command_id on connection connect_id.

If no command is specified, frees the most recent command.

Use prepare to create the prepared command.

functions [object_name_pattern] Lists, in a single column, the names of PL/SQL functions owned by the current user that match the given pattern. When a name pattern is missing, the pattern defaults to %.

If passthrough is enabled, lists PL/SQL functions matching the pattern in the Oracle database.

See the allfunctions command.

grid stmt Performs that specified statement on a grid database.
grid monitor [optional_monitor_column] Formats the contents of the SYS.GV$MONITOR table for easy viewing.

If the optional_monitor_column is specified, only that column is displayed.

This command is not supported in TimesTen Classic.

help [command [command ...]| all | comments | attributes] Prints brief or detailed help information for commands.

If specific commands are given as arguments then detailed help for each command is printed.

If you do not know the exact name of a command, try typing just a few characters that may be part of the command name. ttIsql searches and displays help for any commands that include the characters.

If all is given as an argument then detailed help for all commands is printed.

If comments is given as an argument then information on using ttIsql comments within scripts is printed.

If attributes is given as an argument then information on the set/show attributes is printed.

If no argument is given then brief help information for all commands is printed.

history [-all] [-h] [-r] [num_commands] ttIsql implements a csh-like command history.

Lists previously executed commands. The num_commands parameter specifies the number of commands to list. If the num_commands parameter is omitted then the previous 10 commands are listed by default.

The output of this command omits consecutive duplicate commands. Use the -all option to include the consecutive duplicate commands.

Use the -h option to omit the command numbers.

Use the -r parameter to list the commands in reverse order.

The history list stores up to 100 of the most recently executed commands.

See the savehistory and clearhistorycommand.

host os_command Executes an operating system command. The command is executed in the same console as ttIsql.

This command sets the environment variable TT_CONNSTR in the environment of the process it creates.

The value of the variable is the connection string of the current connection.

To see the exit status of the command, use the define command with _EXIT_STATUS.

if-then-else The if-then-else command construct enables you to implement conditional branching logic in a ttIsql session. For more details, see "Syntax for the IF-THEN-ELSE command construct".
indexes [table_name_pattern] Describes the indexes that it finds on the tables owned by the current user that match the input pattern. When a name pattern is missing, the pattern defaults to %.

If passthrough is enabled, lists indexes on tables matching the pattern in the Oracle database.

See the allindexes command.

monitor [optional_monitor_column] Formats the contents of the SYS.MONITOR table for easy viewing.

If the optional_monitor_column is specified, only that column is displayed.

packages [object_name_pattern] Lists, in a single column, the names of PL/SQL packages owned by the current user that match the given pattern. When a name pattern is missing, the pattern defaults to %.

If passthrough is enabled, lists PL/SQL packages matching the pattern in the Oracle database.

See the allpackages command.

prepare [[connid.]command_id]SQL_Statement Prepares the specified SQL statement. If the command_id argument is not specified the command_id is assigned automatically.

The command_id argument can take a value between 0 and 255 inclusive. If connid is specified, switches to the given connection ID. The connid must be only alphanumeric characters and are case insensitive.

Use free to release the prepared command.

print [variable] Prints the value of the specified bind variable or all variables if no variable is specified. If the variable is a REF CURSOR, then the results are fetched and printed.
procedures [procedure_name_ pattern] Lists, in a single column, the names of PL/SQL procedures owned by the current user that match the given pattern. When a name pattern is missing, the pattern defaults to %.

If passthrough is enabled, lists PL/SQL procedures matching the pattern in the Oracle database.

See the builtins and allprocedures commands.

quit Exits ttIsql.
remark msg Specifies that the message on the line should be treated as a comment. When rem or remark is the first word on the line, ttIsql reads the line and ignores it.
repschemes [[scheme_owner_pattern.] scheme_name_pattern] Reports information on replication schemes defined in the currently connected data source. This information describes all elements associated with the replication schemes.

If the optional argument is not specified then information on all replication schemes defined in the current data source is reported.

retryconnect [0|1] Disables(0) or enables(1) the wait for connection retry feature.

If the connection retry feature is enabled then connection attempts to a data source that initially fail due to a temporary situation are retried until the connection attempt succeeds. For example, if data source recovery is in progress when attempting to connect, the connection retry feature causes the connect command to continue to attempt a connection until the recovery process is complete.

If the optional argument is omitted then the connection retry feature is enabled by default.

rollback Rolls back the current transaction. AutoCommit must be off. This command does not stop TimesTen Cache operations on the Oracle database, including passthrough statements, flushing, manual loading, manual refreshing, synchronous writethrough, propagating and dynamic loading.
rpad varname desiredlength paddingstring The RPAD command acts like the SQL function RPAD()with some limitations:
  • The desired length is in bytes, not characters.

  • The padding string is not expanded for string literal escapes, such as unicode escapes.

  • The padding string can contain partial unicode characters or full unicode characters and it may split the padding string in the middle of a multibyte character or surrogate pair.

Only variables that are character based (CHAR, VARCHAR) can be padded with the RPAD command.

run filename [arguments]|

start filename [arguments...]|

@@ filename [arguments...]|

@ filename [arguments...]

Reads and executes SQL commands from filename. The run command can be nested up to five levels.

The @@ command is identical to the @ command only if the file is specified with an absolute path.

When you specify @ with a relative path, the path is relative to the startup directory of ttIsql. When you specify @@, the path is relative to the currently running input file. Therefore @@ is useful when used in a script that must call other scripts. It does not matter what directory the invoker of ttIsql is in when the script is run.

See "Example parameters of command string substitution" for a description of arguments.

savehistory

[-all [-h] [-a | -f] outputfile

Writes the history buffer to the specified outputfile.

Consecutive duplicate commands are omitted.

Use the -all option to include the consecutive duplicate commands.

Use the -h option to omit the command numbers.

Use -a to append to an existing output file. Use -f to force the overwriting of an existing output file.

See the clearhistory and history commands.

sequences [sequence_name_pattern] Lists, in a single column, the names of sequences owned by the current user that match the given pattern. When a name pattern is missing, the pattern defaults to %.

If passthrough is enabled, lists sequences on tables matching the pattern in the Oracle database.

See the allsequences command.

set attribute [value] Sets the specified set/show attribute to the specified value.

If no value is specified, displays the current value of the specified attribute.

For a description of accepted attributes, see "Set/show attributes".

setjoinorder tblNames [...] Specifies the join order for the optimizer. AutoCommit must be off.
setuseindex index_name,correlation_name,

{0 | 1} [;...]

Sets the index hint for the query optimizer.
setvariable variable_name := value Sets the value of a scalar bind variable or an element of an array bind variable. For example: setvariable myvar := 'TimesTen'; There must be a space on either side of the assignment operator (:=).

For more information, see "Declaring and setting bind variables" in the Oracle TimesTen In-Memory Database Operations Guide.

show {all | attribute} Displays the value for the specified set/show attribute or displays all the attributes.

For a description of accepted attributes, see "Set/show attributes".

showjoinorder {0 | 1} Enables or disables the storing of join orders.

0 - Disables the storing of join orders

1 - Enables the storing of join orders.

Call the ttoptshowjoinorder built-in procedure explicitly to display the join order after SELECT, UPDATE, DELETE or MERGE SQL statements.

sleep [n] Suspends execution for n seconds. If n is not specified then execution is suspended for 1 second.
spool filename [option | OFF] Writes a copy of the terminal output to the file filename.

If you do not provide an extension to filename, the file name has the extension .lst. The available options include:

CREATE - Creates a new file.

APPEND - Appends output to an existing file.

REPLACE (default) - Overwrites an existing file.

When you specify the value OFF, the spooling behavior is terminated and the output file is closed.

If you specify a spool command while one is running, the active spool is closed and a new files is opened.

sqlcolumns [owner_name_pattern.]table_name_pattern Prints results of an ODBC call to SQLColumns.
sqlgetinfo infotype Prints results of an ODBC call to SQLGetInfo.
sqlstatistics [[owner_name_pattern.]table_name_pattern] Prints results of an ODBC call to SQLStatistics.
sqltables[[owner_name_pattern.]table_name_pattern] Prints results of a call to SQLTables. The pattern is a string containing an underscore ( _ ) to match any single character or a percent sign (%) to match zero or more characters.
statsclear [[owner_name.]table_name] Clears statistics for specified table (or all tables if no table is specified).
statsestimate [[owner_name.]table_name] {n rows | p percent} Estimates statistics for specified table (or all tables if no table is specified).

If you estimate statistics with an empty table list, statistics on system tables are updated also, if you have privileges to update the system tables.

statsupdate [[owner_name_pattern.] table_name_pattern] Updates statistics for specified table (or all tables if no table is specified).

If tblName is an empty string, statistics are estimated for all the current user's tables in the database.

synonyms [[schema_pattern.] object_pattern]] Lists, in a single column, the names of synonyms owned by the current user that match the given pattern. When a name pattern is missing, the pattern defaults to %.

If passthrough to an Oracle database is enabled, lists synonyms on tables matching the pattern in the Oracle database.

See the allsynonyms command.

tables [table_name_pattern]] Lists, in a single column, the names of tables owned by the current user that match the given pattern. When a name pattern is missing, the pattern defaults to %.

If passthrough to an Oracle database is enabled, lists tables matching the pattern in the Oracle database.

See the alltables command.

tablesize [[owner_name_pattern.] table_name_pattern]] For each table that matches the pattern, lists the contents of the ALL_TAB_SIZES view.

See the ttComputeTabSizes built-in procedure.

undefine name Undefines a string substitution alias.
unsetjoinorder Clears join order advice to optimizer. AutoCommit must be off.
unsetuseindex Clears the index hint for the query optimizer.
use [conn_id] Displays the list of current connections and their IDs. If connid is specified, switches to the given connection ID.

To use the name of the first connection, you can specify con0 for the conn_id, rather than specifying the full original connection name. You cannot explicitly name a connection con0. If the first connection is disconnected, con0 refers to the connection none.

If use fails to locate the connection id, the current connection is set to the reserved connection named "none."

See the connect command.

variable [variable_name [data_type] [:= value]]

The syntax for binding multiple values to an array using the variable command is as follows:

variable array_name 
'[' array_size ']'
 data_type(n):= 
'[' value1, ... valuex ']'
Declares a bind variable that can be referenced in a statement or displays the definition of the variable if the type is missing. Type can be one of the following: (n), NUMBER, CHAR(n), NCHAR(n), VARCHAR2(n), NVARCHAR2(n), BLOB, CLOB, NCLOB, or REFCURSOR. If only (n) is supplied, it is assumed to be VARCHAR2 (n).

Assigns a value to a single variable or multiple values if the data type is an array. You can assign a value later with the setvariable command.

For more information, see "Declaring and setting bind variables" in the Oracle TimesTen In-Memory Database Operations Guide.

version Reports version information.
views [table_name_pattern] Lists, in a single column, the names of views owned by the current user that match the given pattern. When a name pattern is missing, the pattern defaults to "%".

If passthrough to an Oracle database is enabled, lists views matching the pattern in the Oracle database.

See the allviews command.

waitfor expected_result timeoutseconds sqlstatement Runs the given statement once a second until the query returns the expected result or a timeout occurs. The query must have only one column and must return exactly one row. Any errors in the query terminate the loop.
waitforresult expected_result timeoutseconds searchrow searchcol sqlstatement Similar to the waitfor command, except that the result can have 1 or more columns. Also, the result can return 0 rows.

Runs the given statement once a second until the query returns the expected result or a timeout occurs. The searchrow and searchcol arguments indicate the ordinal position (1..N) of which row or column should be considered. Use '*' in searchrow or searchcol to indicate any row or column of the result set could have the expected value. See the waitfor command.

whenever sqlerror Provide direction on how to handle errors when in ttIsql. For more details, see "Syntax for the WHENEVER SQLERROR command".
xlabookmarkdelete id Deletes a persistent XLA bookmark.

If a bookmark to delete is not specified then the status of all current XLA bookmarks is reported.

Also see "ttXlaDeleteBookmark" in Oracle TimesTen In-Memory Database C Developer's Guide.

Requires ADMIN privilege or object ownership.


Syntax for the IF-THEN-ELSE command construct

This section provides the syntax for the IF-THEN-ELSE construct. For more details on using the IF-THEN-ELSE command construct, see "Conditional control with the IF-THEN-ELSE command construct" in the Oracle TimesTen In-Memory Database Operations Guide.

IF [NOT] 
   { Literal1 | :BindVariable1 } 
   { =  | IN } 
   { Literal2 | :BindVariable2 | SelectStatement } 
 THEN "ThenCommands" 
 [ ELSE "ElseCommands" ] ;

The ttIsql IF-THEN-ELSE command has the parameters:

Parameter Description
IF The IF command must end in a semicolon (;).

The IF command fails if improper syntax is given, the BindVariables do not exist or the SELECT statement fails to execute or does not return just a single column.

NOT Using NOT reverses the desired result of the condition.
Literal1, Literal2 A value that can be part of a comparison.
BindVariable1, BindVariable2 A bind variable is equivalent to a parameter. You can use the :BindVariable1 notation for passing bind variables into this construct. The variable can be created and set using the variable or setvariable ttIsql commands.
= | IN You can use the IN operator only with the SelectStatement. You can use the IN operator with zero or more returned rows. You can use the equal (=) operator only with a single returned row.
SelectStatement A provided SELECT statement must start with SELECT. The SELECT statement can return only one column. In addition, it can return only one row when the equal (=) operator is provided.

The SelectStatement is not available if you are not connected to the database.

ThenCommands, ElseCommands All commands in the THEN or ELSE clauses must be delimited by a semicolon and cannot contain embedded double quotes. These clauses can conditionally execute ttIsql commands, such as host or run, which cannot be executed through PL/SQL. You can use the CALL statement within the THEN or ELSE clauses. You cannot use PL/SQL blocks.

Restrictions for the IF-THEN-ELSE construct are as follows:

  • You cannot compare variables of the LOB data type.

  • The values are compared case-sensitive with strcmp. A character padded value might not match a VARCHAR2 because of the padding.

Syntax for the WHENEVER SQLERROR command

Execute the WHENEVER SQLERROR command to prescribe what to do when a SQL error occurs. For more details and examples on how to use the WHENEVER SQLERROR command, see "Error recovery with WHENEVER SQLERROR" command in the Oracle TimesTen In-Memory Database Operations Guide.

WHENEVER SQLERROR { ExitClause | ContinueClause | SUPPRESS |
     SLEEP Number | ExecuteClause }

When you specify EXIT, always exit ttIsql if an error occurs. ExitClause is as follows:

EXIT [ SUCCESS | FAILURE | WARNING | Number | :BindVariable ]
 [ COMMIT | COMMIT ALL | ROLLBACK ]

When you specify CONTINUE, ttIsql continues to the next command, even if an error occurs. ContinueClause is as follows:

CONTINUE [ COMMIT | COMMIT ALL | ROLLBACK | NONE ]

Execute specified commands before continuing. ExecuteClause is as follows:

EXECUTE "Cmd1;Cmd2;...;"

The WHENEVER SQLERROR command options are as follows:

  • EXIT: Always exit ttIsql if an error occurs. Specify what is performed before ttIsql exits with one of the following. SUCCESS is the default option for EXIT.

    • SUCCESS or FAILURE or WARNING: Return SUCCESS (value 0), FAILURE (value 1), or WARNING (value 2) to the operating system after ttIsql exits for any SQL error.

    • Number: Specify a number from 0 to 255 that is returned to the operating system as a return code. Once ttIsql exits, you can retrieve the error return code with the appropriate operating system commands. For example, use echo $status in the C shell (csh) or echo $? in the Bourne shell (sh) to display the return code.

      The return code can be retrieved and processed within batch command files to programmatically detect and respond to unexpected events.

    • :BindVariable: Returns the value in a bind variable that was previously created in ttIsql with the variable command. The value of the variable at the time of the error is returned to the operating system in the same manner as the Number option.

      Note:

      The bind variable used within the WHENEVER SQLERROR command cannot be defined as a LOB, REFCURSOR, or any array data type.

    In addition, you can specify whether to commit or rollback all changes before exiting ttIsql.

    • COMMIT: Executes a COMMIT and saves changes only in the current connection before exiting. The other connections exit with the normal disconnect processing, which rolls back any uncommitted changes.

    • COMMIT ALL: Executes a COMMIT and saves changes in all connections before exiting.

    • ROLLBACK: Before exiting, executes a ROLLBACK and abandons changes in the current connection and, by default, in all other connections. The other connections exit with the normal disconnect processing, which automatically rolls back any uncommitted changes.

  • CONTINUE: Do not exit if an error occurs. The SQL error is displayed, but the error does not cause ttIsql to exit. The following options enable you to specify what is done before continuing to the next ttIsql command:

    • NONE: This is the default. Take no action before continuing.

    • COMMIT: Executes a COMMIT and saves changes in the current connection before continuing.

    • COMMIT ALL: Executes a COMMIT and saves changes in all connections before continuing.

    • ROLLBACK: Before continuing, executes a ROLLBACK and abandons changes in the current connection and, by default, in all other connections. The other connections exit with the normal disconnect processing, which automatically rolls back any uncommitted changes.

  • SUPPRESS: Do not show any error messages and continue.

  • SLEEP: Sleep for a specified number of seconds before continuing.

  • EXECUTE: Execute specified commands before continuing. Each command is separated from the other commands by a semicolon (;). If any command triggers additional errors, those errors may cause additional actions that could potentially result in a looping condition.

Set/show attributes

Also see the list of ttIsql "Commands". Some commands appear here as attributes of the set command. In that case, you can use them with or without the set command.

Boolean attributes can accept the values "ON" and "OFF" or "1" and "0".

The ttIsql set command has the attributes:

Attribute Description
all With show command only. Displays the setting of all the ttIsql commands.
autocommit [1|0] Turns AutoCommit off and on. If no argument is given, displays the current setting.
autovariables [1|0] Turns autovariables off and on. TimesTen creates an automatic bind variable with the same name as each column in the last fetched row. You can use an automatic bind variable in the same manner of any bind variable. For more information, see "Automatically creating bind variables for retrieved columns" in the Oracle TimesTen In-Memory Database Operations Guide.
columnlabels [0 | 1] Turns the columnlabels feature off (0) or on (1).

If no argument is specified, the current value of columnlabels is displayed.

The initial value of columnlabels is off (0) after connecting to a data source.

When the value is on (1), the column names are displayed before the SQL results.

You can also enable this attribute without specifying the set command.

connstr Prints the connection string returned from the driver from the SQLDriverConnect call. This is the same string printed when ttIsql successfully connects to a database.
define [&|c|on|off] Sets the character used to prefix substitution variables to c.

ON or OFF controls whether ttIsql scans commands for substitution variables and replaces them with their values. ON changes the value of c back to the default &. (It does not change it to the most recently used character.)

Default value for ttIsql is OFF (no variable substitution). See "Example parameters using "variable" and "print"" for an explanation of the default.

dynamicloadenable [1|0] 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.
echo [on | off] With the set command, prints the commands listed in a run, @ or @@ script to the terminal as they are executed.

If off, the output of the commands is printed but the commands themselves are not printed.

editline [0 | 1] Turns the editline function off and on. By default, editline is on.

If editline is turned off, the backspace character deletes full characters, but the rest of editline capabilities are unavailable.

err | error |errors [objecttype [schema.]name] With the show command, displays error information about the given PL/SQL object.If no object type or object name is supplied, ttIsql assumes the PL/SQL object that you last attempted to create and retrieves the errors for that object. If no errors associated with the given object are found, or there was no previous PL/SQL DDL, then ttIsql displays "No errors."
feedback [on | off] rows Controls the display of status messages after statement execution.

When rows is specified, if the statement affected more than the specified number of rows, then the feedback indicates the number of affected rows. If the number of rows affected is less than the specified threshold, the number of rows is not printed.Feedback is not provided for tables, views, sequences, materialized views or indexes. It is available for PL/SQL objects.

isolation [{READ_COMMITTED | 1}| {SERIALIZABLE | 0}] Sets isolation level. If no argument is supplied, displays the current value.

You can also enable this attribute without specifying the set command.

loboffset n Specifies the offset into the LOB that ttIsql should use as the starting point when it prints the resulting value of a LOB. For example if the value of the LOB is ABCEDFG, and the offset is 4, ttIsql prints DEFG, skipping the first 3 bytes.

The behavior is the same as LOBOFFSET in SQL*Plus.

long n Reports or controls the maximum number of characters for CLOB or BLOB data or the maximum number of bytes for BLOB data that are displayed when fetched or printed.

The default value is 80.

The command setting is valid for all connections in a session.

longchunksize n Specifies the size of the chunk that ttIsql uses to get LOB data.
multipleconnections [1 | ON] mc [1 | ON] Reports or enables handling of multiple connections.By default, ttIsql enables the user to have one open connection at a time.

If the argument 1 or ON is specified the prompt is changed to include the current connection and all multiple connection features are enabled.

If no value is supplied, the command displays the value of the multipleconnections setting.

You can also enable this attribute without specifying the set command.

ncharencoding [encoding] Specifies the character encoding method for NCHAR output. Valid values are LOCALE or ASCII.

LOCALE sets the output format to the locale-based setting.

If no value is specified, TimesTen uses the system's native language characters.

You can also enable this attribute without specifying the set command.

nulldisplaystring "string" Sets or shows the string to be displayed when the NULL value appears in a result set.

The option does not affect the SQL user, only the display of NULL in results sets.

optfirstrow [1|0] Enables or disables First Row Optimization.

If the optional argument is omitted, First Row Optimization is enabled.

You can also enable this attribute without specifying the set command.

optprofile Prints the current optimizer flag settings and join order.

This attribute cannot be used with the set command.

passthrough [0|1|2|3] Sets the TimesTen Cache passthrough level for the current transaction. Because AutoCommit must be off to execute this command, ttIsql temporarily turns off AutoCommit when setting the passthrough level.

0 - SQL statements are executed only against TimesTen.

1 - Statements other than INSERT, DELETE or UPDATE and DDL are passed through if they generate a syntax error in TimesTen or if one or more tables referenced within the statement are not in TimesTen. All INSERT, DELETE and UPDATE statements are passed through if the target table cannot be found in TimesTen. DDL statements are not passed through.

2 - Same as 1, plus any INSERT, UPDATE and DELETE statement performed on READONLY cache group tables is passed through.

3 - All SQL statements, except COMMIT and ROLLBACK, and TimesTen built-in procedures that set or get optimizer flags are passed through. COMMIT and ROLLBACK are executed on both TimesTen and the Oracle database.

If no optional argument is supplied, the current setting is displayed.

After the transaction, the passthrough value is reset to the value defined in the connection string or in the DSN or the default setting if no value was supplied to either.

You can also enable this attribute without specifying the set command.

Note: Some Oracle objects may not be described by ttIsql.

prefetchcount [prefetch_count_size] Sets the prefetch count size for the current connection. If the optional argument is omitted, the current prefetch count size is reported. Setting the prefetch count size can improve result set fetch performance. The prefetch_count_size argument can take an integer value between 0 and 128 inclusive.

When you set the prefetch count to 0, TimesTen uses a default prefetch count. The default prefetch value is isolation level specific. In read committed isolation mode, the default value is 5. In serializable isolation mode, the default value is 128.

You can also enable this attribute without specifying the set command.

prompt [string] Replaces the Command> prompt with the specified string.

To specify a prompt with spaces, you must quote the string. The leading and trailing quotes are removed.

A prompt can have a string format specifier (%c) embedded. The %c is expanded with the name of the current connection.

querythreshold [seconds] With the show command, displays the value of the Query Threshold first connection attribute.

With the set command, modifies the value of the QueryThreshold first connection attribute that was set in the connection string or odbc.ini file.

Specify a value in seconds that indicates the number of seconds that a query can execute before TimesTen writes a warning to the daemon log.

rowdelimiters [0|off] | [ {1|on} [begin [ end]]] Controls the row delimiters in result sets. When on, user queries have the row delimited with < and > unless begin and end are specified. Not all result sets are affected by this control.

The default is on.

serveroutput [on | off] With the set command set to on, after each executed SQL statement, displays any available output. This output is available for debugging I/O purposes, if the PL/SQL DBMS_OUTPUT package is set to store the output so that it can be retrieved using this command.

The default is off, (no server output is displayed) as performance may be slower when using this command. If you set serveroutput to on, TimesTen uses an unlimited buffer size.

DBMS_OUTPUT.ENABLE is per connection, therefore set serveroutput on affects the current connection only.

This command is not supported in passthrough mode.

showcurrenttime [1|true|on] | [0|false|off] Enable or disable printing of the current wall clock time.
showplan [0 | 1] Enables (1) or disables (0) the display of plans for selects/updates/deletes in this transaction. If the argument is omitted, the display of plans is enabled. AutoCommit must be off.

You can also enable this attribute without specifying the set command.

sqlquerytimeout [seconds] Specifies the number of seconds to wait for a SQL statement to execute before returning to the application for all subsequent calls.

If no time or 0 seconds is specified, displays the current timeout value.

The value of seconds must be equal to or greater than 0.This attribute does not stop TimesTen Cache operations on the Oracle database, including passthrough statements, flushing, manual loading, manual refreshing, synchronous writethrough, propagating, and dynamic loading.

You can also enable this attribute without specifying the set command.

See "Choose SQL and PL/SQL timeout values" in Oracle TimesTen In-Memory Database Operations Guide for information about the relationship between the client timeout, SQL timeout, and PL/SQL timeout.

timing [1|0] Enables or disables printing of query timing.

You can also enable this attribute without specifying the set command.

tryhash [1|0] Enables or disables use of hash indexes by the optimizer at the transaction level. AutoCommit must be off.

You can also enable this attribute without specifying the set command.

trymaterialize [1|0] Enables or disables materialization by the optimizer at the transaction level. AutoCommit must be off.

You can also enable this attribute without specifying the set command.

trymergejoin [1|0] Enables or disables use of merge joins by the optimizer at the transaction level. AutoCommit must be off.

You can also enable this attribute without specifying the set command.

trynestedloopjoin [1|0] Enables or disables use of nested loop joins by the optimizer at the transaction level. AutoCommit must be off.

You can also enable this attribute without specifying the set command.

tryrowid [1|0] Enables or disables rowID scan hint by the optimizer at the transaction level.
tryrowlocks [1|0] Enables or disables use of row-level locking by the optimizer at the transaction level. AutoCommit must be off.

You can also enable this attribute without specifying the set command.

tryserial [1|0] Enables or disables use of serial scans by the optimizer at the transaction level. AutoCommit must be off.

You can also enable this attribute without specifying the set command.

trytmphash [1|0] Enables or disables use of temporary hashes by the optimizer at the transaction level. AutoCommit must be off.

You can also enable this attribute without specifying the set command.

trytbllocks [1|0] Enables or disables use of table-level locking by the optimizer at the transaction level. AutoCommit must be off.

You can also set this attribute without specifying the set command.

trytmptable [1|0] Enables or disables use of temporary tables by the optimizer at the transaction level. AutoCommit must be off.

You can also enable this attribute without specifying the set command.

trytmprange [1|0] Enables or disables use of temporary range indexes by the optimizer at the transaction level. AutoCommit must be off.

You can also enable this attribute without specifying the set command.

tryrange [1|0] Enables or disables use of range indexes by the optimizer at the transaction level. AutoCommit must be off.

You can also enable this attribute without specifying the set command.

verbosity [level] Changes the verbosity level. The verbosity level argument can be an integer value of 0, 1, 2, 3 or 4. If the optional argument is omitted then the current verbosity level is reported.

You can also enable this attribute without specifying the set command.

vertical [{0 | off} | {1 | on} | statement] Sets or displays the current value of the vertical setting. The default value is 0 (off).

If statement is supplied, the command temporarily turns vertical on for the given statement. This form is only useful when the vertical flag is off.

The vertical setting controls the display format of result sets. When set, the result sets are displayed in a vertical format where each column is on a separate line and is displayed with a column label.

You can also enable this attribute without specifying the set command.


Comment syntax

The types of comment markers are:

-- [comment_text]
/* [comment_text] */

The C-style comments, delineated by "/*" at the beginning and "*/" at the end, can span multiple lines.

The comments delimited by the

-

character should not span multiple lines. If a comment marker is encountered while processing a line, ttIsql ignores the remainder of the line.

'--' at the beginning of a line is considered a SQL comment. The line is considered a comment and no part of the line is included in the processing of the SQL statement. A line that begins with '--+' is interpreted as a segment of a SQL statement.

The comment markers can work in the middle of a line.

Example:

monitor; /*this is a comment after a ttIsql command*/

Command shortcuts

By default, ttIsql supports keystroke shortcuts when entering commands. To turn this feature off, use:

Command> set editline=0;

The ttIsql keystroke shortcuts are:

Keystroke Action
Left Arrow Moves the insertion point left (back).
Right Arrow Moves the insertion point right (forward).
Up Arrow Scroll to the command before the one being displayed. Places the cursor at the end of the line.

If the command being added to the history is identical to the most recently added command, it is skipped.

Up Arrow <RETURN> Scrolls to the PL/SQL block before the one being displayed.
Down Arrow Scrolls to a more recent command history item and puts the cursor at the end of the line.

If the command being added to the history is identical to the most recently added command, it is skipped.

Down Arrow <RETURN> Scrolls to the next PL/SQL block after the one being displayed.
Ctrl-A Moves the insertion point to the beginning of the line.
Ctrl-E Moves the insertion point to the end of the line.
Ctrl-K "Kill" - Saves and erases the characters on the command line from the current position to the end of the line.
Ctrl-Y "Yank"- Restores the characters previously saved and inserts them at the current insertion point.
Ctrl-F Forward character - move forward one character. (See Right Arrow.)
Ctrl-B Backward character - moved back one character. (See Left Arrow.)
Ctrl-P Previous history. (See Up Arrow.)
Ctrl-N Next history. (See Down Arrow.)

Parameters

With dynamic parameters, you are prompted for input for each parameter on a separate line. Values for parameters are specified the same way literals are specified in SQL.

SQL_TIMESTAMP columns can be added using dynamic parameters. (For example, values like '1998-09-08 12:1212').

Parameter values must be terminated with a semicolon character.

The possible types of values that can be entered are:

  • Numeric literals. Example: 1234.5

  • Time, date or timestamp literals within single quotation marks. Examples:

    '12:30:00''2000-10-29''2000-10-29 12:30:00''2000-10-29 12:30:00.123456'
    
  • Unicode string literals within single quotation marks preceded by 'N'. Example: N'abc'

  • A NULL value. Example: NULL

  • The '*' character that indicates that the parameter input process should be stopped. Example: *

  • The '?' character prints the parameter input help information. Example: ?

Examples

Example parameters of command string substitution

Command> select * from dual where :a > 100 and :b < 100;
Type '?' for help on entering parameter values.
Type '*' to end prompting and abort the command.
Type '-' to leave the parameter unbound.
Type '/;' to leave the remaining parameters unbound and execute the command.

Enter Parameter 1 'A' (NUMBER) > 110
Enter Parameter 2 'B' (NUMBER) > 99
< X >
1 row found.
Command> var a number;
         exec :a := 110;

PL/SQL procedure successfully completed.

Command> print a
A                    : 110
Command> var b number;
         exec :b := 99;

PL/SQL procedure successfully completed.

Command> select * from dual where :a > 100 and :b < 100;
< X >
1 row found.
Command> print
A                    : 110
B                    : 99
Command> select * from dual where :a > 100 and :b < 100 and :c > 0;
Enter Parameter 3 'C' (NUMBER) > 1
< X >
1 row found.

Default options

You can set the default command-line options by exporting an environment variable called TTISQL. The value of the TTISQL environment variable is a string with the same syntax requirements as the TTISQL command line. If the same option is present in the TTISQL environment variable and the command line then the command line version always takes precedence.

Examples

Execute commands from ttIsql.inp.

% ttIsql -f ttIsql.inp

Enable all output. Connect to DSN RunData and create the database if it does not exist.

% ttIsql -v 4 -connStr "DSN=RunData;AutoCreate=1"

Print the interactive commands.

% ttIsql -helpcmds

Print the full help text.

% ttIsql -helpfull

Display the setting for all ttIsql set/show attributes:

Command> show all; 
Connection independent attribute values: 

autoprint = 0 (OFF)
columnlabels = 0 (OFF)
define = 0 (OFF)
echo 1 (ON)
FEEDBACK ON
multipleconnections =0 (OFF)
ncharencoding = LOCALE (US7ASCII)
prompt = 'COMMAND>'
timing = 0 (OFF)
verbosity = 2
vertrical = 0 (OFF)

Connection specific attribute values:

autocommit = 1 (ON)
Client timeout = 0
Connection String DSN=repdb1_1121;UID=timesten; DataStore=/DS/repdb1_1121;
 DatabaseCharacterSet=AL32UTF8; ConnectionCharacterSet=US7ASCII;
 DRIVER=/sw/tthome/install/lib/libtten.so; PermSize=20;TempSize=20; 
No errors.
isolation = READ_COMMITTED
Prefetch count = 5
Query threshold = 0 seconds (no threshold)
Query timeout = 0 seconds (no timeout)
serveroutput OFF

Current Optimizer Settings:
    Scan: 1
    Hash: 1
    Range: 1
    TmpHash: 1
    TmpTable: 1
    NestedLoop: 1
    MergeJoin: 1
    GenPlan: 0
    TblLock: 1
    RowLock: 1
    Rowid: 1
    FirstRow: 1
    IndexedOr: 1
    PassThrough: 0
    BranchAndBound: 1
    ForceCompile: 0
    CrViewSemCheck: 1
    ShowJoinOrder: 0
    CrViewSemCheck: 1
    UserBoyerMooreStringSearch: 0
    DynamicLoadEnable: 1
    DynamicLoadErrorMode: 0
    NoRemRowIdOpt: 0

Current Join Order:
    <>

Command

Prepare and execute an SQL statement.

% ttIsql -connStr "DSN=RunData"
ttIsql (c) 1996-2011, TimesTen, Inc. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
(Default setting AutoCommit=1)
Command> prepare 1 SELECT * FROM my_table;
         exec 1;
         fetchall;

Example vertical command:

Command> call ttlogholds;
< 0, 265352, Checkpoint , DS.ds0 >
< 0, 265408, Checkpoint , DS.ds1 >
2 rows found.

Command> vertical call ttlogholds;

 HOLDLFN:       0

 HOLDLFO:       265352
 TYPE:          Checkpoint
 DESCRIPTION:   DS.ds0
 HOLDLFN:       0

 HOLDLFO:       265408
 TYPE:          Checkpoint
 DESCRIPTION:   DS.ds1
 2 rows found.

Command>

To create a new user, use single quotes around the password name for an internal user:

% ttIsql -connStr "DSN=RunData"
ttIsql (c) 1996-2000, TimesTen, Inc. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
(Default setting AutoCommit=1)
Command> CREATE USER terry IDENDTIFIED BY `secret';

To delete the XLA bookmark mybookmark, use:

% ttIsql -connStr "DSN=RunData"
ttIsql (c) 1996-2000, TimesTen, Inc. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql. (Default setting
AutoCommit=1) 
Command> xlabookmarkdelete;
XLA Bookmark: mybookmark
 Read Log File:  0
 Read Offset:    268288
 Purge Log File: 0
 Purge Offset:   268288
 PID:            2004
 In Use:         No
1 bookmark found.

Command> xlabookmarkdelete mybookmark;

Command> xlabookmarkdelete;

0 bookmarks found.

To run a SELECT query until the result "X" is returned or until the query times out at 10 seconds, use:

% ttIsql -connStr "DSN=RunData"
ttIsql (c) 1996-2000, TimesTen, Inc. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql. (Default setting
AutoCommit=1) 
Command> waitfor X 10 select * from dual;

Example of managing XLA bookmarks

You can use the xlabookmarkdelete command to both check the status of the current XLA bookmarks and delete them. This command requires XLA privilege or object ownership.

For example, when running the XLA application, 'xlaSimple', you can check the bookmark status by entering:

Command> xlabookmarkdelete;

XLA Bookmark: xlaSimple
  Read Log File: 0
  Read Offset: 630000
  Purge Log File: 0
  Purge Offset: 629960
  PID: 2808
  In Use: No
1 bookmark found.

To delete the bookmark xlaSimple, enter:

Command> xlabookmarkdelete xlaSimple;

Example parameters using "variable" and "print"

Substitution in ttIsql is modeled after substitution in SQL*Plus. To enable the substitution feature, use set define on or set define substitution_char'. The substitution character when the user specifies 'on' is '&'. It is disabled with 'set define off'.By default, substitution is off. The default is off because the & choice for substitution character conflicts with TimesTen's use of ampersand as the BIT AND operator.When enabled, the alphanumeric identifier following the substitution character is replace by the value assigned to that identifier. When disabled, the expansion is not performed.New definitions can be defined even when substitution is off. You can use the define command to list the definitions ttIsql predefines.

Command> show define
define = 0 (OFF)
Command> define
DEFINE            _PID = "9042" (CHAR)
DEFINE      _O_VERSION = "TimesTen Release 11.2.1.0.0" (CHAR)
Command> select '&_O_VERSION' from dual;
< &_O_VERSION >
1 row found.
Command> set define on
         SELECT '&_O_VERSION' FROM DUAL;
< TimesTen Release 11.2.1.0.0 >
1 row found.

If the value is not defined, ttIsql prompts you for the value.When prompting with only one substitution character specified before the identifier, the identifier is defined only for the life of the one statement.If two substitution characters are used and the value is prompted, it acts as if you have explicitly defined the identifier.

Command> SELECT '&a' FROM DUAL;
Enter value for a> hi
< hi >
1 row found.
Command> define a
symbol a is UNDEFINED
The command failed.
Command> SELECT '&&a' FROM DUAL;
Enter value for a> hi there
< hi there >
1 row found.
Command> define a
DEFINE               a = "hi there" (CHAR)

Additional definitions are created with the define command:

Command> define tblname = sys.dual
         define tblname
DEFINE         tblname = "sys.dual" (CHAR)
Command> select * from &tblname;
< X >
1 row found.

Arguments to the run command are automatically defined to '&1', '&2', ... when you add them to the run or @ (and @@) commands:Given this script:

CREATE TABLE &1 ( a INT PRIMARY KEY, b CHAR(10) );
INSERT INTO &1 VALUES (1, '&2');
INSERT INTO &1 VALUES (2, '&3');SELECT * FROM &1;

Use the script:

Command> SET DEFINE ON
Command> @POPULATE mytable Joe Bob;

CREATE TABLE &1 ( a INT PRIMARY KEY, b CHAR(10) );
INSERT INTO &1 VALUES (1, '&2');
1 row inserted.

INSERT INTO &1 VALUES (2, '&3');
1 row inserted.

SELECT * FROM &1;
< 1, Joe        >
< 2, Bob        >
2 rows found.

This example uses the variable command. It deletes an employee from the employee table. Declare empid and name as variables with the same data types as employee_id and last_name. Delete the row, returning employee_id and last_name into the variables. Verify that the correct row was deleted.

Command> VARIABLE empid NUMBER(6) NOT NULL;
         VARIABLE name VARCHAR2(25) INLINE NOT NULL;
         DELETE FROM employees WHERE last_name='Ernst'
         RETURNING employee_id, last_name INTO :empid,:name;
1 row deleted.
Command> PRINT empid name;
EMPID                : 104
NAME                 : Ernst

Notes

The ttIsql utility supports only generic REF CURSOR variables, not specific REF CURSOR types.

The ttIsql utility command line accepts multiline PL/SQL statements, such as anonymous blocks, that are terminated with the "/" on it's own line. For example:

Command> set serveroutput on
         BEGIN
         dbms_ouput.put_line ('Hi There');
         END;
         /
Hi There

PL/SQL block successfully executed.

Command>

For UTF-8, NCHAR values are converted to UTF-8 encoding and then output.

For ASCII, those NCHAR values that correspond to ASCII characters are output as ASCII. For those NCHAR values outside of the ASCII range, the escaped Unicode format is used. For example:

U+3042 HIRAGANA LETTER A

is output as

Command> SELECT c1 FROM t1;
< a\u3042 >

NCHAR parameters must be entered as ASCII N-quoted literals:

Command> prepare SELECT * FROM t1 WHERE c1 = ?; 
         exec;

Type '?;' for help on entering parameter values. Type '*;' to stop the parameter entry process.

Enter Parameter 1> N'XY';

On Windows, this utility is supported for all TimesTen Data Manager and Client DSNs.

ttMigrate

Description

Performs one of these operations:

  • Saves a migrate object from a TimesTen database into a binary data file.

  • Restores the migrate object from the binary data file into a TimesTen database.

  • Examines the contents of a binary data file created by this utility.

Migrated objects include:

  • Tables

  • Cache group definitions

  • Views and materialized views

  • Sequences

  • Replication schemes

  • Users and user information

Use the ttMigrate utility when upgrading major release versions of TimesTen, since database checkpoint and log files are not compatible between major releases. See "Moving to a different major release of TimesTen Classic" in Oracle TimesTen In-Memory Database Installation, Migration, and Upgrade Guide.

When you migrate a database from Release 7.0 or earlier, TimesTen does not migrate users and user privileges.

Binary files produced by this utility are platform-dependent. For example a binary file produced on Windows must be restored on Windows. In client/server mode, use ttMigrateCS (UNIX and Linux systems only) utility to copy data between platforms.

By default, ttMigrate restores the database using one thread. During restoration, you can specify the -numThreads option to restore the data files using multiple threads, thus potentially improving performance.

Binary files produced by this utility are platform-specific. For example, a binary file produced on Windows 64-bit must be restored on Windows 64-bit. To copy data between platforms or bit levels, use ttMigrate with the ttMigrateCS client/server version (or Windows equivalent). On Windows systems, you can do the equivalent by using ttMigrate to connect to the source system from the target system through a defined TimesTen client DSN.

On UNIX and Linux systems, this utility is supported for TimesTen Data Manager DSNs. For TimesTen Client DSNs, use the utility ttMigrateCS.

Required privilege

This utility requires various privileges depending on the options specified. In general, a user must be the instance administrator or have the ADMIN privilege to use this utility.

Using the -r option requires the instance administrator privilege, as it generally creates a database. If the database has been created at the time this option is used, it requires CREATE ANY TABLE, CREATE ANY SEQUENCE, CREATE ANY VIEW, CREATE ANY MATERIALIZED VIEW, CREATE ANY CACHE GROUP, CREATE ANY INDEX privileges and ADMIN if autocreation of users is necessary. If the database is involved in replication or TimesTen Cache, then CACHE_MANAGER is also required.

Using the -c option to capture an entire database requires the ADMIN privilege. If the database is involved in replication or TimesTen Cache, then CACHE_MANAGER is also required. Using the -c option to capture a subset of the database objects (tables, views, materialized views, cache groups, sequences) requires SELECT ANY TABLE and SELECT ANY SEQUENCE privileges.

Usage with TimesTen Scaleout

This utility is supported for migrating from a TimesTen Classic to a TimesTen Scaleout. After the initial migration, this utility is not supported.

Syntax

ttMigrate {-h | -help | -?}
ttMigrate {-V | -version}

To create or append a binary data file, use:

ttMigrate {-a | -c} [-v verbosity] [-nf] [-nr] [-fixNaN] [-saveAsCharset charset] 
[-relaxedUpgrade | -exactUpgrade]
[-activeDML | -noActiveDML] 
{DSN | -connStr connection_string} data file [[objectOwner.]objectName...]

To restore a database from a binary data file created by this utility, use:

ttMigrate -r  [-C ckptFreq] [-v level] [-nf] [-nr] [-fixNaN] [-numThreads n] [-updateStats | -estimateStats percent] [-relaxedUpgrade | -exactUpgrade] 
[-inline rule] [-noCharsetConversion] [-cacheUid uid [-cachePwd pwd]]
 [-autorefreshPaused] [-restorePublicPrivs] [-localhost host] 
[-resizeHashIndexes] 
{DSN | -connstr connection_string} dataFile [objectOwner.objectName...]

To list or display the contents of a binary data file created by this utility, use:

ttMigrate {-l | -L | -d | -D} dataFile [[objectOwner.]objectName...]

Options

Note:

The append (-a) or create (-c) modes, the list (-l/-L) or describe (-d/-D) modes and the restore (-r) modes are exclusive of each other. You cannot specify any of these options on the same line as any other of these options.

ttMigrate has the options:.

Option Description
-a Selects append mode: Appends data to a pre-existing binary data file, that was originally created using ttMigrate -c. See "Create mode (-c) and Append mode (-a)" for more details.
-activeDML |-noActiveDML Saves all tables in a foreign key hierarchy in a single transaction, maintaining consistency between these tables when there is active DML during the ttMigrate -c operation.

If -noActiveDML is specified, ttMigrate saves each table in its own transaction, regardless of whether it is the parent or the child of a foreign key. Use this option if there is no active DML during the ttMigrate -c operation.

-noActiveDML is the default.

-c Create mode: Creates an original binary data file. See "Create mode (-c) and Append mode (-a)" for more details.
-cacheUid The cache administration user ID to use when restoring asynchronous writethrough cache groups and cache groups with the AUTOREFRESH attribute.
-cachePwd The cache administration password to use when restoring autorefresh and asynchronous writethrough cache groups and cache groups with the AUTOREFRESH attribute.

If the cache administration user ID is provided on the command line but the cache administration password is not, then ttMigrate prompts for the password.

-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
-d Selects Describe mode. Displays a short description of the objects in the data file. See "Describe mode (-d)" for more details.
-D Selects Long-describe mode. Displays a full description of the objects in the data file. See "Long-describe mode (-D)" for more details.
dataFile The path name of the data file to which migrate objects are to be saved or from which migrate objects are to be restored.
DSN Specifies an ODBC data source name of the database to be migrated.
-estimateStats percent Specifies that ttMigrate should estimate statistics on restored tables and materialized views for the specified percentage of rows. Legal values for percentRows are 0 to 100, inclusive.

ttMigrate ignores this option when the -c or -a options are given.

If you specify both -estimateStats and -updateStats, statistics on restored tables are updated, not estimated.

Use of this flag may improve the performance of materialized view restoration and may also improve the performance of queries on the restored tables and views.

-fixNaN Converts all NaN, Inf and -Inf values found in migrate objects to 0.0. This is useful for migrating data into releases of TimesTen that do not support the NaN, Inf and -Inf values.
-h

-help

-?

Prints a usage message and exits.
-inline rule Indicates the rule to be used for converting variable-length columns to INLINE in restore mode. The value for rule is one of:

preserve - ttMigrate preserves the original INLINE attribute of each column. This is the default, and it is required if -exactUpgrade is used.

dsDefault - ttMigrate uses the database's default rule for setting the INLINE attribute of restored columns.

maxlen - ttMigrate restores as INLINE all variable-length columns with length <= maxlen and restores as NOT INLINE all variable-length columns with length greater than maxlen.

If maxlen is 0 then all columns are restored as NOT INLINE.

INLINE variable-length columns cannot successfully be replicated to NOT INLINE columns.

-l Selects List mode. Lists the names of database objects in the specified data file. See "List mode (-l) and Long-list mode (-L)" for more details.
-L Selects Long-list mode. Lists the names of database objects in the specified data file and other details about the database objects. See "List mode (-l) and Long-list mode (-L)" for more details.
-r Selects Restore mode. Restores a database from a binary data file created by this utility. See "Restore mode (-r)" for more details.
name The name of the database object(s) to be saved or restored.
-nf Specifies that ttMigrate should not save or restore foreign key information when saving or restoring ordinary (non-cached) tables.
-nr Specifies that ttMigrate should not save or restore table rows when saving or restoring ordinary (non-cached) tables.
-relaxedUpgrade Save or restore the tables in a way that is compatible with a replication scheme that uses TABLE DEFINITION CHECKING RELAXED.

ttMigrate ignores this option when the -a option is given.

This option should not be used in combination with a replication scheme that uses TABLE DEFINITION CHECKING EXACT, or else replication may no longer work.

The default is -exactUpgrade.

-numThreads n Specifies the number of threads to use while restoring a database files. If unspecified, ttMigrate uses one thread to restore objects from the data file.

Valid values are 1 through 32.

owner The owner of a migrate object.
-exactUpgrade Save or restore the tables in a way that is compatible with a replication scheme that uses TABLE DEFINITION CHECKING EXACT.

ttMigrate ignores this option when the -c or -a options are given.

This option should not be used in combination with a replication scheme that uses TABLE DEFINITION CHECKING RELAXED, or else replication may no longer work. INLINE variable-length columns cannot successfully be replicated to NOT INLINE columns.

This is the default.

-saveAsCharset

charset

Saves an object in the specified connection character set. ttMigrate returns an informational message if the connection character set is different from the database character set.

If this option is not set, by default, ttMigrate saves the migrated object in the database character set.

-updateStats Specifies that ttMigrate should update statistics on restored tables and materialized views.

ttMigrate ignores this option when the -c or -a options are given.

If you specify both -estimateStats and -updateStats, statistics on restored tables are updated, not estimated.

Use of this flag may improve the performance of materialized view restoration and may also improve the performance of queries on the restored tables and views.

-v verbosity Specifies the verbosity level for messages printed when ttMigrate saves or restores a database. One of:

0 - Shows errors and warnings only.

1 - Prints the name of each table as it is saved or restored.

2 - Prints the name of each table or index as it is saved or restored.

3 (default) - Prints the name of each table or index as it is saved or restored and prints a dot (.) for each 10,000 rows saved or restored.

ttMigrate ignores the -v option in List, Long-list, Describe and Long-describe modes.

-V | -version Prints the release number of ttMigrate and exits.

The following ttMigrate options are available in restore mode (-r) only:

Option Description
-autorefreshPaused Restores cache groups with AUTOREFRESH attribute with autorefresh state paused. Otherwise the state is set to OFF.
-C ckptFreq Specifies that ttMigrate should checkpoint the database after restoring every ckptFreq megabytes of data. A value of zero (the default) specifies that ttMigrate should never checkpoint the database.

NOTE: This option is not supported in TimesTen Scaleout.

-convertCGTypes Determines the best type mapping from the underlying Oracle database tables to TimesTen cached tables using:
  • The types of the columns in the Oracle database tables.

  • The types of the columns stored in the migration file.

  • The TimesTen-to-Oracle type mapping rules.

-gridRestoreFinale Restores indexes and foreign keys.

Use this option only for TimesTen Classic to TimesTen Scaleout migration. See "Migrating a database from TimesTen Classic to TimesTen Scaleout" in the Oracle TimesTen In-Memory Database Scaleout User's Guide.

-gridRestoreRows Restores rows into tables.

Use this option only for TimesTen Classic to TimesTen Scaleout migration. See "Migrating a database from TimesTen Classic to TimesTen Scaleout" in the Oracle TimesTen In-Memory Database Scaleout User's Guide.

-localhost hostName Explicitly identifies the name or IP address of the local host when restoring replicated tables.
-noCharsetConversion Restores data, retaining the connection character set that is stored in the data file. ttMigrate does not convert the connection character set to match the database character set.

If not set, ttMigrate restores the data and converts the connection character set to be the same as the database character set.

See also: -saveAsCharset.

This option may be useful for legacy TimesTen users who may have migrated pre-18.1 data into a 18.1 or later release of TimesTen as WE8ISO8895P1, when the data is actually in another character set. If, at a later time you want to have that data interpreted according to its actual character set, use this option to migrate the data into a database that uses the data's actual character set with no character set conversion.

-resizeHashIndexes Resizes user hash indexes during restore to be optimal size based on number of table rows.
-restorePublicPrivs Restores privileges that were granted to PUBLIC after the database was created. By default, the ttMigrate utility does not restore privileges granted to PUBLIC. You must explicitly specify this option to restore privileges to PUBLIC.

Modes

Create mode (-c) and Append mode (-a)

In create mode, ttMigrate saves migrate objects from a TimesTen database into a new binary data file. If the data file does not exist, ttMigrate creates it. Otherwise, ttMigrate overwrites the existing file, destroying its contents.

The data file format used by ttMigrate is independent of any release of TimesTen, so it is possible to use ttMigrate to migrate data from one TimesTen release to another.

In Append mode, ttMigrate appends migrate objects from a TimesTen database to an existing data file. If the data file does not exist, ttMigrate creates it.

For each ordinary (non-cached) table, ttMigrate saves:

  • The table description: the name and type of each of the table's columns, including primary key and nullability information.

  • The table's index definitions: the name of each index and the columns contained in the index. The actual contents of the index are not saved; ttMigrate only saves the information needed to rebuild the index when the table is restored.

  • The table's foreign key definitions. You can disable the saving of foreign key definitions using the -nf option.

  • The rows of the table. You can disable the saving of rows using the -nr option.

For each cache group, ttMigrate saves the following:

  • The cache group definition: the cache group owner and name, the names of all tables in the cache group and any relevant cache group settings, such as the cache group duration.

    Note:

    After ttMigrate has been used to restore a database, all autorefresh cache groups in the restored database have AUTOREFRESH state set to OFF, no matter how it was set on the source database. After restoring a cache group with ttMigrate -r, reset its AUTOREFRESH STATE to ON by using the ALTER CACHE GROUP statement (this can be done programmatically or with the ttIsql utility.
  • All the cached tables in the cache group: the table name, column information, table attributes (propagate or read-only), WHERE clause, if any, foreign key definitions and index definitions.

For each view, ttMigrate saves the following:

  • All the same information as a normal table.

  • The query defining the view.

For each sequence, ttMigrate saves the following:

  • The complete definition of the sequence.

  • The sequence's current value.

For each user (except the instance administrator), ttMigrate saves the following:

  • User name.

  • The user's encrypted password.

  • Privileges that have been granted to the user.

For PUBLIC, ttMigrate saves all privileges that have been granted to PUBLIC after database creation.

If there are any replication schemes defined, ttMigrate saves all of the TTREP tables containing the replication schemes. Replication schemes should have names that are unique from all other database objects. It is not possible to migrate a replication scheme with the same name as any other database object.

Note:

The ttMigrate utility does not save the rows of a cached table into the data file, even if you have not specified the -nr option. The foreign key definitions of cached tables are always saved, regardless of the use of the -nf option, as they are needed to maintain the integrity of the cache group.

By default, ttMigrate saves all database objects and users in the database to the data file, including tables, views, cache groups, sequences, users and replication schemes. Alternatively, you can give a list of database objects to be saved on the command line, except for replication schemes. The names in this list can contain the wildcard characters % (which matches one or more characters) and _ (which matches a single character). ttMigrate saves all database objects that match any of the given patterns. You do not need to be fully qualify names: If a name is given with no owner, ttMigrate saves all database objects that match the specified name or pattern, regardless of their owners.

You cannot save cached tables independently of their cache groups. If you list a cached table on the command line without also listing the corresponding cache group ttMigrate issues an error.

Use the -v option to control the information that ttMigrate prints while the save is in progress.

Restore mode (-r)

In Restore mode, ttMigrate restores all database objects from a data file into a TimesTen database.

For each ordinary (non-cached) table, ttMigrate restores:

  • The table, using the original owner, table name, column names, types and nullability and the original primary key.

  • The table's foreign keys. You can use the -nf flag to disable the restoration of foreign keys.

  • All indexes on the table.

  • All rows of the table. You can use the -nr flag to disable the restoration of rows.

For each cache group, ttMigrate restores:

  • The cache group definition, using the original cache group owner and name.

  • Each cached table in the cache group, using the original table names, column names, types and nullability, the original primary key, the table attributes (PROPAGATE or READONLY), and the WHERE clause, if any.

  • The foreign key definitions of the cached tables.

  • All the indexes on the cached tables.

    Note:

    The ttMigrate utility does not restore the rows of cached tables, even if you have not specified the -nr option. The foreign key definitions of the cached tables are always restored, regardless of the use of the -nf option, as they are needed to maintain the integrity of the cache group.

By default, the -exactUpgrade option is set during restore.

By default, ttMigrate restores all tables and cache groups in the data file. Alternatively, you can list specific tables and cache groups to be restored on the command line. The names in this list must be fully qualified and cannot use wildcard characters.

You cannot restore cached tables independently of their cache groups. If you list a cached table on the command line without also listing the corresponding cache group, then ttMigrate issues an error.

Use the -v option to control the information that ttMigrate prints while the restoration is in progress.

The -inline option may be used to control whether variable length columns are restored as INLINE or NOT INLINE. See "Type specifications" in Oracle TimesTen In-Memory Database SQL Reference. In the default mode, -inlinepreserve, ttMigrate restores all variable-length columns with the same INLINE or NOT INLINE setting with which they were saved. In the other two modes, -inlinedsDefault and -inlinemaxlen, ttMigrate restores variable-length columns equal to or shorter than a threshold length as INLINE, and restores all other variable length columns as NOT INLINE. For-inlinedsDefault, this threshold is the default automatic INLINE length for a TimesTen database. The -inlinemaxlen mode restores variable length columns with a user-specified threshold length of maxlen as INLINE, and all other variable length columns as NOT INLINE, even if they were saved as INLINE. If maxlen is 0, then all variable-length columns are restored as NOT INLINE.

List mode (-l) and Long-list mode (-L)

In List mode, ttMigrate lists the names of database objects in the specified data file, including cached tables and the replication scheme TTREP tables.

In Long-list mode, ttMigrate lists the names of database objects in the data file, including cached tables and the replication scheme TTREP tables, along with the number of rows in each table and the index definitions for each table, the query defining each view and the specifications for each sequence.

By default, ttMigrate lists the replication scheme name and all the database objects in the file. Alternatively you can provide a list of names of database objects on the command line. The names in this list must be fully qualified and cannot use wildcard characters.

Describe mode (-d)

In Describe mode, ttMigrate gives a short description for database objects in the specified file.

For each table, ttMigrate lists the table name, the number of rows in the table, and the table's column definitions, primary key and foreign keys. For cached tables, ttMigrate also lists the table attributes (PROPAGATE or READONLY) and the table's WHERE clause, if any.

For views, ttMigrate also lists the query defining the view.

For cache groups, ttMigrate lists the cache group name, the number of tables in the cache group, the cache group duration and describes each cached table in the cache group.

For replication schemes, ttMigrate lists the replication scheme name and all the TTREP replication scheme tables in the same manner as user tables.

By default, ttMigrate describes all the database objects in the file. Alternatively, you can provide a list of names of database objects on the command line. The names in this list must be fully qualified and cannot use wildcard characters.

Long-describe mode (-D)

In Long-describe mode, ttMigrate gives a full description for database objects in the specified file.

For each table, ttMigrate lists the table's name and the number of rows in the table, the table's column definitions, primary key, foreign keys and index definitions. For cached tables, ttMigrate also lists the table attributes (PROPAGATE or READONLY) and the table's WHERE clause, if any.

For cache groups, ttMigrate lists the cache group name, the number of tables in the cache group, the cache group duration and describes each cached table in the cache group.

For sequences, ttMigrate lists all the values used to define the sequence and its current value.

For replication schemes, ttMigrate lists all the TTREP replication scheme tables in the same manner as user tables.

By default, ttMigrate describes all of database objects in the file. Alternatively, you can provide a list of names of database objects on the command line. The names in this list must be fully qualified and cannot use wildcard characters.

Cache group data type conversions

When restoring a database that contains cache groups from a TimesTen release that is earlier than 7.0, use the -convertCGTypes. option to convert the data type of columns from pre-7.0 types to more clearly map with the data types of the columns in the Oracle database with which the cache group is associated.

The following table describes the type mapping.

Pre-7.0 TimesTen Type Oracle Type Converted Type
TINYINT NUMBER(p,s) when s > 0 NUMBER(p,s)
TINYINT NUMBER(p,s) when s <= 0 TT_TINYINT
SMALLINT NUMBER(p,s) when s > 0 NUMBER(p,s)

TT_SMALLINT

SMALLINT NUMBER(p,s) when s <= 0 TT_SMALLINT
INTEGER NUMBER(p,s) when s > 0 NUMBER(p,s)
INTEGER NUMBER(p,s) when s <= 0 TT_INTEGER
BIGINT NUMBER(p,s) when s > 0 NUMBER(p,s)
BIGINT NUMBER(p,s) when s <= 0 TT_BIGINT
NUMERIC(p,s)DECIMAL(p,s) NUMBER NUMBER
NUMERIC(p,s)DECIMAL(p,s) NUMBER(x,y) NUMBER(x,y)
NUMERIC(p,s)DECIMAL(p,s) FLOAT(x) NUMBER(p,s)
REAL Any BINARY_FLOAT
DOUBLE Any BINARY_DOUBLE
FLOAT(x) x <=24 Any BINARY_FLOAT
FLOAT(x) x >= 24 Any BINARY_DOUBLE
CHAR(x) Any ORA_CHAR(x)
VARCHAR(x) Any ORAVARCHAR2(x)
BINARY(x) Any TT_BINARY(x)
VARBINARY(x) Any TT_VARBINARY(x)
DATE DATE ORA_DATE
TIMESTAMP DATE ORA_DATE
TIME DATE ORA_DATE
Any1 TIMESTAMP(m) ORA_TIMESTAMP(m)

Note:

Any means the type value does not affect the converted result type.

For information on data types, see "Data Types" in Oracle TimesTen In-Memory Database SQL Reference and "Mappings between Oracle Database and TimesTen data types" in Oracle TimesTen Application-Tier Database Cache User's Guide.

Return codes

The ttMigrate utility restore (-r) and create (-c) commands return the following exit codes:

0 - All objects were successfully created or restored.

1 - Some objects successfully created or restored. Some objects could not be created or restored due to errors.

2 - Fatal error, for example, could not connect or could not open the data file.

3 - Ctrl-C or another signal received during the create or restore operation.

Examples

The following command dumps all database objects from database SalesDS into a file called sales.ttm. If sales.ttm exists, ttMigrate overwrites it.

% ttMigrate -c SalesDS sales.ttm

This command appends all database objects in the SalesDS database owned by user MARY to sales.ttm:

% ttMigrate -a SalesDS sales.ttm MARY.%

This command restores all database objects from sales.ttm into the SalesDS database:

% ttMigrate -r SalesDS sales.ttm

This command restores MARY.PENDING and MARY.COMPLETED from sales.ttm into SalesDS (migrate objects are case-insensitive):

% ttMigrate -r SalesDS sales.ttm MARY.PENDINGMARY.COMPLETED

This command lists all migrate objects saved in sales.ttm:

% ttMigrate -l sales.ttm

Notes

When migrating backward into a release of the Oracle TimesTen In-Memory Database that does not support features in the current release, TimesTen generally issues a warning and continues without migrating the unsupported features. In a few cases, where objects have undergone conversion, ttMigrate may fail and return an error message. This may be the case with conversions of data types, character sets and primary key representation.

The following restrictions, limitations and suggestions should be considered before preparing to use ttMigrate.

Cache groups: In restore mode, the presence of foreign key dependencies between tables may require ttMigrate to reorder tables to ensure that a child table is not restored before a parent table.

Character columns in cached tables must have not only the same length but also the same byte semantics as the underlying Oracle database tables. Cache group migration fails when there is a mismatch in the length or length semantics of any of its cached tables.

The connection attribute PassThrough with a nonzero value is not supported with this utility and returns an error.

Character sets: By default, ttMigrate stores table data in the database character set, unless you have specified the -saveAsCharset option. At restore time, conversion to another character set can be achieved by migrating the table into a database that has a different database character set. When migrating data from a release of TimesTen that is earlier than 7.0, TimesTen assumes that the data is in the target database's character set. If the data is not in the same database character set as the target database, the data may not be restored correctly.

When migrating columns with BYTE length semantics between two databases that both support NLS but with different database character sets, it is possible for migration to fail if the columns in the new database are not large enough to hold the values in the migrate file. This could happen, for example, if the source database uses a character set whose maximum byte-length is 4 and the destination database uses a character set whose maximum byte-length is 2.

TimesTen issues a warning whenever character set conversion takes place to alert you to the possibility of data loss due to conversion.

Foreign key dependencies: In restore mode, the presence of foreign key dependencies between tables may require ttMigrate to reorder tables to ensure that a child table is not restored before any of its parents. Such dependencies can also prevent a child table from being restored if any of its parent tables were not restored. For example, when restoring a table A that has a foreign key dependency on a table B, ttMigrate first checks to verify that table B exists in the database. If table B is not found, ttMigrate delays the restoration of table A until table B is restored. If table B is not restored as part of the ttMigrate session, TimesTen prints an error message indicating that table A could not be restored due to an unresolved dependency.

Indexes: TimesTen supports range indexes as primary-key indexes into TimesTen releases that support this feature. When migrating backward into a release that does not support range indexes as primary-key indexes, the primary keys are restored as hash indexes of the default size. When migrating forward from a release that does not support range indexes as primary-key indexes, the primary keys are restored as hash indexes of the same size as the original index.

Replication: Before attempting a full store migrate of replicated stores, ensure the host name and database name are the same for both the source and destination databases.

System views: TimesTen does not save the definitions or content of system vies during migration.

Other considerations: Because ttMigrate uses a binary format, you cannot use ttMigrate to:

  • Migrate databases between hardware platforms.

  • Restore data saved with ttBackup or use ttBackup to restore data saved with ttMigrate.

  • On Windows, you can use ttMigrate to access databases from any release of TimesTen. On Windows, this utility is supported for all TimesTen Data Manager and Client DSNs.

  • On UNIX and Linux systems, the release of ttMigrate must match the release of the database you are connecting to.

It is recommended that you do not run DDL SQL commands while running ttMigrate to avoid lock contention issues for your application.

ttRepAdmin

Description

Displays existing replication definitions and monitors replication status. The ttRepAdmin utility is also used when upgrading to a new release of TimesTen

Required privilege

This utility requires the ADMIN privilege.

Usage with TimesTen Scaleout

This utility is not supported in TimesTen Scaleout.

Syntax

ttRepAdmin {-h | -help | -?}
ttRepadmin {-V | -version}
ttRepAdmin -self -list [-scheme [owner.]schemeName]
       {DSN | -connStr connection_string}

ttRepAdmin -receiver [-name receiverName]
      [-host receiverHostName] [-state receiverState] [-reset]
      [-list] [-scheme [owner.]schemeName]
      {DSN | -connStr connection_string} 

ttRepAdmin -log {DSN | -connStr connection_string}

ttRepAdmin -showstatus -detail {-awtmoninfo} {DSN | -connStr connection_string}

ttRepAdmin -showconfig {DSN | -connStr connection_string}

ttRepAdmin -bookmark {DSN | -connStr connection_string}

ttRepAdmin -wait [-name receiverName] [-host receiverHostName] 
      [-timeout seconds] {DSN | -connStr connection_string}

ttRepAdmin -duplicate -from srcDataStoreName
      -host srcDataStoreHost
      [-localIP localIPAddress] [-remoteIP remoteIPAddress]
      [-setMasterRepStart] [-ramLoad] [-delXla]
      [-UID userId] [-PWD pwd | -PWDCrypt encryptedPwd]
      [-drop { [owner.]table ... | [owner.]sequence |ALL }]
      [-truncate { [owner.]table ... | ALL }]
      [-compression 0 | 1] [-bandwidthmax maxKbytesPerSec]
      [ (  -activeDataGuard [-cacheUid cacheUid [-cachePwd cachePwd]]
         | -initCacheDr [-cacheUid cacheUid [-cachePwd cachePwd]] 
                [-noDRTruncate] [-nThreads]
         | ( -keepCG [-cacheUid cacheUid [-cachePwd cachePwd]] 
             ( [-recoveringNode | -deferCacheUpdate] ))| -nokeepCG ) ]
      [-remoteDaemonPort portNo] [-verbosity {0|1|2}]
      [-localhost localHostName]
      [-open | -close]
      {destDSN | -connStr connection_string}

ttRepAdmin operations

Use the ttRepAdmin utility for many replication operations. These operations fall into the following categories:

Help and version information

Use this form of ttRepAdmin to obtain help and the current version of TimesTen.

ttRepAdmin {-h | -help | -?}
ttRepadmin {-V | -version}
Option Description
-h

-help

-?

Display help information.
-V | -version Display TimesTen version information.

Database information

Use this form of ttRepAdmin to obtain summary information about a database.

ttRepAdmin -self -list [-scheme [owner.]schemeName]
{DSN | -connStr connection_string}

Options

ttRepAdmin -self -list has the options:

Option Description
DSN Data source name of a master or subscriber database.
-connStr connection_string Connection string of a master or subscriber database, an ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
-self Specified database.
-list Lists database name, host, port number, and bookmark position.
-scheme [owner.]schemeName] Name of replication scheme when there is more than one scheme.

Examples

% ttRepAdmin -self -list my_dsn

The above syntax prints out information about the replication definition of the database my_dsn.

Subscriber database operations

Use this form of ttRepAdmin to check the status or reset the state of a subscriber (receiver) database.

ttRepAdmin -receiver [-name receiverName]
[-host receiverHostName] 
       [-state receiverState] [-reset]
       [-list] [-scheme [owner.]schemeName]
       {DSN | -connStr connection_string}

Options

ttRepAdmin -receiver has the options:

Option Description
DSN Data source name of the master database.
-connStr connection_string Connection string of the master database, an ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
-receiver Subscriber databases receiving updates from the master. Use -name and -host to specify a specific subscriber database.
-name receiverName A specific subscriber (receiving) database. The receiverName is the last component in the database path name.
-host receiverHostName Host name or TCP/IP address of the subscriber host.
-state start

-state stop

-state pause

Sets the state of replication for the subscriber.

start (default) - Starts replication to the subscriber.

stop - Stops replication to the subscriber, discarding updates.

pause - Pauses the replication agent, preserving updates.

See "Set the replication state of subscribers" in Oracle TimesTen In-Memory Database Replication Guide for more information.

-reset Clears the bookmark in the master database log for the latest transaction to be sent to a given subscriber. This option should only be used when the transaction numbering of the master database is changed, such as when the database is re-created using ttMigrate or ttBackup. If the master database is saved and restored using ttBackup and ttRestore, transaction numbering is preserved and this option should not be used.
-list Lists information about a replication definition.
-scheme [owner.]schemeName] Specifies the replication scheme name when there is more than one scheme.

Examples

% ttRepAdmin -receiver -list my_dsn

The above syntax lists replication information for all the subscribers of the master database, my_dsn.

% ttRepAdmin -receiver -name rep_dsn -list my_dsn

The above syntax lists replication information for the rep_dsn subscriber of the master database, my_dsn.

% ttRepAdmin -receiver -name rep_dsn -reset my_dsn

The above syntax resets the replication bookmark with respect to the rep_dsn subscriber of the master database. Should only be used when migrating a replicated database with ttMigrate or ttBulkCp.

% ttRepAdmin -receiver -name rep_dsn -state Start my_dsn

The above syntax resets the replication state of the rep_dsn subscriber database to the Start state with respect to the master database, my_dsn.

Duplicate a database

Use this form of ttRepAdmin to create a new database with the same contents as the master database.

The following must be true for you to perform the ttRepAdmin -duplicate:

  • Only the instance administrator can run ttRepAdmin -duplicate.

  • The instance administrator must have the same operating system username on both source and target computer to execute ttRepAdmin -duplicate.

  • You must provide the user name and password with the -UID and -PWD options for an internal user with the ADMIN privilege on the source database.

  • You must run ttRepAdmin on the target host.

  • The DSN specified must be a direct-mode DSN, not a server DSN.

Before running the ttRepAdmin -duplicate command, use ttStatus to ensure the replication agent is started for the source database.

ttRepAdmin -duplicate -from srcDataStoreName
       -host srcDataStoreHost
      [-localIP localIPAddress] [-remoteIP remoteIPAddress]
      [-setMasterRepStart] [-ramLoad] [-delXla]
      -UID userId (-PWD pwd | -PWDCrypt encryptedPwd)
      [-drop { [owner.]table ... | [owner.]sequence |ALL }]
      [-truncate { [owner.]table ... | ALL }]
      [-compression 0 | 1] [-bandwidthmax maxKbytesPerSec]
      [ ( -activeDataGuard [-cacheUid cacheUid [-cachePwd cachePwd]]
         | -initCacheDr [-cacheUid cacheUid [-cachePwd cachePwd]] 
                [-noDRTruncate] [-nThreads]
         | ( -keepCG [-cacheUid cacheUid [-cachePwd cachePwd]] 
             ( [-recoveringNode | -deferCacheUpdate] ))| -nokeepCG  ) ]
      [-remoteDaemonPort portNo] [-verbosity {0|1|2}]
      [-localhost localHostName]
      [-open | -close]
      {destDSN | -connStr connection_string}

Options

ttRepAdmin -duplicate has the options:

Option Description
-close Closes a database to user connections.

When a database is closed to user connections, new connection attempts will fail, but existing connections are unaffected.

-bandwidthmax maxKbytesPerSec Specifies that the duplicate operation should not put more than maxKbytesPerSec KB of data per second onto the network. A value of 0 indicates that there should be no bandwidth limitation. The default is 0. The maximum is 9999999.
-compression 0 | 1 Enables or disables compression during the duplicate operation. The default is 0 (disabled).
-connStr connection_string Specifies the connection string of the destination database, an ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
-delXla Removes all the XLA bookmarks as part of the duplicate operation. Use this option if you do not want to copy the bookmarks to the duplicate database.
destDSN Indicates the data source name of the destination database.
-drop {[owner.]table ... |[owner.]sequence |ALL Drops any tables or sequences that are copied as part of the -duplicate operation but which are not included in the replication scheme. ttRepAdmin ignores the option if the table is a cache group table.
-duplicate Creates a duplicate of the specified database using replication to transmit the database contents across the network. See "Duplicating a database" in Oracle TimesTen In-Memory Database Replication Guide.
-from srcDataStoreName Used with -duplicate to specify the name of the sender (or master) database. The srcDataStoreName is the last component in the database path name.
-host srcDataStoreHost Defines the host name or TCP/IP address of the sender (or master) database.
-initCacheDr [-cacheUid cacheUid -cachePwd cachePwd] Initializes disaster recovery. Must provide the cache admin user id and password.
  • cacheUid is the cache administration user ID.

  • cachePwd is the password for the cache administrator user.

If no password is provided, ttRepAdmin prompts for a password.

( -keepCG [-cacheUid cacheUid -cachePwd cachePwd] ([-recoveringNode | -deferCacheUpdate])) | -noKeepCG -keepCG and -noKeepCG specify whether tables in cache groups should be maintained as cache group tables or converted to regular tables in the target database. The default is -noKeepCG.
  • cacheUid is the cache administration user ID.

  • cachePwd is the password for the cache administrator user.

If no password is provided, ttRepAdmin prompts for a password.

If you cannot connect to the Oracle database or the Oracle database is down, then specify the -recoveringNode option when the -duplicate is being used to recover a failed node for a replication scheme that includes all AWT or incremental autorefresh cache groups. Otherwise, specify the -deferCacheUpdate option. These options defer changes to metadata on the Oracle database (that is used to manage AWT or incremental autorefresh cache groups) until after the duplicate operation completes, the cache and replication agents are started, and these agents can connect to the Oracle database. See "Duplicating a database" in the Oracle TimesTen In-Memory Database Replication Guide for more information.

-localhost hostName Use with -duplicate and -setMasterRepStart to explicitly identify the name or IP address of the local host.
-localIP localIPAddress Specifies the alias or IP (IPv4 or IPv6) address of the local network interface to be used. If not specified, ttRepAdmin chooses any compatible interface.
-noDRTruncate Used with the -initCacheDr option, -noDRTruncate disables truncation of Oracle tables during the initial rollout process for the remote subscriber on the Disaster Recovery site. When –noDRTruncate is specified, TimesTen does not truncate the Oracle Database tables that correspond to the Asynchronous Writethrough cache group tables in an active standby pair replication scheme.
-nThreads n Used with the -initCacheDr option, -nThreads indicates the number of threads used to truncate the Oracle database tables and push the data in the cache into Oracle during the initialization process.
-open Opens a database to user connections.

A database is open to user connections by default upon creation.

-PWD pwd The password of the internal user specified in the -UID option.
-PWDCrypt encryptedPwd The encrypted password of the user specified in the -UID option.
-ramLoad Keeps the database in memory upon completion of the duplicate operation. This option avoids the /reload database cycle to improve the performance of the duplicate operation when copying large databases. After the duplicate option, RAM Policy for the database is set to manual. Use the ttAdmin utility to make further changes to the RAM policy.
-remoteDaemonPort portNo The port number of the remote main daemon.

The port number supplied as an argument to this option is used unless the value is zero. In that case the default behavior to determine the port number is used.

The -remoteDaemonPort option cannot be used to duplicate databases that have stores which use automatic port configuration.

-remoteIP remoteIPAddress Specifies the alias or IP (IPv4 or IPv6) address of the remote or destination network interface to be used. If not specified, ttRepAdmin chooses any compatible interface.
-setMasterRepStart When used with -duplicate, this option sets the replication state for the newly created database to the Start state just before the database is copied across the network. This ensures that all updates made to the source database after the duplicate operation are replicated to the newly duplicated local database. Any unnecessary transaction log files for the database are removed.
-truncate [owner.]table ...| ALL Truncates any tables that are copied as part of the -duplicate operation but which are not included in the replication scheme. ttRepAdmin ignores the option if the table is a cache group table.
-UID userid The user ID of a user having the ADMIN privilege on the source database must be supplied. This must be an internal user.
-verbosity {0 | 1 | 2} Provide details of the communication steps within the duplicate process and reports progress information about the duplicate transfer.

0 (default) - No diagnostics are returned.

1 - Reports details of the duplicate parameters to stdout.

2 - Reports details of the duplicate parameters and details of the duplicate transfer operation to stdout.


Examples

Example 5-1 Duplicating a database

On the source database, create a user and grant the ADMIN privilege to the user:

CREATE USER ttuser IDENTIFIED BY ttuser;
User created.

GRANT admin TO ttuser;

The instance administrator must have the same user name on both instances involved in the duplication. Logged in as the instance administrator, duplicate the ds1 database on server1 to the ds2 database:

% ttRepAdmin -duplicate -from ds1 -host "server1" 
           -UID ttuser -PWD ttuser
           -connStr "dsn=ds2;UID=ttuser;PWD=ttuser" 

Example 5-2 Duplicating a database with cache groups

Use the -keepCG option to keep cache group tables when you duplicate a database. Specify the cache administration user ID and password with the -cacheuid and -cachepwd options. If you do not provide the cache administration user password, ttRepAdmin prompts for a password.

If the cache administration user ID is orauser and the password is orapwd, duplicate database dsn1 on host1:

% ttRepAdmin -duplicate -from dsn1 -host host1 -uid ttuser -pwd ttuser 
        -keepCG -cacheuid orauser -cacheuid orapwd "DSN=dsn2;UID=;PWD="

The UID and PWD for dsn2 are specified as null values in the connection string so that the connection is made as the current operating system user, which is the instance administrator. Only the instance administrator can run ttRepAdmin -duplicate. If dsn2 is configured with PWDCrypt instead of PWD, then the connection string should be "DSN=dsn2;UID=;PWDCrypt=".

Example 5-3 Setting the replication state on the source database

The -setMasterRepStart option causes the replication state in the srcDataStoreName database to be set to the Start state before it is copied across the network and then keeps the database in memory. It ensures that any updates made to the master after the duplicate operation has started are copied to the subscriber.

You can use the -localhost option to identify the local host by host name or IP address. These options ensure that all updates made after the duplicate operation are replicated from the remote database to the newly created or restored local database.

ttRepAdmin -duplicate -from srcDataStoreName -host srcDataStoreHost
        -setMasterRepStart -ramLoad
        -UID timesten_user -PWD timesten_user]
        -localhost localHostName 
        [destDSN | -connStr connection_string ]

Notes

This utility can duplicate any temporary table definition in a database, but it does not replicate the contents of temporary tables.

You cannot use this utility to duplicate databases across major releases of TimesTen.

Wait for updates to complete

Use this form of ttRepAdmin to assure that all the updates in the log are replicated to all subscribers before call returns.

ttRepAdmin -wait [-name receiverName] [-host receiverHostName]
[-timeout seconds] {DSN | -connStr connection_string} 

Options

ttRepAdmin -wait has the options:

Option Description
DSN Indicates the data source name of the master database.
-connStr connection_string Specifies the connection string of the master database, an ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
-wait Waits for replication to become current before continuing.
-name receiverName Identifies the database. The database name is the last component in the database path name.
-host receiverHostName Defines the host name or TCP/IP address of the subscriber host.
-timeout seconds Specifies timeout value in seconds. ttRepAdmin returns within this amount of time, even if all updates to subscribers have not been completed.

Examples

% ttRepAdmin -wait -name receiverName -host receiverHostName
-timeout seconds -dsn DSN 

The above syntax provides a way to ensure that all updates, committed at the time this program was invoked, have been transmitted to the subscriber, receiverName, and the subscriber has acknowledged that all those updates have been durably committed at the subscriber database. The timeout in seconds limits the wait.

Note:

If ttRepAdmin -wait is invoked 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 more before the subscriber sends the acknowledgment that all updates have been durably committed at the subscriber.
% ttRepAdmin -wait -dsn DSN

In the above syntax, if no timeout and no subscriber name are specified, ttRepAdmin does not return until all updates committed at the time this program was invoked have been transmitted to all subscribers and all subscribers have acknowledged that all those updates have been durably committed at the subscriber database.

Replication status

Use this form of ttRepAdmin to check the size of the transaction log files, bookmark position, or replication configuration of a master database.

ttRepAdmin -log {DSN | -connStr connection_string}
ttRepAdmin -showstatus -detail {-awtmoninfo} {DSN | -connStr connection_string}
ttRepAdmin -showconfig {DSN | -connStr connection_string}
ttRepAdmin -bookmark {DSN | -connStr connection_string}

Options

The ttRepAdmin monitor operations have the options:

Option Description
DSN Indicates the data source name of the master database.
-awtmoninfo If you have enabled monitoring for AWT cache groups by calling the AwtMonitorConfig procedure, you can display the monitoring results by using the this option.

If AWT monitoring is enabled, ttrepadmin -awtmoninfo displays the output:

  • TimesTen processing time: The total number of milliseconds spent in processing AWT transaction data since monitoring was enabled.

  • Oracle bookmark time: The total number of milliseconds spent in managing AWT metadata on Oracle since monitoring was enabled.

-connStr connection_string Specifies the connection string of the master database, an ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
-detail Indicates whether the replication agent transmitters and receivers are using TLS (indicated as SSL)
-log Prints out number and size of transaction log files retained by replication to transmit updates to other databases.
-showconfig Lists the entire replication configuration.

See "Show the configuration of replicated databases" in Oracle TimesTen In-Memory Database Replication Guide for more information.

-showstatus Reports the current status of the specified replicated database.

See "Use ttRepAdmin to show replication status" in Oracle TimesTen In-Memory Database Replication Guide for more information.

-bookmark Reports the latest marker record from where replication must read the log, the most recently created log sequence number, and the latest log sequence number whose record has been flushed to disk.

Bookmarks are not supported if you have configured parallel replication.

See "Show replicated log records" in Oracle TimesTen In-Memory Database Replication Guide for more information.


Result set

If AWT monitoring is enabled, this utility displays the following information in addition to other ttRepAdmin -showstatus output.

  • TimesTen processing time: The total number of milliseconds spent in processing AWT transaction data since monitoring was enabled.

  • Oracle bookmark time: The total number of milliseconds spent in managing AWT metadata on Oracle since monitoring was enabled.

  • Oracle execute time: The total number of milliseconds spent in OCI preparation, binding and execution for AWT SQL operations since monitoring was enabled. This statistic includes network latency between TimesTen and the Oracle database.

  • Oracle commit time: The total number of milliseconds spent in committing AWT updates on Oracle since monitoring was enabled. This statistic includes network latency between TimesTen and the Oracle database.

  • Time since monitoring was started.

  • Total number of TimesTen row operations: The total number of rows updated in AWT cache groups since monitoring was enabled.

  • Total number of TimesTen transactions: The total number of transactions in AWT cache groups since monitoring was enabled.

  • Total number of flushes to Oracle: The total number of times that TimesTen data has been sent to the Oracle database.

The output also includes the percentage of time spent on TimesTen processing, Oracle bookmark, Oracle execution and Oracle commits.

See "Use ttRepAdmin to show replication status" in Oracle TimesTen In-Memory Database Replication Guide for more information.

Examples

% ttRepAdmin -log DSN

The above syntax reports the number of transaction log files that replication is retaining to transmit updates to other databases. The replication agent retains a transaction log file until all updates in that transaction log file have been successfully transferred to each subscriber database.

% ttRepAdmin -showconfig DSN

The above syntax reports the entire replication configuration. It lists all the subscribers for the specified DSN, the names and details of the tables being replicated, and all the subscriptions.

% ttRepAdmin -showstatus DSN

The above syntax reports the current state of the database for the specified DSN. The output includes the state of all the threads in the replication agents for the replicated databases, bookmark locations, port numbers, and communication protocols.

For example, consider how to use the ttRepAdmin -showstatus utility to display status for a unidirectional replication scheme from the rep1 database to the rep2 database.

The first ttRepAdmin -showstatus output shows the status of the rep1 database and its TRANSMITTER thread. The second output shows the status of the rep2 database and its RECEIVER thread.

% ttRepAdmin -showstatus rep1

DSN                      : rep1
Process ID               : 1980
Replication Agent Policy : MANUAL
Host                     : MYHOST
RepListener Port         : 1113 (AUTO)
Last write LSN           : 0.1487928
Last LSN forced to disk  : 0.1487928
Replication hold LSN     : 0.1486640

Replication Peers:
  Name                   : rep2
  Host                   : MYHOST
  Port                   : 1154 (AUTO)
  Replication State      : STARTED
  Communication Protocol : 12

TRANSMITTER thread(s):
  For                     : rep2
    Start/Restart count   : 2
    Send LSN              : 0.1485960
    Transactions sent     : 3
    Total packets sent    : 10
    Tick packets sent     : 3
    MIN sent packet size  : 48
    MAX sent packet size  : 460
    AVG sent packet size  : 167
    Last packet sent at   : 17:41:05
    Total Packets received: 9
    MIN rcvd packet size  : 48
    MAX rcvd packet size  : 68
    AVG rcvd packet size  : 59
    Last packet rcvd'd at : 17:41:05
    Earlier errors (max 5):
    TT16060 in transmitter.c (line 3590) at 17:40:41 on 08-25-2004
    TT16122 in transmitter.c (line 2424) at 17:40:41 on 08-25-2004

The replication status for the rep2 database should look similar to the following:

> ttRepAdmin -showstatus rep2

DSN                      : rep2
Process ID               : 2192
Replication Agent Policy : MANUAL
Host                     : MYHOST
RepListener Port         : 1154 (AUTO)
Last write LSN           : 0.416464
Last LSN forced to disk  : 0.416464
Replication hold LSN     : -1.-1

Replication Peers:
  Name              : rep1
  Host              : MYHOST
  Port              : 0 (AUTO)
  Replication State : STARTED
  Communication Protocol : 12

RECEIVER thread(s):
  For                   : rep1
  Start/Restart count   : 1
  Transactions received : 0
  Total packets sent    : 20
  Tick packets sent     : 0
  MIN sent packet size  : 48
  MAX sent packet size  : 68
  AVG sent packet size  : 66
  Last packet sent at   : 17:49:51
  Total Packets received: 20
  MIN rcvd packet size  : 48
  MAX rcvd packet size  : 125
  AVG rcvd packet size  : 52
  Last packet rcvd'd at : 17:49:51
% ttRepAdmin -bookmark DSN

The above syntax prints out the log sequence numbers of the earliest log record still needed by replication, the last log record written to disk, and the last log record generated.

% ttRepAdmin -showstatus -awtmoninfo database1

[other -showstatus output]
...
AWT Monitoring statistics
--------------------------
TimesTen processing time : 0.689000 millisecs (0.164307 %)
   Oracle bookmark  time : 3.229000 millisecs (0.770027%)
   Oracle execute time : 342.908000 millisecs (81.774043 %)
   Oracle commit time : 72.450000 millisecs (17.277315 %)
   Time since monitoring was started: 8528.641000 millisecs
   Cache-connect Operational Stats :
      Total Number of TimesTen row operations : 2
      Total Number of TimesTen transactions : 2
      Total Number of flushes to Oracle : 2

The above syntax and output shows the AWT monitoring status.

Notes

The ttRepAdmin utility is supported only for TimesTen Data Manager DSNs. It is not supported for TimesTen Client DSNs.

You must use the -scheme option when specifying more than one replication scheme, or when more than one scheme exists involving the specified database.

Using SQL configuration, you can create multiple replication schemes in the same database. If there is only one replication scheme, the ttRepAdmin utility automatically determines the scheme. If there is more than one scheme, you must use the ttRepAdmin -scheme option to specify which scheme to use.

When configuring replication for databases with the same name on different hosts, you can indicate which database you want to operate on by using -host. For example, if all the subscribers have the name DATA, you can set the replication state on host SW1 with:

% ttRepAdmin -receiver -name DATA -host SW1 -state start DSN

See also


For a full description of TimesTen Replication, see Oracle TimesTen In-Memory Database Replication Guide.
For upgrade examples, see "Upgrades in TimesTen Classic" in Oracle TimesTen In-Memory Database Installation, Migration, and Upgrade Guide.

ttRestore

Description

Creates a database from a backup that has been created using the ttBackup utility. If the database exists, ttRestore does not overwrite it.

The attributes in the ttRestore connection string can contain any of the first connection or general connection attributes. It can also include the data store attribute LogDir. All other data store attributes are copied from the backup files. The LogDir attribute enables the restored database to be relocated.

The ttRestore action is somewhat more powerful than a first connect, as it can move the database. It is somewhat less powerful than creating a new database, as it cannot override the data store attributes, except for the LogDir attribute.

For an overview of the TimesTen backup and restore facility, see "Backup, Restore, and Migrate Data in TimesTen Classic" in the Oracle TimesTen In-Memory Database Installation, Migration, and Upgrade Guide.

Required privilege

This utility requires the instance administrator privilege.

Usage with TimesTen Scaleout

This utility is not supported in TimesTen Scaleout.

Syntax

ttRestore {-h | -help | -?}
ttRestore {-V | -version}
ttRestore [-fname filePrefix] [-noconn] -dir directory 
       [-open | -close] {DSN | -connStr connection_string}
ttRestore -i [-noconn] [-open | -close] {DSN | -connStr connection_String}

Options

ttRestore has the options:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
-close Closes a database to user connections.

When a database is closed to user connections, new connection attempts will fail, but existing connections are unaffected.

DSN Specifies an ODBC data source name of the database to be administered.
-dir directory Specifies the directory where the backup files are stored.
-fname filePrefix Specifies the file prefix for the backup files in the backup directory. The backup files must have been stored in the backup directory with this prefix.

The default value for this parameter is the file name portion of the DataStore parameter of the database's ODBC definition.

-h

-help

-?

Prints a usage message and exits.
-i Read standard input for the backup data. You cannot use the -dir or -fname options with -i.
-noconn To ensure that the restore was successful, ttRestore connects to the database as a last step. This option disables that last connect. We recommend that you specify this option for best performance. If this option is not specified, the database is loaded into memory and ed from memory.
-open Opens a database to user connections.

A database is open to user connections by default upon creation.

-V | -version Prints the release number of ttRestore and exits.

Examples

% ttRestore -dir /users/pat/TimesTen/backups
 -fname FastInsBkup FastIns

To back up a database named origDSN to the directory /users/rob/tmp and restore it to database named restoredDSN, use:

% ttBackup -dir /users/rob/tmp -fname restored origDSN
% ttRestore -dir /users/rob/tmp -fname restored restoredDSN

The value of fname is the name that you want for the prefix portion of the backup file name.

On UNIX and Linux systems, to restore a tape backup to the FastIns database, use:

% dd bs=64k if=/dev/rmt0 | ttRestore -i FastIns

Notes

The ttBackup utility and the ttRestore utility back up and restore databases only when the first two parts of the TimesTen release and the platform are the same. For example, you can back up and restore files between release 18.1.1.1.0 and release 18.1.1.2.0 or 18.1.2.1.0. You cannot back up and restore files between release 11.2.2.8.0 and release 18.1.1.1.0, or between release 18.1.2.1.0 and release 18.2.1.1.0. You can use the ttBulkCp or ttMigrateCS (UNIX and Linux systems only) utility to migrate databases across major releases or operating systems.

You can backup databases containing cache groups with the ttBackup utility. However, when restoring such a backup, special consideration is required as the restored data within the cache groups may be out of date or out of sync with the data in the back end Oracle database. See the section on "Backing up and restoring a database with cache groups" in the Oracle TimesTen Application-Tier Database Cache User's Guide for details.

ttSchema

Description

Prints out the schema, or selected objects, of a database. The utility can list the following schema objects that are found in SQL CREATE statements:

  • Tables

  • Indexes

  • Cache group definitions

  • Sequences

  • Views

  • Column definitions, including partition information

  • PL/SQL program units

  • Users and user information

The level of detail in the listing and the objects listed are controlled by options. The output represents a point in time snapshot of the state of a database rather than a history of how the database came to arrive at its current state, perhaps through ALTER statements. An entire database, including data, cannot be completely reconstructed from the output of ttSchema. The ttIsql utility can play back the output of ttSchema utility to rebuild the full schema of a database.

On UNIX and Linux systems, this utility is supported for TimesTen Data Manager DSNs. For TimesTen Client DSNs, use the utility ttSchemaCS.

Required privilege

This utility requires no privileges beyond those needed to perform describe operations on database objects.

This utility prints information only about the objects owned by the user executing the utility, and those objects for which the owner has SELECT privileges. If the owner executing the utility has ADMIN privilege, ttSchema prints information about all objects.

Usage with TimesTen Scaleout

This utility is supported in TimesTen Scaleout.

Syntax

ttSchema {-h | -help | -?}
ttSchema {-V | -version}
ttSchema [-userinfo] [-includePassword]
ttSchema [-l] [-c] [-fixedTypes] [-st | -systemTables]
         [ -list {all | tables | views | sequences |
         cachegroups | repschemes |synonyms | plsql | userinfo} [,...] ] 
         [-plsqlAttrs | -noplsqlAttrs]
         [-plsqlCreate |-[no]plsqlCreateOrReplace]
         [-includePassword]
         {-connStr connection_string | DSN }
         [[owner.]object_name][...]

Options

ttSchema has the options:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
-c Compatibility mode. Limits the use of TimesTen-specific and release-specific keywords and extensions. This may be useful if the ttSchema output is being used as input to an older TimesTen release, or to some other database system, such as the Oracle database.

The -c option prevents the INLINE and NOT INLINE keywords from being output.

DSN Specifies an ODBC data source name of the database from which to get a schema.
-fixedTypes Uses fully qualified data type names.
-h

-help

-?

Prints a usage message and exits.
-includePassword Includes exportable password information for users. When the user DDL is executed in a new database, the user can have the same password.
-l One per-line listing of objects in the database.
-list {all | tables | views | sequences | cachegroups | repschemes |synonyms | plsql |userinfo}[,...] A comma-delimited (no space after comma) list of objects to generate. Lists only those types of objects specified. Default is -list all.
[owner.]object_name Limits the scope of the output to specified database object(s).
-plsqlAttrs |-noplsqlAttrs Controls whether ttSchema emits ALTER SESSION statements with CREATE statements for PL/SQL program units.

If -plsqlAttrs is specified, ttSchema emits ALTER SESSION statements to set these attributes before emitting a CREATE statement. This output from ttSchema can be fed back into ttIsql (or sqlplus) to create the same procedures, with the same compiler options as were specified in the original database (default).

If -noplsqlAttrs is specified, only the CREATE statement is generated.

-plsqlCreate | -[no]plsqlCreateOrReplace If -plsqlCreate is specified, ttSchema emits CREATE PROCEDURE, CREATE PACKAGE or CREATE FUNCTION statements for PL/SQL program units.

If -plsqlCreateOrReplace (default) is specified, ttSchema emits CREATE or REPLACE statements.

-st | -systemTables Include system tables. System tables are omitted by default.
-V | -version Prints the release number of ttSchema and exits.

Examples

Objects in the orderdsn database are created with these SQL statements:

CREATE TABLE ttuser.customer (
cust_num            INTEGER NOT NULL PRIMARY KEY,
  region            CHAR(2) NOT NULL,
  name              VARCHAR2(80), 
  address           VARCHAR2(255) NOT NULL);

CREATE SEQUENCE ttuser.custid MINVALUE 1 MAXVALUE 1000000;

CREATE TABLE ttuser.orders (
  ord_num INTEGER NOT NULL PRIMARY KEY,
  cust_num INTEGER NOT NULL,
  when_placed  TIMESTAMP NOT NULL,
  when_shipped TIMESTAMP,
  FOREIGN KEY(cust_num) REFERENCES ttuser.customer (cust_num));

CREATE MATERIALIZED VIEW ttuser.order_summary AS
  SELECT cust.name, ord.ord_num, count(*) ord_count
  FROM ttuser.orders ord, ttuser.customer cust
  WHERE ord.cust_num = cust.cust_num
    GROUP BY cust.name, ord.ord_num;

Example 5-4 ttSchema for the database

Return the schema for the orderdsn database.

% ttSchema orderdsn
-- Database is in Oracle type mode
create table TTUSER.CUSTOMER (
        CUST_NUM NUMBER(38) NOT NULL,
        REGION   CHAR(2 BYTE) NOT NULL,
        "NAME"   VARCHAR2(80 BYTE) INLINE NOT NULL,
        ADDRESS  VARCHAR2(255 BYTE) NOT INLINE NOT NULL,
    primary key (CUST_NUM));
 
create table TTUSER.ORDERS (
        ORD_NUM      NUMBER(38) NOT NULL,
        CUST_NUM     NUMBER(38) NOT NULL,
        WHEN_PLACED  TIMESTAMP(6) NOT NULL,
        WHEN_SHIPPED TIMESTAMP(6),
    primary key (ORD_NUM),
    foreign key (CUST_NUM) references TTUSER.CUSTOMER (CUST_NUM));
 
create sequence TTUSER.CUSTID
    increment by 1
    minvalue 1
    maxvalue 1000000
    start with 1
    cache 20;
 
create materialized view TTUSER.ORDER_SUMMERY as
    SELECT CUST.NAME "NAME", ORD.ORD_NUM "ORD_NUM", COUNT(*) "ORD_COUNT" 
    FROM TTUSER.ORDERS ORD, TTUSER.CUSTOMER CUST WHERE ORD.CUST_NUM = 
    CUST.CUST_NUM GROUP BY CUST.NAME, ORD.ORD_NUM ;

Example 5-5 Listing specific objects

Return only the materialized views and sequences for the orderdsn database.

% ttSchema -list views,sequences orderdsn
-- Database is in Oracle type mode
create sequence TTUSER.CUSTID
    increment by 1
    minvalue 1
    maxvalue 1000000
    start with 1
    cache 20;
 
create materialized view TTUSER.ORDER_SUMMERY as
    SELECT CUST.NAME "NAME", ORD.ORD_NUM "ORD_NUM", COUNT(*) "ORD_COUNT" 
    FROM TTUSER.ORDERS ORD, TTUSER.CUSTOMER CUST WHERE ORD.CUST_NUM = 
    CUST.CUST_NUM GROUP BY CUST.NAME, ORD.ORD_NUM ;

Example 5-6 Specifying an object

Return the schema information for the orders table in the orderdsn database.

% ttSchema orderdsn ttuser.orders
-- Database is in Oracle type mode
Warning: tables may not be printed in an order that can satisfy foreign key
reference constraints
create table TTUSER.ORDERS (
        ORD_NUM      NUMBER(38) NOT NULL,
        CUST_NUM     NUMBER(38) NOT NULL,
        WHEN_PLACED  TIMESTAMP(6) NOT NULL,
        WHEN_SHIPPED TIMESTAMP(6),
    primary key (ORD_NUM),
    foreign key (CUST_NUM) references TTUSER.CUSTOMER (CUST_NUM));

Example 5-7 Specifying fixed data types

Return the schema information for the orderdsn database, using fixed data type names.

% ttSchema -fixedTypes orderdsn
-- Database is in Oracle type mode
create table TTUSER.CUSTOMER (
        CUST_NUM NUMBER(38) NOT NULL,
        REGION   ORA_CHAR(2 BYTE) NOT NULL,
        "NAME"   ORA_VARCHAR2(80 BYTE) INLINE NOT NULL,
        ADDRESS  ORA_VARCHAR2(255 BYTE) NOT INLINE NOT NULL,
    primary key (CUST_NUM));
 
create table TTUSER.ORDERS (
        ORD_NUM      NUMBER(38) NOT NULL,
        CUST_NUM     NUMBER(38) NOT NULL,
        WHEN_PLACED  ORA_TIMESTAMP(6) NOT NULL,
        WHEN_SHIPPED ORA_TIMESTAMP(6),
    primary key (ORD_NUM),
    foreign key (CUST_NUM) references TTUSER.CUSTOMER (CUST_NUM));
 
create sequence TTUSER.CUSTID
    increment by 1
    minvalue 1
    maxvalue 1000000
    start with 1
    cache 20;
 
create materialized view TTUSER.ORDER_SUMMERY as
    SELECT CUST.NAME "NAME", ORD.ORD_NUM "ORD_NUM", 
    COUNT(*) "ORD_COUNT" FROM TTUSER.ORDERS ORD, TTUSER.CUSTOMER CUST 
    WHERE ORD.CUST_NUM = CUST.CUST_NUM
    GROUP BY CUST.NAME, ORD.ORD_NUM ;

Notes

The SQL generated does not produce a history of transformations through ALTER statements, nor does it preserve table partitions, although the output gives information on table partitions in the form of SQL comments. The ttSchema utility prints out the partition numbers for the columns that are not in the initial partition. The initial partition is 0, so partition 1 as printed by ttSchema is secondary partition 1, not the initial partition. For more details on partitions, see "Understanding partitions when using ALTER TABLE," in the "ALTER TABLE" section of the Oracle TimesTen In-Memory Database SQL Reference.

The connection attribute PassThrough with a nonzero value is not supported with this utility and returns an error.

Output is not guaranteed to be compatible with DDL recognized by previous releases of TimesTen.

It is recommended that you do not run DDL SQL commands while running ttSchema to avoid lock contention issues for your application.

ttSize

Description

Estimates the amount of space that a given table, including any views in the database will consume when the table grows to include rows rows. You can use this utility on existing tables or to estimate table sizes when creating tables. If you do not specify an owner, ttSize prints size information for all tables of the given table name. The size information includes space occupied by any indexes defined on the table.

The memory required for varying-length columns is estimated by using the average length of the columns in the current table as the average length of the columns in the final table. If there are no rows in the current table, then ttSize assumes that the average column length is one half the maximum column length.

The memory required for LOB columns is estimated by using the average length of the columns in the current table as the average length of the columns in the final table. When no rows are being inserted into the table, computations do not include LOB columns.

The table is scanned when this utility is called. Avoid the scan of the table by specifying an optional non-NULL frac value, which should be between 0 and 1. The ttSize utility uses this value to estimate 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 option is not specified, 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 not specified and the table has no rows in it, then frac is assumed to have the value 0.5.

Required privilege

This utility requires no privileges beyond those needed to perform select operations on the specified database objects.

Usage with TimesTen Scaleout

This utility is supported in TimesTen Scaleout.

Syntax

ttSize {-h | -help | -?}
ttSize {-V | -version}
ttSize -tbl [owner.][tableName] [-rows rows] [- frac fraction] 
     {-connStr connection_string | DSN}

Options

ttSize has the options:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN Specifies the name of a data source to which ttSize should connect to retrieve table information.
-frac frac Specifies the estimated average fraction of out-of-line VARCHAR or VARBINARY column sizes that will be used. If this option is omitted and the table contains out-of-line variable sized columns, a table scan is done to determine the average sizes. If the table is empty, the fraction is estimated to be 0.5 (50%) filled.
-h

-help

-?

Prints a usage message and exits.
-tbl [owner.][tableName] Specifies the name of the table whose definition should be used for size estimation. If the owner is omitted, the login name of the user is tried. If that is not found, the user SYS is used. tableName is an optional parameter. The output of ttSize is not very useful if you omit the tableName parameter.
-rows rows Specifies the expected number of rows in the table. Space required to store a TimesTen table includes space for the actual data, plus overhead for bookkeeping, dynamic memory allocation and indexes.

TimesTen may consume additional space due to memory fragmentation, temporary space allocated during query execution and space to hold compiled SQL statements.

If this option is omitted, the ttSize utility uses the number of rows in the existing table to estimate the table space, or uses 1 row if the table is empty.

-V | -version Prints the release number of ttSize and exits.

Examples

To estimate the space required for a table, create the table in TimesTen, populate it with a sample of representative rows, create desired indexes and execute ttSize with those definitions. For example, to estimate the size of the NAMEID table in the data source FixedDs when it grows to 200,000 rows, execute:

% ttSize -tbl Nameid -rows 200000 FixedDs

Rows = 200000

Total in-line row bytes = 7139428

Total = 7139428

Notes

LOB columns are treated similar to var-type columns, unless there are no rows being inserted into the table. The average size computation does not include LOB columns in such cases.

The columns PERM_ALLOCATED_SIZE and PERM_IN_USE_SIZE show the currently allocated size of the database (in KB units) and the in-use size of the database. The system updates this information each time a connection is made or released and each time a transaction is committed or rolled back.

This utility is supported only for TimesTen Data Manager DSNs. It is not supported for TimesTen Client DSNs.

ttStats

The ttStats utility is supported in TimesTen Classic and TimesTen Scaleout, but supports different syntax and options. The following sections describe the ttStats utility for:

Table 5-3 shows the main differences of how the ttStats utility works in TimesTen Classic and TimesTen Scaleout.

Table 5-3 Differences between ttStats in TimesTen Classic and TimesTen Scaleout

Action TimesTen Classic
TimesTen Scaleout

Create a snapshot

Execute the ttStats -snapshot utility to create a snapshot. The -description option for -snapshot is optional

The ttStats daemon creates snapshots based on the pollSec parameter of the ttStatsConfig built-in procedure.

If you execute ttStats -snapshot -description description in TimesTen Scaleout, you can associate a description to the latest system generated snapshot.

Drop a snapshot

Execute the ttStats -drop -begin_snap snapid1 -end_snap snapid2 utility to drop snapshots.

The ttStats daemon automatically drops snapshots based on the retentionDays parameter of the ttStatsConfig built-in procedure.

The -drop option of the ttStats utility is not supported in TimesTen Scaleout.

View information about a snapshot

Execute the ttStats -report utility without any arguments. The ttStats utility prints the snapshot ID, date, time, capture level, and the description of all snapshots.

Execute the ttStats -snapshotInfo utility. The ttStats utility prints the snapshot ID, date, time, and the description of all snapshots.

Generate a report between two snapshots

Execute the ttStats -report -snap1 snapid1 -snap2 snapid2 utility. The utility generates a report between two snapshot IDs.

Execute the ttStats -report -snap1 snapid1 -snap2 snapid2 utility or the ttStats -report -timestamp1 ts1 -timestamp2 ts2 utility. The utility generates a report between two snapshot IDs or timestamps.

You can only generate a text version of a report in TimesTen Scaleout.


TimesTen Classic

This section describes how the ttStats utility works in TimesTen Classic.

Description

The ttStats utility monitors database metrics (statistics, states, and other information) or takes and compares snapshots of metrics. It can perform the following functions.

  • Monitor and display database performance metrics in real-time, calculating rates of change during each preceding interval.

  • Collect and store snapshots of metrics to the database then produce reports with values and rates of change from a specified pair of snapshots. (These functions are performed through calls to the TT_STATS PL/SQL package.)

The ttStats utility gathers metrics from TimesTen Classic system tables, views, and built-in procedures. In reports, this includes information such as a summary of memory usage, connections, and load profile, followed by metrics (as applicable) for SQL statements, transactions, PL/SQL memory, replication, logs and log holds, checkpoints, cache groups, latches, locks, XLA, and TimesTen connection attributes. Monitoring displays a smaller set of key data, as shown later in this section.

For client DSNs, use the ttStatsCS version of the utility (UNIX and Linux systems or Windows).

There are three modes of operation:

  • Monitor mode (default mode): Tracks database performance in real-time by monitoring a pre-determined set of metrics, displays those metrics (primarily those whose values have changed since the last display), and calculates rates of change in the values where appropriate. Information is output to the standard output for display to the user and is not stored to disk.

    If the duration or number of iterations is not specified, the monitoring runs until interrupted with Ctrl-C.

    Note:

    The set of metrics displayed in monitor mode is subject to change, depending on changes to the system tables and built-in procedures from which metrics are gathered.
  • Snapshot mode: Takes a snapshot of metrics, according to the capture level, and stores them to database SYS.SNAPSHOT_XXXX system tables. Once the snapshot is taken, its ID number is displayed to the standard output. The capture level applies only to metrics from SYS.SYSTEMSTATS. For metrics from other sources, the same data are collected regardless of the capture level.

    By default, a "typical" set of metrics is collected, which suits most purposes, but you can specify a reduced "basic" set of metrics, all available metrics, or only those metrics from sources other than SYSTEMSTATS.

  • Report mode: Generates a report from two specified snapshots of metrics. Reports are in HTML format by default, but you can request plain text format. You can specify an output file or display output to the standard output. For those familiar with Oracle Database performance analysis tools, the ttStats reports are similar in nature to Oracle Automatic Workload Repository (AWR) reports.

In monitor mode, the overhead of reading from the database is avoided. In snapshot mode and report mode, the ttStats utility is a convenient front end to the TT_STATS PL/SQL package provided by TimesTen. Refer to "TT_STATS" in Oracle TimesTen In-Memory Database PL/SQL Packages Reference for details on that package.

Notes:

The ttStats utility has the following dependencies and limitations:
  • Monitor mode requires features added to the SYS.SYSTEMSTATS table in TimesTen release 11.2.2.4.0.

  • Snapshot and report modes require the TT_STATS PL/SQL package, added in TimesTen release 11.2.2.5.0.

  • The utility cannot be used if you are connecting to TimesTen through a driver manager.

For information about built-in procedures mentioned, and the data they gather, see Chapter 3, "Built-In Procedures".

Required privilege

  • Monitor mode: No special privilege is required to run monitor mode, but ADMIN privilege is required for the monitoring information to include data from the ttSQLCmdCacheInfo built-in procedure and transaction_log_api (XLA) table.

  • Snapshot and report mode: By default, only the instance administrator has privilege to run in snapshot or report mode, due to security restrictions of the TT_STATS PL/SQL package. Any other user, including an ADMIN user, must be granted EXECUTE privilege for the TT_STATS package by the instance administrator or by an ADMIN user, such as in the following example:

    GRANT EXECUTE ON SYS.TT_STATS TO scott;
    

Syntax

These are the supported name/value pairs:

ttStats [-h | -help]
ttStats [-V | -version]
ttStats [-monitor] [-interval seconds]
        [-duration seconds] [-iterations count]
           {DSN | -connStr connection_string}
ttStats  -snapshot [-level capture_level] [-description snap_desc]
           {DSN | -connStr connection_string}
ttStats  -report [-snap1 snapid1 -snap2 snapid2]
         [-html | -text] [-outputFile filename]
           {DSN | -connStr connection_string}
ttStats  -drop [-begin_snap snapid1 [-end_snap snapid2]]
           {DSN | -connStr connection_string}

Note:

Specify only one of -monitor, -snapshot, or -report.

Options

These are the supported options for the ttStats utility in TimesTen Scaleout:

Option Description
-h

-help

Prints the list of options and exits.

Note: This is also the result if nothing is entered on the ttStats command line, or if options are entered without a DSN or connection string.

-V

-version

Prints the TimesTen release number and exits.
-monitor Run in real-time monitor mode. Monitors a pre-determined set of metrics and repeatedly displays the metrics and rates of change. Unlike in snapshot mode, nothing is stored to the database.

Note: This is the default mode if neither -monitor, -snapshot, nor -report is specified.

-interval seconds For monitor mode, this is the time interval between sets of metrics that are displayed, in seconds. The default is 10 seconds. Shorter intervals may negatively impact system performance.
-duration seconds For monitor mode, this is the duration of how long ttStats runs, in seconds. After this duration, the utility exits.

Also see information for the -iterations option.

-iterations count For monitor mode, this is the number of iterations ttStats performs in gathering and displaying metrics. After these iterations, the utility exits.

Note: If you specify both -duration and -iterations, monitoring stops when the first of the two limits is reached. If you specify neither, monitoring continues until interrupted by Ctrl-C

-snapshot Collect a snapshot of metrics according to the capture level and store the metrics in the database. Once the snapshot is captured, its ID number is displayed.

Notes:

  • TimesTen gathers all SYSTEMSTATS when you take a snapshot, but only those within the specified capture level have meaningful accumulated values. Metrics outside of the specified level have a value of 0 (zero).

  • This option is implemented by a call to the CAPTURE_SNAPSHOT procedure of the TT_STATS PL/SQL package.

-level capture_level For snapshot mode, this is the level of metrics to capture. The possible settings are as follows:
  • 0: For metrics outside of SYS.SYSTEMSTATS only.

  • 1: For only "basic" metrics.

  • 2 (default): For "typical" metrics. This includes the basic metrics. This level is appropriate for most purposes.

  • 3: For all available metrics.

Use the same level for any two snapshots to be used in a report.

Notes:

  • These levels correspond to the capture levels NONE, BASIC, TYPICAL, and ALL for the TT_STATS PL/SQL package.

  • The capture level applies only to metrics from the SYS.SYSTEMSTATS table. For metrics from other sources, the same data are collected regardless of the capture level.

-description snap_desc For snapshot mode, optionally use this to provide any description or notes for the snapshot, for example to distinguish it from other snapshots.
-report Generate a report from two specified snapshots, in HTML format by default. Use snapshots taken at the same capture level.

Notes:

  • If you do not specify any snapshot IDs, a list of available snapshots (with date, time, capture level, and any notes) is displayed and you are prompted to enter each of the desired IDs. If you specify only one snapshot ID, you are told that you must enter two—reenter the command, specifying two snapshots.

  • This option is implemented by a call to the GENERATE_REPORT_HTML or (if the -text option is used) the GENERATE_REPORT_TEXT procedure of the TT_STATS PL/SQL package.

-snap1 snapid1 For report mode, this is the snapshot ID of the first snapshot.
-snap2 snapid2 For report mode, this is the snapshot ID of the second snapshot.
-outputFile filename For report mode, optionally specify a file path and name where the report is to be written. If no file is specified, TimesTen writes the to the standard output.
-html | -text For report mode, specify HTML or plain text output format.

Note: It is not necessary to specify -html. If you specify no format, the report is in HTML format by default.

-drop Delete snapshots in the range specified by -begin_snap and -end_snap (inclusive) from the system.

This option is useful to keep the snapshot storage under the limit of 255 snapshots in the database.

-begin_snap snapid1 For the -drop option, this specifies the snapshot ID at the beginning of the range of snapshots to delete.
-end_snap snapid2 For the -drop option, this specifies the snapshot ID at the end of the range of snapshots to delete.

If -end_snap is not specified, then only the snapshot specified by -begin_snap is deleted.

-connStr connection_string

or

DSN

To specify and connect to the database from which to gather metrics, do one of the following:
  • Specify an ODBC connection string, preceded by -connStr.

  • Specify a DSN (data source name), without -connStr, at the end of the command line.

See "Specifying Data Source Names to identify TimesTen databases" in Oracle TimesTen In-Memory Database Operations Guide for information about TimesTen DSNs.


Examples

This section provides examples of ttStats monitoring and report output.

Note:

Examples are for illustrative purposes only. Details are subject to change.

Monitor example

This section shows sample output from monitor mode.

% ttStats database1

Connected to TimesTen Version 18.1.4.1.0 TimesTen Cache version 18.1.4.1.0.

Waiting for 10 seconds for the next snapshot
Description                          Current  Rate/Sec  Notes
date.2016-Feb-20 16:49:25      -869676175380467200           1  sample #, not rate
connections.count                         12
db.size.temp_high_water_mark.kb         7153       7
lock.locks_granted.immediate             832       1
log.log_bytes_per_transaction              0
loghold.bookmark.log_force_lsn    0/12027904
loghold.bookmark.log_write_lsn    0/12050944
loghold.checkpoint_hold_lsn       0/12025856                  database1.ds0
loghold.checkpoint_hold_lsn       0/12023808                  database1.ds1
stmt.executes.count                       44       1
stmt.executes.selects                     32       1

Note:

The number following the date and time is a numeric representation of the time of the snapshot and can be ignored.

The following command line example specifies that monitoring should stop after two iterations and uses a connection string to set a connection attribute value.

% ttStats -iterations 2 
-connStr "DSN=database1;PLSQL_MEMORY_ADDRESS=20000000"

Snapshot example

The following examples take two snapshots at the default typical level:

% ttStats -snapshot database1

Connected to TimesTen Version 18.01.01.0001 TimesTen Cache version 
18.1.4.1.0.
Snapshot 1 at TYPICAL level was successfully captured.

% ttStats -snapshot database1

Connected to TimesTen Version 18.1.4.1.0 TimesTen Cache version 
18.1.4.1.0
Snapshot 2 at TYPICAL level was successfully captured.

Report examples

The following example creates a report from the snapshots generated in the previous section.

% ttStats -report -outputFile testreport.html -snap1 1 -snap2 2 database1

Connected to TimesTen Version 18.01.01.0001 TimesTen Cache version 
18.1.4.1.0.
Report testreport.html was created.

The rest of this section shows excerpts from tables of metrics that a ttStats report generates. This output was produced using the default HTML format.

Note:

Examples are not shown for SWT cache group metrics, local cache group metrics, dynamic global cache group metrics, grid metrics, or latch metrics.

To include latch metrics, you must enable them for the database, using the ttXactAdmin utility as follows:

% ttXactAdmin -latchstats on DSN

Summary Figure 5-1 shows most of a report summary. The summary is good for a quick look at database metrics, with further details provided in the subsequent tables. It includes the following sections:

  • Memory Usage and Connections: This information includes information about memory usage (the db.size metrics) and connections established (the connections.established metrics), including the number of client/server connections and direct connections. Any nonzero value for connections.established.threshold_exceeded, indicates too many connections.

  • Load Profile: This gives an idea of the workload, showing the number of checkpoints, sorts (such as for ORDER BY statements), log buffer waits (delays when the log buffer fills and flushes to disk), inserts, updates, deletes, parses (such as for prepares), commits, and rollbacks. Consider whether there may be too many parses or too many durable commits (which are more expensive than non-durable commits).

  • Instance Efficiency Percentage: Command Cache Hit %, Non-Parse/Execs %, Lock Hit %, and Log Buffer No Wait % are shown. All should be near 100%.

    • Lock Hit % estimates the percentage of lock requests that are granted without waiting.

    • Non-Parse/Execs % represents the percentage of SQL statement executions that do not require a prepare or reprepare.

    • Command Cache Hit % estimates the percentage of executions of SQL commands that can be found in the command cache.

    • Log Buffer No Wait % estimates the percentage of log insertions that do not have to wait due to log buffer waits.

Figure 5-1 ttStats report: summary

Description of Figure 5-1 follows
Description of ''Figure 5-1 ttStats report: summary''

Statement statistics Figure 5-2 shows statement metrics from a report. Both external metrics (stmt.executes, stmt.prepares, and stmt.reprepares metrics) and internal metrics (zzinternal metrics) are shown. External metrics are generally of more interest. The stmt.executes.count value is the sum of all the other stmt.executes values.

Figure 5-2 ttStats report: statement statistics

Description of Figure 5-2 follows
Description of ''Figure 5-2 ttStats report: statement statistics''

Transaction statistics Figure 5-3 shows transaction metrics from a report. The txn.commits.count value is the sum of the txn.commits.durable and txn.commits.nondurable values. Other metrics shown are subsets of these metrics.

Figure 5-3 ttStats report: transaction statistics

Description of Figure 5-3 follows
Description of ''Figure 5-3 ttStats report: transaction statistics''

SQL statistics: sort by executions Figure 5-4 shows an excerpt of SQL execution metrics from the SQL Statistics section of a report. When you look at the "sort by executions" metrics and "sort by preparations" metrics (shown in the next section), note which statements are used a lot and the number of preparations and the number of executions for each statement. Ideally, a statement is not prepared many times.

Figure 5-4 ttStats report: SQL execution statistics

Description of Figure 5-4 follows
Description of ''Figure 5-4 ttStats report: SQL execution statistics''

SQL statistics: sort by preparations Figure 5-5 shows an excerpt of SQL preparation metrics from the SQL Statistics section of a report. Refer to the discussion in the preceding "sort by executions" section.

Figure 5-5 ttStats report: SQL preparation statistics

Description of Figure 5-5 follows
Description of ''Figure 5-5 ttStats report: SQL preparation statistics''

SQL statistics: command texts Figure 5-6 shows an excerpt of SQL statements from the SQL Statistics section of a report. This report shows the complete text of each statement listed in the preceding "sort by executions" and "sort by preparations" reports, where longer statements are abbreviated.

Figure 5-6 ttStats report: SQL command texts

Description of Figure 5-6 follows
Description of ''Figure 5-6 ttStats report: SQL command texts''

PL/SQL memory statistics Figure 5-7 shows PL/SQL memory metrics from a report. These are metrics from the ttPLSQLMemoryStats built-in procedure. There should not be a significant difference between the start and end values of GetHitRatio or PinHitRatio.

Figure 5-7 ttStats report: PL/SQL memory statistics

Description of Figure 5-7 follows
Description of ''Figure 5-7 ttStats report: PL/SQL memory statistics''

Replication statistics Figure 5-8 shows replication metrics from a report. For each transmitter (where there could be multiple transmitters per master), the metrics indicate advancement through the log, including how many records were sent to the receiver. Repl_Peer indicates the subscriber. Repl_Log_Behind and Repl_Latency are significant in indicating whether replication is keeping up with the database workload.

Figure 5-8 ttStats report: replication statistics

Description of Figure 5-8 follows
Description of ''Figure 5-8 ttStats report: replication statistics''

Parallel replication/AWT statistics Figure 5-9 shows an excerpt of parallel replication/AWT metrics from a report. Repl_Peer indicates the subscriber. When parallel replication/AWT is configured, if replication metrics (discussed in the previous section) indicate difficulty keeping up with the workload, parallel replication/AWT metrics may indicate why. Each value is an aggregate across all tracks, but you can click Show Details (at the end of the metrics table, not shown here) to see the data for each track. High values for track switching—"switchin" and "switchout" metrics—may indicate contention. High values for "waits" metrics are also problematic, indicating situations such as one transaction having to wait for a previous transaction to commit before it can begin or before it can commit.

Figure 5-9 ttStats report: parallel replication/AWT statistics

Description of Figure 5-9 follows
Description of ''Figure 5-9 ttStats report: parallel replication/AWT statistics''

Log statistics Figure 5-10 shows log metrics from a report. The report output notes that numbers in log.file.earliest and log.file.latest represent values in the begin and end snapshots. The log.buffer.waits metric is of particular interest. Log buffer waits occur when application processes cannot insert transaction data to the log buffer and must stall to wait for log buffer space to be freed. The usual reason for this is that the log flusher thread has not cleared out data fast enough. This may indicate that log buffer space is insufficient, disk bandwidth is insufficient, writing to disk is taking too long, or the log flusher is CPU-bound. (Also see "Managing transaction log buffers and files" and "Configure log buffer and log file size parameters" in Oracle TimesTen In-Memory Database Operations Guide.)

Figure 5-10 ttStats report: log statistics

Description of Figure 5-10 follows
Description of ''Figure 5-10 ttStats report: log statistics''

Log holds Figure 5-11 shows log hold information from a report. It shows bookmark positions for checkpoint log holds for each checkpoint file, and bookmark positions for replication log holds for each replication subscriber. This report may also show log hold information for backup, XLA, and long-running transactions. Where the begin and end values are the same, there have been no movements.

Ideally there will be evidence of a smooth progression through the log file. (The ttStats monitor information may be more useful in tracking this.)

Figure 5-11 ttStats report: log holds

Description of Figure 5-11 follows
Description of ''Figure 5-11 ttStats report: log holds''

Checkpoint statistics Figure 5-12 shows checkpoint metrics from a report.

Figure 5-12 ttStats report: checkpoint statistics

Description of Figure 5-12 follows
Description of ''Figure 5-12 ttStats report: checkpoint statistics''

Cache group statistics: AWT cache groups Figure 5-13 shows AWT cache group metrics from a report. Values are aggregates across all AWT cache groups. Information includes the number of calls to the Oracle database; the number of commits, rollbacks, and retries on Oracle; and the number of rows inserted, deleted, and updated by PL/SQL operations and by SQL operations.

Figure 5-13 ttStats report: AWT cache group statistics

Description of Figure 5-13 follows
Description of ''Figure 5-13 ttStats report: AWT cache group statistics''

Cache group statistics: auto-refresh cache groups Figure 5-14 shows auto-refresh cache group metrics from a report. Values are aggregates across all auto-refresh cache groups. Whether cache groups are in full or incremental refresh mode is reflected by the cg.autorefresh.full_refreshes value with respect to the cg.autorefresh.cycles.completed value (which indicates the total number of refreshes).

Figure 5-14 ttStats report: auto-refresh cache group statistics

Description of Figure 5-14 follows
Description of ''Figure 5-14 ttStats report: auto-refresh cache group statistics''

Database activity statistics Figure 5-15 shows an excerpt of database activity metrics from a report—index activity, memory activity, and table activity. For hash indexes and range indexes, information includes deletes, inserts, rows fetched, and scans. For memory usage, it shows size data. For tables, it shows rows read, deleted, inserted, and updated.

Figure 5-15 ttStats report: database activity statistics

Description of Figure 5-15 follows
Description of ''Figure 5-15 ttStats report: database activity statistics''

Lock statistics Figure 5-16 shows lock metrics from a report. This provides information about deadlocks, locks acquired, locks granted, and lock timeouts. In particular, lock.deadlocks, lock.locks_granted.wait, and lock.timeouts may indicate lock contention.

Figure 5-16 ttStats report: lock statistics

Description of Figure 5-16 follows
Description of ''Figure 5-16 ttStats report: lock statistics''

XLA information Figure 5-17 shows XLA bookmark information from a report. For each bookmark, the begin and end values are shown for Purge_LSN, which indicates the position in the log file prior to which information has been purged, and for Log_Behind, which indicates whether there is a lag between the position of the XLA transaction and the position of the most recent log file.

Figure 5-17 ttStats report: XLA information

Description of Figure 5-17 follows
Description of ''Figure 5-17 ttStats report: XLA information''

Configuration parameters Figure 5-18 shows database configuration parameter settings from a report. For reference, each report shows the begin and end values of each TimesTen connection attribute.

For information about connection attributes, see Chapter 2, "Connection Attributes".

Figure 5-18 ttStats report: configuration parameters

Description of Figure 5-18 follows
Description of ''Figure 5-18 ttStats report: configuration parameters''

TimesTen Scaleout

This section describes how the ttStats utility works in TimesTen Scaleout.

Description

The ttStats utility monitors database metrics (statistics, states, and other information) or takes and compares snapshots of metrics. It can perform the following functions.

  • Monitor and display database performance metrics in real-time, calculating rates of change during each preceding interval.

The ttStats utility gathers metrics from TimesTen system tables, views, and built-in procedures. In reports, this includes information such as a summary of memory usage, connections, and load profile, followed by metrics (as applicable) for SQL statements, transactions, PL/SQL memory, replication, logs and log holds, checkpoints, cache groups, latches, locks, and TimesTen connection attributes. Monitoring displays a smaller set of key data, as shown later in this section.

For client DSNs, use the ttStatsCS version of the utility (UNIX and Linux systems or Windows).

There are three modes of operation:

  • Monitor mode (default mode): Tracks database performance in real-time by monitoring a pre-determined set of metrics, displays those metrics (primarily those whose values have changed since the last display), and calculates rates of change in the values where appropriate. Information is output to the standard output for display to the user and is not stored to disk.

    If the duration or number of iterations is not specified, the monitoring runs until interrupted with Ctrl-C.

    Note:

    The set of metrics displayed in monitor mode is subject to change, depending on changes to the system tables and built-in procedures from which metrics are gathered.
  • Snapshot mode: In TimesTen Scaleout, the ttStats daemon automatically takes snapshots of the TimesTen Scaleout database based on the parameters of the ttStatsConfig built-in procedure.

    If you use the -snapshot option of the ttStats utility, the -description option is mandatory. When you execute ttStats -snapshot -description description, you can associate a description to the latest system generated snapshot. Provide any description or notes for the snapshot, for example to distinguish it from other snapshots.

  • Report mode: Generates a report from two specified snapshots or two specified timestamps of metrics. Reports are only available in plain text format. You must specify an output file with the -outputFile option. For those familiar with Oracle Database performance analysis tools, the ttStats reports are similar in nature to Oracle Automatic Workload Repository (AWR) reports.

In monitor mode, the overhead of reading from the database is avoided. In snapshot mode and report mode, the ttStats utility is a convenient front end to the TT_STATS PL/SQL package provided by TimesTen. Refer to "TT_STATS" in Oracle TimesTen In-Memory Database PL/SQL Packages Reference for details on that package.

Notes:

The ttStats utility has the following dependencies and limitations:
  • The utility cannot be used if you are connecting to TimesTen through a driver manager.

For information about built-in procedures mentioned, and the data they gather, see Chapter 3, "Built-In Procedures".

Required privilege

  • Monitor mode: No special privilege is required to run monitor mode, but ADMIN privilege is required for the monitoring information to include data from the ttSQLCmdCacheInfo built-in procedure.

  • Snapshot and report mode: By default, only the instance administrator has privilege to create snapshots, get snapshot information and run in report mode, due to security restrictions of the TT_STATS PL/SQL package. Any other user, including an ADMIN user, must be granted EXECUTE privilege for the TT_STATS package by the instance administrator or by an ADMIN user, such as in the following example:

    GRANT EXECUTE ON SYS.TT_STATS TO scott;
    

Syntax

ttStats [-h | -help]
ttStats [-V | -version]
ttStats [-monitor] [-interval seconds]
        [-duration seconds] [-iterations count]
           {DSN | -connStr connection_string}
ttStats  -snapshot -description snap_desc
           {DSN | -connStr connection_string}
ttStats  -report [-snap1 snapid1 -snap2 snapid2 | 
         -timestamp1 'timestamp1' -timestamp2 'timestamp2']
         -outputFile filename
ttStats  -snapshotInfo {DSN | -connStr connection_string}

Note:

Specify only one of -monitor, -snapshot, or -report.

Options

These are the supported options for the ttStats utility in TimesTen Scaleout:

Option Description
-h

-help

Prints the list of options and exits.

Note: This is also the result if nothing is entered on the ttStats command line, or if options are entered without a DSN or connection string.

-V

-version

Prints the TimesTen release number and exits.
-monitor Run in real-time monitor mode. Monitors a pre-determined set of metrics and repeatedly displays the metrics and rates of change. Unlike in snapshot mode, nothing is stored to the database.

Note: This is the default mode if neither -monitor, -snapshot, nor -report is specified.

-interval seconds For monitor mode, this is the time interval between sets of metrics that are displayed, in seconds. The default is 10 seconds. Shorter intervals may negatively impact system performance.
-duration seconds For monitor mode, this is the duration of how long ttStats runs, in seconds. After this duration, the utility exits.

Also see information for the -iterations option.

-iterations count For monitor mode, this is the number of iterations ttStats performs in gathering and displaying metrics. After these iterations, the utility exits.

Note: If you specify both -duration and -iterations, monitoring stops when the first of the two limits is reached. If you specify neither, monitoring continues until interrupted by Ctrl-C

-snapshot -description snap_desc If you use the -snapshot option, the -description option is mandatory. When you execute ttStats -snapshot -description description, you can associate a description to the latest system generated snapshot. Provide any description or notes for the snapshot, for example to distinguish it from other snapshots.
-report Generate a report from two specified snapshots or two specified timestamps. Use the -snapshotInfo option to see available snapshots for your database.
-snap1 snapid1 For report mode, this is the snapshot ID of the first snapshot.
-snap2 snapid2 For report mode, this is the snapshot ID of the second snapshot. The report period must span at least four existing snapshot ID values. Therefore, you must have at least three snapshots between -snap1 and -snap2.
-timestamp1 'timestamp1' For report mode, this specifies the timestamp of the first snapshot. The timestamp must use the YYYY-MM-DD HH:MM:SS format and be wrapped in straight single quotes.
-timestamp2 'timestamp2' For report mode, this specifies the timestamp of the second snapshot. The timestamp must use the YYYY-MM-DD HH:MM:SS format and be wrapped in straight single quotes.
-outputFile filename For report mode, optionally specify a file path and name where the report is to be written. If no file is specified, TimesTen writes the to the standard output.
-snapshotInfo Prints the snapshot ID, date, time, and the description of all snapshots.
-connStr connection_string

or

DSN

To specify and connect to the database from which to gather metrics, do one of the following:
  • Specify an ODBC connection string, preceded by -connStr.

  • Specify a DSN (data source name), without -connStr, at the end of the command line.

See "Specifying Data Source Names to identify TimesTen databases" in Oracle TimesTen In-Memory Database Operations Guide for information about TimesTen DSNs.


Examples

This section provides examples of ttStats monitoring and report output.

Note:

Examples are for illustrative purposes only. Details are subject to change.

Monitor example

This section shows sample output from monitor mode.

% ttStats database1

Connected to TimesTen Version 18.01.01.0001 Oracle TimesTen IMDB version 18.1.4.1.0.

Waiting for 10 seconds for the next snapshot

Description                       Current  Rate/Sec  Notes
date.2016-Mar-16 15:29:23      1458167363         1  sample #, not rate
connections.count                      20            
lock.locks_granted.immediate       124817         1  
log.log_bytes_per_transaction           0            
loghold.bookmark.log_force_lsn 0/21102592            
loghold.bookmark.log_write_lsn 0/21102856            
loghold.checkpoint_hold_lsn    0/21100544            database1.ds0
loghold.checkpoint_hold_lsn    0/21078016            database1.ds1
plsql.GetHitRatio                   0.640     0.000  
plsql.GetHits                     258.000     0.200  
plsql.Gets                        403.000     0.200  
plsql.PinHitRatio                   0.557     0.000  
plsql.PinHits                     424.000     0.200  
plsql.Pins                        761.000     0.200  
stmt.executes.count                 24407         1  
stmt.executes.selects                 620         1  
 

Note:

The number following the date and time is a numeric representation of the time of the snapshot and can be ignored.

The following command line example specifies that monitoring should stop after two iterations and uses a connection string to set a connection attribute value.

% ttStats -iterations 2 -connStr "DSN=database1"

Report examples

The following example creates a report from the snapshots generated in the previous section.

Note:

The report period must span at least four existing snapshot ID values. Therefore, you must have at least three snapshots between -snap1 and -snap2.
% ttStats -report -outputFile testreport.txt -snap1 1 -snap2 5 database1

Connected to TimesTen Version 18.01.01.0001 Oracle TimesTen IMDB version 18.1.4.1.0.
Report testreport.txt was created.

The rest of this section shows excerpts from tables of metrics for a ttStats report for a TimesTen Scaleout database and a ttStats report for an element of a TimesTen Scaleout database. This output was produced using the default plain text output format.

Note:

To include latch metrics, you must enable them for the database, using the ttXactAdmin utility as follows:
% ttXactAdmin -latchstats on DSN

TimesTen Scaleout ttStats report

The following sections show excerpts from tables of metrics for a ttStats report for a TimesTen Scaleout database.

TimesTen Scaleout snapshot summary Displays a grid snapshot summary. The TimesTen Scaleout snapshot summary shows information regarding the snapshots that you specified for the ttStats report.

TimesTen Scaleout elements  Displays information about each database element. This section of the report shows the host name and current number of connections for each database element. See "TimesTen Scaleout element ttStats report" for more information on the contents of an elements ttStats report.

TimesTen Scaleout summary Displays a summary of critical TimesTen Scaleout statistics. The summary includes statistics of your TimesTen Scaleout about transaction rates, SQL statements, database connections, checkpoint rates, transaction log rates, and other critical statistics.

TimesTen Scaleout load profile Displays various database metric rates. This gives you an idea of the workload, showing the rate of checkpoints, log buffer waits (delays when the log buffer fills and flushes to disk), inserts, updates, deletes, parses (such as for prepares), commits, and s. Consider whether there may be too many parses or too many durable commits (which are more expensive than non-durable commits).

Operating system metrics summary Displays various operating system metrics for the TimesTen Scaleout database. These metrics show the used disk space, CPU, I/O rate, and RAM.

TimesTen Scaleout efficiency metrics Displays various metrics that determine the efficiency of the TimesTen Scaleout. This section of the report includes the following sections:

  • Target 100% - bigger is better: This shows you recommendations to improve the efficiency of the TimesTen Scaleout. It includes the following metrics:

    • Prepare exec efficiency: This shows if your SQL statements are prepared and then executed many times. If you prepare a SQL statement once for every execution, this metric goes down.

      Try to minimize the number of times your SQL statements are prepared because preparing SQL statements is CPU intensive. In your applications, consider using bind variables. You can then prepare your SQL statements once and then execute your SQL statements multiple times.

  • Target 0% - smaller is better: This shows you recommendations to improve the efficiency of the TimesTen Scaleout. It includes the following metrics:

    • Log buffer waits: This shows the number of log buffer waits which helps you determine how operations that use the log files are doing. It is optimal to maintain the log buffer wait low because it indicates that transactions do not need to wait before writing to the log buffer.

      If this number is large, try to checkpoint more frequently, increase the Log Buffer Size and/or increase the log buffer parallelism

    • Table data skew deviation: This shows the percentage of table data skew deviations between the elements of the TimesTen Scaleout. Ideally the rows in tables are distributed evenly across all elements. If elements have too many rows compared to other elements, the elements with more rows use more permSize which can cause disk size and data distribution problems.

    • Direct mode connection distribution deviation: This shows the percentage of the direct mode connection deviation between the elements of the TimesTen Scaleout. Evenly spread the direct mode connections between the elements to achieve optimal throughput and latency.

    • Client server connection distribution deviation: This shows the percentage of the client/server connection deviation between the elements of the TimesTen Scaleout. Evenly spread the client/server connections between the elements to achieve optimal throughput and latency.

    • SQL statement distribution deviation: This shows the percentage of the SQL statement distribution deviation between the elements of the TimesTen Scaleout. It is not optimal to execute all SQL statements on a single attempt. Evenly execute the SQL statements on the elements to achieve optimal throughput and latency.

    • Grid channel invalidation: This shows the number of channel invalidations between the elements of the TimesTen Scaleout. Applications should cleanly disconnect and release resources to minimize channel invalidations. The cleanup process that TimesTen Scaleout performs after a channel invalidation takes time, which affects the latency and scalability of operations that want to use that channel.

TimesTen Scaleout transactions  Displays various metrics that show information about transactions on the TimesTen Scaleout. This section of the report includes the following sections:

  • TimesTen Scaleout transactions per second

    This table shows various transaction metrics for each element such as the rate of transactions that: only involve the local element, multiple elements, and require 2PC.

  • TimesTen Scaleout 2PC transactions

    This table shows various 2PC transaction metrics for each element such as the percentage of transactions that: started on this element, were involved in a 2PC transaction but did not initiate it, and used durable 2PC prepares.

  • TimesTen Scaleout Durable Commits

    This table shows various transaction metrics for each element such as the percentage of transactions that are committed durably on this element.

SQL statements: SQL statement protocol Displays an excerpt of SQL statement protocol statistics from the SQL Statements section of a report. These statistics show you the percentage of SQL statements: executed for that element, executed on their local element, that required execution on a remote element, and that required a broadcast to all elements to execute.

SQL statements: SQL statements type Displays an excerpt of SQL statement type statistics from the SQL Statements section of a report. These statistics show you various statistics of SQL statements executed for that element.

DB connections Displays various connection statistics for each element of the TimesTen Scaleout. These statistics show you the type of connections, connections and disconnections per minute, and client server failover for every element of the TimesTen Scaleout.

TimesTen Scaleout data distribution: table data skew - worst three tables Displays the three tables with the highest data skew percentage of the TimesTen Scaleout. For more information on the row distribution table, see "TimesTen Scaleout data distribution: row distribution for table." These statistics show you the percentage of deviation, the table distribution type, and the distribution keys for the three tables with the highest data skew percentage.

TimesTen Scaleout data distribution: TimesTen Scaleout PermSize usage Displays statistics related to the PermSize attribute for each element of the TimesTen Scaleout. These statistics show you the proportional percentage of used PermSize for each element in the TimesTen Scaleout, percentage of used PermSize, the percentage of used high water of PermSize, and the size of the PermSize for each element of the TimesTen Scaleout. For more information about the PermSize attribute, see "PermSize."

TimesTen Scaleout data distribution: TimesTen Scaleout TempSize usage Displays statistics related to the TempSize attribute for each element of the TimesTen Scaleout. These statistics show you the percentage of used TempSize, the percentage of used high water of TempSize, and the size of the TempSize for each element of the TimesTen Scaleout. For more information about the TempSize attribute, see "TempSize."

TimesTen Scaleout data distribution: row distribution for table There are three of these tables in your ttStats report, which show row distribution statistics for the tables with the highest data skew percentage of the TimesTen Scaleout. These statistics show you the number of rows that are stored on each element for that specific table. For more information about the three tables with the highest data skew percentage of the TimesTen Scaleout, see "TimesTen Scaleout data distribution: table data skew - worst three tables."

TimesTen Scaleout channel: TimesTen Scaleout messages per second Displays statistics related to message rates over TimesTen Scaleout channels. These messages can be requests for data or data result sets. These statistics show you the number of sent, received, and invalidated messages for each element of the TimesTen Scaleout.

TimesTen Scaleout channel: TimesTen Scaleout channel data rate Displays statistics related to channel data rates for each element of the TimesTen Scaleout. These data rates are based on the size of messages that TimesTen Scaleout sends over the channels. The messages can be requests for data or data result sets. Larger messages tend to have better throughput than smaller messages. These statistics show you the data rates of sent and received messages for each element of the TimesTen Scaleout.

Checkpoint: checkpoint data rate Displays statistics related to checkpoint data rates for each element of the TimesTen Scaleout database.

Transaction Log: transaction log data rate Displays statistics related to transaction log data rates for each element of the TimesTen Scaleout database.

Top SQL: top SQL attributes Displays statistics related to the attributes of the most executed SQL statements on the TimesTen Scaleout database.

Top SQL: top SQL text Displays information related to the SQL text of the most executed SQL statements on the TimesTen Scaleout database.

OS Disk Space Displays the statistics related to the disk space of every element that is part of the grid.

CPU Utilization Displays the statistics related to the CPU of every element that is part of the grid.

Operating System IO Rates: disk IO rates Displays the statistics related to the disk I/O rates of every element that is part of the grid. This table enables you to determine if a host has a lot of disk I/O operations that are unrelated to TimesTen Scaleout.

Operating System IO Rates: network IO rates Displays the statistics related to the network I/O rates of every element that is part of the grid. This table enables you to determine if a host has a lot of network I/O operations that are unrelated to TimesTen Scaleout.

OS Memory Displays the statistics related to the memory usage of every element that is part of the grid. This table enables you to determine if a host is using swap space or is having performance issues due to a lack of available RAM.

TimesTen Scaleout element ttStats report

The following sections show excerpts from tables of metrics for a ttStats report for an element of a TimesTen Scaleout database.

Snapshot Summary Displays the statistics related to the snapshots that ttStats uses to create the ttStats report for the element.

Element Summary Displays a summary of critical statistics for the element. The summary includes statistics of your element related to transaction rates, SQL statements, database connections, checkpoint rates, transaction log rates, and other critical statistics.

Load Profile Displays various database metric rates. This gives you an idea of the workload, showing the rate of checkpoints, log buffer waits (delays when the log buffer fills and flushes to disk), inserts, updates, deletes, parses (such as for prepares), commits, and s. Consider whether there may be too many parses or too many durable commits (which are more expensive than non-durable commits).

Operating System Metrics Summary Displays various operating system metrics for the element. These metrics show the used disk space, CPU, I/O rate, and RAM.

Efficiency Metrics Displays various metrics that determine the efficiency of the element. This section of the report includes the following sections:

  • Target 100% - bigger is better: This shows you recommendations to improve the efficiency of the element. It includes the following metrics:

    • Prepare exec efficiency: This shows if your SQL statements are prepared and then executed many times. If you prepare a SQL statement once for every execution, this metric goes down.

      Try to minimize the number of times your SQL statements are prepared because preparing SQL statements is CPU intensive. In your applications, consider using bind variables. You can then prepare your SQL statements once and then execute your SQL statements multiple times.

  • Target 0% - smaller is better: This shows you recommendations to improve the efficiency of the element. It includes the following metrics:

    • Log buffer waits: This shows the percentage of log buffer waits which helps you determine how operations that use the log files are doing. It is optimal to maintain the log buffer wait low because it indicates that transactions do not need to wait before writing to the log buffer.

      If this percentage is high, try to checkpoint more frequently, increase the Log Buffer Size and/or increase the log buffer parallelism

    • Table data skew deviation: This shows the percentage of table data skew deviations between the elements of the TimesTen Scaleout. Ideally the rows in tables are distributed evenly across all elements. If elements have too many rows compared to other elements, the elements with more rows use more permSize which can cause disk size and data distribution problems.

    • Direct mode connection distribution deviation: This shows the percentage of the direct mode connection deviation between the elements of the TimesTen Scaleout. Evenly spread the direct mode connections between the elements to achieve optimal throughput and latency.

    • Client server connection distribution deviation: This shows the percentage of the client/server connection deviation between the elements of the TimesTen Scaleout. Evenly spread the client/server connections between the elements to achieve optimal throughput and latency.

    • SQL statement distribution deviation: This shows the percentage of the SQL statement distribution deviation between the elements of the TimesTen Scaleout. It is not optimal to execute all SQL statements on a single attempt. Evenly execute the SQL statements on the elements to achieve optimal throughput and latency.

    • Grid channel invalidation: This shows the percentage of channel invalidations between the elements of the TimesTen Scaleout. Applications should cleanly disconnect and release resources to minimize channel invalidations. The cleanup process that the TimesTen Scaleout performs after a channel invalidation takes time, which affects the latency and scalability of operations that want to use that channel.

Transactions Displays various metrics that show information about transactions on the element. This section of the report includes the following sections:

  • Transaction Type

    This table shows various transaction metrics for your element such as the percentage of transactions that: only involve the local element, use remote transactions, and require 2PC.

  • 2PC transactions

    This table shows various 2PC transaction metrics for each element such as the percentage of transactions that: started on this element, were involved in a 2PC transaction but did not initiate it, and used durable 2PC prepares.

SQL statements: SQL statement protocol Displays an excerpt of SQL statement protocol statistics for the element from the SQL Statements section of a report. These statistics show you the percentage of SQL statements: executed, executed locally, that required execution on a remote element, and that required a broadcast to all elements to execute.

SQL statements: SQL statement type Displays an excerpt of SQL statement type statistics for the element from the SQL Statements section of a report. These statistics show you various statistics for SQL statements executed on your element.

Database connections Displays various connection statistics for the element. These statistics show you the type of connections, connections and disconnections per minute, and client server failover for your element.

Table data skew Displays the three tables with the highest data skew percentage of the element. For more information on the row distribution table, see "TimesTen Scaleout data distribution: row distribution for table." These statistics show you the percentage of deviation, the table distribution type, and the distribution keys for the three tables with the highest data skew percentage.

Grid channel usage Displays message statistics over grid channels. These messages can be requests for data or data result sets. These statistics show you the number of sent, received, and invalidated messages for the element.

Log holds Displays log hold information from a report. It shows bookmark positions for checkpoint log holds for each checkpoint file. This report may also show log hold information for backup, XLA, and long-running transactions. Where the begin and end values are the same, there have been no movements.

Ideally there will be evidence of a smooth progression through the log file. (The ttStats monitor information may be more useful in tracking this.)

Checkpoint usage Displays checkpoint usage metrics from a report.

Transaction log usage Displays transaction log usage statistics for the element. This provides information about the rate of I/O operations for the transaction log, log buffer waits, log file reads, and log reads for commits.

Top SQL: top SQL attributes Displays statistics related to the attributes of the most executed SQL statements on the element.

Top SQL: top SQL text Displays information related to the SQL text of the most executed SQL statements on the element.

ttStatus

Description

Displays information that describes the current state of TimesTen. The command displays:

  • State of the TimesTen daemon process and all subdaemon processes.

  • Names of all existing TimesTen databases.

  • Number of connections currently connected to each TimesTen database.

  • The RAM, cache agent and replication policies.

  • TimesTen cache agent status.

  • The status of PL/SQL.

  • The key and address of the shared memory segment used by TimesTen.

  • The address, key and ID of the shared memory segment used by PL/SQL.

  • Whether the TimesTen instance is accessible by a specified operating system group or accessible by anyone. For more details, see the daemon options in the "Managing TimesTen daemon attributes" in Oracle TimesTen In-Memory Database Operations Guide.

  • Miscellaneous status information.

If you specify a connection string or DSN, ttStatus outputs only the information for the specified database.

Required privilege

This utility requires no privileges.

Syntax

ttStatus {-h | -help | -?}
ttStatus {-V | -version}
ttStatus [-v] [-r secs] [-[no]pretty] [-gridbrief]
ttStatus [-r secs] [-[no]pretty] {DSN | -connStr connection_string}

Options

ttStatus has the options:

Option Description
-h

-help

-?

Prints usage information and exits.
-V | -version Prints the release number of ttStatus and exits.
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN An ODBC data source name of the database for which to get status.
-v Prints detailed information that is useful for TimesTen customer support.
-r secs Enables ttStatus to continue running. Updates status report every secs seconds.
-[no]pretty The -pretty option (default) is for "pretty" formatting, which uses the values of the ConnectionName connection attribute. The -nopretty option is to not use pretty formatting.
-gridbrief Prints a summary of all databases for the instance ttStatus is run from. Without this option, information is also shown for all connections.

Sample output

When you call the procedure, a report that describes the current state of the system is displayed to stdout. To get the status for the cachedb1_18110 DSN:

% ttstatus cachedb1_18110
TimesTen status report as of Thu May 02 19:45:43 2013

Daemon pid 5280 port 53392 instance tt1811
TimesTen server pid 3940 started on port 53393
------------------------------------------------------------------------
Open for user connections
Data store cachedb1_18110
There are 12 connections to the data store
Shared Memory KEY Global\cachedb1_18110.c|. . .HANDLE 0x254
PL/SQL Memory KEY Global\cachedb1_18110.c|. . . HANDLE 0x258 Address 0x5B8C0000
Type            PID     Context     Connection Name              ConnID
Process         5196    0x01066a58  cachedb1_18110                     1
Subdaemon       3912    0x00b2c398  Manager                        2047
Subdaemon       3912    0x00b7e4a0  Rollback                       2046
Subdaemon       3912    0x015d25e8  Flusher                        2045
Subdaemon       3912    0x015e46b0  Monitor                        2044
Subdaemon       3912    0x016767f8  Deadlock Detector              2043
Subdaemon       3912    0x016888c0  Checkpoint                     2041
Subdaemon       3912    0x0d350578  Aging                          2042
Subdaemon       3912    0x0d362640  Log Marker                     2040
Subdaemon       3912    0x0d4347c8  AsyncMV                        2039
Subdaemon       3912    0x0d446890  HistGC                         2038
Subdaemon       3912    0x0d458958  IndexGC                        2037
Replication policy  : Manual
Cache Agent policy  : Manual
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group . . .
End of report

Show a summary of the (only) TimesTen Scaleout database on the current instance:

% ttstatus -gridbrief
TimesTen status report as of Thu Feb  7 11:57:32 2019
 
Daemon pid 12767 port 6624 instance grid1_mgmt
TimesTen server pid 12819 started on port 6625
Grid GUID: C19E1FE5-2E58-4C3F-A66A-81661763B65F
Grid Membership Service is zookeeper
Grid Membership:
6 members
  1!mysys2!6624!0EC4823A-775B-4FD3-A33A-76C24D79E2EA!MGMT!18.1.2.1.0!
  1!mysys1!6624!2D6892CA-AA0C-488D-AB0D-20D0AF994018!MGMT!18.1.2.1.0!
  1!mysys3!46342!873678B9-297E-43A9-A183-2DDAD31E4391!DATA!18.1.2.1.0!
  1!mysys1!46344!F89F57B6-D904-4CD8-A6A0-9764A02C31F2!DATA!18.1.2.1.0!
  1!mysys1!46338!799287BA-FB41-47BD-A990-0B1745D5AD90!DATA!18.1.2.1.0!
  1!mysys2!46340!213D68A4-00AE-4429-A652-D2BC45C20AE8!DATA!18.1.2.1.0!
------------------------------------------------------------------------
------------------------------------------------------------------------
Data store /sw/ttinstances/grid1_mgmt/grid/admin/database/ttgridadmin.0
Daemon pid 12767 port 6624 instance grid1_mgmt
TimesTen server pid 12819 started on port 6625
Replication policy  : Manual
Replication agent is running.
Cache Agent policy  : Manual
PL/SQL enabled.
------------------------------------------------------------------------
Accessible by group timesten
End of report

Notes

While primarily intended for use by TimesTen customer support, this information may be useful to system administrators and developers.

This utility is supported only where the TimesTen Data Manager is installed.

The ttStatus utility only reports the RAM policy if it is not inUse.

See also


ttAdmin

ttTail

Description

Fetches TimesTen internal trace information from a database and displays it to stdout. By default, TimesTen generates no tracing information. See "ttTraceMon" for more information.

Required privilege

This utility requires the ADMIN privilege.

Syntax

ttTail {-h | -help | -?}
ttTail {-V | -version}
ttTail [-f] {-connStr connection_string | DSN}

Options

The ttTail utility supports the options:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN Indicates the ODBC data source name of the database from which to get a trace.
-f When the end of the trace is reached, ttTail does not terminate but continues to execute, periodically polling the database's trace buffer to retrieve and display additional TimesTen trace records. For example, this is useful for generating a display of trace data that is updated in real time.
-h-help

-?

Prints a usage message and exits.
-V | -version Prints the release number of ttTail and exits.

Examples

% ttTail database1

Notes

While primarily intended for use by TimesTen customer support, this information may be useful to system administrators and developers.

This utility is supported only where the TimesTen Data Manager is installed.

ttTraceMon

Description

The ttTraceMon utility lets you enable and disable the TimesTen internal tracing facilities.

Tracing options can be enabled and disabled separately for each database. Each database contains a trace buffer into which messages describing TimesTen internal operations can be written. By default, tracing is disabled. However, it can be enabled using this utility.

The ttTraceMon utility provides subcommands to enable, disable, dump and manipulate trace information. ttTraceMon can be executed interactively (multiple subcommands can be entered at a prompt) or not interactively (one subcommand can be specified on the ttTraceMon command line).

When executed interactively, ttTraceMon prompts for lines of text from standard input and interprets the lines as trace commands. You can provide multiple trace commands on the same line by separating them with semicolons. To exit ttTraceMon, enter a blank line.

In interactive mode, you can redirect ttTraceMon command output to a file:

% ttTraceMon connection_string > filename

Component names are case-insensitive. Some commands (dump, show and flush) allow you to list many components and operate on each one. For each subcommand, if you do not list components, the utility operates on all components.

For a description of the components available through this utility and a description of the information that ttTraceMon returns for each, see "Using the ttTraceMon utility" in Oracle TimesTen In-Memory Database Troubleshooting Guide.

Required privilege

This utility requires the ADMIN privilege.

Syntax

ttTraceMon {-h | -help | -?}
ttTraceMon {-V | -version}
ttTraceMon [-e subcommand] {-connStr connection_string | DSN}

Options

ttTraceMon has the options:

Option Description
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN Indicates the ODBC data source name of the database from which to get trace information.
-e subcommand Causes the subcommand to be executed against the specified database. If the subcommand consists of more than one word, enclose it in double quotes. For example:
ttTraceMon -e "show err" database1

Once the subcommand is complete, ttTraceMon exits. If -e is not specified, ttTraceMon starts in interactive mode, reading commands from stdin and displaying results to stdout.

-h

-help

-?

Prints a usage message and exits.
-V | -version Prints the release number of ttTraceMon and exits.

Subcommands

ttTraceMon can be called with the following subcommands:

Command Description
components List the names and internal identifiers of all components.

For a description of the components available through this utility and a description of the information that ttTraceMon returns for each, see "Using the ttTraceMon utility" in Oracle TimesTen In-Memory Database Troubleshooting Guide.

connection {all | self | connectionNum} [on |off] Turn tracing on/off for specified connection. At database creation, tracing is "on" for all connections. The value for connectionNum is the connection slot number or the first number in the transaction ID.
dump Prints all trace records currently buffered.Requires SELECT privileges or database object ownership.
dump comp Prints all trace records for component comp.Requires SELECT privileges or database object ownership.
flush Discards all buffered trace records.
flush comp Discards all buffered trace records for component comp.
help Prints a summary of the trace commands.
level comp n Sets the trace level for component comp to n.Requires ADMIN privileges or database object ownership.
outfile file Prints trace output to the specified file. The file may be any of 0, stdout, stderr, or a file name. On Windows, the file name must be in short 8.3 format. Printing is turned off when file is 0. TimesTen continues to buffer traces as usual, and they are accessible through other utilities like ttTail. If no file is specified, prints the current outfile setting.
show Shows all the trace levels in force.
show comp Shows the trace level for component comp.
tracefiles n Sets the maximum number of output files.
tracefilesize n[M|G] Sets the file size limit for output files.

If M is specified indicates the file size in the indicated number of megabytes

If G is specified indicates the file size in the indicated number of gigabytes.


Notes

Because tracing can degrade performance significantly, we recommend that you enable tracing only to debug problems. While primarily intended for use by TimesTen customer support, this information may be useful to system administrators and developers.

This utility is supported only where the TimesTen Data Manager is installed.

ttUser

Description

Prompts for a password and returns an encrypted password. You can then include the output in a connection string or as the value for the PWDCrypt connection attribute in an ODBCINI file.

Required privilege

This utility requires no privileges.

Syntax

ttUser {-h | -help | -?}
ttUser {-V | -version}
ttUser -pwdcrypt

Options

The ttuser utility supports the options:

Option Description
-h

-help

-?

Prints a usage message and exits.
-pwdcrypt Generates an encrypted password value for the PWDCrypt connection attribute.
-V | -version Prints the release number of ttuser and exits.

ttVersion

Description

The ttVersion utility lists the TimesTen release information, including: number, platform, instance name, instance administrator, instance home directory, daemon home directory, port number and build timestamp. You can specify various levels of output:

  • You can specify ttVersion with no options to list abbreviated output.

  • You can specify the -m option to list enhanced output.

  • You can specify an attribute to list output only for a specific attribute.

Required privilege

This utility requires no privileges.

Syntax

ttVersion [-m] [attribute] [...]

Options

ttVersion has the options:

Option Description
-m Generates computer-readable enhanced output. If not specified and no attribute is specified, abbreviated information is output.
attribute Generates information only about the specified attribute. You can specify multiple attributes. When you specify more than one attribute, the output is displayed with an equal sign after the attribute name.

Attributes

ttVersion has these attributes:

Attribute Description
patched Lists yes or no, indicating whether the release has been patched.
config_found Lists yes or no, indicating whether the configuration file is found.
product Lists the name of the product.
major1 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 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 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 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 The fifth part of the five-part release number (0 for release 18.1.2.1.0). Reserved for future use.
major3 No longer needed, but maintained for backward compatibility. Same as patchset.
portpatch No longer needed, but maintained for backward compatibility. Same as reserved.
version All five parts of the release number, separated by periods (such as 18.1.2.1.0).
shortversion The first two parts of the five-part release number, without periods (181 for release 18.1.2.1.0).
numversion All five parts of the release number, without periods, in the format %02d%02d%04d%02d%02d, compatible with ODBC version number format (180100020100 for release 18.1.2.1.0).
bits Lists 64 to indicate the 64-bit-level of the operating system for which this release is intended.
os The operating system for which this release is intended
buildstamp A number indicating the specific build.
buildtime The UTC time the release was built, for example: 2013-03-19T17:21:59Z
clientonly Lists yes or no to indicate if the release is a client-only release
instance The name of the instance, for example: tt1811.
effective_port The number of the port on which the main daemon listens.
orig_port The original number of the port on which the main daemon listened.
instance_admin The user name of the instance administrator.
effective_insthome The path that indicates the location of the instance.
orig_insthome The path that indicates the location of the instance.
effective_daemonhome The path to the home of the daemon for the specific instance.
effective_daemonhome_long On Windows, the path to the home of the daemon for the specific instance, including a bit extension on the instance name.
orig_daemonhome The path to the original home of the daemon.
plsql Indicates if PL/SQL is configured for this instance. 0 indicates that PL/SQL is not configured. 1 indicates that PL/SQL is configured. The value corresponds with the setting of the PLSQL connection attribute.
grid Indicates if the instance is configured for grid distribution.
group_name The name of the instance group.

Output

Following is ttVersion output without the -m option:

TimesTen Release 18.1.2.1.0 (64 bit Linux/x86_64) (grid1_mgmt:6624) 2019-01-15T06:25:33Z
  Instance admin: ttuser1
  Instance home directory: /sw/ttinstances/grid1_mgmt
  Group owner: timesten
  Daemon home directory: /sw/ttinstances/grid1_mgmt/info
  PL/SQL enabled.

And with the -m option:

patched=yes
config_found=yes
product=TimesTen
major1=18
major2=1
patchset=2
patch=1
reserved=0
major3=2
portpatch=0
version=18.1.2.1.0
shortversion=181
numversion=180100020100
bits=64
os=Linux/x86_64
buildtstamp=1547533533
buildtime=2019-01-15T06:25:33Z
clientonly=no
instance=grid1_mgmt
effective_port=6624
orig_port=6624
instance_admin=ttuser1
effective_insthome=/sw/ttinstances/grid1_mgmt
orig_insthome=/sw/ttinstances/grid1_mgmt
effective_daemonhome=/sw/ttinstances/grid1_mgmt/info
orig_daemonhome=/sw/ttinstances/grid1_mgmt/info
plsql=1
grid=0
group_name=timesten

ttXactAdmin

Description

The ttXactAdmin utility lists ownership, status, log and lock information for each outstanding transaction. The ttXactAdmin utility also enables you to heuristically commit, terminate or forget an XA transaction branch.

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

Required privilege

This utility requires various privileges depending on which options are entered on the command line. See the description of the options to determine which privilege is needed, if any.

Syntax

ttXactAdmin {-h | -help | -?}
ttXactAdmin {-V | -version}

ttXactAdmin [-v verbosity] [-mt maxTrans] [-ml maxLocks] [-pid pid] 
[-xact xid] [-tbl [owner.]tableName] [-interval seconds]
[-count iterations] {DSN | -connstr connection_string}

ttXactAdmin -latch [-interval seconds] [-count iterations]
{DSN | -connstr connection_string}

ttXactAdmin -latch [-interval seconds] [-count iterations] 
{DSN | -connstr connection_string}

ttXactAdmin -connections [-pid pid] [-interval seconds]
[-count iterations] {DSN | -connstr connection_string}

ttXactAdmin -xactIdRollback xid {DSN | -connstr connection_string}

ttXactAdmin -XactIdCommit xid 

ttXactAdmin {-HCommit xid | -HAbort xid | -HForget xid} {DSN | -connstr connection_string}

Options

ttXactAdmin has the options:

Option Description
-connections Shows all current connections to the database. When run with the -connections option, ttXactAdmin itself does not establish a true connection to the database, and requires no latches. This can be useful when diagnosing frozen systems.

This option requires ADMIN privileges.

-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
-count iterations Generate the report iterations times. If no-interval option is specified, an interval of 1 second is used.
DSN Indicates the ODBC data source name of the database to be administered.

This option requires ADMIN privileges.

-h

-help

-?

Prints a usage message and exits.
-HAbort xid Available for TimesTen Scaleout. Heuristically terminates an XA transaction branch in TimesTen. The specified transaction ID must be the local TimesTen TransID.

This option requires ADMIN privileges or ownership of the specified transactions.

This option is not supported in TimesTen Scaleout.

-HCommit xid Available for TimesTen Scaleout. Heuristically commit an XA transaction branch in TimesTen. The specified transaction ID must be the local TimesTen TransID.

This option requires ADMIN privileges or ownership of the specified transactions.

This option is not supported in TimesTen Scaleout.

-HForget xid Available for TimesTen Scaleout. Heuristically forget an XA transaction branch in TimesTen. The specified transaction ID must be the local TimesTen TransID.

This option requires ADMIN privileges or ownership of the specified transactions.

This option is not supported in TimesTen Scaleout.

-interval seconds Repeat the generation of the report, pausing the indicated number of seconds between each generation. If no -count option is specified, repeat forever.
-latch This option is to be used by TimesTen Customer Support only. Shows only the latch information for the database specified.
-ml maxLocks Maximum number of locks per transaction. Default is 6000.
-mt maxTrans Specifies the maximum number of transactions to be displayed. The default is all outstanding transactions.
-pid pid Displays only transactions started by the process with the specified pid. On Linux, it is the pid of the thread that opens the connection.

This option requires ADMIN privileges or ownership of the specified transactions.

-tbl [owner.]tableName Displays lock information for the specified table.

This option requires ADMIN privileges or ownership of the specified table.

-V | -version Prints the release number of ttXactAdmin and exits.
-v verbosity Specifies the verbosity level. One of:

0 - Does not display the names of the tables for row locks. In this case, ttXactAdmin runs faster.

1 (default) - Displays the names of the tables for row locks.

-xact xid Displays information for the specified transaction, including its log hold LSN.In the output, the field "Last ID" is a set of two sequence numbers. If the sequence numbers did not change in an interval, then no log record was written by the transaction during that interval.

This option requires ADMIN privileges or ownership of the specified transactions.

-xactIdCommit xid Available for TimesTen Scaleout. Enables you to commit a transaction. This may be particularly useful for long running transactions. The parameter xid represents the transaction ID.

This stops any currently executing operations on behalf of that transaction and then rolls back the transaction in TimesTen.

If there is currently a checkpoint in process when the rollback is requested, TimesTen terminates the checkpoint operation.This command does not stop TimesTen Cache operations on the Oracle database. Operations include passthrough statements, flushing, manual loading, manual refreshing, synchronous writethrough, propagating, and dynamic loading.

This option requires ADMIN privileges or ownership of the specified transactions.

-xactIdRollback xid Enables you to roll back a transaction. This may be particularly useful for long running transactions. The parameter xid represents the transaction ID.This stops any currently executing operations on behalf of that transaction and then rollback the transaction in TimesTen.

If there is currently a checkpoint in process when the rollback is requested, TimesTen terminates the checkpoint operation.This command does not stop TimesTen Cache operations on the Oracle database. Operations include passthrough statements, flushing, manual loading, manual refreshing, synchronous writethrough, propagating, and dynamic loading.

This option requires ADMIN privileges or ownership of the specified transactions.


Output

ttXactAdmin produces the following output:

Column Description
Program File Name The executable file name of the process that owns the transaction.
PID The process ID of the application that owns the transaction. On Linux, the PID of the thread that opens the connection.
Context The internal identifier that distinguishes between multiple connections to the database made by a single multithreaded process.
XactID The unique identifier for the transaction used internally by TimesTen. For TimesTen Classic, the identifier has two parts. For TimesTen Scaleout, the identifier is prefixed by the Element ID.

The first part is a relatively small value (less than 2048), used to identify the connection of the program executing the transaction.

The second part is a potentially large value (an unsigned integer), that distinguishes between successive uses of the same first part. (The value wraps around if necessary.) Thus, identifiers 4.100 and 4.200 cannot be present at the same time. If 4.100 is seen, and then 4.200, this indicates that transaction 4.100 has completed (committed or rolled back).

State Current state of the transaction, one of:

Active - Active transaction.

Aborting - A transaction is in the process of terminating. See Notes for more information.

Committing - Committing transaction, locks are being released.

Ckpointing - A transaction doing checkpoint.

Rep-Wait-Return - Replicated transaction waiting Return Receipt/Commit.

Idle - A transaction branch currently not accessing data.

Prepared - Prepared transaction branch.

Heur-Committed - Heuristically committed transaction branch.

Heur-Aborted - Heuristically terminated transaction branch.

Propagating - TimesTen transaction waiting for Oracle to commit.

When using TimesTen Scaleout, the current status of the transaction, one of:

Active - Active transaction.

Aborting - A transaction is in the process of terminating. See Notes for more information.

Committing - Committing transaction, locks are being released.

Ckpointing - A transaction doing checkpoint.

Rep-Wait-Return - Replicated transaction waiting Return Receipt/Commit.

Idle - A transaction branch currently not accessing data.

Grid-Doubtful-Yes - The grid transaction prepared and voted yes for commit on this element, and is now doubtful.

Grid-Doubtful-No - The grid transaction prepared and voted no for commit on this element, and is now doubtful.

Grid-Err - The grid transaction returned an error on this element.

Resource The type of the lock being requested:

Row - Row-level lock.

HashedKey - A lock held on a key value of a hash index; acquired when an operation requires a hash index to be updated.

Table - Table-level lock.

EndScan - End of table or range scan lock.

Database - Database-level lock.

Command - Command lock.

Prepare - Lock acquired while preparing commands.

GrpComm - Group commit lock.

ReplHold - Lock for replication hold.

XlaHold - Lock for XLA hold.

ResourceId A unique identifier of each unique resource. The identifier is displayed in hexadecimal format with a few exception. Table and CompCmd are shown as decimal values. Row locks are shown in the ROWID character format.
Mode A value used to determine the level of concurrency that the lock provides:

S - Shared lock in serializable isolation.

Sn - Shared lock in non-serializable isolation.

U - Update lock in serializable isolation.

Un - Update lock in non-serializable isolation.

En - End-of-scan lock for non-serializable isolation.

IRC - Intention shared lock in non-serializable isolation.

IS - Intention shared lock in serializable isolation.

IU - Intention update lock in serializable isolation.

IUn - Intention update lock in non-serializable isolation.

IX - Intention exclusive lock in serializable isolation.

IXn - Intention exclusive lock non-serializable isolation.

SIX - Shared lock with intent to set an exclusive lock in serializable isolation.

SIXn - Shared lock with intent to set an exclusive lock non-serializable isolation.

X - Exclusive lock.

Xn - Exclusive lock in non-serializable isolation.

W - Update, insert or delete table lock.

XNi - Next lock for inserting into tables or non-unique index.

NS - Table lock in read-committed isolation that conflicts with all table locks in serializable isolation. Lock "0" means the blocker is still in the waiting list.

HMode The mode in which the competing transaction is holding the lock which the waiting transaction is requesting.

See "Mode" in this table for concurrency level descriptions.

RMode Shows the mode in which the waiting transaction has requested to hold the lock. See "Mode" in this table for concurrency level descriptions.
HolderTransId The identifier of the transaction with which the waiting transaction is in contention.
Name The name of the table that the lock is being held on or within.

Examples

The following command displays all locks in the database:

% ttXactAdmin -connStr "DSN=demodata"
2018-03-20 13:02:54.760
/timesten/jsmith/demo/demodata
TimesTen Release 18.1.1.1.0
ElementID 1

Program File Name: _ttIsql
XactID            PID      Context            State       Loghold Last ID
1.1.195           115640   0x859570           Active      391.15355904 [1666839:6]

  Resource  ResourceID           Mode  SqlCmdID             Name
  Database  0x01312d0001312d00   IX    0
  Table     2367528              IXn   275642480            JSMITH.T
  Row       AAAVVUAAADXAQAANje   Xn    275642480            JSMITH.T

  Begin Time: 13:01:43.108

1 outstanding transaction found

Notes

If the transaction specified in the command is not an XA transaction branch but a TimesTen local transaction, no XA-XID are displayed. The XA-XID is a C structure that contains a format identifier, two length fields and a data field. The data field consists of at most two contiguous components: a global transaction identifier (gtrid) and a branch qualifier (bqual). The two length fields specify the number of bytes (1-64) in gtrid and bqual respectively. For more details, refer to the X/Open publication: Distributed Transaction Processing: The XA Specification (c193).

For databases, TimesTen only holds S locks when the isolation mode is serializable. For commands, S only means "shared" lock, and can be held in either serializable or read-committed isolation modes.Under RMode, awaiting transactions are sorted by PID and Context. The listing does not reflect the order of the lock requests.

A lock request with an RMode compatible with the HMode of the lock holder can be waiting because there is another lock request with an incompatible mode ahead of the compatible request in the lock request queue.

A transaction can have the status Aborting for one of these reasons:

  • A user application requested a rollback after doing a large amount of work.

  • An application with autocommit tried a statement that could not be completed and it is being undone.

  • Another call to ttXactAdmin caused a transaction to rollback.

  • A process died with work in progress and that work is being undone.

ttXactLog

Description

Displays a formatted dump of the contents of a TimesTen transaction log. It is designed to be used by TimesTen customer support to diagnose problems in the log or database.

A loss of data can occur with certain options such as -tr, therefore only use this tool if you have been asked to do so by a TimesTen customer support representative.

Required privilege

This utility requires the ADMIN privilege.

Syntax

ttXactLog {-h | -help | -?}

ttXactLog {-V | -version}

ttXactLog [-v verbosity] [-m maxChars] [-s] [-t] [-b blkID]
[-l1 lfn.lfo [-l2 lfn.lfo]] [-r recType] [...] [-tr dir]
[-lb] [-headers recs] [-logdir dir]
{-connStr connection_string | DSN | dspath}

ttXactLog [-v verbosity] -logAnalyze 
[-s subscriberName -host hostname]]
[-xid xid] {-connStr connection_string | DSN | dspath}

Options

ttXactLog has the options:

Option Description
-b blkID Restricts log records to those accessing this block, plus any transaction records.
-connStr connection_string An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.
DSN The ODBC source name of the database for which to display the transaction log.
dspath The fully qualified name of the database. This is not the DSN associated with the connection but the fully qualified database path name associated with the database as specified in the DataStore= parameter of the database's ODBC definition.

For example, for a database consisting of files/home/payroll/2011.ds0, /home/payroll/2011.ds1 and several transaction log files /home/payroll/2011.logn,dspath is /home/payroll/2011.

-h

-help

-?

Prints a usage message and exits.
-headers records Prints one header for every records records. A value of 0 disables headers.
-host hostName Specifies the name of the host on which the subscriber resides. Use this option with the -subscriber option, if the name of the subscriber is ambiguous.
-lb Connects to the database and prints out the log buffer. Contents of the transaction log files are not printed. Requires SELECT privileges or database object ownership.
lfn.lfo Transaction log file number (lfn) and transaction log file offset (lfo) for a log record.
-l1 Considers this log record only (unless an -l2 argument is present).
-l2 Considers records between -l1 and -l2, inclusive.
-logAnalyze Determines the remaining amount of a database to be replicated for one or all of the subscribers.Use with the -v option to print:

1 - A summary for every track (default).

2 - Level 1 plus a track analysis.3 - Level 2 plus an in-depth transaction analysis.Use with -subscriber and -host to get information for a specific subscriber.

Use with -xid to look for a specific transaction ID.

-logdir dir Specifies the directory where the database's transaction log files reside. If -logdir is not specified, ttXactLog uses the directory path portion of the value supplied in dspath.
-m maxChars Maximum number of characters printed for binary items (for -v 3) only (defaults to 4000).
-r recType Considers only records of the specified type. This option may be used multiple times to specify a list of desired log record types. recType is case-sensitive.
-s Prints summary information. Requires SELECT privileges or database object ownership.
-subscriber subscriberName Specifies the name of the subscriber. To qualify the name of the subscriber, use -host hostname.
-t Only reads transaction log file tail (from start of last checkpoint transaction log file or, if no checkpoint, the most recent transaction log file).
-tr dir Truncates all log records in the directory at the LWN boundary. The original transaction log files are moved to the directory dir.
-V | -version Prints the release number of ttXactLog and exits.
-v verbosity Specifies the verbosity level. One of:

0 - Print only summary log information (if -s specified).

1 (default) - Print log record headers too.

2 - Print log record bodies too, except long data.

3 - Print full log records (see -m option).

-x xid Specifies the transaction ID.

Examples

% ttXactLog -v 3 -m 100 /users/pat/TimesTen/Daily/F112697SS

Notes

This utility is supported only where the TimesTen Data Manager is installed.

See also


"Analyze outstanding transactions in the replication log" in the Oracle TimesTen In-Memory Database Replication Guide.