Timesten导入数据到Cache Group

Timesten导入数据到Cache Group[@more@]

1.load cache group语句来导入read only的cache group
用户必须有CACHE_MANAGER或 LOAD CACHE GROUP的权限

下面的语句会导入cacheadm.ro cache group,HR.DEPARTMENTS有27条数据
Command> load cache group ro commit every 256 rows;
27 cache instances affected.

也可以用load cache group来导入可update的cache group
Command> load cache group g_awt where employees.employee_id > 200 commit every 0 rows;
6 cache instances affected.

2.用select 语句导入可update的cache group
用hr帐户登入,查询之前用load cache group导入的6笔数据
Command> connect "dsn=ljg_tt1122;uid=hr;pwd=hr;orclepwd=hr";

Warning 01S00: Undefined connection attribute "orclepwd" in connection string

Connection successful: DSN=ljg_tt1122;UID=hr;DataStore=/home/timesten/TimesTen/tt1122/info/ljg;DatabaseCharacterSet=WE8MSWIN1252;ConnectionCharacterSet=US7ASCII;DRIVER=/home/timesten/TimesTen/tt1122/lib/libtten.so;LogDir=/home/timesten/TimesTen/tt1122/info/ljg/logs;PermSize=64;TempSize=32;TypeMode=0;OracleNetServiceName=orcl131;
(Default setting AutoCommit=1)
con1: Command> select employee_id, first_name from employees;
< 201, Michael >
< 202, Pat >
< 203, Susan >
< 204, Hermann >
< 205, Shelley >
< 206, William >
6 rows found.

用select导入一笔资料


con4: Command> connect "dsn=ljg_tt1122;uid=hr;pwd=hr;oraclepwd=hr";
Connection successful: DSN=ljg_tt1122;UID=hr;DataStore=/home/timesten/TimesTen/tt1122/info/ljg;DatabaseCharacterSet=WE8MSWIN1252;ConnectionCharacterSet=US7ASCII;DRIVER=/home/timesten/TimesTen/tt1122/lib/libtten.so;LogDir=/home/timesten/TimesTen/tt1122/info/ljg/logs;PermSize=64;TempSize=32;TypeMode=0;OracleNetServiceName=orcl131;
(Default setting AutoCommit=1)
con5: Command> select first_name, last_name from employees where employee_id=100;
< Steven, King >
1 row found.
con5: Command>
con5: Command> select count(*) from employees;
< 7 >
1 row found.

如果导入的子表的数据,则主表的数据会自动被导入,job_history是employees的子表。
con5: Command> select employee_id, start_date, end_date from job_history where employee_id=200;
< 200, 1995-09-17 00:00:00, 2001-06-17 00:00:00 >
< 200, 2002-07-01 00:00:00, 2006-12-31 00:00:00 >
2 rows found.
con5: Command> select count(*) from employees;
< 8 >
1 row found.

最后把cachr group "g_awt"的数据全部导进来
con5: Command> connect "dsn=ljg_tt1122;uid=cacheadm;pwd=cacheadm;oraclepwd=cacheadm";
Connection successful: DSN=ljg_tt1122;UID=cacheadm;DataStore=/home/timesten/TimesTen/tt1122/info/ljg;DatabaseCharacterSet=WE8MSWIN1252;ConnectionCharacterSet=US7ASCII;DRIVER=/home/timesten/TimesTen/tt1122/lib/libtten.so;LogDir=/home/timesten/TimesTen/tt1122/info/ljg/logs;PermSize=64;TempSize=32;TypeMode=0;OracleNetServiceName=orcl131;
(Default setting AutoCommit=1)
con6: Command> load cache group g_awt commit every 256 rows;
99 cache instances affected.

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

转载于:http://blog.itpub.net/271283/viewspace-1057743/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值