zoukankan      html  css  js  c++  java
  • TimesTen InMemory Database Cache 配置整理

    TimesTen In-Memory Database Cache 配置其实在在TimesTen Quick Start有详细说明,在这里用自已的语言整理总结一下,方便查阅。这里使用TimesTen 11.2.2在widnows平台下操作(http://www.cnblogs.com/mlog/)

    一,oracle配置

    (以:sqlplus sys@orcl as sysdba)
    1,在oracle创建一个专用表空间用于管理缓存到timesten 的对象
      create tablespace ttusers datafile 'ttusers.dbf' SIZE 40M;
    2,创建timesten用户:运行initCacheGlobalSchema.sql脚本来创建用户
      @D:\TimesTen\tt1122_32\oraclescripts\initCacheGlobalSchema.sql 'ttusers'
    3,创建一个cache管理用户,这个用户负责追踪oracle database和cache database之间数据的改变
      create user cacheadm identified by cacheadm
      default tablespace ttusers
      quota unlimited on ttusers
      temporary tablespace temp;
    4,授予系统管理权限给cache管理用户,即3,创建的cacheadm用户 运行grantCacheAdminPrivileges.sql即可
      @D:\TimesTen\tt1122_32\oraclescripts\grantCacheAdminPrivileges.sql
    5,授予数据访问权限给cache管理用户,即对表的select, insert, update, delete之类的权限
    如:conn scott/tiger
      grant select on scott.dept to cacheadm;
      grant select,insert,update,delete on scott.emp to cacheadm;
      grant select,insert,update,delete on scott.bonus to cacheadm;

    二, TimesTen配置

    1,创建一个DSN实例: OracleNetServiceName为oracle数据库实例名。DatabaseCharacterSet与oracle数据库一致。User ID:为与oracle一致的Cache Administration 用户(创建时先不写,等一下写)
    ttisql;
      connect my_ttdb;
    2,创建一个Cache Manager 用户,授予admin或者cache_manager权限,此用户负责设置和管理cache grid 和cache group 操作,授与oracle配置3中用户名一致.
      create user cacheadm identified by cacheadm;
      grant admin to cacheadm;
    3,创建Cache Table 用户,与oracle实际用户一致.
      create user scott identified by scott;
      grant create session to scott;
    4,将oracle cache管理用户与timesten关联
      call ttcacheuidpwdset ('cacheadm','cacheadm');
      call ttcacheuidget;
    5,创建一个cache grid.
      call ttcacheuidpwdset ('cacheadm','cacheadm');
      call ttcacheuidget;查看创建信息
    6,将cache database 和cache grid关联
      call ttgridnameset ('samplegrid');

    1. 三,添加缓存组到内存数据库

    1,启动cache agent高速缓存代理,cache agent进程负责cache database之间的够沟通,同时也负责oracle database 到cache database之间的数据流。
      connect XX;
      call ttcachestart;
    2, 根据需要创建CREATE CACHE GROUP,如:
      create readonly cache group ro autorefresh
      interval 5 seconds mode incremental
      from scott.dept(
      deptno number(2) not null primary key,
      dname varchar2(14),
      loc varchar2(13));

    3,启动复制代理,如果数据库中有asynchronous writethrough cache groups就必须要启动这个agent,这个进程负责TT数据库之间,TT和oracle之间的数据复制。
      call ttrepstart;
    4,将高速缓存数据库高速缓存网格(只有当当前数据库包含global cache groups或者需要进行global cache grid操作时才需要这一步骤,注:windows不支持)
      call ttgridattach(1,'my_ttdb','liyanwei',9991);
      call ttgridnodestatus;//
    5,使用LOAD CACHE GROUP语句来预加载数据。如下
      load cache group RO commit every 1 rows;

    完成!

      靓点博客在0与1之间的博客

     

    靓点博客 http://www.cnblogs.com/mlog 或 http://blog.csdn.net/cml2030
  • 相关阅读:
    vs c++ 自动生成svn版本信息 编译前脚本
    cannot seek value-initialized vector iterator 程序崩溃
    shell 统计代码行数
    c++ 控制台程序增加图标的一种方法
    grpc c++ 设置断线重连时间
    拓端数据tecdat|R语言用lme4多层次(混合效应)广义线性模型(GLM),逻辑回归分析教育留级调查数据
    拓端数据tecdat|R语言计量经济学:虚拟变量(哑变量)在线性回归模型中的应用
    拓端数据tecdat|Python风险价值计算投资组合VaR(Value at Risk )、期望损失ES(Expected Shortfall)
    拓端数据tecdat|R语言用相关网络图可视化分析汽车配置和饮酒习惯
    拓端数据tecdat|R语言 PCA(主成分分析),CA(对应分析)夫妻职业差异和马赛克图可视化
  • 原文地址:https://www.cnblogs.com/mlog/p/2790305.html
Copyright © 2011-2022 走看看