日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle 百万记录 cache,学习笔记:通过案例深入学习In-Memory Database Cache 总结配置过程...

發布時間:2024/10/14 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle 百万记录 cache,学习笔记:通过案例深入学习In-Memory Database Cache 总结配置过程... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

天萃荷凈

詳細記錄關于In-Memory Database Cache配置方法與使用案例

一、Oracle數據庫創建相關用戶和權限

1.創建timesten用戶

store information about cache grids

SQL> CREATE TABLESPACE cachetblsp DATAFILE

2 'E:\ORACLE\ORADATA\XFF\datfttuser.dbf'

3 SIZE 10M autoextend on next 10m maxsize 30g;

表空間已創建。

SQL> @E:\oracle\timesten\oraclescripts\initCacheGlobalSchema "cachetblsp"

Please enter the tablespace where TIMESTEN user is to be created

The value chosen for tablespace is cachetblsp

******* 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 過程已成功完成。

2.創建測試用戶

the Oracle tables to be cached in a TimesTen database

SQL> create user xff identified by oracle研究中心;

用戶已創建。

SQL> grant create session,resource to xff;

授權成功。

3.創建cache管理用戶

creates and maintains Oracle objects that store information used to manage cache grids and enforce predefined behaviors of particular cache group types.

SQL> CREATE USER cacheuser IDENTIFIED BY oracle

2 DEFAULT TABLESPACE cachetblsp QUOTA UNLIMITED ON cachetblsp;

用戶已創建。

SQL> @grantCacheAdminPrivileges "cacheuser"

Please enter the administrator user id

The value chosen for administrator user id is cacheuser

***************** Initialization for cache admin begins ******************

0. Granting the CREATE SESSION privilege to CACHEUSER

1. Granting the TT_CACHE_ADMIN_ROLE to CACHEUSER

2. Granting the DBMS_LOCK package privilege to CACHEUSER

3. Granting the RESOURCE privilege to CACHEUSER

4. Granting the CREATE PROCEDURE privilege to CACHEUSER

5. Granting the CREATE ANY TRIGGER privilege to CACHEUSER

6. Granting the DBMS_LOB package privilege to CACHEUSER

7. Granting the SELECT on SYS.ALL_OBJECTS privilege to CACHEUSER

8. Granting the SELECT on SYS.ALL_SYNONYMS privilege to CACHEUSER

9. Checking if the cache administrator user has permissions on the default

tablespace

Permission exists

11. Granting the CREATE ANY TYPE privilege to CACHEUSER

********* Initialization for cache admin user done successfully *********

二、TimesTen創建相關用戶

1.cache管理用戶

A cache manager user performs cache grid and cache group operations. The TimesTen cache manager user must have the same name as an Oracle user that can access the cached Oracle tables.

Command> CREATE USER cacheuser IDENTIFIED BY timesten;

User created.

Command> GRANT CREATE SESSION, CACHE_MANAGER, CREATE ANY TABLE TO cacheuser;

2.cache對應用戶

You must create a TimesTen cache table user with the same name as an Oracle schema user for each schema user who owns or will own Oracle tables to be cached in the TimesTen database

Command> create user xff identified by timesten;

User created.

三、配置DSN

Data Store Path + Name: E:\oracle\timesten\mytt_db\data

Permanent Data Size: 64

Oracle Net Service Name: XFF

Database Character Set: ZHS16GBK

四、在TT中設置cache管理用戶名和密碼

ttIsql "DSN=my_ttdb;UID=cacheuser;PWD=timesten;OraclePWD=oracle"

Command> call ttCacheUidPwdSet('cacheuser','oracle');

Warning 5183: Function kollglid2 was not in the library. The function will not

be called.

Warning 5183: Function kollgsnp2 was not in the library. The function will not

be called.

Warning 5186: The OCI client library in use does not contain required routines

to support caching LOBS from Oracle.

--第一次調用相關函數因為沒有編譯出錯,再次調用即可

Command> call ttCacheUidPwdSet('cacheuser','oracle');

五、創建測試表(Oracle db中)

SQL> CREATE TABLE readtab (keyval NUMBER NOT NULL PRIMARY KEY, str VARCHAR2(32));

表已創建。

SQL> CREATE TABLE writetab (pk NUMBER NOT NULL PRIMARY KEY, attr VARCHAR2(40));

表已創建。

SQL> INSERT INTO readtab VALUES (1, 'Hello');

已創建 1 行。

SQL> INSERT INTO readtab VALUES (2, 'World');

已創建 1 行。

SQL> INSERT INTO writetab VALUES (100, 'oracle研究中心');

已創建 1 行。

SQL> INSERT INTO writetab VALUES (101, 'WWW.oracleplus.net');

已創建 1 行。

SQL> COMMIT;

提交完成。

SQL> GRANT SELECT ON readtab TO cacheuser;

授權成功。

SQL> GRANT SELECT ON writetab TO cacheuser;

授權成功。

SQL> GRANT INSERT ON writetab TO cacheuser;

授權成功。

SQL> GRANT UPDATE ON writetab TO cacheuser;

授權成功。

SQL> GRANT DELETE ON writetab TO cacheuser;

授權成功。

六、TimesTen相關配置

1.創建cache grid

Command> call ttGridCreate('myGrid');

Command> call ttGridNameSet('myGrid');

2.Start the cache agent

Command> call ttCacheStart;

3.創建cache group

Command> call ttCacheStart;

Command> CREATE READONLY CACHE GROUP readcache

> AUTOREFRESH INTERVAL 5 SECONDS

> FROM XFF.readtab

> (keyval NUMBER NOT NULL PRIMARY KEY, str VARCHAR2(32));

Command> CREATE DYNAMIC ASYNCHRONOUS WRITETHROUGH CACHE GROUP writecache

> FROM XFF.writetab

> (pk NUMBER NOT NULL PRIMARY KEY, attr VARCHAR2(40));

Command> cachegroups;

Cache Group CACHEUSER.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: XFF.READTAB

Table Type: Read Only

Cache Group CACHEUSER.WRITECACHE:

Cache Group Type: Asynchronous Writethrough (Dynamic)

Autorefresh: No

Aging: LRU on

Root Table: XFF.WRITETAB

Table Type: Propagate

2 cache groups found.

4.Start the replication agent for the AWT cache group

Command> call ttRepStart;

5.Manually load the cache group

Command> LOAD CACHE GROUP readcache COMMIT EVERY 256 ROWS;

2 cache instances affected.

Command> LOAD CACHE GROUP writecache COMMIT EVERY 256 ROWS;

2 cache instances affected.

七、TT授權

主要是為了直接在cacheuser中操作方便,無其他應意義

ttisql my_ttdb

Command> GRANT SELECT ON xff.readtab TO cacheuser;

Command> GRANT SELECT ON xff.writetab TO cacheuser;

Command> GRANT UPDATE ON xff.writetab TO cacheuser;

Command> GRANT DELETE ON xff.writetab TO cacheuser;

Command> GRANT INSERT ON xff.writetab TO cacheuser;

八、相關測試

1.測試READTAB表

Command> SELECT * FROM XFF.READTAB;

< 1, Hello >

< 2, World >

2 rows found.

SQL> INSERT INTO readtab VALUES (3, 'Welcome');

已創建 1 行。

SQL> commit;

提交完成。

Command> SELECT * FROM XFF.READTAB;

< 1, Hello >

< 2, World >

< 3, Welcome >

3 rows found.

SQL> update readtab set str='www.oracle研究中心';

已更新3行。

SQL> commit;

提交完成。

Command> SELECT * FROM XFF.READTAB;

< 1, www.oracle研究中心 >

< 2, www.oracle研究中心 >

< 3, www.oracle研究中心 >

3 rows found.

SQL> delete from readtab where keyval=3;

已刪除 1 行。

SQL> commit;

提交完成。

Command> SELECT * FROM XFF.READTAB;

< 1, www.oracle研究中心 >

< 2, www.oracle研究中心 >

2 rows found.

2.測試WRITETAB表

Command> SELECT * FROM XFF.writeTAB;

< 100, oracle研究中心 >

< 101, WWW.oracleplus.net >

2 rows found.

Command> update xff.writetab set attr='www.oracleplus.net' where pk=100;

1 row updated.

Command> commit;

SQL> select * from writetab;

PK ATTR

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

100 www.oracleplus.net

101 WWW.oracleplus.net

Command> insert into xff.writetab values(102,'oracle研究中心');

1 row inserted.

Command> commit;

SQL> select * from writetab;

PK ATTR

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

102 oracle研究中心

100 www.oracleplus.net

101 WWW.oracleplus.net

--------------------------------------ORACLE-DBA----------------------------------------

最權威、專業的Oracle案例資源匯總之學習筆記:通過案例深入學習In-Memory Database Cache 總結配置過程

總結

以上是生活随笔為你收集整理的oracle 百万记录 cache,学习笔记:通过案例深入学习In-Memory Database Cache 总结配置过程...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。