ITPub博客

首页 > 数据库 > Oracle > Oracle 12c启用inmemory特性

Oracle 12c启用inmemory特性

原创 Oracle 作者:parknkjun 时间:2015-04-13 17:13:16 0 删除 编辑
一、为数据库启用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博客 ” ,链接:https://blog.itpub.net/10271187/viewspace-1572155/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
DBA攻城狮

注册时间:2008-02-11

  • 博文量
    115
  • 访问量
    625447