创建一个Aging功能的cache group,常在READONLY cache group中使用。
LIFETIME为5分钟,探测周期为1分钟。
Oracle端上的该表也需要有一个AgeTimestamp字段,类型为TIMESTAMP。
SQL> alter table customer add (AgeTimestamp TIMESTAMP);
将所有记录都更新为当前时间。
SQL> update customer set agetimestamp=sysdate;
已更新10行。
CREATE READONLY CACHE GROUP AgingCacheGroup
AUTOREFRESH
MODE INCREMENTAL
INTERVAL 5 SECONDS
STATE PAUSED
FROM
CUSTOMER (CUSTID INT NOT NULL,
NAME CHAR(100) NOT NULL,
ADDR CHAR(100),
ZIP INT,
AgeTimestamp TIMESTAMP NOT NULL,
PRIMARY KEY (Custid))
AGING USE AgeTimestamp LIFETIME 5 MINUTES CYCLE 1 MINUTES;
Command> desc customer;
Table TT.CUSTOMER:
Columns:
*CUSTID NUMBER (38) NOT NULL
NAME CHAR (100) NOT NULL
ADDR CHAR (100)
ZIP NUMBER (38)
AGETIMESTAMP TIMESTAMP (6) NOT NULL
Aging use AGETIMESTAMP lifetime 5 minute cycle 1 minute on
1 table found.
(primary key columns are indicated with *)
在Timesten端unload数据,可以确保Timesten里的数据总是最近5分钟的。
Command> unload cache group agingcachegroup;
阅读(1011) | 评论(0) | 转发(0) |