Oracle® TimesTen In-Memory Database SQL Reference Release 11.2.1 Part Number E13070-04 |
|
|
View PDF |
The ALTER TABLE statement changes an existing table definition.
Required privilege
No privilege is required for the table owner.
ALTER ANY TABLE for another user's table.
For ALTER TABLE...ADD FOREIGN KEY, the owner of the altered table must have the REFERENCES privilege on the table referenced by the foreign key clause.
SQL syntax
To add columns:
ALTER TABLE [Owner.]TableName ADD [COLUMN] ColumnName ColumnDataType [DEFAULT DefaultVal] [[NOT] INLINE] [UNIQUE] [NULL]
or
ALTER TABLE [Owner.]TableName ADD (ColumnName ColumnDataType [DEFAULT DefaultVal] [[NOT] INLINE] [UNIQUE] [NULL] [, ... ] )
To remove columns:
ALTER TABLE [Owner.]TableName DROP [COLUMN] ColumnName
or
ALTER TABLE [Owner.]TableName DROP (ColumnName [, ... ] )
To add a primary key constraint:
ALTER TABLE [Owner.]TableName ADD CONSTRAINT ConstraintName PRIMARY KEY (ColumnName [,... ]) USE HASH INDEX PAGES = {RowPages | CURRENT}]
To add a foreign key and optionally add ON DELETE CASCADE:
ALTER TABLE [Owner.]TableName ADD [CONSTRAINT ForeignKeyName] FOREIGN KEY (ColumnName [,...]) REFERENCES RefTableName [(ColumnName [,...])] [ON DELETE CASCADE]
To remove a foreign key:
ALTER TABLE [Owner.]TableName DROP CONSTRAINT ForeignKeyName
To resize a hash index:
ALTER TABLE [Owner.]TableName SET PAGES = {RowPages | CURRENT}
To change the primary key to use a hash index:
ALTER TABLE [Owner.]TableName USE HASH INDEX PAGES = {RowPages | CURRENT}
To change the primary key to use a range index:
ALTER TABLE [Owner.]TableName USE RANGE INDEX
To change the default value of a column:
ALTER TABLE [Owner.]TableName MODIFY (ColumnName DEFAULT DefaultVal)
To add or drop a UNIQUE constraint on a column:
ALTER TABLE Owner.]TableName {ADD | DROP} UNIQUE (ColumnName)
To remove the default value of a column that is nullable, by changing it to NULL:
ALTER TABLE [Owner.]TableName MODIFY (ColumnName DEFAULT NULL)
To add LRU aging:
ALTER TABLE [Owner.]TableName ADD AGING LRU [ON | OFF]
To add time-based aging:
ALTER TABLE [Owner.]TableName ADD AGING USE ColumnName LIFETIME num1 {SECOND[S] | MINUTE[S] | HOUR[S] | DAY[S]} [CYCLE num2 {SECOND[S] | MINUTE[S] | HOUR[S] | DAY[S] }] [ON | OFF]
To change the aging state:
ALTER TABLE [Owner.]TableName SET AGING {ON | OFF}
To drop aging:
ALTER TABLE [Owner.]TableName DROP AGING
To change LIFETIME for time-based aging:
ALTER TABLE [Owner.]TableName SET AGING LIFETIME num1 {SECOND[S] | MINUTE[S] | HOUR[S] | DAY[S]}
To change CYCLE for time-based aging:
ALTER TABLE [Owner.]TableName SET AGING CYCLE num2 {SECOND[S] | MINUTE[S] | HOUR[S] | DAY[S]}
Parameters
The ALTER TABLE statement has the parameters:
Parameter | Description |
---|---|
[ Owner .] TableName |
Identifies the table to be altered. |
UNIQUE |
Specifies that in the column ColumnName each row must contain a unique value. |
MODIFY |
Specifies that an attribute of a given column is to be changed to a new value. |
DEFAULT [ DefaultVal |NULL] |
Specifies that the column has a default value, DefaultVal . If NULL, specifies that the default value of the columns is to be dropped. If a column with a default value of SYSDATE is added, the value of the column of the existing rows only is the system date at the time the column was added. If the default value is one of the USER functions the column value is the user value of the session that executed the ALTER TABLE statement.
Altering the default value of a column has no impact on existing rows. |
ColumnName |
Name of the column to for which the UNIQUE CONSTRAINT or default value is to be changed. A new column cannot have the same name as an existing column or another new column. |
ColumnDataType |
Type of the column to be added. Some types require additional parameters. See Chapter 1, "Data Types" for the data types that can be specified. |
INLINE| NOT INLINE |
By default, variable-length columns whose declared column length is > 128 bytes are stored out of line. Variable-length columns whose declared column length is <= 128 bytes are stored inline. The default behavior can be overridden during table creation through the use of the INLINE and NOT INLINE keywords. |
ADD CONSTRAINT ConstraintName PRIMARY KEY ( ColumnName
|
Adds a primary key constraint to the table. Columns of the primary key must be defined as NOT NULL.
Specify Specify the USE HASH INDEX clause to use a hash index for the primary key. Specify either See "Column Definition" for a description of hash indexes and pages. |
CONSTRAINT |
Specifies that a foreign key is to be dropped. Optionally specifies that an added foreign key is named by the user. |
ForeignKeyName |
Name of the foreign key to be added or dropped. All foreign keys are assigned a default name by the system if the name was not specified by the user. Either the user-provided name or system name can be specified in the DROP FOREIGN KEY clause. |
FOREIGN KEY |
Specifies that a foreign key is to be added or dropped. See "FOREIGN KEY ". |
REFERENCES |
Specifies that the foreign key references another table. |
RefTableName |
The name of the table that the foreign key references. |
[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. |
USE HASH INDEX PAGES = { RowPages | CURRENT} |
Specifies that a hash index is to be used for the primary key. If the primary key already uses a hash index, then this clause is equivalent to the SET PAGES clause. |
USE RANGE INDEX |
Specifies that a range index is to be used for the primary key. If the primary key already uses a range index, TimesTen ignores this clause. |
SET PAGES |
Resizes the hash index based on the expected number of row pages in the table. Each row page can contain up to 256 rows of data. This number determines the number of hash buckets created for the hash index. The minimum is 1. If your estimate is too small, performance may be degraded. You can specify a constant (RowPages ) or the CURRENT number of row pages. See "Column Definition" for a description of hash indexes and pages. |
RowPages |
The number of row pages expected. |
CURRENT |
Use the number of row pages currently in use. |
ADD AGING LRU [ON | OFF] |
Adds least recently used (LRU) aging to an existing table that has no aging policy defined.
The LRU aging policy defines the type of aging (least recently used (LRU)), the aging state ( Set the aging state to either LRU attributes are defined by calling the For more information about LRU aging, see "Implementing aging in your tables" in Oracle TimesTen In-Memory Database Operations Guide. |
ADD AGING USE ColumnName ... [ON| OFF] |
Adds time-based aging to an existing table that has no aging policy defined.
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). You can define your aging column with a data type of TT_TIMESTAMP or TT_DATE. If you choose data type TT_DATE, then you must specify the LIFETIME unit as days. For more information about time-based aging, see "Implementing aging in your tables" in Oracle TimesTen In-Memory Database Operations Guide. |
LIFETIME Num1 {SECOND[S] | MINUTE[S] | HOUR[S] | DAY[S] |
Specify the LIFETIME clause after the ADD AGING USE ColumnName clause if you are adding the time-based aging policy to an existing table. Specify the LIFETIME clause after the SET AGING clause to change the LIFETIME setting.
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 {SECOND[S]| MINUTE[S]| HOUR[S]|DAY[S]} |
Specify the optional CYCLE clause after the LIFETIME clause if you are adding the time-based aging policy to an existing table.
CYCLE is a time-based aging attribute. 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. Specify the CYCLE clause after the SET AGING clause to change the CYCLE setting. |
SET AGING {ON|OFF} |
Changes the aging state. The aging policy must be previously defined. ON enables automatic aging. OFF disables automatic aging. If you wish to control aging with an external scheduler, then disable aging and invoke the ttAgingScheduleNow built-in procedure. |
DROP AGING |
Drops the aging policy from the table. After you define an aging policy, you cannot alter it. Drop aging, then redefine. |
SET AGING LIFETIME Num1 {SECOND[S]| MINUTE[S]|HOUR[S] |DAY[S]} |
Use this clause to change the LIFETIME for time-based aging.
If you defined your aging column with data type TT_DATE, then you must specify DAYS as the LIFETIME unit. |
SET AGING CYCLE Num2 {SECOND[S]| MINUTE[S]| HOUR[S]|DAY[S]} |
Use this clause to change the CYCLE for time-based aging.
|
Description
The ALTER TABLE statement cannot be used to alter a temporary table.
The ALTER TABLE statement cannot be used to alter a replicated table that is part of a TWOSAFE BY REQUEST transaction. If DDLCommitBehavior
=1, this operation results in error 8051. If DDLCommitBehavior
=0, the operation succeeds because a commit is performed before the ALTER TABLE operation, resulting in the ALTER TABLE operation being in a new transaction which is not part of the TWOSAFE BY REQUEST transaction.
The ALTER TABLE ADD [COLUMN] ColumnName
statement adds one or more new columns to an existing table. The new columns are added to the end of all existing rows of the table in one new partition.
Columns referenced by materialized views cannot be dropped.
Only one partition is added to the table per statement regardless of the number of columns added.
The new columns cannot be declared NOT NULL.
NULL is the initial value for all added columns, unless a default value is specified for the new column.
The total number of columns in the table cannot exceed 255. In addition, the total number of partitions in a table cannot exceed 255, one of which is used by TimesTen.
Use the ADD CONSTRAINT ... PRIMARY KEY clause to add a primary key constraint to a regular table or to a detailed or materialized view table. Do not use this clause on a table that already has a primary key.
If you use the ADD CONSTRAINT... PRIMARY KEY clause to add a primary key constraint, and you do not specify the USE HASH INDEX clause, then a range index is used for the primary key constraint.
If a table is replicated and the replication agent is active, you cannot use the ADD CONSTRAINT ... PRIMARY KEY clause. Stop the replication agent first.
Do not specify the ADD CONSTRAINT ... PRIMARY KEY clause on a global temporary table.
Do not specify the ADD CONSTRAINT ... PRIMARY KEY clause on a cache group table because cache group tables defined with a primary key must be defined in the CREATE CACHE GROUP statement.
As the result of an ALTER TABLE ADD statement, an additional read occurs for each new partition during queries. Therefore, altered tables may have slightly degraded performance. The performance can only by restored by dropping and recreating the table, or by using the ttMigrate create -c
-noRepUpgrade
command, and restoring the table using the ttRestore -r
-noRepUpgrade
command. Dropping the added column does not recover the lost performance or decrease the number of partitions.
The ALTER TABLE DROP statement removes one or more columns from an existing table. The dropped columns are removed from all current rows of the table. Subsequent SQL statements must not attempt to make any use of the dropped columns. You cannot drop columns that are in the table's primary key. You cannot drop columns that are in any of the table's foreign keys until you have dropped all foreign keys. You cannot drop columns that are indexed until all indexes on the column have been dropped. ALTER TABLE cannot be used to drop all of the columns of a table. Use DROP TABLE instead.
When a column is dropped from a table, all commands referencing that table need to be recompiled. An error may result at recompilation time if a dropped column was referenced. The application must re-prepare those commands, and rebuild any parameters and result columns. When a column is added to a table, the commands that contain a SELECT * statement are invalidated. Only these commands must be re-prepared. All other commands continue to work as expected.
When you drop a column, the column space is not freed.
When you add a UNIQUE constraint, there is overhead incurred (in terms of additional space and additional time). This is because an index is created to maintain the UNIQUE constraint. You cannot use the DROP INDEX statement to drop an index used to maintain the UNIQUE constraint.
A UNIQUE constraint and its associated index cannot be dropped if it is being used as a unique index on a replicated table.
Use ALTER TABLE...USE RANGE INDEX if your application performs range queries over a table's primary key.
Use ALTER TABLE...USE HASH INDEX if your application performs exact match lookups on a table's primary key.
An error is generated if a table has no primary key and either the USE HASH INDEX clause or the USE RANGE INDEX clause is specified.
If ON DELETE CASCADE is specified on a foreign key constraint for a child table, a user can delete rows from a parent table for which the user has the DELETE privilege without requiring explicit DELETE privilege on the child table.
To change the ON DELETE CASCADE triggered action, drop then redefine the foreign key constraint.
ON DELETE CASCADE is supported on detail tables of a materialized view. If you have a materialized view defined over a child table, a deletion from the parent table causes cascaded deletes in the child table. This, in turn, triggers changes in the materialized view.
The total number of rows reported by the DELETE statement does not include rows deleted from child tables as a result of the ON DELETE CASCADE action.
For ON DELETE CASCADE, since different paths may lead from a parent table to a child table, the following rule is enforced:
Either all paths from a parent table to a child table are "delete" paths or all paths from a parent table to a child table are "do not delete" paths.
Specify ON DELETE CASCADE on all child tables on the "delete" path.
This rule does not apply to paths from one parent to different children or from different parents to the same child.
For ON DELETE CASCADE, a second rule is also enforced:
If a table is reached by a "delete" path, then all its children are also reached by a "delete" path.
For ON DELETE CASCADE with replication, the following restrictions apply:
The foreign keys specified with ON DELETE CASCADE must match between the Master and subscriber for replicated tables. Checking is done at runtime. If there is an error, the receiver thread stops working.
All tables in the delete cascade tree have to be replicated if any table in the tree is replicated. This restriction is checked when the replication scheme is created or when a foreign key with ON DELETE CASCADE is added to one of the replication tables. If an error is found, the operation is aborted. You may be required to drop the replication scheme first before trying to change the foreign key constraint.
You must stop the replication agent before adding or dropping a foreign key on a replicated table.
The ALTER TABLE ADD/DROP CONSTRAINT statement has the following restrictions:
When a foreign key is dropped, TimesTen also drops the index associated with the foreign key. Attempting to drop an index associated with a foreign key using the regular DROP INDEX statement results in an error.
Foreign keys cannot be added or dropped on tables in a cache group.
Foreign keys cannot be added or dropped on tables that participate in TimesTen replication. If the operation is attempted on a table that is either being replicated or is a replicated table, TimesTen returns an error.
Foreign keys cannot be added or dropped on views or temporary tables.
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.
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.
Call the ttAgingScheduleNow
procedure to schedule the aging process right away regardless if the aging state is ON or OFF.
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.
Aging restrictions:
You cannot drop the column that is used for time-based aging.
Tables that are related by foreign keys must have the same aging policy.
For LRU aging, if a child row is not a candidate for aging, 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.
Examples
Add returnrate
column to parts
table.
ALTER TABLE parts ADD COLUMN returnrate DOUBLE;
Add numsssign
and prevdept
columns to contractor
table.
ALTER TABLE contractor ADD ( numassign INTEGER, prevdept CHAR(30) );
Remove addr1
and addr2
columns from employee
table.
ALTER TABLE employee DROP ( addr1, addr2 );
Drop the UNIQUE title column of the books
table.
ALTER TABLE books DROP UNIQUE (title);
Add the x1
column to the t1
table with a default value of 5:
ALTER TABLE t1 ADD (x1 INT DEFAULT 5);
Change the default value of column x1
to 2:
ALTER TABLE t1 MODIFY (x1 DEFAULT 2);
Alter table primarykeytest
to add the primary key constraint c1
. Use the ttIsql
INDEXES
command to show that the primary key constraint c1
is created and a range index is used:
Command> CREATE TABLE primarykeytest (col1 TT_INTEGER NOT NULL); Command> ALTER TABLE primarykeytest ADD CONSTRAINT c1 > PRIMARY KEY (col1); Command> INDEXES primarykeytest; Indexes on table SAMPLEUSER.PRIMARYKEYTEST: C1: unique range index on columns: COL1 1 index found. 1 table found.
Alter table prikeyhash
to add the primary key constraint c2
using a hash index. Use the ttIsql
INDEXES
command to show that the primary key constraint c2
is created and a hash index is used:
Command> CREATE TABLE prikeyhash (col1 NUMBER (3,2) NOT NULL); Command> ALTER TABLE prikeyhash ADD CONSTRAINT c2 > PRIMARY KEY (col1) USE HASH INDEX PAGES = 20; Command> INDEXES prikeyhash; Indexes on table SAMPLEUSER.PRIKEYHASH: C2: unique hash index on columns: COL1 1 index found. 1 table found.
Attempt to add a primary key constraint on a table already defined with a primary key. You see an error:
Command> CREATE TABLE oneprikey (col1 VARCHAR2 (30) NOT NULL, > col2 TT_BIGINT NOT NULL, col3 CHAR (15) NOT NULL, > PRIMARY KEY (col1,col2)); Command> ALTER TABLE oneprikey ADD CONSTRAINT c2 > PRIMARY KEY (col1,col2); 2235: Table can have only one primary key The command failed.
Attempt to add a primary key constraint on a column that is not defined as NOT NULL. You see an error:
Command> CREATE TABLE prikeynull (col1 CHAR (30)); Command> ALTER TABLE prikeynull ADD CONSTRAINT c3 > PRIMARY KEY (col1); 2236: Nullable column can not be part of a primary key The command failed.
This example illustrates the use of range and hash indexes. It creates the pkey
table with col1
as the primary key. A range index is created by default. The table is then altered to change the index on col1
to a hash index. The table is altered again to change the index back to a range index.
Command> CREATE TABLE pkey (col1 TT_INTEGER PRIMARY KEY, col2 VARCHAR2 (20)); Command> INDEXES pkey; Indexes on table SAMPLEUSER.PKEY: PKEY: unique range index on columns: COL1 1 index found. 1 table found.
Alter the pkey
table to use a hash index:
Command> ALTER TABLE pkey USE HASH INDEX PAGES = CURRENT; Command> INDEXES pkey; Indexes on table SAMPLEUSER.PKEY: PKEY: unique hash index on columns: COL1 1 index found. 1 table found.
Alter the pkey
table to use a range index:
Command> ALTER TABLE pkey USE RANGE INDEX; Command> INDEXES pkey; Indexes on table SAMPLEUSER.PKEY: PKEY: unique range index on columns: COL1 1 index found. 1 table found.
This example generates an error when attempting to alter a table to define either a range or hash index on a column without a primary key.
Command> CREATE TABLE illegalindex (Ccl1 CHAR (20)); Command> ALTER TABLE illegalindex USE RANGE INDEX; 2810: The table has no primary key so cannot change its index type The command failed. Command> ALTER TABLE illegalindex USE HASH INDEX PAGES = CURRENT; 2810: The table has no primary key so cannot change its index type The command failed.
These examples show how time resolution works with aging. In this example, lifetime is 3 days.
If (SYSDATE - ColumnValue) <= 3, do not age out the row.
If (SYSDATE - ColumnValue) > 3, then the row is a candidate for aging.
If (SYSDATE - ColumnValue) = 3 days, 22 hours, then row is not aged out because lifetime was specified in days. The row would be aged out if lifetime had been specified as 72 hours.
This example alters a table by adding LRU aging. The table has no previous aging policy. The aging state is ON by default.
ALTER TABLE agingdemo3 ADD AGING LRU; Command> DESCRIBE agingdemo3; Table USER.AGINGDEMO3: Columns: *AGINGID NUMBER NOT NULL NAME VARCHAR2 (20) INLINE Aging lru on 1 table found. (primary key columns are indicated with *)
This example alters a table by adding time-based aging. The table has no previous aging policy. The agingcolumn
column is used for aging. LIFETIME is 2 days. CYCLE is 30 minutes.
ALTER TABLE agingdemo4 ADD AGING USE agingcolumn LIFETIME 2 DAYS CYCLE 30 MINUTES; Command> DESCRIBE agingdemo4; Table USER.AGINGDEMO4: Columns: *AGINGID NUMBER NOT NULL NAME VARCHAR2 (20) INLINE AGINGCOLUMN TIMESTAMP (6) NOT NULL Aging use AGINGCOLUMN lifetime 2 days cycle 30 minutes on
This example illustrates that after you create an aging policy, you cannot change it. You must drop aging and redefine.
CREATE TABLE agingdemo5 (agingid NUMBER NOT NULL PRIMARY KEY ,name VARCHAR2 (20) ,agingcolumn TIMESTAMP NOT NULL ) AGING USE agingcolumn LIFETIME 3 DAYS OFF; ALTER TABLE agingdemo5 ADD AGING LRU; 2980: Cannot add aging policy to a table with an existing aging policy. Have to drop the old aging first The command failed.
Drop aging on the table and redefine with LRU aging.
ALTER TABLE agingdemo5 DROP AGING; ALTER TABLE agingdemo5 ADD AGING LRU; Command> DESCRIBE agingdemo5; Table USER.AGINGDEMO5: Columns: *AGINGID NUMBER NOT NULL NAME VARCHAR2 (20) INLINE AGINGCOLUMN TIMESTAMP (6) NOT NULL Aging lru on 1 table found. (primary key columns are indicated with *)
This example alters a table by setting the aging state to OFF. The table has been defined with a time-based aging policy. If you set the aging state to OFF, aging is not done automatically. This is useful if you wish to use an external scheduler to control the aging process. Set aging state to OFF and then call the ttAgingScheduleNow
procedure to start the aging process.
Command> DESCRIBE agingdemo4; Table USER.AGINGDEMO4: Columns: *AGINGID NUMBER NOT NULL NAME VARCHAR2 (20) INLINE AGINGCOLUMN TIMESTAMP (6) NOT NULL Aging use AGINGCOLUMN lifetime 2 days cycle 30 minutes on ALTER TABLE AgingDemo4 SET AGING OFF;
Note that when you describe agingdemo4
, the aging policy is defined and the aging state is set to OFF.
Command> DESCRIBE agingdemo4; Table USER.AGINGDEMO4: Columns: *AGINGID NUMBER NOT NULL NAME VARCHAR2 (20) INLINE AGINGCOLUMN TIMESTAMP (6) NOT NULL Aging use AGINGCOLUMN lifetime 2 days cycle 30 minutes off 1 table found. (primary key columns are indicated with *)
Call ttAgingScheduleNow
to invoke aging with an external scheduler:
Command> CALL ttAgingScheduleNow ('agingdemo4');
Attempt to alter a table adding the aging column and then use that column for time-based aging. An error is generated.
Command> DESCRIBE x; Table USER1.X: Columns: *ID TT_INTEGER NOT NULL 1 table found. (primary key columns are indicated with *) Command> ALTER TABLE x ADD COLUMN t TIMESTAMP; Command> ALTER TABLE x ADD AGING USE t LIFETIME 2 DAYS; 2993: Aging column cannot be nullable The command failed.
Attempt to alter the LIFETIME clause for a table defined with time-based aging. The aging column is defined with data type TT_DATE. An error is generated because the LIFETIME unit is not expressed in DAYS.
Command> CREATE TABLE aging1 (col1 TT_DATE NOT NULL) AGING USE col1 LIFETIME 2 DAYS; Command> ALTER TABLE aging1 SET AGING LIFETIME 2 HOURS; 2977: Only DAY lifetime unit is allowed with a TT_DATE column The command failed.
See also
"Implementing aging in your tables" in Oracle TimesTen In-Memory Database Operations Guide