ttCheck

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

Required Privilege

This utility requires the ADMIN privilege.

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

Usage in TimesTen Scaleout and TimesTen Classic

This utility is supported in both TimesTen Classic and TimesTen Scaleout.

Syntax

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

Options

ttCheck has the options:

Option Description

-blkDir

Checks all the block directories.

-compHeap

Checks the compilation heap structure.

-connStr connection_string

An ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings.

DSN

Specifies an ODBC data source name of the database to be checked.

dspath

The fully qualified name of the database to be checked. This is not the DSN associated with the connection. It is the fully qualified database path name associated with the database as specified in the DataStore= parameter connection attribute in the database's DSN.

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

-f outFile

Specifies the output file name; defaults to stdout.

-h

-help

-?

Prints a usage message and exits.

-header

Checks the content of the database header.

-heap

Checks all heap structures.

-indexHeap

Checks the index heap structure.

-level levelNum

Indicates the level of checking for header, block directory, heap and table. Different structures can be checked using different levels in a same command. A level specification is applied to all structures specified to its left in the command string that do not have a level specification. A level specification is applied to all structures if no structure is specified in the command string.

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

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

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

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

-log

Checks the log buffer.

-m maxErrors

Maximum number of errors to report. Default is 10; a few extra related errors may be reported. If 0, the utility only connects, then returns.

-permBlkDir

Checks the permanent partition block directory.

-permHeap

Checks the permanent heap structure.

-tables tblName [...]

Checks table(s) specified by tblName.

-tempBlkDir

Checks the temporary partition block directory.

-tmpHeap

Checks the temporary heap structure.

-users userName [...]

Checks tables belonging to the user(s) specified by userName.

-V | -version

Prints the release number of ttCheck and exits.

-v verbosity

0 - No output (program's exit status indicates if an error was found).

1 (default) - Enable error output only.

2 - Error output and a progress report.

Examples

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

% ttCheck test_db

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

% ttCheck -level 1 test_db

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

% ttCheck -tables test_db

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

% ttCheck -tables -level 3 test_db

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

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

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

% ttCheck -tables tab1 tab2 -level 3 test_db

Notes

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

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

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

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

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

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