在Oracle数据库上创建一张CUSTOMER表。
CREATE TABLE CUSTOMER (CUSTID INT NOT NULL,
NAME CHAR(100) NOT NULL,
ADDR CHAR(100),
ZIP INT,
REGION CHAR(10),
PRIMARY KEY(CUSTID));
插入若干数据。
在Oracle数据库上创建一张ORDERTAB表。
CREATE TABLE ORDERTAB (ORDERID INT NOT NULL,
CUSTID INT NOT NULL,
PRIMARY KEY (ORDERID),
FOREIGN KEY (CUSTID) REFERENCES CUSTOMER(CUSTID));
插入若干数据。
创建一个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));
建立完cache group之后,必须手动LOAD一次,之后才可以自动刷新。
Command> load cache group customerorders commit every 100 rows;
2 cache instances affected.
该cache group是一个系统管理的READONLY cache group,每10分钟会自动刷新一次,但前提是必须启动了cache agent。
启动cache agent的命令是:
call ttCacheStart();
会产生一个进程:
oracle 2892 2820 0 09:46 ? 00:00:00 /u01/TimesTen/tt70/bin/timestenorad -verbose -userlog tterrors.log -supportlog ttmesg.log -id 6 -datastore /u01/TimesTen/tt70/info/LDY/ldy -flags 0x1000040 -logfilesize 0x40 -logbuffsize 0x10000 -permsize 0x0 -tempsize 0x0 -isoLevel 0x0 -oracleId ora10g -autorefreshType 0x1 -logflushmethod 1 -connections 64 -ckptfrequency 600 -ckptlogvolume 0 -recoverythreads 0 -ckptrate 0 -facility user
阅读(1204) | 评论(0) | 转发(0) |