TimesTen 应用层数据库缓存学习:16. Aging策略与AWT缓存组
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了TimesTen 应用层数据库缓存学习:16. Aging策略与AWT缓存组,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2341字,纯文字阅读大概需要4分钟。
内容图文
![TimesTen 应用层数据库缓存学习:16. Aging策略与AWT缓存组](/upload/InfoBanner/zyjiaocheng/465/fac3a3edebab48939bb673d52348f89e.jpg)
启动cache agent。
建立AWT缓存组(cache管理用户 - cacheadm),定义Aging策略为基于TimeStamp,生命周期为10秒,检查周期为5秒
CREATE DYNAMIC ASYNCHRONOUS WRITETHROUGH CACHE GROUP "AGEAWT"
FROM
"TTHR"."T1" (
"ID" NUMBER(38) NOT NULL,
"T" TIMESTAMP(6) NOT NULL,
PRIMARY KEY("ID")
)
AGING USE T LIFETIME 10 seconds CYCLE 5 seconds ON
start rep agent
在TimesTen中插入数据
$ ttisql "dsn=cachedb1_1122;uid=tthr;pwd=timesten"
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
connect "dsn=cachedb1_1122;uid=tthr;pwd=timesten";
Connection successful: DSN=cachedb1_1122;UID=tthr;DataStore=/home/oracle/TimesTen/tt1122/info/DemoDataStore/cachedb1_1122;DatabaseCharacterSet=AL32UTF8;ConnectionCharacterSet=US7ASCII;DRIVER=/home/oracle/TimesTen/tt1122/lib/libtten.so;PermSize=40;TempSize=32;TypeMode=0;OracleNetServiceName=ttorcl;
(Default setting AutoCommit=1)
Command> select * from t1;
0 rows found.
Command> insert into t1 values(1, sysdate);
1 row inserted.
Command> select * from t1;
< 1, 2016-05-30 01:12:49.000000 >
1 row found.
Command> select * from t1; <- aging生效了
0 rows found.
Command> insert into t1 values(2, sysdate);
1 row inserted.
Command> select * from t1;
< 2, 2016-05-30 01:13:50.000000 >
1 row found.
Command> select * from t1; <- aging生效了
0 rows found.
Command>
在Oracle中观察数据变化, 可以看到数据不断增加,没有因为Aging而被删除
$ sqlplus tthr/oracle@ttorcl
SQL*Plus: Release 11.2.0.2.0 Production on Mon May 30 01:12:27 2016
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from t1;
no rows selected
SQL> select * from t1;
no rows selected
SQL> /
ID
----------
T
---------------------------------------------------------------------------
1
30-MAY-16 01.12.49.000000 AM
SQL> /
ID
----------
T
---------------------------------------------------------------------------
1
30-MAY-16 01.12.49.000000 AM
2
30-MAY-16 01.13.50.000000 AM
TimesTen 应用层数据库缓存学习:16. Aging策略与AWT缓存组
标签:
本文系统来源:http://blog.csdn.net/stevensxiao/article/details/51539102
内容总结
以上是互联网集市为您收集整理的TimesTen 应用层数据库缓存学习:16. Aging策略与AWT缓存组全部内容,希望文章能够帮你解决TimesTen 应用层数据库缓存学习:16. Aging策略与AWT缓存组所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。