Customizing Startup Command Line Options for ttIsql Sessions

The ttIsql utility can be customized to automatically run a set of command line options every time a ttIsql session is started from the command prompt.

This is accomplished by setting an environment variable called TTISQL to the value of the ttIsql command line that you prefer. A summary of ttIsql command line options is shown below. For a complete description of the ttIsql command line options, see the ttIsql section in the Oracle TimesTen In-Memory Database Reference.

Usage: ttIsql [-h | -help | -helpcmds | -helpfull | -V]
        ttIsql [-f <filename>] 
               [-v <verbosity>] 
               [-e <commands>]
               [-interactive] 
               [-N <ncharEncoding>] 
               [-wait]
               [{<DSN> | -connstr <connection_string>}]

The TTISQL environment variable has the same syntax requirements as the ttIsql command line. When ttIsql starts up it reads the value of the TTISQL environment variable and applies all options specified by the variable to the current ttIsql session. If a particular command line option is specified in both the TTISQL environment variable and the command line, then the command line version always takes precedence.

The procedure for setting the value of an environment variable differs based on the platform and shell that ttIsql is started from. As an example, setting the TTISQL environment variable on Windows could look like this:

C:\>set TTISQL=-connStr "DSN=database1" -e "autocommit 0;dssize;"

In this example, ttIsql automatically connects to a DSN called MY_DSN, turns off autocommit, and displays the size of the database, as shown below:

C:\>ttIsql

Copyright (c) 1996, 2024 Oracle.  All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.

Command> connect "DSN=database1";
Connection successful: 
DSN=database1;DataStore=/disk1/databases/database1;DatabaseCharacterSet=AL32UTF8;
ConnectionCharacterSet=AL32UTF8;PermSize=128;
(Default setting AutoCommit=1)
Command> autocommit 0;
Command> dssize;
The following values are in KB:
 
  PERM_ALLOCATED_SIZE:      40960
  PERM_IN_USE_SIZE:         9453
  PERM_IN_USE_HIGH_WATER:   9453
  TEMP_ALLOCATED_SIZE:      32768
  TEMP_IN_USE_SIZE:         9442
  TEMP_IN_USE_HIGH_WATER:   9885
Command>