相關(guān)閱讀
劉傳龍,公眾號(hào):IT那活兒TimesTen Classic系統(tǒng)及其與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;
驗(yàn)證登錄:
▼▼▼
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.
注:此步驟必須在緩存管理員用戶下創(chuàng)建:
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)插入測(cè)試數(shù)據(jù):
▼▼▼
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)賦權(quán)給緩存管理員:
▼▼▼
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)創(chuàng)建寫入緩存組:
▼▼▼
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)起復(fù)制代理:
▼▼▼
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
注:必須先有寫緩存然后起復(fù)制代理,否則報(bào)錯(cuò):
▼▼▼
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插入數(shù)據(jù):
▼▼▼
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;
驗(yàn)證:
▼▼▼
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) ------------異步寫入(動(dòng)態(tài))
Autorefresh: No
Aging: LRU on
Root Table: ORATT.WRITETAB
Table Type: Propagate
2 cache groups found.
Command>
異步寫入(動(dòng)態(tài))
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;
驗(yàn)證:
▼▼▼
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
停緩存代理:
更多精彩干貨分享
點(diǎn)擊下方名片關(guān)注
IT那活兒
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/129918.html
摘要:大勢(shì)所趨,云原生數(shù)據(jù)庫的崛起不過,在全球數(shù)據(jù)庫領(lǐng)域,目前恐怕還不止這兩股力量。在年數(shù)據(jù)庫系統(tǒng)的魔力象限中,阿里云數(shù)據(jù)庫被列入遠(yuǎn)見者象限,這是國(guó)產(chǎn)數(shù)據(jù)庫首次進(jìn)入魔力象限。從傳統(tǒng)數(shù)據(jù)庫到云原生數(shù)據(jù)庫,這50年來,數(shù)據(jù)庫行業(yè)到底都發(fā)生了怎樣的變化?以O(shè)racle為代表的傳統(tǒng)數(shù)據(jù)庫廠商,不斷邁向云化的過程,從中嘗到了甜頭。不僅可以讓用戶Oracle數(shù)據(jù)庫遷移到Oracle云上,順帶也把用戶業(yè)務(wù)帶上O...
摘要:和聯(lián)合總裁及董事會(huì)成員將在下周宣布更多的戰(zhàn)略。曾在去年月的大會(huì)上宣布了公共云計(jì)劃,其中包含了和的相關(guān)功能,以及云服務(wù)和數(shù)據(jù)庫云服務(wù)。目前已經(jīng)表示將會(huì)把和整合進(jìn)自身的公有云之中。但截至到目前,這些組件仍然處在預(yù)覽階段。 在當(dāng)前的云計(jì)算時(shí)代,PaaS領(lǐng)域已經(jīng)成為各大巨頭必爭(zhēng)之地。PaaS提供應(yīng)用服務(wù)引擎,用戶基于該應(yīng)用服務(wù)引擎可構(gòu)建該類的應(yīng)用,典型的案例有Google App Engine、...
摘要:甲骨文的一名代表拒絕證實(shí)裁員消息的細(xì)節(jié),但表示公司將繼續(xù)尋求平衡資源,并圍繞其云產(chǎn)品以重組我們的開發(fā)團(tuán)隊(duì)。甲骨文并不是今年唯一一家裁員的主要云軟件供應(yīng)商。被甲骨文稱為基于的最初。自年發(fā)布第二代稱為,以來,甲骨文基本上已經(jīng)淘汰了。過去一周,不少社交媒體和論壇上的許多帖子都提到了甲骨文(Oracle)裁員的事情,這些人聲稱自己被甲骨文解雇了,或者了解其他人被甲骨文解雇的事情。目前,該裁員風(fēng)波波及...
摘要:方法也可以接收一個(gè)參數(shù)表示數(shù)據(jù)請(qǐng)求著請(qǐng)求的數(shù)據(jù)大小,但是可讀流可以根據(jù)需要忽略這個(gè)參數(shù)。讀取數(shù)據(jù)大部分情況下我們只要簡(jiǎn)單的使用方法將可讀流的數(shù)據(jù)重定向到另外形式的流,但是在某些情況下也許直接從可讀流中讀取數(shù)據(jù)更有用。 介紹本文介紹了使用 node.js streams 開發(fā)程序的基本方法。 We should have some ways of connecting programs ...
摘要:學(xué)編程真的不是一件容易的事不管你多喜歡或是多會(huì)編程,在學(xué)習(xí)和解決問題上總會(huì)碰到障礙。熟練掌握核心內(nèi)容,特別是和多線程初步具備面向?qū)ο笤O(shè)計(jì)和編程的能力掌握基本的優(yōu)化策略。 學(xué)Java編程真的不是一件容易的事,不管你多喜歡或是多會(huì)Java編程,在學(xué)習(xí)和解決問題上總會(huì)碰到障礙。工作的時(shí)間越久就越能明白這個(gè)道理。不過這倒是一個(gè)讓人進(jìn)步的機(jī)會(huì),因?yàn)槟阋恢辈粩嗟膶W(xué)習(xí)才能很好的解決你面前的難題...
摘要:的測(cè)試完全不同級(jí)別的。記錄請(qǐng)求的級(jí)別在高于或等于其的有效級(jí)別時(shí)被稱為被啟用,否則,稱為被禁用。該規(guī)則是的核心。指定名稱,指定的全限定名。對(duì)記錄事件進(jìn)行格式化。查看當(dāng)前活動(dòng)文件的大小,如果超過指定大小會(huì)告知觸發(fā)當(dāng)前活動(dòng)文件滾動(dòng)。 一、logback的介紹 Logback是由log4j創(chuàng)始人設(shè)計(jì)的又一個(gè)開源日志組件,官方網(wǎng)站: http://logback.qos.ch。 logback當(dāng)...
閱讀 1356·2023-01-11 13:20
閱讀 1707·2023-01-11 13:20
閱讀 1215·2023-01-11 13:20
閱讀 1906·2023-01-11 13:20
閱讀 4165·2023-01-11 13:20
閱讀 2757·2023-01-11 13:20
閱讀 1402·2023-01-11 13:20
閱讀 3671·2023-01-11 13:20