Oracle® TimesTen In-Memory Database SQL Reference Release 11.2.1 Part Number E13070-03 |
|
|
View PDF |
The CREATE CACHE GROUP statement:
Creates the table defined by the cache group
Inserts all new information associated with the cache group in the appropriate system tables.
A cache group is a set of tables related through foreign keys that cache data from tables in an Oracle database. There is one root table that does not reference any of the other tables. All other cache tables in the cache group reference exactly one other table in the cache group. In other words, the foreign key relationships form a tree.
A cache table is a set of rows satisfying the conditions:
The rows constitute a subset of the rows of a vertical partition of an Oracle table.
The rows are stored in a TimesTen table with the same name as the Oracle table.
If a data store has more than one cache group, the cache groups must correspond to different Oracle (and TimesTen) tables.
Cache group instance refers to a row in the root table and all the child table rows related directly or indirectly to the root table rows.
User managed and system managed cache groups
A cache group can be either system managed or user managed.
A system managed cache group is fully managed by TimesTen and has fixed properties. System managed cache group types include:
READONLY - Read-only cache groups are updated in Oracle, and the updates are propagated from Oracle to the cache.
ASYNCHRONOUS WRITETHROUGH (AWT) - AWT cache groups are updated in the cache and the updates are propagated to Oracle. Transactions continue executing on the cache without waiting for a commit on Oracle.
SYNCHRONOUS WRITETHROUGH (SWT) - SWT cache groups are updated in the cache and the updates are propagated to Oracle. Transactions are committed on the cache after notification that a commit has occurred on Oracle.
Because TimesTen manages system managed cache groups, including loading and unloading the cache group, certain statements and clauses cannot be used in the definition of these cache groups, including:
WHERE clauses in AWT and SWT cache group definitions
READONLY, PROPAGATE and NOT PROPAGATE in cache table definitions
AUTOREFRESH in AWT and SWT cache group definitions
The FLUSH CACHE GROUP and REFRESH CACHE GROUP operations are not allowed for AWT and SWT cache groups.
You must stop the replication agent before creating an AWT cache group.
A user managed cache group must be managed by the application or user. PROPAGATE in a user managed cache group is synchronous. The table-level READONLY keyword can only be used for user managed cache groups.
In addition, both TimesTen and Oracle must be able to parse all WHERE clauses.
Explicitly loaded cache groups and dynamic cache groups
Cache groups can be explicitly loaded or dynamic.
In cache groups that are explicitly loaded, new cache instances are loaded manually into the TimesTen cache tables from the Oracle tables using a LOAD CACHE GROUP or REFRESH CACHE GROUP statement or automatically using an autorefresh operation.
In a dynamic cache group, new cache instances can be loaded manually into the TimesTen cache tables by using a LOAD CACHE GROUP or on demand using a dynamic load operation. A manual refresh or automatic refresh operation on a dynamic cache group can result in the updating or deleting of existing cache instances, but not in the inserting or loading of new cache instances.
Any cache group type (READONLY, ASYNCHRONOUS WRITETHROUGH, SYNCHRONOUS WRITETHROUGH, USERMANAGED) can be defined as an explicitly loaded cache group.
Any cache group type can be defined as a dynamic cache group except a user managed cache group that has both the AUTOREFRESH cache group attribute and the PROPAGATE cache table attribute.
Data in a dynamic cache group is aged out because LRU aging is defined by default. Use the ttAgingLRUConfig
built-in procedure to override the space usage thresholds for LRU aging. You can also define time-based aging on a dynamic cache group to override LRU aging.
For more information on explicitly loaded and dynamic cache groups, see Oracle In-Memory Database Cache User's Guide. For more information about the dynamic load operation, see "Dynamically loading a cache group" in Oracle In-Memory Database Cache User's Guide.
You can create either local or global cache groups.
In a local cache group, data in the cache tables are not shared across TimesTen databases even if the databases are members of the same cache grid. Therefore, the databases can have overlapping data or the same data. Any cache group type can be defined as a local cache group. A local cache group can be either dynamic or explicitly loaded.
In a global cache group, data in the cache tables are shared among TimesTen databases within a cache grid. Updates to the same data by different grid members are coordinated by the grid. Only a dynamic AWT cache group can be defined as a global cache group.
For more information on local and global cache groups, see Oracle In-Memory Database Cache User's Guide. In particular, see "Example of data sharing among the grid members" in Oracle In-Memory Database Cache User's Guide.
Required privilege
CREATE CACHE GROUP or CREATE ANY CACHE GROUP and
CREATE TABLE (if all tables in the cache group are owned by the current user) or CREATE ANY TABLE (if at least one of the tables in the cache group is not owned by the current user)
SQL syntax
There are CREATE CACHE GROUP statements for each type of cache group:
There is one CREATE CACHE GROUP statement to create a global cache group:
CREATE READONLY CACHE GROUP
For READONLY cache groups, the syntax is:
CREATE [DYNAMIC] READONLY CACHE GROUP [Owner.]GroupName [AUTOREFRESH [MODE {INCREMENTAL | FULL}] [INTERVAL IntervalValue {MINUTE[S] | SECOND[S] | MILLESECOND[S] }] [STATE {ON|OFF|PAUSED}] ] FROM {[Owner.]TableName ( {ColumnDefinition[,…]} [,PRIMARY KEY(ColumnName[,…])] [,FOREIGN KEY(ColumnName [,…]) REFERENCES RefTableName (ColumnName [,…]) [ON DELETE CASCADE] [UNIQUE HASH ON (HashColumnName[,…]) PAGES=PrimaryPages] [WHERE ExternalSearchCondition] [AGING USE ColumnName LIFETIME Num1 {MINUTE[S] |HOUR[S] | DAY[S]} [CYCLE Num2 {MINUTE[S] |HOUR[S] |DAY[S]}] [ON|OFF] ] } [,...];
CREATE ASYNCHRONOUS WRITETHROUGH CACHE GROUP
For ASYNCHRONOUS WRITETHROUGH cache groups, the syntax is:
CREATE [DYNAMIC] [ASYNCHRONOUS] WRITETHROUGH CACHE GROUP [Owner.]GroupName FROM {[Owner.]TableName ( {ColumnDefinition[,…]} [,PRIMARY KEY(ColumnName[,…])] [FOREIGN KEY(ColumnName [,…]) REFERENCES RefTableName (ColumnName [,…])] [ ON DELETE CASCADE ] UNIQUE HASH ON (HashColumnName[,…]) PAGES=PrimaryPages] [AGING {LRU| USE ColumnName LIFETIME Num1 {MINUTE[S] |HOUR[S] |DAY[S]} [CYCLE Num2 {MINUTE[S] |HOUR[S] |DAY[S]}] }[ON|OFF] ] } [,...];
CREATE SYNCHRONOUS WRITETHROUGH CACHE GROUP
For SYNCHRONOUS WRITETHROUGH cache groups, the syntax is:
CREATE [DYNAMIC] SYNCHRONOUS WRITETHROUGH CACHE GROUP [Owner.]GroupName FROM {[Owner.]TableName ( {ColumnDefinition[,…]} [,PRIMARY KEY(ColumnName[,…])] [FOREIGN KEY(ColumnName [,…]) REFERENCES RefTableName (ColumnName [,…])}] [ ON DELETE CASCADE ] [UNIQUE HASH ON (HashColumnName[,…]) PAGES=PrimaryPages] [AGING {LRU| USE ColumnName LIFETIME Num1 {MINUTE[S] |HOUR[S] |DAY[S]} [CYCLE Num2 {MINUTE[S] |HOUR[S] |DAY[S]}] }[ON|OFF] ] } [,...];
CREATE USERMANAGED CACHE GROUP
For user managed cache groups, the syntax is:
CREATE [DYNAMIC][USERMANAGED] CACHE GROUP [Owner.]GroupName [AUTOREFRESH [MODE {INCREMENTAL | FULL}] [INTERVAL IntervalValue {MINUTE[S] | SECOND[S] | MILLESECOND[S] }] [STATE {ON|OFF|PAUSED}] ] FROM {[Owner.]TableName ( {ColumnDefinition[,…]} [,PRIMARY KEY(ColumnName[,…])] [FOREIGN KEY(ColumnName[,…]) REFERENCES RefTableName (ColumnName [,…])] [ON DELETE CASCADE] [, {READONLY | PROPAGATE | NOT PROPAGATE}] [UNIQUE HASH ON (HashColumnName[,…]) PAGES=PrimaryPages] [WHERE ExternalSearchCondition] [AGING {LRU| USE ColumnName LIFETIME Num1 {MINUTE[S] |HOUR[S] |DAY[S]} [CYCLE Num2 {MINUTE[S] |HOUR[S] |DAY[S]}] }[ON|OFF] ] } [,...];
CREATE DYNAMIC ASYNCHRONOUS WRITETHROUGH GLOBAL CACHE GROUP
To create a global dynamic cache group to cache data within a cache grid:
CREATE DYNAMIC ASYNCHRONOUS WRITETHROUGH GLOBAL CACHE GROUP [Owner.]GroupName FROM {[Owner.]TableName ( {ColumnDefinition[,…]} [,PRIMARY KEY(ColumnName[,…])] [FOREIGN KEY(ColumnName [,…]) REFERENCES RefTableName (ColumnName [,…])] [ ON DELETE CASCADE ] UNIQUE HASH ON (HashColumnName[,…]) PAGES=PrimaryPages] [AGING {LRU| USE ColumnName LIFETIME Num1 {MINUTE[S] |HOUR[S] |DAY[S]} [CYCLE Num2 {MINUTE[S] |HOUR[S] |DAY[S]}] }[ON|OFF] ] } [,...];
Parameters
The parameters for the cache group definition before the FROM keyword are:
Parameter | Description |
---|---|
[ Owner .] GroupName |
Owner and name assigned to the new cache group. |
[DYNAMIC] |
If specified, a dynamic cache group is created. |
AUTOREFRESH |
The AUTOREFRESH parameter automatically propagates changes from the Oracle database to the cache group. For details, see "AUTOREFRESH in cache groups". |
MODE [INCREMENTAL | FULL] |
Determines which rows in the cache are updated during an autorefresh. If the INCREMENTAL clause is specified, TimesTen refreshes only rows that have been changed on Oracle since the last propagation. If the FULL clause is specified, TimesTen updates all rows in the cache with each autorefresh. The default autorefresh mode is INCREMENTAL. |
INTERVAL IntervalValue |
Indicates the interval at which autorefresh should occur in units of minutes, seconds or milliseconds. IntervalValue is an integer value that specifies how often autorefresh should be scheduled, in MINUTES, SECONDS or MILLISECONDS. The default IntervalValue value is 5 minutes. If the specified interval is not long enough for an autorefresh to complete, a runtime warning is generated and the next autorefresh waits until the current one finishes. An informational message is generated in the support log if the wait queue reaches 10. |
STATE [ON | OFF | PAUSED] |
Specifies whether autorefresh should be ON or OFF or PAUSED when the cache group is created. You can alter this setting later by using the ALTER CACHE GROUP statement. By default, the autorefresh state is PAUSED. |
FROM |
Designates one or more table definitions for the cache group. |
Everything after the FROM keyword comprises the definitions of the Oracle tables cached in the cache group. The syntax for each table definition is similar to that of a CREATE TABLE statement. However, primary key constraints are required for the cache group table.
Table definitions have the parameters:
Parameter | Description |
---|---|
[ Owner .] TableName |
Owner and name to be assigned to the new table. If you do not specify the owner name, your login becomes the owner name for the new table. |
ColumnDefinition |
Name of an individual column in a table, its data type and whether or not it is nullable. Each table must have at least one column. See "Column Definition". |
PRIMARY KEY ( ColumnName [,…]) |
Specifies that the table has a primary key. Primary key constraints are required for a cache group. ColumnName is the name of the column that forms the primary key for the table to be created. Up to 16 columns can be specified for the primary key. Cannot be specified with UNIQUE in one specification. |
FOREIGN KEY ( ColumnName [,…]) |
Specifies that the table has a foreign key. ColumnName is the name of the column that forms the foreign key for the table to be created. See "FOREIGN KEY ". |
REFERENCES RefTableName ( ColumnName [,…]) |
Specifies the table which the foreign key is associated with. RefTableName is the name of the referenced table and ColumnName is the name of the column referenced in the table. |
[ON DELETE CASCADE] |
Enables the ON DELETE CASCADE referential action. If specified, when rows containing referenced key values are deleted from a parent table, rows in child tables with dependent foreign key values are also deleted. |
READONLY |
Specifies that changes cannot be made on the cached table. |
PROPAGATE| NOT PROPAGATE |
Specifies whether changes to the cached table are automatically propagate to the corresponding Oracle table at commit time. |
UNIQUE HASH ON ( HashColumnName ) |
Specifies that a hash index is created on this table. HashColumnName identifies the column that is to participate in the hash key of this table. The columns specified in the hash index must be identical to the columns in the primary key. |
PAGES= PrimaryPages |
Specifies the expected number of pages in the table. The PrimaryPages number determines the number of hash buckets created for the hash index. The minimum is 1. If your estimate is too small, performance is degraded. See "CREATE TABLE" for more information. |
WHERE ExternalSearchCondition |
The WHERE clause evaluated by Oracle for the cache group table. This WHERE clause is added to every LOAD and REFRESH operation on the cache group. It may not directly reference other tables. It is parsed by both TimesTen and Oracle. See "Using a WHERE clause" in Oracle In-Memory Database Cache User's Guide. |
AGING LRU [ON | OFF] |
If specified, defines the LRU aging policy on the root table. The LRU aging policy applies to all tables in the cache group. The LRU aging policy defines the type of aging (least recently used (LRU)), the aging state (ON or OFF) and the LRU aging attributes.
Set the aging state to either ON or OFF. ON indicates that the aging state is enabled and aging is done automatically. OFF indicates that the aging state is disabled and aging is not done automatically. In both cases, the aging policy is defined. The default is ON. In dynamic cache groups, LRU aging is set ON by default. You can specify time-based aging instead. LRU attributes are defined by calling the LRU aging is not supported for cache groups with autorefresh. For more information about LRU aging, see "Implementing aging on a cache group" in Oracle In-Memory Database Cache User's Guide. |
AGING USE ColumnName ...[ON|OFF] |
If specified, defines the time-based aging policy on the root table. The time-based aging policy applies to all tables in the cache group. The time-based aging policy defines the type of aging (time-based), the aging state (ON or OFF) and the time-based aging attributes.
Set the aging state to either ON or OFF. ON indicates that the aging state is enabled and aging is done automatically. OFF indicates that the aging state is disabled and aging is not done automatically. In both cases, the aging policy is defined. The default is ON. Time-based aging attributes are defined at the SQL level and are specified by the LIFETIME and CYCLE clauses. Specify The values of the column used for aging are updated by your applications. If the value of this column is unknown for some rows, and you do not want the rows to be aged, define the column with a large default value (the column cannot be NULL). For more information about time-based aging, see "Implementing aging on a cache group" in Oracle In-Memory Database Cache User's Guide. |
LIFETIME Num1 {MINUTE[S]|HOUR[S]DAY[S]} |
LIFETIME is a time-based aging attribute and is a required clause.
Specify the LIFETIME clause after the AGING USE The LIFETIME clause specifies the minimum amount of time data is kept in cache. Specify The concept of time resolution is supported. If DAYS is specified as the time resolution, then all rows whose timestamp belongs to the same day are aged out at the same time. If HOURS is specified as the time resolution, then all rows with timestamp values within that hour are aged at the same time. A LIFETIME of 3 days is different than a LIFETIME of 72 hours (3*24) or a LIFETIME of 432 minutes (3*24*60). |
[CYCLE Num2 {MINUTE[S] |HOUR[S]| DAY[S]}] |
CYCLE is a time-based aging attribute and is optional. Specify the CYCLE clause after the LIFETIME clause.
The CYCLE clause indicates how often the system should examine rows to see if data exceeds the specified LIFETIME value and should be aged out (deleted). Specify If you do not specify the CYCLE clause, then the default value is 5 minutes. If you specify 0 for If the aging state is OFF, then aging is not done automatically and the CYCLE clause is ignored. |
Description
Two cache groups cannot have the same owner name and group name. If you do not specify the owner name, your login becomes the owner name for the new cache group.
Dynamic parameters are not allowed in the WHERE clause.
Oracle temporary tables cannot be cached.
Each table must correspond to a table in the Oracle database.
You cannot use lowercase delimited identifiers to name your cache tables. Table names in TimesTen are case-insensitive and are stored as uppercase. The name of the cache table must be the same as the Oracle table name. Uppercase table names on TimesTen will not match mixed case table names on Oracle. As a workaround, create a synonym for your table in Oracle and use that synonym as the table name for the cache group. This workaround is not available for read-only cache groups or cache groups with the AUTOREFRESH attribute.
Each column in the cache table must match each column in the Oracle table, both in name and in data type. See "Mappings between Oracle and TimesTen data types" in Oracle In-Memory Database Cache User's Guide. In addition, each column name must be fully qualified with an owner and table name when referenced in a WHERE clause.
The WHERE clause can only directly refer to the cache group table. Tables that are not in the cache group can only be referenced with a sub-select.
Generally, you do not have to fully qualify the column names in the WHERE clause of the CREATE CACHE GROUP, LOAD, UNLOAD, REFRESH or FLUSH statements. However, since TimesTen automatically generates queries that join multiple tables in the same cache group, a column needs to be fully qualified if there is more than one table in the cache group that contains columns with the same name.
By default, a range index is created to enforce the primary key for a cache group table. Use the UNIQUE HASH clause to specify a hash index for the primary key.
If your application performs range queries over a cache group table's primary key, then choose a range index for that cache group table by omitting the UNIQUE HASH clause.
If, however, your application performs only exact match lookups on the primary key, then a hash index may offer better response time and throughput. In such a case, specify the UNIQUE HASH clause. See "CREATE TABLE" for more information on the UNIQUE HASH clause.
Use ALTER TABLE to change the representation of the primary key index for a table.
For cache group tables with the propagate attribute and for tables of SWT and AWT cache groups, foreign keys specified with ON DELETE CASCADE must be a proper subset of foreign keys with ON DELETE CASCADE in the Oracle tables.
The AUTOREFRESH parameter automatically propagates changes from the Oracle database to TimesTen cache groups. For explicitly loaded cache groups, deletes, updates and inserts are automatically propagated from the Oracle database to the cache group. For dynamic cache groups, only deletes and updates are propagated. Inserts to the specified Oracle tables are not propagated to dynamic cache groups. They are dynamically loaded into IMDB Cache when referenced by the application. They can also be explicitly loaded by the application.
To use AUTOREFRESH with a cache group, you must specify AUTOREFRESH when you create the cache group. You can change the MODE, STATE and INTERVAL AUTOREFRESH settings after a cache group has been created by using the ALTER CACHE GROUP command. Once a cache group has been specified as either AUTOREFRESH or PROPAGATE, you cannot change these attributes.
TimesTen supports FULL or INCREMENTAL AUTOREFRESH. In FULL mode, the entire cache is periodically unloaded and then reloaded. In INCREMENTAL mode, TimesTen installs triggers in the Oracle database to track changes and periodically updates only the rows that have changed in the specified Oracle tables. The first incremental refresh is always a full refresh, unless the autorefresh state is PAUSED. The default mode is INCREMENTAL.
FULL AUTOREFRESH is more efficient when most of the Oracle table rows have been changed. INCREMENTAL AUTOREFRESH is more efficient when there are fewer changes.
TimesTen schedules an AUTOREFRESH operation when the transaction that contains a statement with AUTOREFRESH specified is committed. The statement types that cause AUTOREFRESH to be scheduled are:
A CREATE CACHE GROUP statement in which AUTOREFRESH is specified, and the AUTOREFRESH state is specified as ON
An ALTER CACHE GROUP statement in which the AUTOREFRESH state has been changed to ON
A LOAD CACHE GROUP statement on an empty cache group whose autorefresh state is PAUSED
The specified interval determines how often AUTOREFRESH occurs.
The current STATE of AUTOREFRESH can be ON, OFF or PAUSED. By default, the autorefresh state is PAUSED.
The NOT PROPAGATE attribute cannot be used with the AUTOREFRESH attribute.
You can implement sliding windows with time-based aging. See "Configuring a sliding window" in Oracle In-Memory Database Cache User's Guide.
After you have defined an aging policy for the table, you cannot change the policy from LRU to time-based or from time-based to LRU. You must first drop aging and then alter the table to add a new aging policy.
The aging policy must be defined to change the aging state.
LRU and time-based aging can be combined in one system. If you use only LRU aging, the aging thread wakes up based on the cycle specified for the whole data store. If you use only time-based aging, the aging thread wakes up based on an optimal frequency. This frequency is determined by the values specified in the CYCLE clause for all tables. If you use both LRU and time-based aging, then the thread wakes up based on a combined consideration of both types.
Call the ttAgingScheduleNow
procedure to schedule the aging process right away regardless if the aging state is ON or OFF.
The following rules determine if a row is accessed or referenced for LRU aging:
Any rows used to build the result set of a SELECT statement.
Any rows used to build the result set of an INSERT...SELECT statement.
Any rows that are about to be updated or deleted.
Compiled commands are marked invalid and need recompilation when you either drop LRU aging from or add LRU aging to tables that are referenced in the commands.
For LRU aging, if a child row is not a candidate for aging, then neither this child row nor its parent row are deleted. ON DELETE CASCADE settings are ignored.
For time-based aging, if a parent row is a candidate for aging, then all child rows are deleted. ON DELETE CASCADE (whether specified or not) is ignored.
Specify either the LRU aging or time-based aging policy on the root table. The policy applies to all tables in the cache group.
For the time-based aging policy, you cannot add or modify the aging column. This is because you cannot add or modify a NOT NULL column.
Restrictions on defining aging for a cache group:
LRU aging is not supported on a cache group defined with the autorefresh attribute.
The aging policy cannot be added, altered, or dropped for read-only cache groups or cache groups with the AUTOREFRESH attribute while the cache agent is active. Stop the cache agent first.
You cannot drop the column that is used for time-based aging.
To cache data in a cache grid, you must create a dynamic asynchronous writethrough global cache group. Before you can create this cache group, the TimesTen database must be associated with a cache grid. For more information on creating and using a cache grid and creating and using global cache groups, see "Cache grid" and "Global cache group" in Oracle In-Memory Database Cache User's Guide.
Examples
Create a READONLY cache group:
CREATE READONLY CACHE GROUP customerorders AUTOREFRESH INTERVAL 10 MINUTES FROM customer (custid INT NOT NULL, name CHAR(100) NOT NULL, addr CHAR(100), zip INT, region CHAR(10), PRIMARY KEY(custid)), ordertab (orderid INT NOT NULL, custid INT NOT NULL, PRIMARY KEY (orderid), FOREIGN KEY (custid) REFERENCES customer(custid));
Create an ASYNCHROUS WRITETHROUGH cache group:
CREATE ASYNCHRONOUS WRITETHROUGH CACHE GROUP cstomers FROM customer (custid INT NOT NULL, name CHAR(100) NOT NULL, addr CHAR(100), zip INT, PRIMARY KEY(custid));
Create a SYNCHRONOUS WRITETHROUGH cache group:
CREATE SYNCHRONOUS WRITETHROUGH CACHE GROUP customers FROM customer (custid INT NOT NULL, name CHAR(100) NOT NULL, addr CHAR(100), zip INT, PRIMARY KEY(custid));
Create a USERMANAGED cache group:
CREATE USERMANAGED CACHE GROUP updateanywherecustomers AUTOREFRESH MODE INCREMENTAL INTERVAL 30 SECONDS STATE ON FROM customer (custid INT NOT NULL, name CHAR(100) NOT NULL, addr CHAR(100), zip INT, PRIMARY KEY(custid), PROPAGATE);
Create a cache group with time-based aging. Specify agetimestamp
as the column for aging. Specify LIFETIME 2 hours, CYCLE 30 minutes. Aging state is not specified, so the default setting (ON) is used.
CREATE READONLY CACHE GROUP agingcachegroup AUTOREFRESH MODE INCREMENTAL INTERVAL 5 MINUTES STATE PAUSED FROM customer (customerid NUMBER NOT NULL, agetimestamp TIMESTAMP NOT NULL, PRIMARY KEY (customerid)) AGING USE agetimestamp LIFETIME 2 HOURS CYCLE 30 MINUTES; Command> DESCRIBE customer; Table USER.CUSTOMER: Columns: *CUSTOMERID NUMBER NOT NULL AGETIMESTAMP TIMESTAMP (6) NOT NULL AGING USE AgeTimestamp LIFETIME 2 HOURS CYCLE 30 MINUTES ON 1 table found. (primary key columns are indicated with *)
Use a synonym for a mixed case delimited identifier table name in Oracle so the mixed case table name can be cached in TimesTen. First attempt to cache the mixed case Oracle table name. You see the error "Could not find 'NameofTable' in Oracle"
:
Command> AUTOCOMMIT 0; Command> PASSTHROUGH 3; Command> CREATE TABLE "MixedCase" (col1 NUMBER PRIMARY KEY NOT NULL); Command> INSERT INTO "MixedCase" VALUES (1); 1 row inserted. Command> COMMIT; Command> CREATE CACHE GROUP MixedCase1 from "MixedCase" (col1 NUMBER PRIMARY KEY NOT NULL); 5140: Could not find SAMPLEUSER.MIXEDCASE in Oracle. May not have privileges. The command failed.
Now create the synonym "MIXEDCASE"
and use that synonym as the table name.
Command> AUTOCOMMIT 0; Command> PASSTHROUGH 3; Command> CREATE SYNONYM "MIXEDCASE" FOR "MixedCase"; Command> COMMIT; Command> CREATE CACHE GROUP MixedCase2 FROM "MIXEDCASE" (col1 NUMBER PRIMARY KEY NOT NULL); Warning 5147: Cache group contains synonyms Command> COMMIT;
Attempt to use a synonym name with a read-only cache group or a cache group with the AUTOREFRESH attribute. You see an error:
Command> AUTOCOMMIT 0; Command> PASSTHROUGH 3; Command> CREATE SYNONYM "MIXEDCASE_AUTO" FOR "MixedCase"; Command> COMMIT; Command> CREATE READONLY CACHE GROUP MixedCase3 AUTOREFRESH MODE INCREMENTAL INTERVAL 10 MINUTES FROM "MIXEDCASE_AUTO" (Col1 NUMBER PRIMARY KEY NOT NULL); 5142: Autorefresh is not allowed on cache groups with Oracle synonyms The command failed.
See also