TimesTen中配置只读Cache Group to Oracle的基本步骤

一、准备工作
1)软件安装
安装TimesTen
安装Oracle client[@more@]

一、准备工作
1)软件安装
安装TimesTen
安装Oracle client
2)在Oracle中创建一个让TimesTen访问的帐户
 SQL> conn /as sysdba;
 已连接。
 SQL> create user tt_toms identified by tt_toms;
 用户已创建。
 SQL> grant connect,resource,create any trigger ,create session to tt_toms;
 授权成功。
 SQL>

3)create 一个dsn
 我在这里创建了一个system dsn,命名为tt_study

4)create 一个帐户在dsn上
 E:>ttisql tt_study
 Copyright (c) 1996-2006, Oracle. All rights reserved.
 Type or "help" for help, type "exit" to quit ttIsql.
 All commands must end with a semicolon character.

 connect "DSN=tt_study";
 Connection successful: DSN=tt_study;UID=46192;DataStore=E:tt_dbdatatt_study;
 DRIVER=C:WINDOWSsystem32ttdv60.dll;LogDir=e:tt_dbdatalog;PermSize=20;
 (Default setting AutoCommit=1)
 Command> create user tt_toms identified by 'tt_toms'; 

Command> grant ddl,admin to tt_toms; 

Command> exit
 Disconnecting...
 Done.

5)修改DSN tt_study增加
 User ID:tt_toms
Oracle ID:ora10
Oracle Password: tt_toms

保存退出,重新用ttisql 访问tt_study,你会发现:
E:>ttisql tt_study
 Copyright (c) 1996-2006, Oracle. All rights reserved.
 Type ? or "help" for help, type "exit" to quit ttIsql.
 All commands must end with a semicolon character.

 connect "DSN=tt_study";
 Enter password for 'tt_toms':
 Connection successful: DSN=tt_study;UID=tt_toms;DataStore=E:tt_dbdatatt_study
 ;DRIVER=C:WINDOWSsystem32ttdv60.dll;OracleId=ora10;LogDir=e:tt_dbdatalog;
 PermSize=20;
 (Default setting AutoCommit=1)
 Command> 

二、创建一个read only cache group

1)在Oracle上用tt_toms用户创建一个测试用的表
 SQL> conn tt_toms/tt_toms@ora10
  已连接。
  SQL> create table tt_test (a int primary key);
  表已创建。

  SQL> insert into tt_test values(1);
  已创建 1 行。

  SQL> insert into tt_test values(2);
  已创建 1 行。

  SQL> commit;
  提交完成。

  SQL> select * from tt_test;

  NO
  ----------
  1
  2
  SQL>

2)创建一个cache group
 E:>ttisql tt_study
 Copyright (c) 1996-2006, Oracle. All rights reserved.
 Type ? or "help" for help, type "exit" to quit ttIsql.
 All commands must end with a semicolon character.

 connect "DSN=tt_study";
 Enter password for 'tt_toms':
 Connection successful: DSN=tt_study;UID=tt_toms;DataStore=E:tt_dbdatatt_study
 ;DRIVER=C:WINDOWSsystem32ttdv60.dll;OracleId=ora10;LogDir=e:tt_dbdatalog;
 PermSize=20;
 (Default setting AutoCommit=1)
 Command> call ttcacheuidpwdset('tt_toms','tt_toms');
 Command> call ttcachestart();
 Command> create readonly cache group tt_cache autorefresh interval 2 seconds from tt_test(a int primary key);
 Command>


 3)Load Cache Group
Command> load cache group tt_cache commit every 2 rows;

2 rows affected.
Command> select *from tt_test;
< 1 >
< 2 >
2 rows found.
Command> cachegroups;

Cache Group TT_TOMS.TT_CACHE:

Cache Group Type: Read Only
Autorefresh: Yes
Autorefresh Mode: Incremental
Autorefresh State: On
Autorefresh Interval: 2 Seconds
Autorefresh Limit: 10000

Root Table: TT_TOMS.TT_TEST
Table Type: Read Only

1 cache group found.
Command>


4)测试
 在oracle上在插入一行数据
  SQL> insert into tt_test values(3);
  已创建 1 行。

  SQL> commit;
  提交完成。
  SQL>
 
  到TimesTen上验证一下
  Command> select *from tt_test;
 < 1 >
 < 2 >
 < 3 >
 3 rows found.

5)删除Cache Group

drop cache group tt_cache;

6)stop cache group agent
call ttcachestop();

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9099175/viewspace-905063/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9099175/viewspace-905063/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值