Oracle 12c啟用inmemory特性

parknkjun發表於2015-04-13
一、為資料庫啟用IM column store,需要完成以下步驟:
1、資料庫版本需12.1.0.2以上;
2、設定INMEMORY_SIZE初始化引數為非0值(最小要求100M);
3、重啟資料庫;
二、檢查資料庫哪些物件使用了inmemory,使用如下語句:
SELECT OWNER, SEGMENT_NAME, INMEMORY_PRIORITY, INMEMORY_COMPRESSION FROM V$IM_SEGMENTS;
三、檢視資料庫版本:
SQL> select * from v$version;

BANNER                                                           CON_ID
------------------------------------------------------------ ----------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 -           0
64bit Production


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
四、啟用IN-MEMORY特性
SQL> show parameter inmemory

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> alter system set inmemory_size=200M scope=spfile;
System altered.
SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1027604480 bytes
Fixed Size                  2932096 bytes
Variable Size             738198144 bytes
Database Buffers           71303168 bytes
Redo Buffers                5455872 bytes
In-Memory Area            209715200 bytes =========》多了In-Memory Area
Database mounted.
Database opened.

SQL> show parameter inmemory 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
inmemory_clause_default              string
inmemory_force                       string      DEFAULT
inmemory_max_populate_servers        integer     1
inmemory_query                       string      ENABLE
inmemory_size                        big integer 200M
inmemory_trickle_repopulate_servers_ integer     1
percent
optimizer_inmemory_aware             boolean     TRUE

五、建立測試表
SQL> create table test_inmem(
  2  id number(5) primary key,
  3  test_col varchar2(15));
Table created.
注:SYS,SYSTEM,SYSAUX使用者下的物件無法使用IM column store特性。
SQL> select TABLE_NAME,INMEMORY_PRIORITY,INMEMORY_DISTRIBUTE,INMEMORY_COMPRESSION from user_tables;


TABLE_NAME                     INMEMORY INMEMORY_DISTRI INMEMORY_COMPRESS
------------------------------ -------- --------------- -----------------
TEST_INMEM


SQL> alter table test_inmem inmemory;
Table altered

SQL> select TABLE_NAME,INMEMORY_PRIORITY,INMEMORY_DISTRIBUTE,INMEMORY_COMPRESSION from user_tables;

TABLE_NAME                     INMEMORY INMEMORY_DISTRI INMEMORY_COMPRESS
------------------------------ -------- --------------- -----------------
TEST_INMEM                     NONE     AUTO            FOR QUERY LOW








來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10271187/viewspace-1572155/,如需轉載,請註明出處,否則將追究法律責任。

相關文章