Oracle® TimesTen In-Memory Database Troubleshooting Procedures Guide Release 11.2.1 Part Number E13075-02 |
|
|
View PDF |
This chapter describes how to troubleshoot some of the problems you may encounter when using Oracle In-Memory Database Cache (IMDB Cache). It includes the following topics:
If you are having problems with an AWT cache group, see also Chapter 5, "Troubleshooting AWT Cache Groups".
This section describes some of the problems you might encounter when executing the CREATE CACHE GROUP statement.
Possible cause | What to do |
---|---|
User does not have the correct Oracle privileges to create the cache group type. | See "Check Oracle privileges". |
User has insufficient access to data store. | You must have CACHE_MANAGER privilege to create a cache group. |
The internal/external user does not match the Oracle user. | The TimesTen user name must be the same as the Oracle user name. |
Cannot connect to Oracle | See:
Check the network status. |
Cache administration user ID or password not set (when trying to create AWT or autorefresh cache groups) | See "Set the cache administration user id and password". |
Unsupported data type mapping | See "Unsupported data type mapping". |
Different nullability setting in Oracle | See "Null constraint does not match Oracle". |
Failure to specify primary key in root table | The root table of a cache group must have a primary key. See "Defining cache groups" in the Oracle In-Memory Database Cache User's Guide. |
This section describes some of the problems you might encounter when starting or stopping the cache agent.
Possible cause | What to do |
---|---|
Cache agent already running | See "Check status of the cache agent". |
Unable to locate Oracle libraries |
|
ORACLE_HOME is invalid. | See "Check ORACLE_HOME environment variable". |
Insufficient privileges | You must have CACHE_MANAGER privilege to start or stop the cache agent. |
Wrong OracleID | Ensure that the OracleID set in your DSN definition matches the Oracle Service Name for the Oracle instance that contains the tables to cache in TimesTen. |
Check the status of the cache agent by using the ttStatus
utility as described in "Using the ttStatus utility" to check the status of the cache agent.
If the cache agent is not running, start it as described in "Starting the cache agent" in the Oracle In-Memory Database Cache User's Guide. If attempts to start the cache agent fail, then investigate the possible causes and reboot the machine before attempting to start the cache agent.
On UNIX or Linux platforms, check that the ORACLE_HOME environment variable is set correctly for the shell from which you are starting the cache agent and the TimesTen daemon. Use the ttmodinstall
utility if you need to change the setting for ORACLE_HOME.
See "Environment variables" in Oracle In-Memory Database Installation Guide.
If you receive error ORA-12514 indicating "could not resolve service name":
Use the Oracle TNSPING utility to verify that the service can be reached.
Ensure that the OracleID
set in your DSN definition matches the Oracle Service Name for the Oracle instance that contains the tables to cache in TimesTen.
Ensure that there is a service name defined. If it is a Windows Oracle client, use Oracle Net Configuration Assistant to configure a service name. In Oracle Net Configuration Assistant, navigate to Oracle Net Configuration -> Local -> Service Naming, select your Oracle server and confirm that there is a service name or a SID that identifies the Oracle server. If you add or modify a service name, you may need to reboot.
Check the cache administration user name and password on Oracle with SQL*Plus to make sure this service name works. For example:
%sqlplus cache_admin_user/cache_admin_pwd@OracleHost
cache_admin_user
is the cache administration user name, cache_admin_pwd
is the cache administration user password, and OracleHost
is the OracleID specified in your DSN definition.
Note:
Your cache administration user may be different from your regular Oracle user. See "Create Oracle users" in the Oracle In-Memory Database Cache User's Guide.Ensure that there is only one copy of tnsnames.ora
on your TimesTen machine. Also check the permission on tnsnames.ora
.
If you are running TimesTen on a UNIX system, check that the ORACLE_HOME environment variable points to the correct Oracle installation directory. For example:
ORACLE_HOME=/products/oracle10g
Check the Oracle client and server versions. See "Incompatible Oracle Server and Client versions".
You may receive ORA-12154 "TNS:could not resolve the connect identifier specified" when you try to connect to a a data store.
This can occur when you are trying to use IMDB Cache and Oracle on the same machine and the TNS_ADMIN environment variable does not point to the proper tnsnames.ora
file for Oracle. For example, you may have several instances of the Oracle Database running on a laptop.
In a production environment, you typically have TimesTen and Oracle running on different machines. In this case, do not reset the TNS_ADMIN environment variable to point to a tnsnames.ora
file on the machine where TimesTen is running. The Oracle client uses the TNS_ADMIN setting to resolve the connection, but the TimesTen main daemon, the cache agent, the Web server, and the replication agent are unaware of the TNS_ADMIN setting. IMDB Cache cannot operate properly when the Oracle client and TimesTen use different tnsnames.ora
files.
On Windows, set the TNS_ADMIN environment variable as follows:
Right-click My Computer and choose Properties.
On the Advanced tab, choose Environment Variables.
Add or edit TNS_ADMIN as a system environment variable so that it points to the directory that contains the tnsnames.ora
file that you wish to use. You can include other tnsnames.ora
files with the INAME command inside the tnsnames.ora
file.
If you receive connection timeout errors such as ORA-12170 or ORA-12535, or if you receive ORA-03134 (server version not supported), verify that you are using an Oracle client and Oracle server whose versions are compatible.
Metalink Documentation Note 207303.1, "Client/Server/Interoperability Support Between Different Oracle Versions", lists the client/server combinations supported by Oracle.
See "Oracle In-Memory Database Cache" in the Oracle TimesTen In-Memory Database Installation Guide for information about Oracle clients and servers supported for use with TimesTen. Also check Oracle and TimesTen release notes for known problems with client/server versions.
This section describes some of the problems you might encounter when using the Oracle username and password.
Possible cause | See... |
---|---|
The library environment variable is not set correctly | "Check library path environment variable". |
Oracle processes not running | "Check status of TNS listener and Oracle Server". |
User does not have the correct Oracle privileges | "Check Oracle privileges". |
Incorrectly configured DSN | "Check DSN definition". |
Problems with cache administration user ID or password | "Set the cache administration user id and password". |
Inconsistent user and system environments | "Check user and system environment". |
Dynamic libraries not loading | "Verify the loaded dynamic libraries". |
Check the library path environment variable on your platform.
On this platform... | Check this variable... |
---|---|
UNIX except HP-UX | LD_LIBRARY_PATH
On 64-bit platforms, LD_LIBRARY_PATH64 takes precedence over LD_LIBRARY_PATH. Make sure that the library path is specified in LD_LIBRARY_PATH64. |
HP-UX | SHLIB_PATH |
Windows | PATH |
The library path environment variable must include the following information:
TimesTen and platform bit combination | Setting |
---|---|
64-bit TimesTen or 32-bit TimesTen on 32-bit platform | $ORACLE_HOME/LIB and $ORACLE_HOME/NETWORK/LIB |
32-bit TimesTen on 64-bit platform | $ORACLE_HOME/LIB32 and $ORACLE_HOME/NETWORK/LIB32 |
Try to connect to the Oracle database by using SQL*Plus or use Oracle Enterprise Manager to verify the status.
From an Oracle SQL*Plus command prompt, list the current Oracle privileges granted to you by entering:
SELECT * FROM SESSION_ROLES; SELECT * FROM SESSION_PRIVS;
Compare the privileges listed against the required privileges for the various IMDB Cache operations that are specified in "Grant privileges to Oracle users" in the Oracle In-Memory Database Cache User's Guide. Contact your Oracle Administrator if you require additional privileges.
Confirm you have correctly set the DSN attributes as described in "DSN for a TimesTen database that caches data from an Oracle database" in the Oracle In-Memory Database Cache User's Guide.
Confirm that the DSN definition for IMDB Cache is a system DSN.
Confirm that the DSN for IMDB Cache is defined only once.
Confirm Oracle user name and password. Use SQLPlus and connect to Oracle using the same OracleID and OraclePWD used in your DSN definition to confirm they are correct.
If the Oracle client was installed and the machine has not been restarted, then the TimesTen daemon is still running under the "old" environment before the Oracle client install. Reboot your machine so the TimesTen can start under the "new" environment.
From a ttIsql
session, connect to the data store and enter the following:
Command> call ttCacheUidPwdSet('scott','tiger');
If it returns an error, then check the Oracle ID, the cache administration user ID and cache administration password. Also check whether the Oracle instance is running.
Test to see if the problem is due to differences in user and system environment. This procedure requires two session windows (Command Prompt windows in Windows or shell windows in UNIX).
Stop the TimesTen daemon.
In one session window, start the Timesten daemon as a regular user.
On Windows:
% install_dir/srv/ttsrv1121.exe -d -verbose
On UNIX:
% install_dir/srv/timestend -d verbose
Some messages will flash by, and then it goes into a wait state.
In another session window, try to restart the cache agent.
If Step 3 succeeds, then use Ctrl-C on Windows or the kill
command on UNIX to stop the TimesTen daemon you started for the other session in Step 2.
Compare the user environment and system environment. For example, do both user and system see the same copy of oci.dll
? Are there any differences in the path name to the oci.dll
library between the user and system environments?
If you detect differences, make the necessary modifications.
Reboot the system and restart the TimesTen daemon.
If you are running on a Windows system with Visual C++ installed, verify the loaded dynamic libraries. This works only if you can start the cache agent without autorefresh:
Make sure TimesTen is started.
Start the cache agent without autorefresh.
Command> call ttCacheStart; Command> create cache group cg1 from t1(c1 int not null primary key);
Open the Windows Task Manager, find process ttora1121.exe
and highlight it. Right-click on it and select Debug. This brings you into Visual C++ and you should see the loaded DLL in the debug window, as described in "Unable to resolve Oracle Service Name".
Load the cache group to force an cache connection from the cache agent:
Command> load cache group cg1 commit every 100 rows;
Compare the loaded DLL in your debug window with the partial list shown in Example 4-1.
Example 4-1 List of loaded dlls
This partial list was created with the Oracle client.
Loaded 'E:\TimesTen\tt1121_32\bin\timestenorad1121.exe', no matching symbolic information found. Loaded 'C:\WINDOWS\SYSTEM32\ntdll.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\SYSTEM32\kernel32.dll', no matching symbolic information found. Loaded 'E:\TimesTen\tt1121_32\bin\tten1121.dll', no matching symbolic information found. Loaded 'E:\TimesTen\tt1121_32\bin\ttcommon1121.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\SYSTEM32\wsock32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\SYSTEM32\ws2_32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\SYSTEM32\msvcrt.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\SYSTEM32\ws2help.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\SYSTEM32\advapi32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\SYSTEM32\rpcrt4.dll', no matching symbolic information found. ...
Error 5105, "OCI initialization failed," may occur when an operation requires contact with the Oracle database. For example, the error can occur in the following situations:
Starting the cache agent
Setting the cache administration user ID or password
Entering a SQL statement in TimesTen when autocommit=0 and PassThrough=3
Error 5105 contains additional information about its cause:
OCI is unable to find an Oracle library. See "Check library path environment variable" and check the permissions on the library specified in the error message.
ORACLE_HOME is invalid. See "Check ORACLE_HOME environment variable".
When you try to create a cache group, you may receive the following error:
5115: Unsupported type mapping for column name
For example, table tab on Oracle can be described as follows:
COL1 NUMBER(38) NOT NULL COL2 NUMBER(38)
Try to create the cache group as follows:
CREATE CACHE GROUP cg FROM tab(col1 CHAR(10) NOT NULL PRIMARY KEY);
Error 5119 is displayed and the cache group is not created because the statement attempts to map a column of NUMBER data type to a column of CHAR data type.
See "Data type mappings" in the Oracle In-Memory Database Cache User's Guide.
When you try to create a cache group, you may receive the following warning:
Warning 5119: Column name has different nullability setting in Oracle
For example, table tab
on Oracle can be described as follows:
COL1 NUMBER(38) NOT NULL COL2 NUMBER(38)
Try to create the cache group as follows:
CREATE CACHE GROUP cg FROM tab(col1 INTEGER NOT NULL PRIMARY KEY, col2 INTEGER NOT NULL);
Warning 5119 is displayed because col2
on Oracle does not have a NULL constraint, but col2
in the cache group is defined as NOT NULL.
DDL operations that are performed on an Oracle table that is being cached in TimesTen may cause a failure on the cache group. For example, the user drops a column on the Oracle table that is being cached in TimesTen. When the cache group is propagated or flushed, TimesTen will update the column that no longer exists in the Oracle table. When the cache group loads or refreshes, then TimesTen attempts to retrieve data from the column that has been dropped.
The following cache group operations may fail:
Autorefresh does not occur.
AWT cache group operations are not propagated or refreshed to/from Oracle.
Cache group load or propagate fails.
If you suspect the cache group operations are not working properly because of a DDL operation on the Oracle base table, then use DDL tracking to diagnose the issue. DDL tracking saves the change history for all the cached Oracle tables. The SQL statement and when it was executed are each written to a TimesTen table in the cache administrator user schema on Oracle.
For more information on how to create the DDL tracking objects and how to enable DDL tracking for the base table within Oracle, see "Monitoring DDL operations on cached Oracle tables" in the Oracle In-Memory Database Cache User's Guide. For details on the built-in procedures used for initializing and enabling DDL tracking, see the Oracle TimesTen In-Memory Database Reference.
If you modify an object in a cache group and then the changes do not appear on a subsequent SQL statement, then one of the following may have occurred:
The object was dropped from the Oracle database or was somehow damaged.
The Oracle database was restored or recovered to a time before the object was created.
The Oracle database was down.
The user modified the OracleNetServiceName
DSN or connection attribute after creating the cache group, which points to an Oracle database other than the one that the cache group was created upon.
For example, if the user creates an AWT cache group. Then, the user added rows to a table. When the user performs a SELECT * FROM
the table, the rows did not appear. The ttmesg.log
error file does not display an error that Oracle is not available. Instead, it displays the following messages:
12:09:02.10 Err : REP: 29934: CACHE1:meta.c(904): TT5221: TT5221: Oracle syntax error in OCIStmtExecute(): ORA-00942: table or view does not exist rc = -1 -- file "bdbStmt.c", lineno 1535, procedure "getOraOutTypesNLengths()" 12:09:02.27 Err : REP: 29934: CACHE1:receiver.c(1978): TT5250: Awt Initialization Failure. Could not compile meta data sql. 12:09:02.27 Warn: REP: 29934: CACHE1:transmitter.c(6505): TT16060: Failed to read data from the network. select() timed out
To recover, perform the following:
Stop all updates to the cache group.
If you are using an AWT cache group, then flush the cache group.
Recreate the cache group with the drop and create.
If the LOAD CACHE GROUP or REFRESH CACHE GROUP statement fails when you specify COMMIT EVERY n
ROWS and n
is greater than 0, the contents of the target cache group could be in an inconsistent state. Some cache instances may be partially loaded.
Unload the cache group and then load it again. In some situations, it may be easier to drop and re-create the cache group.
This section includes the following topics:
The ttCacheAutorefreshStatsGet
procedure returns information about the last ten autorefresh operations on a specified cache group.
The ttCacheAutorefreshStatsGet
procedure returns information only when the cache agent is running and the autorefresh state is ON or PAUSED. All of the return fields are set to 0 when the cache agent is restarted or the autorefresh state is changed to OFF.
Example 4-2 Calling ttCacheAutorefreshStatsGet
This example uses testcache
, which is a READONLY cache group with one table and an incremental autorefresh interval of 10 seconds.
Command> call ttcacheautorefreshstatsget('user1','testcache'); < 1164260, 2007-07-23 15:43:52.000000, 850280, 44, 0, 75464, 528255, 75464, 310, 110, 6800, 1890912, 12439795, 1890912, 160020, InProgress > < 1164260, 2007-07-23 15:43:33.000000, 831700, 43, 13550, 108544, 759808, 108544, 1030, 230, 12290, 1815448, 11911540, 1815448, 160020, Complete > < 1164260, 2007-07-23 15:43:12.000000, 810230, 42, 17040, 115712, 809984, 115712, 610, 330, 16090, 1706904, 11151732, 1706904, 146470, Complete > < 1164260, 2007-07-23 15:42:52.000000, 790190, 41, 14300, 94208, 659456, 94208,560, 320, 13410, 1591192, 10341748, 1591192, 129430, Complete > < 1164260, 2007-07-23 15:42:32.000000, 770180, 40, 12080, 99328, 695296, 99328,450, 290, 11340, 1496984, 9682292, 1496984, 115130, Complete > < 1164260, 2007-07-23 15:42:12.000000, 750130, 39, 10380, 86016, 598368, 86016,430, 230, 9720, 1397656, 8986996, 1397656, 103050, Complete > < 1164260, 2007-07-23 15:41:52.000000, 730130, 38, 13530, 112640, 700768, 112640, 530, 220, 12780, 1311640, 8388628, 1311640, 92670, Complete > < 1164260, 2007-07-23 15:41:32.000000, 710120, 37, 9370, 56320, 326810, 56320, 310, 160, 8900, 1199000, 7687860, 1199000, 79140, Complete > < 1164260, 2007-07-23 15:41:22.000000, 700120, 36, 2120, 10240, 50330, 10240, 50, 200, 1870, 1142680, 7361050, 1142680, 69770, Complete > < 1164260, 2007-07-23 15:41:12.000000, 690110, 35, 0, 0, 0, 0, 0, 0, 0, 1132440, 7310720, 1132440, 67650, Complete > 10 rows found.
Table 4-1 describes the results from the first row of output.
Table 4-1 ttCacheAutorefreshStatsGet results from last autorefresh operation
Result | Field name | Description |
---|---|---|
1164260 |
|
Cache group ID |
2007-07-23 15:43:52.000000 |
|
Timestamp when autorefresh started for this interval |
850280 |
|
Number of cache agent clock ticks in milliseconds at the time the autorefresh transaction started for this interval. This value is cumulative and is reset when the cache agent process starts. |
44 |
|
Autorefresh number |
0 |
|
The number of milliseconds spent in this autorefresh operation. It is zero because the operations is in progress. |
75464 |
|
The number of rows autorefreshed in this autorefresh operation. This would include all rows in the root table and child tables if the cache group had child tables. Note: This information is not provided for full autorefresh. |
528255 |
|
The number of bytes transferred from Oracle in this autorefresh operation. Note: This information is not provided for full autorefresh. |
75464 |
|
The number of root table rows autorefreshed in this autorefresh operation. |
310 |
|
The duration in milliseconds for the autorefresh query to execute on Oracle. Note: This information is not provided for full autorefresh. |
110 |
|
The duration in milliseconds for the autorefresh query to fetch rows from Oracle. Note: This information is not provided for full autorefresh. |
6800 |
|
The duration in milliseconds for TimesTen to apply the updated rows to the cache group. Note: This information is not provided for full autorefresh. |
1890912 |
|
The total number of rows autorefreshed since the cache agent started. Note: This information is not provided for full autorefresh. |
12439795 |
|
The total number of bytes transferred from Oracle since the cache agent started. Note: This information is not provided for full autorefresh. Note: This information is not provided for full autorefresh. Note: This information is not provided for full autorefresh. |
1890912 |
|
The total number of root table rows autorefreshed since the cache agent started. |
160020 |
|
The total autorefresh duration in milliseconds since the cache agent started. |
InProgress |
|
Status. The status can also be Complete or Failed. |
Note that the total number of autorefreshed rows (1890912) is the same as the total number of autorefreshed root table rows in this example because there are no child tables.
The number of autorefreshed rows in TimesTen does not necessarily reflect the number of rows updated on Oracle. The Oracle updates may be applied in TimesTen more than once, or multiple Oracle updates on the same row may be applied as one update in TimesTen.
TimesTen provides a SQL script that gathers information from the change log tables that exist on the Oracle database for autorefresh cache groups. See "Oracle objects used to manage cache groups" in the Oracle In-Memory Database Cache User's Guide for more information about change log tables.
The script displays the following information for each cached table:
**************************** * Host name: my-pc * Timesten datastore name: c:\data\tt1121 * Cache table name: USER1.TESTCACHE * Change log table name: tt_03_55555_L * number of rows in change log table: 100000 * Maximum logseq on the change log table: 38 * Timesten has autorefreshed updates up to logseq: 38 * Number of updates waiting to be autorefreshed: 0 * Number of updates that has not been marked with a valid logseq: 0 ****************************
The log sequence number (logseq
) acts as a marker for the autorefresh operation.
Run the script as the cache administration user on the Oracle database using SQL*Plus. If you run the script as a different user, it reports that the change log tables do not exist.
The script is in the following location:
install_dir/oraclescripts/cacheInfo.sql
The support log contains messages that show the progress of autorefresh. For example, testcache
is a READONLY cache group with an autorefresh interval of 10 seconds (10,000 milliseconds).
The support log shows when autorefresh starts:
15:43:33.96 Info: ORA: 5264: ora-5264-5676-refresh03918: Starting autorefresh number 43 for interval 10000ms
The message includes the following information:
Timestamp (15:43:33.96
)
Cache agent process ID (5264
)
Thread ID (5676
)
The thread ID is important because autorefresh numbers are unique only for a specific interval. Always check both the thread ID and the autorefresh number when you are tracking a specific autorefresh operation.
The support log also contains a longer message that reports information similar to the ttCacheAutorefreshStatsGet
procedure. 108544 rows were updated in this autorefresh interval, and 1815448 rows have been updated since the cache agent was started. Note that the total number of rows and the total number of root table rows are the same in this message because there is only one table in the cache group. Number
refers to the autorefresh number. All times are expressed in milliseconds.
15:43:51.81 Info: ORA: 5264: ora-5264-5676-refresh04387: Cache agent refreshed cache group USER1.TESTCACHE: Number - 43, Duration - 13550, NumRows - 108544, NumRootTblRows - 108544, NumOracleBytes - 759808, queryExecDuration - 230, queryFetchDuration - 1030, ttApplyDuration - 12290, totalNumRows - 1815448, totalNumRootTblRows - 1815448, totalNumOracleBytes - 11911540, totalDuration - 160020
Additional messages show that the autorefresh operation completes successfully:
15:43:51.81 Info: ORA: 5264: ora-5264-5676-refresh04449: Autorefresh number 43 finished for interval 10000ms successfully 15:43:51.81 Info: ORA: 5264: ora-5264-5676-fresher01619: Autorefresh number 43 succeeded for interval 10000 milliseconds
Inspect the timestamps to determine whether autorefresh is progressing as expected.
See "Managing TimesTen daemon options" in the Oracle TimesTen In-Memory Database Operations Guide for information about setting the support log location.
If ttCacheAutorefreshStatsGet
shows that the status of an autorefresh operation is Failed, check the support log for messages related to the autorefresh operation with number the number shown in the ttCacheAutorefreshStatsGet
output. Look for errors that occurred after the autorefresh operation started.
Example 4-3 ttCacheAutorefreshStatsGet output shows autorefresh failure
This row of output from ttCacheAutorefreshStatsGet
shows a failed autorefresh operation.
< 1164260, 2007-08-01 14:56:36.000000, 959350, 9, 0, 0, 0, 0, 0, 0, 0, 1, 7, 1, 50, Failed >
The autorefresh number is 9.
The support log shows the start message for autorefresh number 9:
14:56:36.10 Info: ORA: 5988: ora-5988-4724-refresh03926: Starting autorefresh number 9 for interval 15000ms
The thread ID for autorefresh number 9 is 4724. Look for error messages with this thread ID.
The following messages appear in the support log:
14:56:36.10 Info: ORA: 5988: ora-5988-4724-refresh03953: Autorefresh thread for interval 15000ms is connected to instance inst1 on host host1. Server handle 231976252 14:56:36.12 Err : ORA: 5988: ora-5988-4724-refresh07567: TimesTen error code:5901, msg The Oracle refresh log table, "USER2"."TT_03_81799_L", for base table, USER2.READTAB2, cannot be found. 14:56:36.12 Info: ORA: 5988: ora-5988-4724-refresh05559: Autorefresh rolled back. 14:56:36.12 Info: ORA: 5988: ora-5988-4724-refresh04458: Autorefresh number 9 finished for interval 15000ms with error. 14:56:36.12 Err : ORA: 5988: ora-5988-4724-fresher01606: Autorefresh number 9 failed for cache groups with interval 15000 ms after 10 retries.
The error message for thread ID 4724 shows that the change log table, TT_03_81799_L, is missing. The introduction to "Autorefresh not refreshing cache at the specified interval" has a table entry that describes what to do in this situation.
You can use the ttTraceMon
utility to diagnose autorefresh performance problems. See "AUTOREFRESH tracing".
TimesTen tracing severely impacts application performance and consumes a great deal of disk space if trace output is directed to a file. When you are finished, reset tracing to the default values.
Enable SNMP traps to alert you when autorefresh problems occur.The SNMP traps related to autorefresh include:
ttCacheAutoRefQueFullTrap
ttCacheIncAutoRefFailedTrap
ttCacheValidationErrorTrap
ttCacheValidationWarnTrap
ttCacheValidationAbortedTrap
See "Diagnostics through SNMP Traps" in the Oracle TimesTen In-Memory Database Error Messages and SNMP Traps.
The following table shows possible causes for autorefresh problems.
Possible cause | What to do |
---|---|
Cache agent not started with a cache administration user | Specify a cache administration user ID and password when starting the cache agent, as described in "Starting the cache agent" in the Oracle In-Memory Database Cache User's Guide. |
Object ID of the base table has changed. | See "Recover and reset autorefresh oracle objects". |
Autorefresh trigger not enabled | See "Recover and reset autorefresh oracle objects". |
Current log sequence number recorded in the TT_version _USER_COUNT table is less than to the maximum log sequence number in the autorefresh log table. |
See "Recover and reset autorefresh oracle objects". |
There is no row in the TT_version _USER_COUNT table with usercount > 0 for every active incrementally autorefresh table |
See "Recover and reset autorefresh oracle objects". |
Change log table is empty. | See "Recover and reset autorefresh oracle objects". |
User count is less than 0 or any TT_version _USER_COUNT log sequence anomalies |
See "Recover and reset autorefresh oracle objects". |
Autorefresh log table, trigger, or sequence associated with a cached table does not exist or is not valid. | Check whether the cache agent was started with the correct cache administration user ID. If the cache administration user ID is correct, follow the procedure described in "Recover and reset autorefresh oracle objects".
Check the user error log for messages about "fatal anomalies". This indicates corrupt or missing Oracle objects. |
TT_version _USER_COUNT table is missing. |
Check whether the cache agent was started with the correct cache administration user ID. If the cache administration user ID is correct, follow the procedure in "Recover and reset autorefresh oracle objects".
Check the user error log for messages about "fatal anomalies". This indicates corrupt or missing Oracle objects. |
If the current log sequence number in the TT_version _USER_COUNT table changes, is different from the bookmark and the associated cached table is not refreshed by the next committed autorefresh. |
Restart the cache agent. If that does not work, follow the procedure in "Recover and reset autorefresh oracle objects". |
Resource problem | Restart the cache agent. |
Incremental autorefresh does not work if the TRUNCATE statement is used on an Oracle base table. If TRUNCATE is used on an Oracle base table, then you must reset autorefresh by using the ALTER CACHE GROUP statement to set the autorefresh state to OFF followed by another ALTER CACHE GROUP to reset the autorefresh state to ON.
If you know or suspect the Oracle objects used by autorefresh are the cause of the problem, use the following procedure to re-create the Oracle objects.
Use ALTER CACHE GROUP to reset the autorefresh state to OFF on all cache groups on all data stores that have the affected cached table:
ALTER CACHE GROUP cache_group_name SET AUTOREFRESH STATE OFF;
Shut down all cache agents on all affected data stores.
Check if the user count is zero for each table in the cache group.
On the Oracle database, execute the following statement:
SELECT usercount FROM autorefresh_id.tt_version_user_count WHERE tablename ='owner.tablename';
If the count is not zero, set the count to zero:
UPDATE autorefresh_id.tt_version_user_count SET usercount = 0 WHERE tablename ='owner.tablename';
Start one of the cache agents. The cache agent performs a clean up operation. It displays the following message to the support log after it has completed the cleanup:
Cleanup of the Oracle objects completed
After the cache agent has completed the clean up, use ALTER CACHE GROUP to reset the autorefresh state back to ON:
ALTER CACHE GROUP cache_group_name SET AUTOREFRESH STATE ON;
Start all other cache agents.
Use ALTER CACHE GROUP to reset the autorefresh state back to ON for all of the affected cache groups on all data stores.
If incremental autorefresh is not progressing, verify that:
Autorefresh state is ON
Cache agent is running
Inspect the support log for the conditions described in the following table:
Table summary is in the first heading cell.
Condition | What to do |
---|---|
Oracle server connection errors or warnings | See "Troubleshooting Client/Server problems" for information about resolving connection problems. |
Lock timeout errors or warnings on TimesTen | This usually occurs because of an open DDL transaction on the cache group. Commit the DDL transaction so that autorefresh can get the necessary locks. |
Insufficient permanent data partition errors on TimesTen | Increase PermSize. |
Autorefresh Oracle object validations errors or warnings | See "Recover and reset autorefresh oracle objects". |
Cache agent exits unexpectedly. | Contact Technical support. |
Core files in main daemon directory | Contact Technical support. |
Warnings about incremental autorefresh becoming full refresh | See "Incremental autorefresh becomes full autorefresh". |
Warnings that autorefresh has not finished for a long time | The autorefresh transaction can take a long time if many transactions have occurred since the last autorefresh.
Note: Cache groups with the same autorefresh interval are autorefreshed in one transaction. |
The cache agent automatically verifies that Oracle objects exist and that they are valid so that autorefresh can progress. In normal operation, you should not see object validation errors or warnings in the user error log. If you see object validation errors, contact Technical support.unless one of the following conditions has occurred:
The TimesTen data store has been destroyed without using the DROP CACHE GROUP statement.
A customer application inadvertently modifies the objects directly in the Oracle database.
A DDL operation occurs on the base table on the Oracle database. This disables the trigger that controls autorefresh operations.
The cache group needs to be re-created if one of the preceding conditions has occurred.
Incremental autorefresh can become full autorefresh if the cache administration user tablespace becomes full.
This section includes the following topics:
Monitoring the usage of the cache administration user's tablespace
Considerations when the cache administration user's tablespace is full
You can detect when incremental autorefresh becomes full refresh by several methods:
Check for messages in the support log that indicate full autorefresh operations are occurring. For example:
2007-08-08 08:06:51.35 Warn: ORA: 22119: ora-22119-0015-refresh05652: A full autorefresh will be performed for Incremental autorefresh table USER1.READTAB because change log table T_03_55555_L on Oracle has been truncated.
Use the ttCacheAutorefreshStatsGet
procedure.
If autorefresh is InProgress for longer than usual, full autorefresh may be occurring.
If a much larger number of rows (autoRefNumRows
) was autorefreshed than usual, full autorefresh may have occurred.
Check the support log for messages about full autorefresh.
If SNMP traps are enabled, the ttCacheRecoveryAutorefreshTrap
SNMP trap indicates a full autorefresh.
TimesTen strongly recommends creating a separate tablespace for the cache administration user. This tablespace is used as the cache administration user's default tablespace. The tablespace contains autorefresh triggers for each Oracle table, change log tables for each Oracle table, and other objects that TimesTen needs for each cache administration user. If you do not specify a separate tablespace, then these objects are placed in the Oracle system tablespace.
Specify the tablespace when you create the cache administration user on Oracle. You can also specify the tablespace after user creation with the DEFAULT TABLESPACE clause of the Oracle ALTER USER statement.
Change log tables for each of the cached Oracle tables reside in the cache administration user tablespace. For each update on an Oracle table, one row (a change log record) is inserted into the change log table for that Oracle table. The size of a change log record in bytes is as follows:
size of change log record = size of primary key on Oracle table + 250
The number of records in a change log table depends on the update rate on the Oracle table and on the autorefresh interval on TimesTen. Every 20 seconds, TimesTen removes change log records that have been applied to all data stores that cache the associated Oracle table.
When change logs are removed, a message similar to the following is displayed in the support log:
16:32:26.73 Info: ORA: 5652: ora-5652-4756-ogTblGC01036: Garbage collector deleted 1 rows from TT_03_383270_L where logseq < 1
There are options on how to manage what happens when the cache administration user tablespace is filled. See "Considerations when the cache administration user's tablespace is full" for more information.
Check for the following conditions if the cache administration user tablespace is full:
Is the autorefresh state set to PAUSED? Change log records accumulate when the state is PAUSED.
Has the cache group been created but not loaded? The default autorefresh state for cache group creation is PAUSED.
Is a cache group being created or is a data store being duplicated? Both of these operations temporarily stop clean-up operations on the change log table.
Are the cache agents on all TimesTen data stores running? If a cache agent is not running, change log records accumulate.
Has a data store been abandoned without dropping autorefresh cache groups in the data store? Abandoned data stores result from scenarios such as the following:
The data store is destroyed by ttDestroy
-force
.
The application connected to the data store with the Overwrite
connection attribute set to 1, but the cache groups that were in the old data store are not re-created.
If the data store still exists, connect to the abandoned data store and drop the cache group.
Use the cacheInfo.sql
script to find out how large the change log tables are for each cached Oracle table. Use the output to verify that the data stores are still in use. See "Displaying information from the change log tables".
If the data stores are still in use, verify that the cache agents are running.
Compare the autorefresh progress on TimesTen to the maximum log sequence number on the change log table. If TimesTen is behind, then call the ttCacheAutorefreshStatsGet
procedure to see whether the autorefresh operations are successful. See "Using the ttCacheAutorefreshStatsGet procedure".
If the status is InProgress longer than seems reasonable, see "Poor autorefresh performance".
You may need to decrease the autorefresh interval or increase the size of the cache administration user tablespace.
There are options on how to manage what happens when the cache administration user tablespace is filled. See "Considerations when the cache administration user's tablespace is full" for more information.
To monitor the cache administration user tablespace, you can use either Oracle Enterprise Manager alerts or set the TimesTen tablespace threshold parameter.
The cache agent can be configured to periodically monitor the tablespace usage and issue a warning when it exceeds a specified threshold. Set the tablespace threshold percentage with the TblspaceThreshold
parameter of the ttCacheConfig
built-in procedure. For example, if you set the TblspaceThreshold
parameter to 80, then a warning is issued when more than 80% of the tablespace is used.
If the threshold is set to zero, then no warning is issued. This is the default.
If the threshold is set between 1 and 99, a warning is issued when the tablespace threshold exceeds that number.
If the threshold is set to 100, then a warning is issued when the tablespace is full.
For example, to configure for a warning to be issued if the tablespace exceeds 80%, execute the following:
call ttCacheConfig('TblspaceThreshold',,,'80');
For full details of the ttCacheConfig
built-in procedure, see the Oracle TimesTen In-Memory Database Reference.
With Oracle tables that are cached in a TimesTen database, you can configure them to use incremental automatic refresh. For these tables, you can specify which one of the following is to occur when the cache administration user's tablespace is full:
The application performing the DML is to fail. This is the default.
The tablespace full recovery is set to none. The application receives an "Out of Tablespace" error from Oracle when the tablespace is full. At that point, the application will need to rollback the transaction.
Setting the tablespace full recovery to none is configured when you set the Param
parameter to TblSpaceFullRecovery
and the Value
parameter to None
with the ttCacheConfig
built-in procedure. For example, the following configures Param
to TblSpaceFullRecovery
and Value
to None
for the employees
table that is owned by terry
:
call ttCacheConfig('TblSpaceFullRecovery','terry', 'employees','None');
Truncate the change log table to free up space and cause a full autorefresh.
When the cache administration user's tablespace is full, any application that is executing DML statements on the autorefresh cached Oracle tables continues to execute. A trigger executes to free up space for new change log records by deleting existing change log records. This can result in a full automatic refresh on cache groups that have the incremental automatic refresh mode configured. However, if the Oracle table is not configured for incremental automatic refresh, then no trigger executes.
To set the operation to allow the application to continue and cause an autorefresh, set the Param
parameter to TblSpaceFullRecovery
and the Value
parameter to Reload
with the ttCacheConfig
procedure. The user will see stale data until the full autorefresh is complete.
However, even if the user sets the cache configuration parameter TblSpaceFullRecovery
with the value of Reload
, the tablespace may not be able to be emptied enough to handle the case of a growing index. Deleting rows from the change log table may not free up enough space for the index that is on the change log table. If the index is growing so fast that it uses all the tablespace to the point where purging the change log tables does not help, then the user's application may receive the following error:
ORA-01654: unable to extend index <index> by 128 in tablespace <tblspace>
For full details of the ttCacheConfig
built-in procedure, see the Oracle TimesTen In-Memory Database Reference.
Poor autorefresh performance is usually the result of large autorefresh operations. Use the ttCacheAutorefreshStatsGet
procedure to check the autorefresh duration and observe whether the status remains InProgress for a long time.
Factors that can cause large autorefresh operations include:
Unresponsive or dead TimesTen database degrades autorefresh performance
Large autorefresh interval
Large number of cache groups with the same interval
High rate of changes to the Oracle tables
The number of generations of child tables in a cache group
The number of rows in the cached Oracle tables
The size of the rows in the cached Oracle tables
Enable an AUTOREFRESH trace to diagnose autorefresh performance problems. See "AUTOREFRESH tracing".
Note:
Automatic recovery for TimesTen cache groups only applies to read-only and user managed cache groups that use the AUTOREFRESH cache group attribute. In this section, all references to autorefresh cache groups are read-only and user managed cache groups that use the AUTOREFRESH cache group attribute.If any TimesTen databases containing autorefresh cache groups are destroyed or no longer in use, TimesTen continues to track autorefresh changes to the Oracle tables for the TimesTen database for which the cache agent is not running. This causes automatic refresh to cache groups in active TimesTen databases to slow down.
The cache agent is responsible for detecting if a database is unresponsive or no longer in use. You can specify if and how a dead TimesTen database is to be recovered. However, you cannot recover a TimesTen database if all of the Oracle objects have been removed.
The following sections describe how you can avoid a degraded autorefresh performance for inactive TimesTen databases:
You can instruct TimesTen to mark the database as dead and no longer accepting updates if the cache agent has not communicated with the Oracle server within a specific timeout period.
Set the timeout for the TimesTen database and the recovery method for each autorefresh cache group with the AgentTimeOut
parameter in the ttCacheConfig
built-in procedure. The timeout value applies to the all TimesTen databases that use the same cache administration user. You should set the timeout value greater than the time necessary to load the TimesTen database into memory on first connect and start the cache agent. Otherwise, the TimesTen database could be incorrectly marked as dead. For any planned maintenance for the TimesTen instance, you could temporarily set the AgentTimeOut
value to zero to disable the timeout. For full details of the ttCacheConfig
built-in procedure, see the Oracle TimesTen In-Memory Database Reference.
For example, the following sets the timeout value for the TimesTen database to 6000 seconds or 100 minutes. If the cache agent does not contact the Oracle server within a 100-minute period, then the TimesTen database is marked as dead.
ttIsql> call ttCacheConfig('AgentTimeOut',,,'6000');
You can recover a TimesTen database and autorefresh cache groups if they are not synchronizing with the Oracle database. If there is no synchronization, then updates on the Oracle tables are not automatically refreshed to the corresponding TimesTen cache tables.
You can configure the DeadDbRecovery
parameter of the ttCacheConfig
built-in procedure to specify how to recover the synchronization for the TimesTen database and all autorefresh cache groups. The setting for DeadDbRecovery
applies to all TimesTen databases that use the same cache administrator user. Set the DeadDbRecovery
parameter to Normal
, Manual
or None
to describe how TimesTen is to recover the database and all autorefresh cache groups. The DeadDbRecovery
setting applies to all TimesTen databases that use the same cache administration user. While TimesTen is recovering the database and its autorefresh cache groups, there is an autorefresh status for the TimesTen database and the autorefresh cache groups that describes the recovery status for each of these entities. The TimesTen database can have an automatic refresh status of Alive, Dead or Recovering. The autorefresh cache groups can have an automatic refresh status of OK, Dead or Recovering. The TimesTen database status changes are linked to changes in the status for the autorefresh cache groups, as follows:
If the recovery method is set to Normal, then when TimesTen starts a full automatic refresh on an autorefresh cache group, the cache group's status is set to Recovering and the database's status is also set to Recovering.
The TimesTen database's status is only set to Alive when all of the autorefresh cache groups have either been recovered to OK or have been dropped.
When the database status is set to Dead, then all of its autorefresh cache groups are also set to Dead.
Note:
You can determine the autorefresh status of the TimesTen database and autorefresh cache groups with thettCacheDbCgStatus
built-in procedure, which is described in the Oracle TimesTen In-Memory Database Reference..When communication between the cache agent and the Oracle server is re-established, TimesTen determines how to recover the autorefresh cache groups. TimesTen follows the recovery method you configured in the DeadDbRecovery
parameter in the ttCacheConfig
built-in procedure. This parameter can be set to one of the following:
Normal
: This is the default. The autorefresh cache groups will each be recovered with a full automatic refresh. After the first full refresh, the cache group is recovered and will incrementally perform autorefresh.
The autorefresh cache groups within the same automatic refresh interval will be transactionally consistent. Because it is a full refresh, it is not as performant as an incremental refresh.
The autorefresh sets the status to Recovering. When the full autorefresh is completed successfully, the autorefresh cache group status is set to OK.
Manual
: You must manually refresh an autorefresh cache group to recover it, or unload it if the cache group is dynamic.
None
: The autorefresh cache group will never be recovered by a TimesTen autorefresh. Drop and recreate the cache group to recover it.
The database status changes as the first autorefresh cache group status changes. If there is at least one cache group that is in the process of recovery, then the database status is set to Recovering. Once all cache groups have been recovered, the status of the TimesTen database is marked as Alive.
The following example sets the DeadDbRecovery
parameter to Normal
for all autorefresh cache groups. The dead TimesTen database will be recovered when all of its autorefresh cache groups have each been recovered with a full automatic refresh.
ttIsql> call ttCacheConfig('DeadDbRecovery',,,'Normal');
When TimesTen databases participating in an active standby pair replication scheme contains cache groups, if the autorefresh status of the active master database is Dead and the autorefresh status of the standby master database is Alive, the standby master does not automatically assume the role of the active master. The recovery requires that you manually ensure that the cache and replication agents are executing. The specifics for each situation is as follows:
Table 4-2 Recovery for cache groups involved in active standby replication pair
DeadDbRecovery Setting | Active Master | Standby Master | Resulting Behavior |
---|---|---|---|
Normal |
Alive |
Dead |
Make sure that the cache and replication agents are executing on the standby master. Once the cache agent can connect to the Oracle Database, then the status of all autorefresh cache groups is set to Recovering. This sets the database to Recovering. Once a single cache group has received enough data to resume autorefresh, the status is set to OK. After all cache group are set to OK, the database is set to Alive. Alternatively, you can fail the standby master and rollout a new standby master. |
Normal |
Dead |
Alive |
Make sure that the cache and replication agents are executing on the active master. Once the cache agent can connect to the Oracle Database, then the status of all autorefresh cache groups is set to Recovering. This sets the database to Recovering. Once a single cache group has received enough data to resume autorefresh, the status is set to OK. After all cache group are set to OK, the database is set to Alive. Alternatively, you can fail the active master, switch the standby master as the new active and then rollout a new standby master. |
Normal |
Dead |
Dead |
Make sure that the cache and replication agents are executing on both masters. Once the cache agent can connect to the Oracle Database, then the status of all autorefresh cache groups is set to Recovering. This sets the database to Recovering. Once a single cache group has received enough data to resume autorefresh, the status is set to OK. After all cache group are set to OK, the database is set to Alive. Alternatively, you can rollout new masters. |
Manual |
Alive |
Dead |
Make sure that the cache and replication agents are executing on the standby master. Once the cache agent can connect to the Oracle Database, then the status of all autorefresh cache groups is set to Recovering. This sets the database to Recovering. Once a single cache group has received enough data to resume autorefresh, the status is set to OK. After all cache group are set to OK, the database is set to Alive. Alternatively, you can fail the standby master and rollout a new standby master. |
Manual |
Dead |
Alive |
Make sure that the cache and replication agents are executing on the active master. Use a manual refresh to recover the autorefresh cache groups on the active master. After all cache group are set to OK or have been dropped, the database is set to Alive. |
Manual |
Dead |
Dead |
Make sure that the cache and replication agents are executing on the active master. Use a manual refresh to recover the autorefresh cache groups on the active master. After all cache group are set to OK or have been dropped, the database is set to Alive. Changes are then replicated to the standby master. |
None |
Alive |
Dead |
Mark the standby master as failed. Execute |
None |
Dead |
Alive |
Destroy the dead active master with the |
None |
Dead |
Dead |
Rollout new masters. |