Skip Headers
Oracle® TimesTen In-Memory Database Reference
Release 11.2.1

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

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

3 Utilities

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

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 non-zero if an error occurs.

Note:

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

Required authentication and authorization for utilities

The following sections describe the authentication and authorization required for utilities:

Required user authentication for utilities

All utilities that require a password prompt for one.

If a UID attribute is given but no PWD attribute is given, either through a connection string or in the ODBCINI file for the specified DSN, TimesTen prompts for a password. When explicitly prompted, input is not displayed on the command line.

A password given on the command line, before TimesTen prompts for the password, is visible to the ps command, so use of the PWD attribute is not recommended in the first call to the utility. For example, the following command is not recommended:

% ttIsql -connStr "DSN=mydsn;UID=terry;PWD=secret"

Generally, when no UID attribute is given, the UID is assumed to be the user name identified by the operating system, and TimesTen does not prompt for a password.

When a utility accepts a DSN, connection string or database path as a parameter, specify the value at the end of the command line.

Required privileges for executing utilities

Certain TimesTen command-line utilities require privileges. Each utility in this chapter describes the privilege required for execution. You may receive a "database not loaded" error if you try to execute any utility with a user other than the instance administrator and the database is not loaded into memory. In this case, we cannot determine the privileges of the user. Thus any utilities requiring privileges have to be run either as the instance administrator or executed while the database is loaded.


ttAdmin

Description

Allows you to:

Required privilege

This utility requires no privileges to query the database.Replication options require the ADMIN privilege.

Cache options require the CACHE_MANAGER privilege.

All other options require 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.

Syntax

ttAdmin {-h | -help | -?}

ttAdmin {-V | -version}

ttAdmin [-ramPolicy always|manual|inUse [-ramGrace secs] ]
[-ramLoad | -ramUnload]
[-autoreload | -noautoreload]
[-repPolicy always|manual|norestart]
[-reqpQueryThresholdGet]
[-reqpQueryThresholdSet seconds]
[-repStart | -repStop]
[[-cacheUidGet] |
 [-cacheUidPwdSet -cacheUid uid [-cachePwd pwd]] |
 [-cachePolicy always|manual|norestart] |
 [-cacheStart] | 
 [-cacheStop [-stopTimeout seconds]]]
[-query]
{-connStr connection_string | DSN} 

Options

ttAdmin has the options:

Option Description
-connStr connection_string An ODBC connection string containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
DSN Specifies an ODBC data source name of the database to be administered.
-h -help

-?

Prints a usage message and exits.
-autoreload | -noautoreload if set to -noautoreload, TimesTen does not automatically reload the database after an invalidation.

If set to -autoreload, TimesTen reloads the database after an invalidation. This is the default autoreload policy.

See "Preventing an automatic reload of the database after failure" in the Oracle TimesTen In-Memory Database Operations Guide for more information about RAM policy after a failure.

-cachePolicy Defines the policy used to determine when the cache agent for the database should run.

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.

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

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

This option requires CACHE_MANAGER privileges.

-cacheStart Starts a cache agent for the database. This option requires CACHE_MANAGER privileges.
-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 objects that were used by the AUTOREFRESH feature. This option requires CACHE_MANAGER privileges.
-cachePwd The password associated with the cache administration user ID that is used to manage AUTOREFRESH cache groups and ASYNCHRONOUS WRITETHROUGH cache groups. The cache administration user has extended privileges. See "Grant privileges to the Oracle users" in the Oracle In-Memory Database Cache User's Guide for more details. This option requires CACHE_MANAGER privileges.
-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. This option requires CACHE_MANAGER privileges.

See "Grant privileges to the Oracle users" in the Oracle In-Memory Database Cache User's Guide for more details.

-cacheUidGet Gets the current cache administration user ID for the specified database. This option requires CACHE_MANAGER privileges.
-cacheUidPwdSet Sets the cache administration user ID and password for the specified database. This option requires CACHE_MANAGER privileges. Must be set with the -cacheUid and -cachePwd options. Some things to consider are:
  • You only need to specify the cache administration user ID and password once for each new database.

  • You cannot set the cache administration user ID and password while either the cache agent or the replication agent are running.

  • The cache administration user ID cannot be reset while there are ASYNCHRONOUS WRITETHROUGH cache groups or AUTOREFRESH cache groups (with a state that is not equal to OFF) on the database.

  • The cache administration password can be changed at any time.

-query Displays a summary of the policy settings for the named database.
-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 set to 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.
  • always - Specifies that the database should remain in system RAM all the time.

  • manual- Specifies that the database is only to be loaded in system RAM when explicitly loaded by the user (using the -ramLoad option).

  • inUse (default) - Specifies that the database is only loaded in system RAM when in use (i.e., 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 option requires ADMIN privileges.

-ramUnload Valid only when -ramPolicy is set to manual. Causes the database to be unloaded from RAM.
-repPolicy Defines the policy used to determine when the replication agent starts.
  • always - Specifies that the agent should always be running for the database. This option immediately starts the replication agent and when the daemon restarts the replication agent is restarted.

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

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

This option requires ADMIN privileges.

-repQueryThresholdGet Returns the number of seconds that a query can be executed by the replication agent before TimesTen writes a warning to the support log and throws an SNMP trap.

A value of 0 and indicates that no warning is sent.

This option requires ADMIN privileges.

-repQueryThresholdSet This option specifies the number of seconds that a query can be executed by the replication agent before TimesTen writes a warning to the support log and throws an SNMP trap.

The specified value takes effect the next time the replication agent is started. The query threshold for the replication agent applies to SQL execution on detail tables of materialized views, ON DELETE CASCADE operations and some internal operations.

.The value must be greater than or equal to 0.

Default is 0 and indicates that no warning is sent.

This option requires ADMIN privileges.

-repStop Stops the database's replication agent.
-stopTimeout seconds Specifies that the TimesTen daemon should stop the cache agent if it doesn't stop within seconds.

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

This option requires CACHE_MANAGER privileges.

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

Examples

A database referred to by DSN SalesData is used by some very performance sensitive applications. 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 achieve this, use:

ttAdmin -ramPolicy always SalesData

The SalesData database is normally always resident in RAM. However, it is not being used at all today and should be loaded only when applications are connected to it. To change the RAM policy, use:

ttAdmin -ramPolicy inUse SalesData

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

ttAdmin -ramPolicy manual -ramLoad SalesData

To manually unload the SalesData database from RAM, thus preventing any new applications from connecting to the database, use:

ttAdmin -ramPolicy manual -ramUnload SalesData

A database referred to by DSN History is not always in use. Permanently loading it into RAM unnecessarily uses 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, as long as applications are connected to the database, the database remains in RAM. To set this policy, use:

ttAdmin -ramPolicy inUse -ramGrace 300 History

A database referred to by DSN SalesData is used to cache Oracle data. Use the following ttAdmin command to start the cache agent for the SalesData DSN:

ttAdmin -cacheStart SalesData

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

ttAdmin -cachePolicy always SalesData

To turn off the automatic start of cache agent, use:

ttAdmin -cachePolicy manual SalesData

To set the cache administration user ID and password, the -cacheUidPwdSet flag with the -cacheUid and -cachePwd options can be used with ttAdmin. For example, if the cache administration user ID and password on the database SalesData should be scott and tiger respectively, use:

ttAdmin -cacheUidPwdSet -cacheUid scott -cachPwd tiger SalesData

To get the current cache administration user ID for the SalesData DSN, use:

ttAdmin -cacheUidGet SalesData

ttAdmin displays the following output:

Cache User Id: scott
RAM Residence Policy: inUse
Replication Agent Policy: manual
Replication Manually Started: False
Cache Agent Policy: manual
Cache Agent Manually Started: False

Notes

If TimesTen is installed as a user instance, and the user attempts to start the cache agent for a database with a relative path, TimesTen looks for the database relative to where it is running, and fails. Therefore, a relative path should not be used in this scenario. For example, on Windows, if you have specified the path for the database as DataStore=./dsn1 and attempt to start the cache agent with the command ttAdmin -cacheStart dsn1, the cache agent does not start because it looks for the database in install_dir\srv\dsn1. For UNIX it looks in a directory in /var/TimesTen/instance/.

When using AUTOREFRESH (automatic propagation from Oracle to TimesTen) or ASYNCHRONOUS WRITETHROUGH cache groups, you must specify the cache administration user ID and password. This user account is used to perform AUTOREFRESH and ASYNCHRONOUS WRITETHROUGH operations.

To load Oracle data, 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 the Oracle In-Memory Database Cache User's Guide for more details. For details on other environment variables that you may want to set, see "Environment variables" in Oracle TimesTen In-Memory Database Installation Guide.

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

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

$ ttAdmin -repstart repl1
*** [TimesTen][TimesTen 11.2.1.0.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 the -ramPolicy always option, a persistent system connection is created on the database. The -ramPolicy always option can only be specified on shared databases.

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

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.

See also


ttStatus
"ttCachePolicySet"
"ttCacheUidGet"
"ttCacheUidPwdSet"
"ttCacheStart"
"ttCacheStop"

ttAdoptStores

Description

On UNIX systems, moves databases from a TimesTen instance to a new TimesTen instance that is of the same minor version. For example, you can move files from TimesTen 11.2.1.0.0 to TimesTen 11.2.1.0.1.

The utility makes it easy to move to a new patch release and can be useful for testing a new release without uninstalling the old one. You can install the new version of TimesTen and move one or more databases to the new release to test it without uninstalling the old one. Both utilities require that both instances be of the same minor version.

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.

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 ("infodir").

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

Note

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. If the database is in use at the time of backup, it must be in shared mode to enable ttBackup. For an overview of the TimesTen backup and restore facility, see "Migration, backup, and restoration of the database" in Oracle TimesTen In-Memory Database Operations 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.

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 containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
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 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, 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

When an incremental backup has been enabled, TimesTen creates a backup hold in the transaction log file. This hold can be seen using the ttLogHolds built-in procedure. The backup hold is used to determine 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 committed after the most recent checkpoint are not reflected in the backup.

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

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

You cannot back up temporary databases.

See also


ttBulkCp
ttMigrate
ttRestore

ttBulkCp

Description

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

On UNIX, 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.

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] [-dateMode dateMode] 
[-tsformat timeStampFormat] [-dformat | -D dateFormat] 
[-F firstRow] [-L lastRow] [-N ncharEncoding] [-Q 0|1] 
[-S errLevel] {-connStr connection_string | DSN} 
[owner.]tableName [dataFile ...]

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

Options

ttBulkCp has the following 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 containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
DSN Specifies an ODBC data source name of the database to be copied.
-D | -dformat

dateFormat

Sets the date format. Legal fixed values are described in "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 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.

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

-h -help

-?

Prints a short usage message and exits.
-helpfull Prints a longer usage message and exits.
-i Selects copy-in mode.
-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.
-N ncharEncoding Specifies the input and output character encoding for NCHAR types. Valid values are UTF8, UTF-8 or ASCII.
-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.

-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

  • 1 (default) - Indicates that strings should be quoted.This option overrides the QUOTES file attribute.

-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. Legal values are defined in "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. Legal fixed values are described in "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.


The following options can be used 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.

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

The following options can be used in copy-in (-i) mode 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.

-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 where 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 "datafile 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. This option can be used (perhaps 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.
-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 (i.e., 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 or VARBINARY 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.

-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 successful inserts.

The default value is 1000.

The -xp option can be used with -cp option to enable periodic checkpointing of the database.


datafile format

Every line of a ttBulkCp input file is one of the following: a blank line, a comment line, an attribute line or a data line.

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.

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.

Command line options take precedence over the values in the file attributes that are supported by ttBulkCp. Those file attributes are:

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

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: 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:

In addition, any of the ~ ! @ # $ % ^ & * ( ) = : ; | < > ? , / characters can be escaped with a backslash. Although it is unnecessary to escape these characters in most cases, 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 datafile. Trailing blanks are neither added nor removed.

Binary values

BINARY, VARBINARY: 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 hexadecimalstring is converted to a single binary byte, the hexadecimalstring 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 datafile.

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: 1997-01-03

(default value)

Oracle DD-Mon-YYYY

Example: 03-Jan-1997

SYBASE1 MM/DD/YYYY

Example: 01/03/1997

SYBASE2 DD-MM-YYYY

Example: 03-01-1997

SYBASE3 Mon*DD*YYYY

Example: Jan 03 1997


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: 1997-01-03 07:47:23

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

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

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

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

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

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

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

Example: Jan 03 199707: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 DSN=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 DSN=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 fatal error), use -m 0, as in:

ttBulkCp -i -e mytbl.err -m 0 DSN=mystore mytbl mytbl.dump

To ignore errors caused by constraint violations, use -d ignore:

ttBulkCp -i -e mytbl.err -d ignore DSN=mystore mytbl mytbl.dump

Notes

ttBulkCp explicitly sets the Overwrite database 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.

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 datafile:

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.

See also


ttBackup
ttMigrate
ttRestore

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:

Directory and file names should always be double-quoted 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.

Syntax

ttCapture {-h | -help | -?}
ttCapture {-V | -version}
ttCapture [-noinstinfo] [-nosysinfo] [-stdout | -dest dir] [-logdir dir] 
 [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 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/1997.ds0, /home/payroll/1997.ds1, and several transaction log files /home/payroll/1997.logn, dspath is /home/payroll/1997.

-h

-help

-?

Prints a usage message and exits.
-logdir dir Specifies the location of the log directory. Must be used with the -dsname option. If not specified, the log directory may not be available.
-noinstinfo Do not capture any installation information.
-nosysinfo Do not capture any system information.
-stdout On UNIX systems, writes all output to stdout, instead of writing the output to a file.
-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

Note

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.

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 containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
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 of the database's ODBC definition.

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

-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 Can be used to indicate 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. If run on a shared database and other transactions are active, ttCheck may return errors when the database is in fact intact.

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 allows 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 about using Oracle Clusterware to manage TimesTen active standby pairs, see Oracle TimesTen In-Memory Database TimesTen to TimesTen Replication Guide.

These commands are available only with advanced high availability:

These commands fail with basic high availability.

Required privilege

On Windows 2008, a user with Administrators privileges can execute all commands as Administrator. On other supported Windows platforms, any user that has Administrator privileges can execute all commands in this utility.

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

The admin 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.

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 -switch -dsn DSN

ttCWAdmin -relocate -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 -shutdown [-hosts "host_name1, host_name2[, ...]"]

Options

ttCWAdmin has these general options:

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

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

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

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

-beginAlterSchema Allows addition of tables and 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. While adding objects to the schema, the active standby pair is brought down, but the active node stays attached if you are using grid.
-create Creates the active standby pair replication scheme for the specified DSN and creates the associated action scripts.

This command prompts for the user ID and password for an internal user with the ADMIN privilege if it does not find this information in the sys.odbc.ini file. This command also prompts for a passphrase for the encryption of stored authentication information.

This internal user is used to create the active standby pair. When caching Oracle tables, the command also prompts for the user password for the Oracle database. The Oracle password is used to set the autorefresh states for cache groups.

-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 Clusterware.
-delMasterHosts Deletes spare hosts to the poll 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 systems, only the root user can execute this command.

-delSubscriberHosts Deletes spare hosts to the poll 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 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 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.
-h

-help

-?

Prints a usage message and exits.
-init Starts the TimesTen cluster agent.
-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.

-relocate Relocates the database from the local host to the next available spare host specified in the MasterHosts attribute in the 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 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 cluster agent.
-start Starts the active standby pair.
-status Obtains the status of resources in the cluster.
-stop Stops the active standby pair.
-switch 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.
-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:

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.

Syntax

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

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.
-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 ttendaemon.options file.

The -force option should be used with caution, as it may leave databases in a state where you must perform recovery procedures.

When you use this utility on Windows Vista, 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 CRS 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 CRS agent, the main daemon stops temporarily with this command, but then restarts. To stop the CRS agent, use:

ttcwadmin -shutdown -hosts localhost

When you use this utility to restart the server, the TimesTen daemon reads the ttendaemon.options 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 options:

-server -serverShmIpc -serverShmSize -noserverlog

See also

For a description of all daemon options and instructions for changing the ttendaemon.options file, see "Managing TimesTen daemon options" in Oracle TimesTen In-Memory Database Operations Guide.


ttDaemonLog

Description

TimesTen uses a TimesTen daemon (referred to as the TimesTen Data Manager Service on Windows) and other background processes, known as subdaemons and agents, to manage access to the either the "user" or "error" log.

By default, TimesTen messages are stored in:

The ttDaemonLog utility allows you to control the type of events that TimesTen writes to and fetches from the user and error logs.

There are two versions of the ttDaemonLog utility:

Required privilege

This utility requires the instance administrator privilege.


ttDaemonLog for Windows

On Windows, TimesTen user and error log messages are written to the Windows Application Event Log. The ttDaemonLog utility controls which events are written to and fetched from the log and displayed to stdout.

Syntax

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

Options

ttDaemonLog has the options:

Option Description
-b Prints all TimesTen-generated syslog entries.
-f When the end of the log is reached, ttDaemonLog does not terminate but continues to execute, periodically polling the event 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.
-h

-help

-?

Prints a usage message and exits.
-maxlines Maximum number of lines at end of log to display. Defaults to 40 lines if -f is specified. If 0, no limit is set.
-logcomponent component

-nologcomponent

Specifies that the given component should be logged.

If a DSN or connection string is specified as the component, logging applies only to the specified database.

If -nologcomponent is specified, no logging is done for the indicated component. Legal values for component are:

  • ALL

  • DAEMON

  • DAEMONDBG

  • REPLICATION

  • ORACLECONNECT

-loglevel level Specifies that messages of level greater than or equal to the specified level should be logged. If a DSN or connection string is specified as the component, the option applies only to the specified database.
-logreset Resets event logging parameters.
-msg messagestring Insert string 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.

-r Print only the TimesTen Replication Agent log. (Same as -show replication.)
-s Print only the TimesTen Server log. (Same as -show server.)
-setverbose

-setquiet

Enable (-setverbose) or disable (-setquiet) TimesTen verbose logging.
-show type Limits output to the given type. Types are:

:all (default) - Shows all.

replication - Shows only log entries for replication agents. (Same as -r option.)

ora - Shows only log entries for cache agents.

server - Shows only log entries for TimesTen Server. (Same as -s option.)

-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. The -nologcomponent option can be applied to selected databases or all databases.

For example, to prevent messages and errors related to replication for all databases from being written to the log, enter:

ttDaemonLog -nologcomponent replication

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

ttDaemonLog -nologcomponent replication masterdsn

If, you want to prevent both replication and IMDB Cache errors and messages from being written, enter:

ttDaemonLog -nologcomponent replication
ttDaemonLog -nologcomponent oracleconnect

If, after setting a -nologcomponent option, you want to re-enable writing errors for a component, you can use the -logcomponent option. For example, if after preventing both replication and IMDB Cache errors from being logged, as shown in the example above, you want to re-enable logging of replication errors, enter:

ttDaemonLog -logcomponent replication

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

ttDaemonLog -logreset

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

ttDaemonLog

To display the log output from the host computer named, backup1, use:

ttDaemonLog -n backup1

To write the log output to the file C:\TimesTen\logout\log1, use:

ttDaemonLog -file C:\TimesTen\logout\log1

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, use:

ttDaemonLog -show server

To display just the replication agent messages, use:

ttDaemonLog -show replication

To display just the cache agent messages, use:

ttDaemonLog -show ora

To display all messages from the TimesTen processes, use:

ttDaemonLog -show all

To restore logging to its default "verbose" level, use the -setverbose option:

ttDaemonLog -setverbose

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, you must change the options in the ttendaemon.options file. See "Modifying informational messages" in the Oracle TimesTen In-Memory Database Operations Guide.


ttDaemonLog for UNIX

Description

On UNIX, ttDaemonLog fetches all TimesTen events from the file generated by syslogd(1). It displays all events to stdout.

The TimesTen daemon (timestend) records its event log via syslog(2). The eventual disposition of the log information depends on the configuration of your /etc/syslog.conf file, which you can customize to log or ignore messages selectively. Messages can be logged into various files depending on the configuration of the file. These files can grow to be quite large. You should prune them periodically to conserve disk space.

Syntax

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

Options

ttDaemonLog has the options:

Option Description
-b Prints all TimesTen generated syslog entries.
-f When the end of the log is reached, ttDaemonLog does not terminate but continues to execute, periodically polling the event 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.
-file filename Specifies the file into which TimesTen is logging messages.

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

-h

-help

-?

Prints a usage message and exits.
-integer Maximum number of lines at end of log to display. Defaults to 40 lines if -f is specified. If 0, no limit is set.
-logcomponent component

-nologcomponent

Specifies that the given component should be logged, along with any other components that are already being logged.

If a DSN or connection string is specified as the component, logging applies only to the specified database.

If -nologcomponent is specified, no logging is done for the indicated component.Legal values for component are:

  • ALL

  • DAEMON

  • DAEMONDBG

  • REPLICATION

  • ORACLECONNECT

-loglevel level Specifies that messages of level greater than or equal to the specified level should be logged. If a DSN or connection string is specified as the component, the option applies only to the specified database.
-logreset Resets event logging parameters.
-msg string Insert string into the TimesTen user log.
-r Print only the TimesTen Replication Agent log. (Same as -show replication.)
-s Prints the TimesTen Server log. (Same as -show server.)
-setverbose

-setquiet

Enable (-setverbose) or disable (-setquiet) TimesTen verbose logging.
-show type Limits output to the given type. Types are:

:all (default) - Shows all.

replication - Shows only log entries for replication agents. (Same as -r option.)

ora - Shows only log entries for cache agents.

server - Shows only log entries for TimesTen Server. (Same as -s option.)

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

Examples

Except for the example with the -n option, all the examples shown under "ttDaemonLog for Windows" also apply to the UNIX version of ttDaemonLog. The following examples, show the use of some UNIX-specific options.

To write the log output to the file /var/adm/syslog/syslog.log, use:

ttDaemonLog -file /var/adm/syslog/syslog.log

To direct logging to the local7 facility, use.

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, you must change the options in the ttendaemon.options file. For information on this file and on configuring sys.log, see "Modifying 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.

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 containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
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/1997.ds0, /home/payroll/1997.ds1, and several transaction log files /home/payroll/1997.logn,dspath is /home/payroll/1997.

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

Example

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.

In the case that the database to be destroyed is part of a cache grid, ttDestroy performs a detaches the database from the grid.

ttDestroy does not perform cleanup of Oracle objects from AUTOREFRESH or AWT cache groups. If there are AUTOREFRESH or AWT cache groups in the database, use the ttCacheSqlGet built-in procedure, specifying NULL for the cache group name, to generate Oracle SQL to perform cleanup after the database has been destroyed.


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

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

Required privilege

This utility requires no privileges.

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 containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
DSN Specifies an ODBC data source name of the database to be connected.
-e commands Specifies a semi-colon separated list of ttIsql commands to execute on start up.
-f filename Read SQL commands 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" in place of "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 is validated 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.

See the views command.

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.

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

[timeeout seconds]

Sets the client timeout value in seconds for the current connection.
cachesqlget

[ASYNCHRONOUS_WRITETHROUGH | 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 objects associated with a a read-only 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 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 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.

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.
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 DurableCommits=1 for the connection).
commitdurable Commits the current transaction durably.
compact Compacts the database.
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.

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, materialized view logs, sequences, PL/SQL functions, PL/SQL procedures, PL/SQL packages, synonyms 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 being described is a materialized view log, the message lists the name of the materialized view for which the table is a log. If the table being described has a materialized view log on it, the message indicates the name of the materialized view log.

The command alias is desc.

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] Prints database size information in KB or MB. The default is KB.
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.
exec [connect_id.]command_id] | PLSQLSTMT Executes the prepared command command_id on 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.

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

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.

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

If no command is specified, frees the most recent 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.

globalprocessing statement Runs the specified statement with global processing enabled.

You cannot specify the statement with the ! command.

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 don't 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

[-r] [num_commands]

Lists previously executed commands.

The num_commands parameter specifies the number of commands to list. If this parameter is omitted, the previous ten commands are listed by default.

If the-r parameter is specified, commands are listed in reverse order.

The history list stores up to 100 of the most recently executed commands. Use the clearhistory command to clear the history.

See the savehistory command.

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.

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 Formats the contents of the MONITOR table for easy viewing.
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.

print [variable] Prints the value of the specified bind variable or all variables if no variable is specified. If the variable is a refcursor, 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 includes the attributes of 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 IMDB Cache operations on Oracle, including passthrough statements, flushing, manual loading, manual refreshing, synchronous writethrough, propagating and transparent loading.
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 @ is used with a relative path, the path is relative to the startup directory of ttIsql. When @@ is used, it 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

[-a | -f] outputfile

Writes the history buffer to the specified output file.

Only command, no parameter values are saved in the output file. Therefore, a script may not be able to replay the history from the output file.

If the output file exists, you must specify either the -a or -f option.

If -a is specified, the history is appended to the specified output file.

If -f is specified, the history overwrites the contents of the specified 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 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.
show {all | attribute} Displays the value for the specified database 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 the filename, the filename 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).
statsupdate [[owner_name_pattern.]table_name_pattern] Updates statistics for specified table (or all tables if no table is specified).
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 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 is enabled, lists tables matching the pattern in the Oracle database.

See the alltables command.

tryglobalprocessing [0|1] Disables (0) or enables (1) the global processing of eligible queries in the cache grid. If the optional argument is omitted, global processing is enabled. Use show optprofile to query GlobalProcessing.

AutoCommit must be off.

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 [type]] Declares a bind variable that can be referenced in a statement, or displays the definition of the variable.
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 is enabled, lists views matching the pattern in the Oracle database.

See the allviews 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.


Set/show attributes

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

Boolean attributes can accept the values "ON" and "OFF" in place of "1" and "0".

ttIsql set supports these 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.
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 [on|off] Enables or disables dynamic load of Oracle data to a TimesTen dynamic cache group. By default, dynamic load of Oracle data 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] Shows errors command display 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.

multipleconnections [1 | ON] mc [1 | ON] Reports or enables handling of multiple connections.By default, ttIsql allows 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 multipleconnection 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.

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|4|5] Sets the IMDB 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 Oracle.

4 - All SELECT statements on global cache groups tables that cannot use transparent load are executed on Oracle.

5 - All SELECT statements on global cache groups tables that cannot use transparent load are executed on Oracle. The SELECT statement is not executed until after all committed changes to the global cache group are propagated to Oracle.

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.

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 support log or throws an SNMP trap.

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.

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 IMDB Cache operations on Oracle, including passthrough statements, flushing, manual loading, manual refreshing, synchronous writethrough, propagating, and transparent loading.

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

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 optimizer. AutoCommit must be off.

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

trymaterialize [1|0] Enables or disables materialization by optimizer. 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 optimizer. 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 optimizer. AutoCommit must be off.

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

tryrowid [1|0] Enables or disables rowID scan hint.
tryrowlocks [1|0] Enables or disables use of row-level locking by the optimizer. 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 optimizer. 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 optimizer. 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. 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 optimizer. AutoCommit must be off.

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

trytmpttree [1|0] Enables or disables use of temporary range indexes by optimizer. AutoCommit must be off.

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

tryttree [1|0] Enables or disables use of range indexes by optimizer. 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]
/* [comment_text] */

The C-style comments ( /* [comment_text] */) can span multiple lines.

The comments delimited by the

#

and the

-

characters should not span multiple lines. If a comment marker is encountered while processing a line, then the remainder of the line is ignored.

'--' 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 history

ttIsql implements a csh-like command history.

Command Usage: history [-r] [num_commands]

Description: Lists previously executed commands. The num_commands parameter specifies the number of commands to list. If the -r parameter is specified, commands are listed in reverse order.

Command Usage: ! [command_id|command_string| !]

Description: Executes a command in the history list. If a command_id argument is specified, the command in the history list associated with this ID is executed again. If the command_string argument is specified, the most recent command in the history list that begins with command_string is executed again. If the ! argument is specified then the most recently executed command is executed again.

Example: "!!;" -or- "!10;" -or- "!con;"

Also see the clearhistory, history, savehistory commands.

Command shortcuts

By default, ttIsql supports keystroke shortcuts when entering commands. To turn this feature off, use:

Command> set editline=0;

The bindings available 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.
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.
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:

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;
Command> exec :a := 110;

PL/SQL procedure successfully completed.

Command> print a
A                    : 110
Command> var b number;
Command> 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.
Command>

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 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=/opt/TimesTen/tt1121/lib/libtten.so; PermSize=20;TempSize=20;TypeMode=1; 
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
    Ttree: 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
    TransparentLoad: 0
    UserBoyerMooreStringSearch: 0
    DynamicLoadEnable: 1
    DynamicLoadErrorMode: 0
    NoRemRowIdOpt: 0

Current Join Order:
    <>

Command

Prepare and exec an SQL statement.

ttIsql (c) 1996-2009, TimesTen, Inc. All rights reserved.
ttIsql -connStr "DSN=RunData"
Type ? or "help" for help, type "exit" to quit ttIsql.
(Default setting AutoCommit=1)
Command> prepare 1 SELECT * FROM my_table;
Command> exec 1;
Command> 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.

Example parameters using "variable" and "print"

Substitution in ttIsql is modeled after substitution in SQL*Plus. The substitution feature is enabled by '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
Command> 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 and only one substitution character is used 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
Command> 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.
Command>

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;
Command> VARIABLE name VARCHAR2(25) INLINE NOT NULL;
Command> 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

Multiple ttIsql commands are allowed per line separated by semicolons.

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
Command> 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 = ?; 
Command> exec;

Type '?;' for help on entering parameter values. Type '*;' to abort 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:

Migrated objects include:

The ttMigrate utility is used when upgrading major release versions of TimesTen, since major revisions are not compatible. For an example, see the Oracle TimesTen In-Memory Database Installation Guide.

When you migrate a database into Release 11.2.1 from a previous release, users and user privileges are not migrated. When you migrate a database between releases of Release 11.2.1 or into a release later than Release 11.2.1, users and user privileges are migrated.

Binary files produced by this utility are platform-dependent. For example a binary file produced on Windows must be restored on Windows. Use the ttBulkCp utility to copy data between platforms.

The ttMigrate utility can be used to copy data between bit-levels within the same architecture. For example, it can be used to move data from a 32-bit Solaris system to a 64-bit Solaris system. The -noRepUpgrade option must be used when changing bit-levels and the database should not be involved in a replication scheme, in this case.

On UNIX, 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 IMDB Cache, then CACHE_MANAGER is also required.

Using the -c option to capture an entire database requires the ADMIN privilege.

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.

Syntax

ttMigrate {-h | -help | -?}
ttMigrate {-V | -version}

To create or append a binary datafile, use:

ttMigrate {-a | -c} [-v verbosity] [-nf] [-nr] [-fixNaN] 
[-saveAsCharset charset] [-repUpgrade | -noRepUpgrade 
[-convertTypesToOra | -convertTypestoTT]] 
{-connStr connection_string | DSN} dataFile [objectOwner.]objectName

To restore a database from a binary datafile created by this utility, use:

ttMigrate -r -noRepUpgrade  [-numThreads n] [-inline rule] [-v verbosity]
 [-fixNaN] [-nf] [-nr] [-C chkPtFreq] [-rename oldOwner:newOwner] [-localhost
 hostName] [-n noCharsetConversion] [-cacheUid uid [-cachePwd pwd]]
 [-convertCGtypes]  [-autorefreshPaused] [-convertTypesToOra | -convertTypesToTT]  
 [-noAutoCreateUsers] -connStr connection_string | DSN} dataFile 
 [[objectOwner.]objectName]

or

ttMigrate -r -repUpgrade  [-numThreads n] [-vverbosity] [-fixNaN] [-nf] [-nr] 
[-C chkPtFreq] [-rename oldOwner:newOwner] [-localhost hostName]
[-noCharsetConversion] [-cacheUid uid [-cachePwd pwd]] [-convertCGtypes]
[-updateStats | -estimateStats percentRows] {-connStr connection_string | DSN}
dataFile [[objectOwner.]objectName]

To list or display the contents of a binary datafile created by this utility, use:

ttMigrate {-l | -L | -d | -D} dataFile [[objectowner.]name ...]

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.
-c Create mode: Creates an original binary datafile. 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 containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
-convertTypesToOra

-convertTypesToTT

Converts TimesTen data types to Oracle data types or Oracle data types to TimesTen data types. These options require the-noRepUpgrade option.

In TimesTen 11.2.1 the default type mode is ORACLE type mode. The -convertTypesToOra is useful when migrating older databases into TimesTen 11.2.1.

The -convertTypesToTT option is useful to allow backward migration into a release that does not support Oracle types.

These options apply to all table types except materialized views. Table types include: regular, cached, global and temporary tables.

See also -convertCGTypes, "TimesTen to Oracle data type conversions" and "Oracle to TimesTen data type conversions".

-d Selects Describe mode. Displays a short description of the objects in the datafile. See "Describe mode (-d)" for more details.
-D Selects Long-describe mode. Displays a full description of the objects in the datafile. See "Long-describe mode (-D)" for more details.
dataFile The path name of the datafile 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. This option is ignored 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-repUpgrade 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.When this option is used during migration, the database should not be replicated with databases from a TimesTen version that does not support INLINE columns.

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 datafile. 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 datafile 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 datafile 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.
-noAutoCreateUsers Specifies that ttMigrate should not create users.

By default, TimesTen creates "disabled" users when migrating tables from releases earlier than 11.2.1. TimesTen creates users but does not assign any privileges to these users. You must explicitly assign privileges, including CREATE SESSION, to these users after they are created.

-noRepUpgrade Do not ensure that saved/restored tables are compatible for replication with the original tables.

Use of this option may cause the restored tables to be slightly more compact and slightly faster to access than otherwise.

This option is ignored when the -a option is given.

This option should be used with care, however, as replication between the original tables and the restored tables may not work properly.

INLINE variable-length columns cannot successfully be replicated to NOT INLINE columns.

If you specify this option, replication is only possible if you have specified RELAXED for your replication scheme.

-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.
-rename oldOwner:newOwner Renames user oldUser to be newUser. If newUser exists in the database, the operation returns an error and stops. Also restores all database objects previously owned by oldUser to be owned by newUser. Also grants newUser all privileges previously granted to oldUser. You cannot rename the TimesTen system users (TTREP, SYS, SYSTEM, GRID).

This option is restricted to only work in databases that have PL/SQL disabled (PLSQL=0). For databases with PL/SQL enabled, consider using synonyms to achieve comparable behavior.

This option should be used with some caution. When using the -rename option, be aware that:

  • If the old user name does not exist, a warning is printed at the end of the ttMigrate operation that no object with the specified user was renamed.

  • If creating a database object with the new user returns an error, ttMigrate prints an error and continues restoring the rest of the database objects.

  • You cannot rename users TTREP, SYS, SYSTEM or GRID.

  • If you change a user which owns a table referenced by a view, you may need to drop and re-create the view.

  • If you change a user which owns a replicated table, you must rename that user on all replication peers in order to replicate updates successfully.

-repUpgrade Ensures that the saved/restored tables are compatible for replication with the original tables when restoring tables for replication upgrade. This option is ignored when the -c or -a options are given.

The ttMigrate utility in restore mode sets -repUpgrade by default. When restoring data from a ttMigrate datafile, if the file was created by a version of ttMigrate that does not support the -repUpgrade option, or if you explicitly specified-noRepUpgrade when you created the file (with a ttMigrate version before 5.1), you may encounter an error that indicates that a migration object could not be created with "replication compatibility."

This option is set by default. If you use a version of ttMigrate that does not support the -repUpgrade option, or you explicitly specify -noRepUpgrade when creating a migration file, you may encounter an error that indicates that a migration object could not be created with "replication compatibility."

You must either obtain a version of ttMigrate that supports the -repUpgrade option for the TimesTen release from which you are migrating, or, if supported, specify -noRepUpgrade when migrating files into a version of TimesTen that sets-repUpgrade by default.

-saveAsCharset

charset

Allows you to save an object in a character set other than the database character set. When saving an object, ttMigrate stores it in the database character set by default.
-updateStats Specifies that ttMigrate should update statistics on restored tables and materialized views. This option is ignored 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.

-v is ignored in List, Long-list, Describe and Long-describe modes.

-V | -version Prints the release number of ttMigrate and exits.
The following options are available in Restore mode (-r) only: -
-autorefreshPaused Restores cache groups with AUTOREFRESH attribute with autorefresh state paused. Otherwise the state is set to OFF.
-C chkPtFreq Specifies that ttMigrate should checkpoint the database after restoring every chkPtFreq megabytes of data. A value of zero (the default) specifies that ttMigrate should never checkpoint the database.
-convertCGTypes Determines the best type mapping from the underlying Oracle tables to TimesTen cached tables using:
  • The types of the columns in the Oracle tables.

  • The types of the columns stored in the migration file.

  • The TimesTen-to-Oracle type mapping rules described above.

If this option is specified with either the-convertTypesToOra or the -convertTypesToTT option, this option takes precedence for cached tables. This option does not impact non-cached tables.

-localhost hostName Can be used to explicitly identify the name or IP address of the local host when restoring replicated tables.
-noCharsetConversion Restores data in the database character set, not the tagged character set.

See also -saveAsCharset.

This option may be useful for legacy TimesTen users who may have migrated pre-11.2.1 data into a 11.2.1 or later release of TimesTen as TIMESTEN8 or another character set such as WE8ISO8895P1, when the data is actually in another character set. If, at a later time you wish 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.

-restorePublicPrivs Restores privileges that were granted to PUBLIC after the database was created. PUBLIC's privileges are not restored by default.

Modes

Create mode (-c) and Append mode (-a)

In Create mode, ttMigrate saves migrate objects from a TimesTen database into a new binary datafile. If the datafile does not exist, ttMigrate creates it. Otherwise, ttMigrate overwrites the existing file, destroying its contents.

The datafile 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 datafile. If the datafile does not exist, ttMigrate creates it.

For each ordinary (non-cached) table, ttMigrate saves:

For each cache group, ttMigrate saves the following:

For each view, ttMigrate saves the following:

For each sequence, ttMigrate saves the following:

For each user (except the instance administrator), ttMigrate saves the following:

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 the 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 datafile, 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 datafile, 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 datafile into a TimesTen database.

For each ordinary (non-cached) table, ttMigrate restores:

For each cache group, ttMigrate restores:

By default, the -repUpgrade option is set during restore.

By default, ttMigrate restores all tables and cache groups in the datafile. 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 datafile, including cached tables and the replication scheme TTREP tables.

In Long-list mode, ttMigrate lists the names of database objects in the datafile, 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.

TimesTen to Oracle data type conversions

Both TimesTen and Oracle data types are supported in TimesTen 11.2.1 When migrating a database from an earlier version of TimesTen to TimesTen release 11.2.1, you can convert the data types in your database to the default Oracle type mode. This is not required, however.

In replication, the type mode must be the same on both sides of the replication scheme. Therefore you cannot convert the data types as part of an online upgrade, as TimesTen releases previous to 11.2.1 do not support Oracle data types.

Note:

If -convertTypesToOra is specified, and a DECIMAL (or NUMERIC) column exists in the database with a precision > 38, the column is converted to a NUMBER column with a precision of 38, and a warning is returned. If this occurs, and column values exist that overflow or underflow with a precision of 38, those values are reduced or increased to the maximum or minimum possible value for a NUMBER with a precision of 38. Because of this and some other cases, the data type conversion procedures (using -convertTypesToOra and -convertTypesToTT) are not guaranteed to be reversible. Converting types from TT->ORA->TT can result in columns and data which are different from the original in some cases.

To convert from TimesTen data types to Oracle data types, use the -convertTypesToOra option.

The -convertTypesToOra option instructs ttMigrate to make the following type conversions as it saves or restores tables:

From TimesTen Type To Oracle Type
TT_CHAR ORA_CHAR
TT_VARCHAR ORA_VARCHAR2
TT_NCHAR ORA_NCHAR
TT_NVARCHAR ORA_NVARCHAR2
TT_DECIMAL ORA_NUMBER
TT_DATE ORA_DATE (append 12:00:00 am)
TT_TIMESTAMP ORA_TIMESTAMP(6)

Note:

Columns of type TT_TINYINT, TT_SMALLINT, TT_INTEGER, TT_BIGINT, BINARY_FLOAT, BINARY_DECIMAL, TT_BINARY, TT_VARBINARY, and TT_TIME are not converted.

For information on data types, see "Data Types" in the Oracle TimesTen In-Memory Database SQL Reference.

Oracle to TimesTen data type conversions

When migrating tables backward from TimesTen release 11.2.1 to an earlier version of TimesTen, you may need to convert Oracle data types to TimesTen data types, as the Oracle data types were not supported in releases before 11.2.1.

To convert from Oracle data types to TimesTen data types, use the -convertTypesToTT option.

The -convertTypesToTT option instructs the ttMigrate utility to make the following type conversions as it saves or restores tables:

From Oracle Type To TimesTen Type
ORA_CHAR TT_CHAR
ORA_VARCHAR2 TT_VARCHAR
ORA_NCHAR TT_NCHAR
ORA_NVARCHAR2 TT_NVARCHAR
ORA_NUMBER TT_DECIMAL
ORA_DATE TT_DATE (time portion of date is silently truncated)
ORA_TIMESTAMP TT_TIMESTAMP

For information on data types, see "Data Types" in the Oracle TimesTen In-Memory Database SQL Reference.

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 and TimesTen data types" in Oracle In-Memory 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 DSN=SalesDS sales.ttm

This command appends all database objects in the SalesDS database owned by user MARY to sales.ttm:

ttMigrate -a DSN=SalesDS sales.ttm MARY.%

This command restores all database objects from sales.ttm into the SalesDS database:

ttMigrate -r DSN=SalesDS sales.ttm

This command restores MARY.PENDING and MARY.COMPLETED from sales.ttm into SalesDS (case is ignored in migrate objects):

ttMigrate -r DSN=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.

Asynchronous materialized view: When migrating to a previous release, asynchronous materialized views are ignored and TimesTen returns a warning.

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.

When migrating databases that contain cache groups from a previous release of TimesTen to TimesTen 7.0 or greater, you must use the option -convertTypesToOra. See "Cache group data type conversions" for a description of the data type mapping.

Character columns in cached tables must have not only the same length but also the same byte semantics as the underlying Oracle tables. Cache group migration fails when there is a mismatch in the length or length semantics of any of its cached tables.

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.

Data type conversions: When migrating data from a pre-7.0 release of TimesTen, you must explicitly request data type conversions, using either the -convertTypesToOra or the -convertTypesToTT options.

ttMigrate saves the length semantic annotation (BYTE or CHAR) of CHAR and VARCHAR columns and restores these annotations when restoring into TimesTen releases that support them. When migrating backward into a TimesTen release that does not support these annotations, columns with CHAR length semantics are converted to BYTE length, but their lengths are adjusted to match the byte length of the original columns. When migrating forward from a release that does not support these annotations, BYTE length semantics are used.

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.

TimesTen also supports bitmap indexes. When migrating backward into a release that does not support bitmap indexes, ttMigrate converts the bitmap indexes to range indexes.

INLINE columns: When migrating TimesTen tables that contain INLINE variable length columns to a release of TimesTen that is earlier than 5.1, you must explicitly use the -noRepUpgrade option. Using the default -repUpgrade option results in an error. The INLINE attribute of the columns is maintained, unless you specify otherwise using the -inline option.

Materialized view logs: TimesTen does not save the content of materialized view logs, only the definition.

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:

Platforms: You can use ttMigrate to migrate databases between 32- and 64-bit platforms if the two platforms are otherwise the same. Follow the examples in the Oracle TimesTen In-Memory Database Installation Guide.

See also


ttBackup
ttBulkCp
ttRestore

ttmodinstall

Description

Modifies specified settings for an installation.

Required privilege

This utility requires the instance administrator privilege.

Syntax

ttmodinstall {-h | -help | -?}
ttmodinstall {-V | -version}
ttmodinstall -port portNumber
ttmodinstall -tns_admin path
ttmodinstall -enablePLSQL 
ttmodinstall -crs

Options

ttmodinstall has the options:

Option Description
-h

-help

-?

Displays help information.
-crs Create or modify Oracle Clusterware configuration.

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

-enablePLSQL Enables PL/SQL in the database.
-port portNumber Changes the daemon port for the current instance of TimesTen to portNumber. This is useful if you discover that other processes are listening on the port that you assigned to TimesTen at installation time.

Also can be used to assign the port for the TimesTen cluster agent. See "Using Oracle Clusterware to Manage Active Standby Pairs" in Oracle TimesTen In-Memory Database TimesTen to TimesTen Replication Guide.

-tns_admin path Sets the value for the TNS_ADMIN environment variable. Specify the directory where the tnsnames.ora file can be found.
-V | -version Display TimesTen version information.

Examples

To change the port number of the TimesTen instance to 12345, use:

ttmodinstall -port 12345

Notes

All TimesTen operations must be completely shut down to use this utility. This utility stops and then restarts the TimesTen daemon before making any changes to the instance.


ttRepAdmin

Description

Displays existing replication definitions and monitors replication status. The ttRepAdmin utility is also used when upgrading to a new release of TimesTen, as described in Oracle TimesTen In-Memory Database Installation Guide.

Required privilege

This utility requires the ADMIN privilege.

Syntax

ttRepAdmin {-h | -help | -?}
ttRepadmin {-V | -version}
ttRepAdmin -self -list [-scheme [owner.]schemeName]
       {DSN | -connStr connectionString}

ttRepAdmin -receiver [-name receiverName]
      [-host receiverHostName] [-state receiverState] [-reset]
      [-list] [-scheme [owner.]schemeName]
      {DSN | -connStr connectionString} 

ttRepAdmin -log {DSN | -connStr connectionString}

ttRepAdmin -showstatus {-awtmoninfo} {DSN | -connStr connectionString}

ttRepAdmin -showconfig {DSN | -connStr connectionString}

ttRepAdmin -bookmark {DSN | -connStr connectionString}

ttRepAdmin -wait [-name receiverName] [-host receiverHostName] 
      [-timeout seconds] {DSN | -connStr connectionString}

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]
      [-initCacheDr [-noDRTruncate][-nThreads]]
      [-keepCG [-cacheUid cacheUid [-cachePwd cachePwd]] 
         [-recoveringNode | -deferCacheUpdate]
      | -nokeepCG]
      [-remoteDaemonPort portNo] [-verbosity {0|1|2}]
      [-localhost localHostName]
      {destDSN | -connStr connectionString}

ttRepAdmin operations

The ttRepAdmin utility is used 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 connectionString}

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.
-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 connectionString}

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.
-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 Hostname 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 "Setting the replication state of subscribers" in Oracle TimesTen In-Memory Database TimesTen to TimesTen 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:

Before running the ttRepAdmin -duplicate command, use ttStatus to be sure that 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]
      [-initCacheDr [-noDRTruncate] [-nThreads]]
      [-keepCG [-cacheUid cacheUid [-cachePwd cachePwd]] 
      [-recoveringNode | -deferCacheUpdate]
      |-nokeepCG]
      [-remoteDaemonPort portNo] [-verbosity {0|1|2}]
      [-localhost localHostName]
      {destDSN | -connStr connectionString}

Options

ttRepAdmin -duplicate has the options:

Option Description
-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.
-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. The option is ignored 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 TimesTen to TimesTen 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 srcDataStoreName Defines the hostname or TCP/IP address of the sender (or master) database.
-initCacheDr Initializes disaster recovery. Must be used with -cacheUid and -cachePwd options.
-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.

-recoveringNode specifies that -duplicate is being used to recover a failed node for a replication scheme that includes an AWT or autorefresh cache group. Do not specify -recoveringNode when rolling out a new or modified replication scheme to a node. If -duplicate cannot update metadatabase on the Oracle database and all incremental autorefresh cache groups are replicated, then updates to the metadata are automatically deferred until the cache and replication agents are started.

-deferCacheUpdate forces the deferral of changes to metadatabase on the Oracle database until the cache and replication agents are started and the agents can connect to the Oracle database. Using this option can cause a full autorefresh if some incremental cache groups are not replicated or if -duplicate is being used for rolling out a new or modified replication scheme to a node.

-localhost hostName Can be used with -duplicate and-setMasterRepStart to explicitly identify the name or IP address of the local host.
-localIPAddress localIPAddress Specifies the alias or IP (IPv4 or IPv6) address of the local network interface to be used. If not specified, ttRepAdmin choose any compatible interface.
-noDRTruncate Used with the -initCacheDr option, -noDRTruncate indicates the number of threads used to truncate the Oracle tables and load the data in the cache into Oracle during the initialization process.
-nThreads n Used with the -initCacheDr option, -nThreads indicates the number of threads used to truncate the Oracle tables and push the data in the cache into Oracle during the initialization process.
-PWD pwd The password of the 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 unload/reload database cycle to improve the performance of the duplicate operation when copying large databases. After the duplicate option, the 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.

-remoteIPAddress remoteIPAddress Specifies the alias or IP (IPv4 or IPv6) address of the remote destination network interface to be used. If not specified, ttRepAdmin choose 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. The option is ignored 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.
-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 3-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 3-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 OS 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 3-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 connectionString ]

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 connectionString} 

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.
-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 hostname 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 connectionString}
ttRepAdmin -showstatus {-awtmoninfo} {DSN | -connStr connectionString}
ttRepAdmin -showconfig {DSN | -connStr connectionString}
ttRepAdmin -bookmark {DSN | -connStr connectionString}

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 ttCacheAwtMonitorConfig 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 management 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.
-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 TimesTen to TimesTen Replication Guide for more information.

-showstatus Reports the current status of the specified replicated database.

See "Show replication status" in Oracle TimesTen In-Memory Database TimesTen to TimesTen 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 TimesTen to TimesTen 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.

The output also includes the percentage of time spent on TimesTen processing, Oracle bookmark management, Oracle execution and Oracle commits.

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.

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 myDSN

[other -showstatus output]
...
AWT Monitoring statistics
--------------------------
TimesTen processing time : 0.689000 millisecs (0.164307 %)
   Oracle bookmark management 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 wish 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 TimesTen to TimesTen Replication Guide.

For upgrade examples, see "Database Upgrades" in Oracle TimesTen In-Memory Database Installation 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. This allows 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 other Data Store attributes.

For an overview of the TimesTen backup and restore facility, see "Migration, backup, and restoration of the database" in the Oracle TimesTen In-Memory Database Operations Guide.

Required privilege

This utility requires the instance administrator privilege.

Syntax

ttRestore {-h | -help | -?}
ttRestore {-V | -version}
ttRestore [-fname filePrefix] [-noconn] -dir directory 
       {DSN | -connStr connectionString}
ttRestore -i [-noconn] {DSN | -connStr connection_String}

Options

ttRestore has the options:

Option Description
-connStr connection_string An ODBC connection string containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
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. ttRestore rolls the logs forward.
-noconn In order to ensure that the restore was successful, ttRestore connects to the database as a last step. This option disables that last connect.
-V | -version Prints the release number of ttRestore and exits.

Example

ttRestore -dir /users/pat/TimesTen/backups
-fname FastInsBkup "DSN=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 "dsn=origDSN"
ttRestore -dir /users/rob/tmp -fname restored "dsn=restoredDSN"

The value of fname is the name that you want for the prefix portion of the backup file name.

On UNIX, to restore a tape backup to the FastIns database, use:

dd bs=64k if=/dev/rmt0 | ttRestore -i DSN=FastIns

Note

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

See also


ttBackup
ttBulkCp
ttMigrate

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:

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 output of ttSchema can be played back by the ttIsql utility in order to rebuild the full schema of a database.

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.

Syntax

ttSchema {-h | -help | -?}
ttSchema {-V | -version}
ttSchema [-l] [-c] [-fixedTypes] [-st | -systemTables]
         [ -list {all | tables | views | sequences |
         cachegroups | repschemes | plsql} [,...] ] 
         [-plsqlAttrs | -noplsqlAttrs]
         [-plsqlCreate |-plssqlCreateOrReplace]
         {-connStr connection_string | DSN }
         [[owner.]object_name][...]

Options

ttSchema has the options:

Option Description
-connStr connection_string An ODBC connection string containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
-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 Oracle.

For this release, -c 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 regardless of the current TypeMode value.
-h

-help -?

Prints a usage message and exits.
-l One per-line listing of objects in the database.
-list {all | tables | views | sequences | cachegroups | repschemes | plsql}[,...] A comma-delimited (no space after comma) list of objects to generate. Lists only those types of objects specified. Default is -list all.

-list views also displays information about materialized view logs.

[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 | -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 3-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 3-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 3-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 3-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.

Output is not guaranteed to be compatible with DDL recognized by previous releases of TimesTen.


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. It can be used on existing tables or to estimate table sizes when creating tables. If no owner is specified, the size information is printed for all tables of the given 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 table is scanned when this utility is called. The scan of the table can be avoided by specifying an optional non-NULL frac value, which should be between 0 and 1. This value is used 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.

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 containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
DSN Specifies the name of a data source to which ttSize should connect to retrieve table information.
-frac fraction Estimated average fraction of VARBINARY or VARCHAR column sizes.
-h

-help

-?

Prints a usage message and exits.
-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 number of rows in the existing table is used, or 1 if the table is empty.

-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.
-V | -version Prints the release number of ttSize and exits.

Example

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 FixedDs -tbl Nameid -rows 200000

Notes

Another method for estimating size requirements and measuring fragmentation is to use the MONITOR table. (See "SYS.MONITOR" in Oracle TimesTen In-Memory Database System Tables and Limits Reference.)

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.


ttStatus

Description

Displays information that describes the current state of TimesTen. The command displays:

Required privilege

This utility requires no privileges.

Syntax

ttStatus {-h | -help | -?}
ttStatus {-debug}
ttStatus {-V | -version}
ttStatus [-v] [-r secs] [-[no]pretty] 

Options

ttStatus has the options:

Option Description
-h

-help

-?

Prints a usage message and exits.
-debug The -debug option emits additional information. It is not advised for use in production. The data emitted by this option should only bs used in consultation with customer support. The content of the data and the format is subject to change without notice.
-[no]pretty With [no], indicates that pretty formatting is not used. The default is pretty formatting, which uses the values of the ConnectionName attribute.
-r secs Allows ttStatus to continue running. Updates status report every secs seconds.
-V | -version Prints the release number of ttStatus and exits.
-v Prints detailed information that is useful for TimesTen customer support.

Sample output

When you invoke the command, a report that describes the current state of the system is displayed to stdout. The following is sample output:

TimesTen
 status report as of Thu Jul 17 19:15:41 2008

Daemon pid 26622 port 4133 instance sadrake
No TimesTen server running

------------------------------------------------------------------------
Data store /scratch/timesten_user/rdbms
There are 7 connections to the data store
Data store is in shared mode
Shared Memory KEY 0x13014429 ID 80347138
PL/SQL Memory KEY 0x14014429 ID 80379907 Address 0x2345678900000000
Type            PID     Context     Connection Name              ConnID
Process         26743   0x08117148  rdbms                             1
Subdaemon       26626   0x080bdfa8  Worker                         2042
Subdaemon       26626   0x08159228  Flusher                        2043
Subdaemon       26626   0x081c8850  Monitor                        2044
Subdaemon       26626   0x08217c10  HistGC                         2045
Subdaemon       26626   0x08266fd0  Aging                          2046
Subdaemon       26626   0x082b6390  Checkpoint                     2047
Replication policy  : Manual
Cache agent policy  : Manual
Access control enabled.
PL/SQL enabled.

End of report

When you invoke the command with the -pretty option, a report that describes the current state of the system is displayed to stdout. The following is sample output:

Data store /ds0/timesten_user/sample
          There are 7 connections to the data store
          Data store is in shared mode
          Shared Memory KEY 0x13014429 ID 80347138
          PL/SQL Memory KEY 0x14014429 ID 80379907 Address 0x2345678900000000
      Type            PID     Context             Connection Name      ConnID
Process        29508   0x00000001001c6680  rdbms                     1
Process         26743   0x08117148  rdbms                             1
Subdaemon       26626   0x080bdfa8  Worker                         2042
Subdaemon       26626   0x08159228  Flusher                        2043
Subdaemon       26626   0x081c8850  Monitor                        2044
Subdaemon       26626   0x08217c10  HistGC                         2045
Subdaemon       26626   0x08266fd0  Aging                          2046
Subdaemon       26626   0x082b6390  Checkpoint                     2047

          Replication policy  : Manual
          Cache agent policy : Manual
          Access control enabled.
          PL/SQL enabled.

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.

See also

ttAdmin


ttSyslogCheck (UNIX)

Description

Determines if the system's /etc/syslog.conf file is properly configured for TimesTen. The TimesTen Data Manager uses syslog to log a variety of progress messages. It is highly desirable to configure syslog so that all TimesTen messages are written to disk in a single disk file. The ttSyslogCheck utility examines the syslog configuration (in /etc/syslog.conf) to verify that it is properly configured for TimesTen.

If syslog is properly configured, ttSyslogCheck displays the name of the file that TimesTen messages are logged to and exits with exit code 0. If syslog is not properly configured, ttSyslogCheck displays an error message and exits with code 1.

Required privilege

This utility requires no privileges.

Syntax

ttSyslogCheck {-h | -help | -?}
ttSyslogCheck {-V | -version}
ttSyslogCheck [-facility name]

Options

ttSyslogCheck has the options:

Option Description
-h

-help

-?

Prints a usage message and exits.
-facility name Specifies the syslog facility name being used for message logging.
-V | -version Prints the release number of ttSyslogCheck and exits.

Note

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


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 containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
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.

Example

ttTail MyDatastore

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 Procedures 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 containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
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" SalesData

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

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 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 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 admin, instance home directory, daemon home directory, port number and build timestamp.

Required privilege

This utility requires no privileges.

Syntax

ttVersion [-m]
ttVersion [-m]

Options

ttVersion has the option:

Option Description
-m Generates computer-readable enhanced output. If not specified, abbreviated information is output.

Output

ttVersion produces the following sample output.

TimesTen Release 11.2.1 (32 bit Linux/x86) (tt1121_32:53384) 2009-05-26T23:00:04Z
Instance admin: terry
Instance home directory: spider/terry/TimesTen/tt1121_32
Daemon home directory: spider/terry/TimesTen/tt1121_32/srv/info

ttVersion -m produces the following sample output. Most of the entries only appear for patch releases.

patched=yes
product=TimesTen
major1=11
major2=2
major3=1
patch=1
portpatch=0
version=11.2.1.1.0
shortversion=1121
numversion=110200010100
bits=32
os=Linux/x86
buildtstamp=1243378804
buildtime=2009-05-26T23:00:04Z
clientonly=no
instance=tt1121_32
effective_port=53384
orig_port=53384
instance_admin=terry
effective_insthome=/spider/terry/ttcur/TTBuild/linux86_dbg/tt1121_32
orig_insthome=/spider/terry/ttcur/TTBuild/linux86_dbg/tt1121_32
effective_daemonhome=/spider/terry/ttcur/TTBuild/linux86_dbg/tt1121_32/info
orig_daemonhome=/spider/terry/ttcur/TTBuild/linux86_dbg/tt1121_32/info
plsql=0
groupname=timesten

ttXactAdmin

Description

The ttXactAdmin utility lists ownership, status, log and lock information for each outstanding transaction. The ttXactAdmin utility also allows you to heuristically commit, abort or forget an XA transaction branch.

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 what privilege is needed, if any.

Syntax

ttXactAdmin {-h | -help | -?}
ttXactAdmin {-V | -version}
ttXactAdmin [-v verbosity] [-lsn] [-mt maxTrans] [-ml maxLocks] [-pid pid] 
[-xact xid] [-tbl [owner.]tableName][-row rowid] [-interval seconds]
[-count iterations] {DSN | -connstr connectionString}
ttXactAdmin -latch [-interval seconds] [-count iterations]
{DSN | -connstr connStr}
ttXactAdmin -latchstats clear | off |on | [show] [-interval seconds] 
[-count iterations] {DSN | -connstr connectionString}
ttXactAdmin -connections [-pid pid] [-interval seconds]
[-count iterations] {DSN | -connstr connStr}
ttXactAdmin -xactIdRollback xid {DSN | -connstr connStr}
ttXactAdmin {-HCommit xid | -HAbort xid | -HForget xid} {DSN | -connstr connStr}

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 connectionString An ODBC connection string containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
-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.
-h

-help

-?

Prints a usage message and exits.
-HAbort xid Heuristically abort 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.

-HCommit xid 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.

-HForget xid 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.

-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.
-latchstats[clear | off | on | show] This option is to be used by TimesTen Customer Support only. Performs the requested latchstat operation.

This option requires ADMIN privileges.

All other options are ignored when -latchstats is used.

clear - Resets all latchstat information to zero.

off - Turns off collection of latchstats.

on - Turns on collection of latchstats.

show (default) - Shows the latch information, including access counts and other stats.

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

-row rowid Displays lock information for the specified row.

This option requires ADMIN privileges or database object ownership.

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

-xactIdRollback xid Allows you to roll back a transaction. This may be particularly useful for long running transactions. This 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 IMDB Cache operations on Oracle. Operations include passthrough statements, flushing, manual loading, manual refreshing, synchronous writethrough, propagating, and transparent 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.
TransId The unique identifier for the transaction used internally by TimesTen. The identifier has two parts.

The first part is a relatively small value (less than 2048), used to discriminate between transactions that are active at the same time.

The second part is a potentially large value (an unsigned integer), and is used to discriminate 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).

TransStatus Current status of the transaction, one of:
  • Active - Active transaction.

  • Aborting - A transaction is in the process of aborting. 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 aborted transaction branch.

  • Propagating - TimesTen transaction waiting for Oracle to commit.

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 isolationLock "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.

Example

The following command displays all locks in the database:

ttXactAdmin -connstr DSN=demodata

Outstanding locks
PID   Context  TransId     TransStatus Resource  ResourceId         Mode Name
Program File Name: localtest
10546 0x118e28 2047.000003 Active      Table     411104             IS  SYS.TABLES
                                       Table     416480             IXn TEST1.TAB1
                                       Row       BMUFVUAAABQAAAAGTD Sn  SYS.TABLES
                                       Hashed Key 0x69cf9c36        Sn  SYS.TABLES
                                       Database   0x01312d00        IX
                                       Row       BMUFVUAAABQAAAAGzD Xn  TEST1.TAB1
Program File Name: /users/smith/demo/XAtest1
XA-XID: 0xbea1-001b238716dc35a7425-64280531947e1657380c5b8d
1817 0x118e28 2046.000004 Active       Table    416480              IS  TEST1.TAB1
                                       CompCmd  21662408            S
                                       Database 20000000            IS
                                       Row      BMUFVUAAABQAAAAJzD  Sn  TEST1.TAB1
Program File Name: /users/smith/demo/XAtest2
XA-XID: 0xbea1-001c99476cf9b21e85e1-70657473746f7265506f6f6c
27317 0x118e28 2045.000005 Prepared    Table  411104             IS   SYS.TABLES
                                       Table  416816             IXn  TEST1.TAB2
                                       Row    BMUFVUAAABQAAAAMzD Sn   SYS.TABLES
                                       Database   0x01312d00     IX
                                       Hashed Key 0x67fe3852     Sn   SYS.TABLES
                                       Row    BMUFVUAAABQAAAAHTE Xn   TEST1.TAB2
Program File Name: /users/smith/demo/Reptest
27589 0x118e28 2044.000006 Rep-Wait-Return
Awaiting locks
PID  Context  TransId     Resource ResourceId RMode HolderTransId HMode Name
Program File Name: /users/smith/demo/XAtest1
1817 0x118e28 2046.000004 Row BMUFVUAAABQAAAAPTD  Sn  2047.000003   Xn  TEST1.TAB1

The following command displays all locks for transaction 2045.000005:

ttXactAdmin -xact 2045.000005 -connstr DSN=demodata
PID   Context  TransStatus 1stLSN    LastLSN  Resource ResourceId Mode Name
Program File Name: /users/smith/demo/XAtest2
XA-XID: 0xbea1-001c99476cf9b21e85e1-70657473746f7265506f6f6c 
27317 0x118e28 Prepared    0.0116404 0.0116452 Table 411104         IS  SYS.TABLES
                                             Table   416816         IXn TEST1.TAB2
                                             Row BMUFVUAAABQAAAAGzE Sn  SYS.TABLES
                                             Database 0x01312d00    IXn
                                             Hashed Key 0x67fe3852  Sn SYS.TABLES
                                             Row BMUFVUAAABQAAAAKzE Xn TEST1.TAB2

To display all the connections to the database:

$ ttXactAdmin -connections sample
2006-09-10 10:26:33
/datastore/terry/sample
TimesTen Release 11.2.1.0.0

ID   PID    Context            Name           Program        State TransID UID
1    29508  0x00000001001c6680 myconnection   ttIsql         Run   1.23    TERRY
2044 29505  0x0000000100165290 Worker         timestensubd   Run           TERRY
2045 29505  0x00000001001df190 Flusher        timestensubd   Run           TERRY
2046 29505  0x000000010021cc50 Monitor        timestensubd   Run           TERRY
2047 29505  0x0000000100206730 Checkpoint     timestensubd   Run           TERRY
    5 connections 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).

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:


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}

Options

ttXactLog has the options:

Option Description
-b blkID Restricts log records to those accessing this block, plus any transaction records.
-connStr connectionString An ODBC connection string containing the name of the database, the server name and DSN (if necessary) and any relevant connection attributes.
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/1997.ds0, /home/payroll/1997.ds1 and several transaction log files /home/payroll/1997.logn,dspath is /home/payroll/1997.

-h

-help

-?

Prints a usage message and exits.
-headers records Prints one header for every records records. A value of 0 disables headers entirely.
-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.
-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 1000).
-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.
-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).


Example

ttXactLog -v 3 -m 100 /users/pat/TimesTen/Daily/F112697SS

Note

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