API Tracing
API traces are generated for database operations such as connecting to a database, changing a connection attribute, and committing a transaction. Table 2-2 describes the levels for API tracing. Each level with a '+' sign includes the trace information described for that level, plus all levels preceding it.
Table 2-2 API tracing levels
Level | Output |
---|---|
1 |
All rollback attempts by the subdaemon This occurs if an application exits abruptly and the subdaemon recovers its connection. |
2 |
+ Some low-on-space conditions |
3 |
+ Create, connect, disconnect, checkpoint, backup, and compact operations for the database, as well as commit and rollback for each connection, and a few other operations |
4 |
+ Most other operations conducted at TimesTen's internal API level It does not show numerous operations on the storage manager and indexes that are done internally. |
Note:
TimesTen recommends tracing at level 3.
In this example, execute ttTraceMon
to do a API trace at level 3 on the databae1
database. The output from the API trace is written to the APItrace.txt
file. Before saving the API trace to the buffer, use the flush
command to empty the buffer.
% ttTraceMon database1 Trace monitor; empty line to exit Trace> outfile APItrace.txt Trace> level api 3 Trace > flush
At this point, execute the application. When the application has completed, turn off API tracing and exit ttTraceMon
:
Trace > level api 0 Trace > {press ENTER – blank line}
The contents of APItrace.txt
are similar to the sample output shown below. The output shows connection to the database, setting the connection character set, setting the isolation level, and committing a transaction.
11:54:26.796 1016 API 3L 2C 4848P sb_dbConnect()(X) 11:54:26.796 1017 API 3L 2C 4848P sb_dbConnCharsetSet()(E) 11:54:26.796 1018 API 3L 2C 4848P sb_dbConnSetIsoLevel()(E) 11:54:39.795 1019 API 3L 2C 4848P sb_dbConnSetIsoLevel()(E) 11:54:45.253 1020 API 3L 2C 4848P sb_xactCommitQ()(E)