ITPub博客

首页 > 数据库 > Oracle > timesten配置只读同步

timesten配置只读同步

原创 Oracle 作者:安佰胜 时间:2014-10-21 15:20:53 0 删除 编辑
数据库方面:

 

create tablespace ttusers datafile '/opt/oracle/oradata/data2db/ttusers_001.dbf' size 100m;

cd /opt/TimesTen/tt1122/oraclescripts/
cp initCacheGlobalSchema.sql /tmp
cp grantCacheAdminPrivileges.sql /tmp
cd /tmp
chmod  777 initCacheGlobalSchema.sql  grantCacheAdminPrivileges.sql

su - oracle
cd /tmp
sqlplus / as sysdba
@initCacheGlobalSchema.sql


SQL> @initCacheGlobalSchema.sql

Please enter the tablespace where TIMESTEN user is to be created
ttusers
The value chosen for tablespace is ttusers

******* Creation of TIMESTEN schema and TT_CACHE_ADMIN_ROLE starts *******
1. Creating TIMESTEN schema
2. Creating TIMESTEN.TT_GRIDID table
3. Creating TIMESTEN.TT_GRIDINFO table
4. Creating TT_CACHE_ADMIN_ROLE role
5. Granting privileges to TT_CACHE_ADMIN_ROLE
** Creation of TIMESTEN schema and TT_CACHE_ADMIN_ROLE done successfully **

PL/SQL procedure successfully completed.


create user cacheadm identified by cacheadm
default tablespace ttusers
quota unlimited on ttusers
temporary tablespace temp;

@grantCacheAdminPrivileges.sql


------------

SQL> create user cacheadm identified by cacheadm
  2  default tablespace ttusers
  3  quota unlimited on ttusers
  4  temporary tablespace temp;

User created.

SQL> @grantCacheAdminPrivileges.sql

Please enter the administrator user id
cacheadm
The value chosen for administrator user id is cacheadm

***************** Initialization for cache admin begins ******************
0. Granting the CREATE SESSION privilege to CACHEADM
1. Granting the TT_CACHE_ADMIN_ROLE to CACHEADM
2. Granting the DBMS_LOCK package privilege to CACHEADM
3. Granting the RESOURCE  privilege to CACHEADM
4. Granting the CREATE PROCEDURE  privilege to CACHEADM
5. Granting the CREATE ANY TRIGGER  privilege to CACHEADM
6. Granting the DBMS_LOB package privilege to CACHEADM
7. Granting the SELECT on SYS.ALL_OBJECTS privilege to CACHEADM
8. Granting the SELECT on SYS.ALL_SYNONYMS privilege to CACHEADM
9. Checking if the cache administrator user has permissions on the default
tablespace
     Permission exists
11. Granting the CREATE TYPE privilege to CACHEADM
12. Granting the SELECT on SYS.GV$LOCK privilege to CACHEADM (optional)
13. Granting the SELECT on SYS.GV$SESSION privilege  to CACHEADM (optional)
14. Granting the SELECT on SYS.DBA_DATA_FILES privilege  to CACHEADM (optional)
15. Granting the SELECT on SYS.USER_USERS privilege  to CACHEADM (optional)
16. Granting the SELECT on SYS.USER_FREE_SPACE privilege  to CACHEADM (optional)
17. Granting the SELECT on SYS.USER_TS_QUOTAS privilege  to CACHEADM (optional)
18. Granting the SELECT on SYS.USER_SYS_PRIVS privilege  to CACHEADM (optional)
********* Initialization for cache admin user done successfully *********


创建表空间ttusers
脚本创建timesten用户
手动创建cacheadm用户
手动授权给cacheadm用户需要同步到timesten中的表的相关权限

SQL> create table ta(id int);

SQL> select * from ta; 

no rows selected

SQL>
SQL>
SQL> insert into ta select 1 from dual;

1 row created.

SQL> commit;

Commit complete.

SQL> grant select on ta to cacheadm;

Grant succeeded.

SQL> grant update,delete,insert on ta to cacheadm;

Grant succeeded.


grant connect,resource,create any trigger to cacheadm;
grant dba to cacheadm;


tt配置

ttisql an_tt1122
create user cacheadm identified by cacheadm;
grant admin to cacheadm;

create user an identified by anbaisheng;
grant create session to an;

connect "dsn=an_tt1122;uid=cacheadm;oraclepwd=cacheadm";

call ttcacheuidpwdset ('cacheadm','cacheadm');
call ttcacheuidget;
call ttCacheStart;


call ttGridCreate('myGrid');
call ttGridNameSet('myGrid');


call ttCacheStart;


CREATE READONLY CACHE GROUP readcache
AUTOREFRESH
INTERVAL 1 SECONDS
FROM ta (id int not null primary key);


load cache group readcache commit every 1 rows;

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

上一篇: timesten创建dsn
请登录后发表评论 登录
全部评论

注册时间:2009-08-26

  • 博文量
    215
  • 访问量
    613630