如何驗證/啟用記憶體資料庫配置? (文件 ID 2178918.1)
適用於:
Oracle Database - Enterprise Edition - 版本 12.1.0.2 和更高版本本文件所含資訊適用於所有平臺
目標
如何驗證/啟用記憶體資料庫配置?
解決方案
檢查資料庫的版本是 12.1.0.2:
BANNER CON_ID
-------------------------------------------------------------------------------- ----------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 0
PL/SQL Release 12.1.0.2.0 - Production 0
CORE 12.1.0.2.0 Production 0
TNS for Linux: Version 12.1.0.2.0 - Production 0
NLSRTL Version 12.1.0.2.0 - Production 0
inmemory_size 的設定應大於0
在設定 inmemory_size 引數之前先檢查:
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
inmemory_clause_default string
inmemory_force string DEFAULT
inmemory_max_populate_servers integer 0
inmemory_query string ENABLE
inmemory_size big integer 0
inmemory_trickle_repopulate_servers_ integer 1
percent
optimizer_inmemory_aware boolean TRUE
SQL> select name, value from v$sga;
NAME VALUE
-------------------- ----------
Fixed Size 2927336
Variable Size 201327896
Database Buffers 402653184
Redo Buffers 5459968
配置資料庫引數:
System altered.
設定 inmemory_size 引數後(需要重新啟動資料庫讓引數生效)
SQL> show parameter inmemory
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
inmemory_clause_default string
inmemory_force string DEFAULT
inmemory_max_populate_servers integer 2
inmemory_query string ENABLE
inmemory_size big integer 200M
inmemory_trickle_repopulate_servers_ integer 1
percent
optimizer_inmemory_aware boolean TRUE
SQL> select name, value from v$sga;
NAME VALUE
-------------------- ----------
Fixed Size 2927336
Variable Size 264242456
Database Buffers 130023424
Redo Buffers 5459968
In-Memory Area 209715200
5 rows selected.
使用 SH 使用者進行測試
SQL> conn sh/oracle
Connected.
放置表到記憶體之前先檢查:
SQL> SELECT table_name,
inmemory,
inmemory_priority,
inmemory_distribute,
inmemory_compression,
inmemory_duplicate
FROM user_tables
WHERE table_name='CUSTOMERS';
TABLE_NAME INMEMORY INMEMORY INMEMORY_DISTRI INMEMORY_COMPRESS INMEMORY_DUPL
------------------------------ -------- -------- --------------- ----------------- -------------
CUSTOMERS DISABLED
1 row selected.
SQL> select pool, alloc_bytes, used_bytes, populate_status from v$inmemory_area;
POOL ALLOC_BYTES USED_BYTES POPULATE_STATUS
-------------------------- ----------- ---------- --------------------------
1MB POOL 0 0 OUT OF MEMORY
64KB POOL 0 0 OUT OF MEMORY
SQL> select owner, segment_name, populate_status from v$im_segments;
no rows selected
放置表到記憶體的命令:
SQL> alter table CUSTOMERS inmemory;
Table altered.
放置表到記憶體以後,檢查:
SQL> SELECT cust_valid, Count(*)
FROM customers
GROUP BY cust_valid; 2 3
C COUNT(*)
- ----------
I 44879
A 10621
2 rows selected.
SQL> SELECT table_name,
inmemory,
inmemory_priority,
inmemory_distribute,
inmemory_compression,
inmemory_duplicate
FROM user_tables
WHERE table_name='CUSTOMERS';
TABLE_NAME INMEMORY INMEMORY INMEMORY_DISTRI INMEMORY_COMPRESS INMEMORY_DUPL
------------------------------ -------- -------- --------------- ----------------- -------------
CUSTOMERS ENABLED NONE AUTO FOR QUERY LOW NO DUPLICATE
1 row selected.
SQL> select owner, segment_name, populate_status from v$im_segments;
OWNER SEGMENT_NAME POPULATE_
------------------------- ------------------------- ---------
SH CUSTOMERS COMPLETED
1 row selected.
SQL> select pool, alloc_bytes, used_bytes, populate_status from v$inmemory_area;
POOL ALLOC_BYTES USED_BYTES POPULATE_STATUS
-------------------------- ----------- ---------- --------------------------
1MB POOL 166723584 4194304 DONE
64KB POOL 25165824 131072 DONE
2 rows selected.
驗證使用的執行計劃:
SQL> set autotrace traceonly;
SQL> SELECT cust_valid, Count(*)
FROM customers
GROUP BY cust_valid;
2 rows selected.
Execution Plan
----------------------------------------------------------
Plan hash value: 1577413243
-----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2 | 4 | 28 (11)| 00:00:01 |
| 1 | HASH GROUP BY | | 2 | 4 | 28 (11)| 00:00:01 |
| 2 | TABLE ACCESS INMEMORY FULL| CUSTOMERS | 55500 | 108K| 26 (4)| 00:00:01 |
-----------------------------------------------------------------------------------------
Statistics
----------------------------------------------------------
249 recursive calls
0 db block gets
273 consistent gets
5 physical reads
0 redo size
676 bytes sent via SQL*Net to client
552 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
17 sorts (memory)
0 sorts (disk)
2 rows processed
功能使用情況的統計資料將在資料庫建立的7天后生成,否則將只返回2行。雖然解釋計劃可能會顯示’IN MEMORY FULL’,最終的執行可能會也可能不會使用 IN-Memory。如果表沒有被生成到列儲存裡(沒有足夠的空間,第一次訪問等),此時將會使用 Buffer Cache。可以使用 SQL Monitor 或日誌跟蹤來實際確認它的使用情況。
from dba_feature_usage_statistics u1
where version=(select max(version)
from dba_feature_usage_statistics u2
where u2.name=u1.name and u1.name like 'In-%')
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31393455/viewspace-2129698/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何配置oracle資料庫伺服器的記憶體Oracle資料庫伺服器記憶體
- 【大頁記憶體】Oracle資料庫配置大頁記憶體記憶體Oracle資料庫
- 記憶體資料庫如何發揮記憶體優勢?記憶體資料庫
- 在可插拔資料庫上如何監控程式記憶體的使用 (文件 ID 1985042.1)資料庫記憶體
- 在資料庫中如何驗證 In-Memory 選項的使用 (文件 ID 2178917.1)資料庫
- 記憶體資料庫記憶體資料庫
- 如何檢視MySQL資料庫佔多大記憶體,佔用太多記憶體怎麼辦?MySql資料庫記憶體
- Mongodb記憶體資料庫MongoDB記憶體資料庫
- 記憶體資料庫有幾個人用過?記憶體資料庫
- 如何讓NoSQL記憶體資料庫適合企業級應用SQL記憶體資料庫
- 【記憶體資料庫】TimesTen記憶體資料庫
- [android]記憶體分析相關文件Android記憶體
- 採用java連結timesten記憶體資料庫Java記憶體資料庫
- Python記憶體資料庫/引擎Python記憶體資料庫
- 構建個人記憶體資料庫記憶體資料庫
- 如何在redhat5為oracle啟用及配置hugepage大頁記憶體RedhatOracle記憶體
- Aerospike 分散式記憶體資料庫 筆記ROS分散式記憶體資料庫筆記
- 11g rman validate驗證資料庫資料庫
- Oracle - 資料庫的記憶體結構Oracle資料庫記憶體
- Oracle - 資料庫的記憶體調整Oracle資料庫記憶體
- 瀚高資料庫記憶體結構資料庫記憶體
- 記憶體資料庫發展歷程記憶體資料庫
- 記憶體資料庫快取介紹記憶體資料庫快取
- 主要測試記憶體和資料庫記憶體資料庫
- 記憶體資料庫TimesTen介紹記憶體資料庫
- 合理配置TimesTen記憶體資料庫Hash索引的PAGES引數記憶體資料庫索引
- 如何驗證Oracle資料庫中表的型別Oracle資料庫型別
- LINUX HUGEPAGES在大記憶體資料庫中的應用Linux記憶體資料庫
- 磁碟資料庫與記憶體資料庫的特點比較資料庫記憶體
- 資料庫實現原理#6(共享記憶體)資料庫記憶體
- 南大通用極速記憶體資料庫記憶體資料庫
- SQL Server 記憶體資料庫原理解析SQLServer記憶體資料庫
- oracle資料庫記憶體分配(sga和pga)Oracle資料庫記憶體
- AIX 下oracle 資料庫記憶體優化AIOracle資料庫記憶體優化
- Oralce記憶體資料庫TimesTen簡介記憶體資料庫
- 共享記憶體段未釋放導致資料庫記憶體被耗盡記憶體資料庫
- SQL Server資料庫佔用記憶體過多的解決方法SQLServer資料庫記憶體
- 為SQL Server啟用AWE記憶體SQLServer記憶體