相關閱讀
劉傳龍,公眾號: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那活兒
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/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當...
閱讀 1346·2023-01-11 13:20
閱讀 1684·2023-01-11 13:20
閱讀 1132·2023-01-11 13:20
閱讀 1858·2023-01-11 13:20
閱讀 4100·2023-01-11 13:20
閱讀 2704·2023-01-11 13:20
閱讀 1385·2023-01-11 13:20
閱讀 3597·2023-01-11 13:20