TimesTen Application Layer Database Cache learning: 16. Aging policy and AWT cache group

Source: Internet
Author: User
Tags dsn reserved

This article discusses if a cache table has the aging policy set, does the deletion of the data in the cached aging result in an impact to the Oracle database?

If it is a read-only cache group, it will of course not affect Oracle. If it is an AWT cache group, the answer will not be affected, that is, the data deletion caused by aging is not propagated to Oracle, which is verified by experiment.

Previous preparations to set up the cache group were skipped here.

Creating a source table in Oracle (schema user-Tthr):

create table t1(id int not null, t timestamp not null, primary key(id));

Start the cache agent.

Set up AWT cache group (cache management User-Cacheadm), define aging policy to be based on timestamp, life cycle is 10 seconds, check period is 5 seconds

CREATEDYNAMIC Asynchronous Writethrough CACHEGROUP "AGEAWT"   from  "Tthr"."T1"("ID"  Number( -) not NULL,"T"  TIMESTAMP(6) not NULL,PRIMARY KEY("ID")) AGING use T LIFETIMETenSeconds CYCLE5Seconds on  StartRep Agent

Inserting data in TimesTen

$ ttisql"Dsn=cachedb1_1122;uid=tthr;pwd=timesten"Copyright (c)1996, the, Oracle and/orits affiliates. All rights reserved. Type?or "Help"  forHelp, type"Exit"  toQuit 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= +; Tempsize= +; Typemode=0; ORACLENETSERVICENAME=TTORCL; (DefaultSetting autocommit=1) command>Select* fromT1;0Rows found.command> Insert intoT1 VALUES (1, sysdate);1Row inserted.command>Select* fromt1;<1, .- to- -  on: A:49.000000>1Row found.command>Select* fromT1; <-aging took effect.0Rows found.command> Insert intoT1 VALUES (2, sysdate);1Row inserted.command>Select* fromt1;<2, .- to- -  on: -:50.000000>1Row found.command>Select* fromT1; <-aging took effect.0Rows found.command>

Observe data changes in Oracle, and you can see that the data is increasing without being deleted because of aging

$ sqlplus tthr/[email protected]sql*plus:release 11.2.0.2.0 Production on Mon could 30 01:12:27 2016Copyright (c) 1982, Oracle. All rights reserved. Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit productionwith The partitioning, OLAP, Data Mining and Real Application testing optionssql> SELECT * FROM t1;no rows selectedsql> select * from t1;no rows Sele ctedsql>/ ID----------  T---------------------------------------------------------------------------  1 30-may-16 01.12.49.000000 amsql>/ ID----------  T---------------------------------------------------------------------------  1 30-may-16 01.12.49.000000 am 2  30-may-16 01.13.50.000000 AM 

TimesTen Application-tier Database Cache learning: 16. Aging policy and AWT cache group

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.