mysql inmemory_Oracle 12c启用inmemory特性

一、为数据库启用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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值