Skip Headers
Oracle® In-Memory Database Cache User's Guide
11g Release 2 (11.2.2)

Part Number E21634-05
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
PDF · Mobi · ePub

13 Compatibility Between TimesTen and Oracle

This chapter lists compatibility issues between TimesTen and Oracle. The list is not complete, but it indicates areas that require special attention. It includes the following topics:

Summary of compatibility issues

Consider the following differences between TimesTen and Oracle:

Transaction semantics

TimesTen and Oracle transaction semantics differ as follows:

For more information about TimesTen isolation levels and transaction semantics, see "Transaction Management and Recovery" in Oracle TimesTen In-Memory Database Operations Guide.

API compatibility

For a complete list of the JDBC API classes and interfaces that TimesTen supports with notes on which methods have a compatibility issue, see "Key JDBC classes and interfaces" in Oracle TimesTen In-Memory Database Java Developer's Guide.

For a complete list of the ODBC API functions that TimesTen supports with notes on which functions have a compatibility issue, see "TimesTen ODBC Functions and Options" in Oracle TimesTen In-Memory Database C Developer's Guide.

For a complete list of the OCI functions for Oracle database, release 11.2.0.2, that TimesTen supports with notes on which functions have a compatibility issue, see "TimesTen Support for Oracle Call Interface" in Oracle TimesTen In-Memory Database C Developer's Guide.

For information about TimesTen support for Pro*C/C++, see "TimesTen Support for Oracle Pro*C/C++ Precompiler" in Oracle TimesTen In-Memory Database C Developer's Guide.

For information about TimesTen support for ODP.NET, see Oracle Data Provider for .NET Oracle TimesTen In-Memory Database Support User's Guide.

For information about TimesTen support for PL/SQL, see Oracle TimesTen In-Memory Database PL/SQL Developer's Guide.

The TimesTen C++ Interface Classes (TTClasses) library provides a high-performance interface to TimesTen that is easy to use. This C++ class library provides wrappers around the most common ODBC functionality. This API is not available for the Oracle Database. See Oracle TimesTen In-Memory Database TTClasses Guide.

SQL compatibility

This section compares TimesTen's SQL implementation with Oracle's SQL. The purpose is to provide users with a list of Oracle SQL features not supported in TimesTen or supported with different semantics.

Schema objects

TimesTen does not recognize some of the schema objects that are supported in Oracle. TimesTen returns a syntax error when a statement manipulates or uses these objects. TimesTen passes the statement to Oracle. The unsupported objects are:


Clusters
Objects created by the CREATE DATABASE statement
Objects created by the CREATE JAVA statement
Database links
Database triggers
Dimensions
Extended features
External procedure libraries
Index-organized tables
Mining models
Partitions
Object tables, types and views
Operators

TimesTen supports views and materialized views, but it cannot cache an Oracle view. TimesTen can cache an Oracle materialized view in a user managed cache group without the AUTOREFRESH cache group attribute and PROPAGATE cache table attribute. The cache group must be manually loaded and flushed.

Caching and Oracle partitioned tables

TimesTen can cache Oracle partitioned tables at the table level, but individual partitions cannot be cached. The following describes how operations on partitioned tables affect cache groups:

  • DDL operations on a table that has partitions do not affect the cache group unless there is data loss. For example, if a partition with data is truncated, an AUTOREFRESH operation does not delete the data from the corresponding cached table.

  • WHERE clauses in any cache group operations cannot reference individual partitions or subpartitions. Any attempt to define a single partition of a table returns an error.

Nonschema objects

TimesTen does not recognize some of the schema objects that are supported in Oracle. TimesTen returns a syntax error when a statement manipulates or uses these objects. TimesTen passes the statement to Oracle. The unsupported objects are:


Contexts
Directories
Editions
Restore points
Roles
Rollback segments
Tablespaces

Differences between Oracle and TimesTen tables

The Oracle table features that TimesTen does not support are:

  • ON DELETE SET NULL

  • Check constraints

  • Foreign keys that reference the table on which they are defined

Data type support

The following Oracle data types are not supported by TimesTen:


TIMESTAMP WITH TIME ZONE
TIMESTAMP WITH LOCAL TIME ZONE
INTERVAL YEAR TO MONTH
INTERVAL DAY TO SECOND
UROWID
BFILE
Oracle-supplied types
User-defined types

The following TimesTen data types are not supported by Oracle:


TT_CHAR
TT_VARCHAR
TT_NCHAR
TT_NVARCHAR
TT_BINARY
TT_VARBINARY
TINYINT and TT_TINYINT
TT_SMALLINT
TT_INTEGER
TT_BIGINT
TT_DECIMAL
TT_DATE
TIME and TT_TIME
TT_TIMESTAMP

Note:

TimesTen NCHAR and NVARCHAR2 data types are encoded as UTF-16. Oracle NCHAR and NVARCHAR2 data types are encoded as either UTF-16 or UTF-8.

To cache an Oracle NCHAR or NVARCHAR2 column, the Oracle NLS_NCHAR_CHARACTERSET encoding must be AL16UTF16, not AL32UTF8.

SQL operators

TimesTen supports these operators and predicates that are supported by Oracle:


unary -
+, -, *, /
=, <, >, <=, >=, <>, !=
||
IS NULL, IS NOT NULL
LIKE (Oracle LIKE operator ignores trailing spaces, but TimesTen does not)
BETWEEN
IN
NOT IN (list)
AND
OR
+ (outer join)
ANY, SOME
ALL (list)
EXISTS
UNION
MINUS
INTERSECT

To perform a bitwise AND operation of two bit vector expressions, TimesTen uses the ampersand character (&) between the expressions while Oracle uses the BITAND function with the expressions as arguments.

SELECT statements

TimesTen supports these clauses of a SELECT statement that are supported by Oracle:

  • FOR UPDATE

  • ORDER BY, including NULLS FIRST and NULLS LAST

  • GROUP BY, including ROLLUP, GROUPING_SETS and grouping expression lists

  • Table alias

  • Column alias

  • Subquery factoring clause with constructor

Oracle supports flashback queries, which are queries against a database that is in some previous state (for example, a query on a table as of yesterday). TimesTen does not support flashback queries.

TimesTen does not support the CONNECT BY clause.

SQL subqueries

TimesTen supports these subqueries that are supported by Oracle:


IN (subquery)
>,<,= ANY (subquery)
>,=,< SOME (subquery)
EXISTS (subquery)
>,=,< (scalar subquery)
Subqueries in WHERE clause of DELETE/UPDATE
Subqueries in FROM clause
Subquery factoring clause (WITH constructor)

Note:

A nonverifiable scalar subquery is a scalar subquery whose 'single-row-result-set' property cannot be determined until execution time. TimesTen allows at most one nonverifiable scalar subquery in the entire query and the subquery cannot be specified in an OR expression.

SQL functions

TimesTen supports these functions that are supported by Oracle:


ABS
ADD_MONTHS
ASCIISTR
AVG
CAST
CEIL
COALESCE
CONCAT
COUNT
CHR
DECODE
DENSE_RANK
EMPTY_BLOB
EMPTY_CLOB
EXTRACT
FIRST_VALUE
FLOOR
GREATEST
GROUP_ID
GROUPING
GROUPING_ID
INSTR
LAST_VALUE
LEAST
LENGTH
LOWER
LPAD
LTRIM
MAX
MIN
MOD
MONTHS_BETWEEN
NCHR
NLS_CHARSET
NLS_CHARSET_NAME
NLSSORT
NULLIF
NUMTOYMINTERVAL
NUMTODSINTERVAL
NVL
POWER
RANK
REPLACE
ROUND
ROW_NUMBER
RPAD
RTRIM
SIGN
SQRT
SUBSTR
SUM
SYS_CONTEXT
SYSDATE
TO_BLOB
TO_CLOB
TO_CHAR
TO_DATE
TO_LOB
TO_NCLOB
TO_NUMBER
TRIM
TRUNC
UID
UNISTR
UPPER
USER

These TimesTen functions are not supported by Oracle:


CURRENT_USER
GETDATE
ORA_SYSDATE
SESSION_USER
SYSTEM_USER
TIMESTAMPADD
TIMESTAMPDIFF
TT_HASH
TT_SYSDATE
TTGRIDNODENAME
TTGRIDMEMBERID
TTGRIDUSERASSIGNEDNAME

TimesTen and the Oracle Database interpret the literal N'\UNNNN' differently. In TimesTen, N'\unnnn' (where nnnn is a number) is interpreted as the national character set character with the code nnnn. In the Oracle Database, N'\unnnn' is interpreted as 6 literal characters. The \u is not treated as an escape. This difference causes unexpected behavior. For example, loading a cache group with a WHERE clause that contains a literal can fail. This can also affects dynamic loading and cache grid operation. Applications should use the UNISTR SQL function instead of literals.

SQL expressions

TimesTen supports these expressions that are supported by Oracle:


Column Reference
Sequence
NULL
()
Binding parameters
CASE expression
ROWID pseudocolumn
ROWNUM pseudocolumn

TimesTen and Oracle treat literals differently. See the description of HexadecimalLiteral in "Constants" in Oracle TimesTen In-Memory Database SQL Reference.

INSERT/DELETE/UPDATE/MERGE statements

TimesTen supports these DML statements that are supported by Oracle:

  • INSERT INTO ... VALUES

  • INSERT INTO ... SELECT

  • UPDATE WHERE expression (expression may contain a subquery)

  • DELETE WHERE expression (expression may contain a subquery)

TimesTen does not support updating of primary key values except when the new value is the same as the old value.

TimesTen-only SQL and built-in procedures

This section lists TimesTen SQL statements and functions and built-in procedures that are not supported by Oracle. With PassThrough=3, these statements are passed to Oracle for execution and an error is generated.

  • All TimesTen cache group DDL and DML statements, including CREATE CACHE GROUP, DROP CACHE GROUP, ALTER CACHE GROUP, LOAD CACHE GROUP, UNLOAD CACHE GROUP, REFRESH CACHE GROUP and FLUSH CACHE GROUP.

  • All TimesTen replication management DDL statements, including CREATE REPLICATION, DROP REPLICATION, ALTER REPLICATION, CREATE ACTIVE STANDBY PAIR, ALTER ACTIVE STANDBY PAIR and DROP ACTIVE STANDBY PAIR.

  • FIRST n clause

  • ROWS m TO n clause

  • All TimesTen built-in procedures. See "Built-In Procedures" in Oracle TimesTen In-Memory Database Reference.

PL/SQL constructs

TimesTen supports a subset of stored procedure constructs, functions, data types, packages and package bodies that are supported by Oracle. See Oracle TimesTen In-Memory Database PL/SQL Developer's Guide for details.

Mappings between Oracle and TimesTen data types

When you choose data types for columns in the TimesTen cache tables, consider the data types of the columns in the Oracle tables and choose an equivalent or compatible data type for the columns in the cache tables.

Note:

TimeTen cache, including passthrough, does not support the Oracle ROWID data type. However, you can cast any ROWID data type to the CHAR data type when provided on the SELECT list in a SQL query.

Primary and foreign key columns are distinguished from non-key columns. The data type mappings allowed for key columns in a cache table are shown in Table 13-1.

Table 13-1 Data type mappings allowed for key columns

Oracle data type TimesTen data type

NUMBER(p,s)

NUMBER(p,s)

Note: DECIMAL(p,s) or NUMERIC(p,s) can also be used. They are aliases for NUMBER(p,s).

NUMBER(p,0)

INTEGER

TT_TINYINT

TT_SMALLINT

TT_INTEGER

TT_BIGINT

NUMBER(p,0)

NUMBER

TT_TINYINT

TT_SMALLINT

TT_INTEGER

TT_BIGINT

NUMBER

CHAR(m)

CHAR(m)

VARCHAR2(m)

VARCHAR2(m)

RAW(m)

VARBINARY(m)

DATE

DATE

TIMESTAMP(m)

TIMESTAMP(m)

NCHAR(m)

NCHAR(m)

NVARCHAR2(m)

NVARCHAR2(m)


Table 13-2 shows the data type mappings allowed for non-key columns in a cache table.

Table 13-2 Data type mappings allowed for non-key columns

Oracle data type TimesTen data type

NUMBER(p,s)

NUMBER(p,s)

REAL

FLOAT

BINARY_FLOAT

DOUBLE

BINARY_DOUBLE

NUMBER(p,0)

INTEGER

TT_TINYINT

TT_SMALLINT

TT_INTEGER

TT_BIGINT

NUMBER(p,0)

FLOAT

BINARY_FLOAT

DOUBLE

BINARY_DOUBLE

NUMBER

TT_TINYINT

TT_SMALLINT

TT_INTEGER

TT_BIGINT

NUMBER

REAL

FLOAT

BINARY_FLOAT

DOUBLE

BINARY_DOUBLE

CHAR(m)

CHAR(m)

VARCHAR2(m)

VARCHAR2(m)

RAW(m)

VARBINARY(m)

LONG

VARCHAR2(m)

Note: m can be any valid value within the range defined for the VARCHAR2 data type.

LONG RAW

VARBINARY(m)

Note: m can be any valid value within the range defined for the VARBINARY data type.

DATE

DATE

TIMESTAMP(0)

TIMESTAMP(m)

TIMESTAMP(m)

FLOAT(n)

Note: Includes DOUBLE and FLOAT, which are equivalent to FLOAT(126). Also includes REAL, which is equivalent to FLOAT(63).

FLOAT(n)

BINARY_DOUBLE

Note: FLOAT(126) can be declared as DOUBLE. FLOAT(63) can be declared as REAL.

BINARY_FLOAT

BINARY_FLOAT

BINARY_DOUBLE

BINARY_DOUBLE

NCHAR(m)

NCHAR(m)

NVARCHAR2(m)

NVARCHAR2(m)

CLOB

VARCHAR2(m)

Note: 1<=m<=4 megabytes

BLOB

VARBINARY(m)

Note: 1<=m<=16 megabytes

NCLOB

NVARCHAR2(m)

Note: 1<=m<=4 megabytes