相关阅读
刘传龙,公众号:IT那活儿TimesTen Classic系统及其与Oracle的用户缓存部署(上篇)
1)oratt作为oracle的schema用户:
▼▼▼
sqlplus sys/system@ordb as sysdba
CREATE USER oratt IDENTIFIED BY oracle;
GRANT CREATE SESSION, RESOURCE TO oratt;
alter user oratt quota unlimited on users;
▼▼▼
ttisql sampledb
create user oratt identified by timesten;
grant create session, create table to oratt;
3)cacheadm作为TT的cache用户:
▼▼▼
CREATE USER cacheadm IDENTIFIED BY timesten;
GRANT CREATE SESSION, CACHE_MANAGER, CREATE ANY TABLE TO cacheadm;
验证登录:
▼▼▼
ttisql "uid=cacheadm;pwd=timesten;dsn=sampledb"
▼▼▼
cd $TIMESTEN_HOME/install/oraclescripts
sqlplus sys/system@ordb as sysdba
alter session set container=PDBORDB;
CREATE TABLESPACE cachetblsp DATAFILE cachetblsp.dbf SIZE 100M;
CREATE USER cacheadm IDENTIFIED BY oracle DEFAULT TABLESPACE cachetblsp QUOTA UNLIMITED ON cachetblsp;
@grantCacheAdminPrivileges "cacheadm"
SQL>
SQL> @grantCacheAdminPrivileges "cacheadm"
Please enter the administrator user id
The value chosen for administrator user id is cacheadm
***************** Creation of TT_CACHE_ADMIN_ROLE starts ******************
0. Creating TT_CACHE_ADMIN_ROLE role
** Creation of TT_CACHE_ADMIN_ROLE done successfully **
***************** 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 DBMS_DDL package privilege to CACHEADM
4. Granting the DBMS_FLASHBACK package privilege to CACHEADM
5. Granting the CREATE SEQUENCE privilege to CACHEADM
6. Granting the CREATE CLUSTER privilege to CACHEADM
7. Granting the CREATE OPERATOR privilege to CACHEADM
8. Granting the CREATE INDEXTYPE privilege to CACHEADM
9. Granting the CREATE TABLE privilege to CACHEADM
10. Granting the CREATE PROCEDURE privilege to CACHEADM
11. Granting the CREATE ANY TRIGGER privilege to CACHEADM
12. Granting the GRANT UNLIMITED TABLESPACE privilege to CACHEADM
13. Granting the DBMS_LOB package privilege to CACHEADM
14. Granting the SELECT on SYS.ALL_OBJECTS privilege to CACHEADM
15. Granting the SELECT on SYS.ALL_SYNONYMS privilege to CACHEADM
16. Checking if the cache administrator user has permissions on the default
tablespace
Permission exists
18. Granting the CREATE TYPE privilege to CACHEADM
19. Granting the SELECT on SYS.GV$LOCK privilege to CACHEADM
20. Granting the SELECT on SYS.GV$SESSION privilege to CACHEADM
21. Granting the SELECT on SYS.DBA_DATA_FILES privilege to CACHEADM
22. Granting the SELECT on SYS.USER_USERS privilege to CACHEADM
23. Granting the SELECT on SYS.USER_FREE_SPACE privilege to CACHEADM
24. Granting the SELECT on SYS.USER_TS_QUOTAS privilege to CACHEADM
25. Granting the SELECT on SYS.USER_SYS_PRIVS privilege to CACHEADM
26. Granting the SELECT on SYS.V$DATABASE privilege to CACHEADM (optional)
27. Granting the SELECT ANY TRANSACTION privilege to CACHEADM
********* Initialization for cache admin user done successfully *********
▼▼▼
ttIsql "DSN=sampledb;UID=cacheadm;PWD=timesten;OraclePWD=oracle"
call ttCacheUidPwdSet(cacheadm,oracle);
Command> call ttCacheUidPwdSet(cacheadm,oracle);
5220: Permanent Oracle connection failure error in OCIServerAttach: ORA-12154: TNS: ???????????? rc = -1
5935: Could not validate Oracle login: uid = CACHEADM, pwd = HIDDEN, OracleNetServiceName = pdbordb, TNS_ADMIN = "/timesten/ttuser/tt181/conf", ORACLE_HOME= "/timesten/ttuser/tt181/install/ttoracle_home/instantclient_12_1"
The command failed.
注:此步骤必须在缓存管理员用户下创建:
sqlplus oratt/oracle@orclpdb
▼▼▼
CREATE TABLE readtab (keyval NUMBER NOT NULL PRIMARY KEY, str VARCHAR2(32));
CREATE TABLE writetab (pk NUMBER NOT NULL PRIMARY KEY, attr VARCHAR2(40));
2)插入测试数据:
▼▼▼
INSERT INTO readtab VALUES (1, Hello);
INSERT INTO readtab VALUES (2, World);
INSERT INTO writetab VALUES (100, TimesTen);
INSERT INTO writetab VALUES (101, CACHE);
COMMIT;
3)赋权给缓存管理员:
▼▼▼
GRANT SELECT ON readtab TO cacheadm;
GRANT SELECT ON writetab TO cacheadm;
GRANT INSERT ON writetab TO cacheadm;
GRANT UPDATE ON writetab TO cacheadm;
GRANT DELETE ON writetab TO cacheadm;
▼▼▼
ttisql "uid=cacheadm;pwd=timesten;dsn=sampledb;oraclepwd=oracle"
CREATE READONLY CACHE GROUP readcache AUTOREFRESH INTERVAL 5 SECONDS FROM oratt.readtab (keyval NUMBER NOT NULL PRIMARY KEY, str VARCHAR2(32));
Command> CREATE READONLY CACHE GROUP readcache AUTOREFRESH INTERVAL 5 SECONDS FROM oratt.readtab (keyval NUMBER NOT NULL PRIMARY KEY, str VARCHAR2(32));
Warning 5002: Unable to connect to the cache agent for /timesten/ttuser/datads/sampledb; check agent status
Warning 5051: Commit message to cache agent failed. Cache agent must be restarted
▼▼▼
Command> cachegroups
Cache Group CACHEADM.READCACHE:
Cache Group Type: Read Only
Autorefresh: Yes
Autorefresh Mode: Incremental
Autorefresh State: Paused
Autorefresh Interval: 5 Seconds
Autorefresh Status: ok
Aging: No aging defined
Root Table: ORATT.READTAB
Table Type: Read Only
1 cache group found.
5)起缓存代理
▼▼▼
[ttuser@timesten1 conf]$ ttAdmin -cacheStart sampledb
RAM Residence Policy : manual
Manually Loaded In RAM : True
Replication Agent Policy : manual
Replication Manually Started : False
Cache Agent Policy : manual
Cache Agent Manually Started : True
Database State : Open
1)创建写入缓存组:
▼▼▼
ttisql "uid=cacheadm;pwd=timesten;dsn=sampledb;oraclepwd=oracle"
CREATE DYNAMIC ASYNCHRONOUS WRITETHROUGH CACHE GROUP writecache FROM oratt.writetab (pk NUMBER NOT NULL PRIMARY KEY, attr VARCHAR2(40));
2)起复制代理:
▼▼▼
ttAdmin -repStart sampledb
[ttuser@timesten1 ~]$ ttAdmin -repStart sampledb
RAM Residence Policy : manual
Manually Loaded In RAM : True
Replication Agent Policy : manual
Replication Manually Started : True
Cache Agent Policy : manual
Cache Agent Manually Started : True
Database State : Open
注:必须先有写缓存然后起复制代理,否则报错:
▼▼▼
ttAdmin -repStart sampledb
[ttuser@timesten1 ~]$ ttAdmin -repStart sampledb
RAM Residence Policy : manual
Manually Loaded In RAM : True
Replication Agent Policy : manual
Replication Manually Started : True
Cache Agent Policy : manual
Cache Agent Manually Started : True
Database State : Open
1)读:
▼▼▼
ttisql "uid=oratt;pwd=timesten;dsn=sampledb;oraclepwd=oracle"
Oracle插入数据:
▼▼▼
sqlplus oratt/oracle@ordb
INSERT INTO readtab VALUES (3, Welcome);
DELETE FROM readtab WHERE keyval=2;
UPDATE readtab SET str=Hi WHERE keyval=1;
COMMIT;
验证:
▼▼▼
Command> select * from oratt.readtab;
< 1, Hello >
< 2, World >
2 rows found.
Command> select * from oratt.readtab;
< 1, Hi >
< 3, Welcome >
2 rows found.
GRANT SELECT ON readtab TO cacheadm;
GRANT SELECT ON writetab TO cacheadm;
GRANT INSERT ON writetab TO cacheadm;
GRANT UPDATE ON writetab TO cacheadm;
GRANT DELETE ON writetab TO cacheadm;
2)写:
▼▼▼
Command> cachegroups
Cache Group CACHEADM.READCACHE:
Cache Group Type: Read Only
Autorefresh: Yes
Autorefresh Mode: Incremental
Autorefresh State: On
Autorefresh Interval: 5 Seconds
Autorefresh Status: ok
Aging: No aging defined
Root Table: ORATT.READTAB
Table Type: Read Only
Cache Group CACHEADM.WRITECACHE:
Cache Group Type: Asynchronous Writethrough (Dynamic) ------------异步写入(动态)
Autorefresh: No
Aging: LRU on
Root Table: ORATT.WRITETAB
Table Type: Propagate
2 cache groups found.
Command>
异步写入(动态)
ttisql "uid=oratt;pwd=timesten;dsn=sampledb;oraclepwd=oracle"
Command> SELECT * FROM writetab;
0 rows found.
Command> SELECT * FROM writetab where pk=100;
< 100, TimesTen >
▼▼▼
INSERT INTO oratt.writetab VALUES (102, Cache);
DELETE FROM oratt.writetab WHERE pk=101;
UPDATE oratt.writetab SET attr=Oracle WHERE pk=100;
COMMIT;
验证:
▼▼▼
SQL> select * from writetab;
Command> select * from writetab;
< 100, Oracle >
< 102, Cache >
2 rows found.
SQL> select * from writetab;
PK ATTR
---------- ----------------------------------------
100 Oracle
102 Cache
停缓存代理:
更多精彩干货分享
点击下方名片关注
IT那活儿
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/129918.html
摘要:大势所趋,云原生数据库的崛起不过,在全球数据库领域,目前恐怕还不止这两股力量。在年数据库系统的魔力象限中,阿里云数据库被列入远见者象限,这是国产数据库首次进入魔力象限。从传统数据库到云原生数据库,这50年来,数据库行业到底都发生了怎样的变化?以Oracle为代表的传统数据库厂商,不断迈向云化的过程,从中尝到了甜头。不仅可以让用户Oracle数据库迁移到Oracle云上,顺带也把用户业务带上O...
摘要:和联合总裁及董事会成员将在下周宣布更多的战略。曾在去年月的大会上宣布了公共云计划,其中包含了和的相关功能,以及云服务和数据库云服务。目前已经表示将会把和整合进自身的公有云之中。但截至到目前,这些组件仍然处在预览阶段。 在当前的云计算时代,PaaS领域已经成为各大巨头必争之地。PaaS提供应用服务引擎,用户基于该应用服务引擎可构建该类的应用,典型的案例有Google App Engine、...
摘要:甲骨文的一名代表拒绝证实裁员消息的细节,但表示公司将继续寻求平衡资源,并围绕其云产品以重组我们的开发团队。甲骨文并不是今年唯一一家裁员的主要云软件供应商。被甲骨文称为基于的最初。自年发布第二代称为,以来,甲骨文基本上已经淘汰了。过去一周,不少社交媒体和论坛上的许多帖子都提到了甲骨文(Oracle)裁员的事情,这些人声称自己被甲骨文解雇了,或者了解其他人被甲骨文解雇的事情。目前,该裁员风波波及...
摘要:方法也可以接收一个参数表示数据请求着请求的数据大小,但是可读流可以根据需要忽略这个参数。读取数据大部分情况下我们只要简单的使用方法将可读流的数据重定向到另外形式的流,但是在某些情况下也许直接从可读流中读取数据更有用。 介绍本文介绍了使用 node.js streams 开发程序的基本方法。 We should have some ways of connecting programs ...
摘要:学编程真的不是一件容易的事不管你多喜欢或是多会编程,在学习和解决问题上总会碰到障碍。熟练掌握核心内容,特别是和多线程初步具备面向对象设计和编程的能力掌握基本的优化策略。 学Java编程真的不是一件容易的事,不管你多喜欢或是多会Java编程,在学习和解决问题上总会碰到障碍。工作的时间越久就越能明白这个道理。不过这倒是一个让人进步的机会,因为你要一直不断的学习才能很好的解决你面前的难题...
摘要:的测试完全不同级别的。记录请求的级别在高于或等于其的有效级别时被称为被启用,否则,称为被禁用。该规则是的核心。指定名称,指定的全限定名。对记录事件进行格式化。查看当前活动文件的大小,如果超过指定大小会告知触发当前活动文件滚动。 一、logback的介绍 Logback是由log4j创始人设计的又一个开源日志组件,官方网站: http://logback.qos.ch。 logback当...
阅读 1249·2023-01-11 13:20
阅读 1558·2023-01-11 13:20
阅读 1012·2023-01-11 13:20
阅读 1680·2023-01-11 13:20
阅读 3971·2023-01-11 13:20
阅读 2519·2023-01-11 13:20
阅读 1355·2023-01-11 13:20
阅读 3486·2023-01-11 13:20