关于DB In-Memory Option你必须知道的17个问题

本文详细解读了OracleDatabaseIn-Memory选件的发布细节,包括其发布时间、价格、与现有技术的区别、性能提升、内存数据库引擎、与Exalytics的关系、与Exadata的区别、功能影响、高可用性、内存规划、RAC环境下的配置以及对不同业务类型的影响。此外,文章还探讨了OracleDatabaseIn-Memory选件在高可用性上的表现、内存需求规划和在RAC环境中的工作机制。

Oracle数据库内存(Oracle Database In-Memory)选件于美国时间610日发布。根据甲骨文中国的报道,选件进一步增强了Oracle数据库12c的威力,而且可以透明运行,使企业能够实时发现深度商业信息,提高交易性能。凭借Oracle数据库内存选件,用户可以即刻得到业务问题的答案,这在以前则需要数小时时间。此外,用户还能够为内部及外部人员提供更快、更好的体验。


下面是云和恩墨专家张乐奕第一时间对于选件的
17个重点解析:

1Oracle Database In-Memory选件什么时候能够发布?
该选件将包含在Oracle Database 12c的第一个Pacthset12.1.0.2)中一起发布。


2
、价格如何?

价格会在发布日的时候决定。


3
、新的Oracle Database In-Memory选件是否会替代In-MemoryDatabase Cache(就是TimesTen技术)选件?

当然不,完全不一样的应用场景。In-Memory Database Cache是在应用程序层通过TimesTen来管理的内存性质的数据库,这是为了让OLTP应用享受到对于存储在Oracle数据库中一部分表的超低延迟访问而设计的。


4
Oracle Database In-Memory选件是否会替代TimesTen

当然不。像上面所说,TimesTen通常是部署在应用层的,可能是作为一个独立的数据库,也可能是作为在Oracle数据库前面的In-Memory Database CacheTimesTen提供的是超低延迟数据访问,由此提供了极速的响应时间。由此受益的OLTP系统通常不会创建用于报表应用的索引,也因此通常无法从数据库层的Oracle Database In-Memory选件中获得多少性能提升。


5
Oracle Database In-Memory选件是否会替代Exalytics

当然不。并不是所有客户都需要在他们的系统中拥有强力的分析能力,而ExalyticsOracle的一体化策略分析平台。它提供了丰富的分析工具和可视化工具,以及大量的标准报表、预测分析、数据发现,是为了最优化地运行BIEPM工作的平台,是对数据库层的补充而不是竞争。 Exalytics也不仅仅是针对Oracle Database 12c的,它可以处理多种数据源,包括TeradataOracle database 11gSAP Netweaver等。


6
、那么在Exalytics中使用的是什么关系型内存数据库引擎呢?

Exalytics使用的是TimesTen In-MemoryDatabase for Exalytics。在TimesTen产品发展路线图中也包含着跟Oracle Database In-Memory选件相类似的列式存储技术,而且是使用的相同的底层列式处理架构。这项技术计划在2014年跟Oracle Database In-Memory选件一起在相同的时间窗口发布。实际上,TimesTenOracleDatabaseIn-Memory选件在Oracle公司内部是由同一个小组来开发的,共享相同的创新技术以及底层架构。


7
、那么在Exalytics中使用的内存数据库引擎在未来会变成Oracle Database In-Memory选件吗?

没有这个计划。Oracle期望TimesTen会持续研发。


8
Oracle Database In-Memory选件是否会替代Exadata

当然不。这个问题太幼稚,就不做解释了。


9
、好吧,那到底什么是Oracle Database In-Memory选件呢?

这是一项新的技术,内置在Oracle数据库中,通过内存中的列式存储数据来获得超快的数据处理能力。


10
、当使用Oracle Database In-Memory时,数据库的大小受限于服务器中的可用内存容量吗?

不。由用户来决定哪些对象会存在In-Memory列式缓存中。如果一张表太大了,无法完全缓存在In-Memory列存中,Oracle会尝试将尽可能多的数据保持在内存中(以列的形式),剩下的仍然存储在闪存或者磁盘中(以原来行的形式),这样的操作非常高效并且是完全透明的。你可以有选择性的定义一部分数据库,比如将热表、热分区、经常访问的列放入内存中。这就让除了Oracle原有的那些跨越内存、闪存、磁盘的各种优化方式之外,Oracle Database In-Memory选件还能够专门为频繁访问的业务关键数据提供帮助。当然,如果数据库足够小,全部表都能使用Oracle Database In-Memory选件。


11
Oracle Database In-Memory选件只会对分析/报表类业务有帮助吗?

虽然确实分析/报表类业务能够从列式存储中获得最多的收益,但是其他类型业务也同样能够受益。比如通过减少需要的索引,就能够加速OLTP业务。通常在以前的混合负载业务中需要在表上创建很多的多字段索引来支撑报表类型的查询,如今In-Memory列存则对DML操作造成更少的影响,而又可以提供相同的查询性能。减少索引还能够带来优化和管理的简便,DBA不再需要去rebuild那些碎片化的索引,也不再需要去研究为什么优化器选择了错误的索引。


12
、从Oracle Database In-Memory功能中能够期望获得多少性能提升?

使用该选项能够为多种查询负载提供显著的性能提升。从一个非常简单的星型查询到一个非常复杂的具有多个子查询的SQL,就算所有的的表都在内存中,In-Memory列式缓存仍然会胜过普通的Buffer Cache。比如说,In-Memory列存在查询很少列上的很多行时,会提供极高的性能,通常这类查询都是分析类的查询,在这类查询上使用In-Memory列存和使用普通缓存(Buffer Cache)相比,有超过100倍的性能提升。


13
、当使用Oracle Database In-Memory选件的时候,我该对索引做些什么吗?

你可以保留以前的所有索引,就像以前那样运行你的应用。Oracle优化器完全能够感知到内存中的列式数据,只有当确认使用这些列式数据会有性能提升的时候才会使用到,如果优化器认为从索引访问中能够获得更好的性能,那么就会自动去读取普通缓存(Buffer Cache)中的数据,就跟以前一样。不过,如果将一些多列索引设置为invisible,引导Oracle优化器更多地去选择列式缓存,可能会带来额外的速度提升。然后,你可以删除掉这些无用的索引,这样又能带来进一步的性能提升,因为Oracle数据库需要维护的索引更少了。


14
、如果使用Oracle Database In-Memory选项,数据库现在的功能会受影响吗?

没有任何一项现有的Oracle数据库功能会受到Oracle Database In-Memory选项的限制;很多操作还能在性能上获得显著提升;一些原本为了提高性能所做的操作(比如创建索引)会变得不再重要;安全性、高可用性以及其它的所有功能都跟以前一模一样,完全不受影响。当然在DML操作上会有一些额外消耗,因为In-Memory列存要时刻跟表数据保持同步,但是这部分列存是完全在内存中的,所以不需要额外的Logging操作。


15
Oracle Database In-Memory选项在高可用性上跟其它厂商的内存数据库相比如何?

因为In-Memory列存并没有给Oracle数据库施加任何限制,因此在高可用性上可以享受Oracle数据库完整的丰富的高可用解决方案,而其它厂商的高可用性均不太完备。


16
、如何规划In-Memory列存所需要的内存大小?

In-Memory Area(用于保存In-Memory列存的内存区域)是SGA中的一块新的缓存池,该缓存大小由初始化参数INMEMORY_SIZE指定,如果一旦设定,最小是100MB。因为In-Memory AreaSGA的一部分,因此其最大大小受制于分配了其它所有内存池之后的SGA中的剩余空间。INMEMORY_SIZE默认是0,也就是不启用Oracle Database In-Memory选项。 由于In-Memory Area是一块静态区域,所以不会被自动内存管理算法所影响。 如果想要修改In-MemoryArea的大小,需要重启数据库实例,在RAC数据库中,可以在各实例的内存中复制In-Memory列存,因此可以通过重启节点的方式来最小化对应用的影响。


17
、在RAC环境中,是否In-Memory列存是在集群的所有节点中完全镜像的?

RAC环境中,用户可以自行设定使用以下三种选项中的任何一种: 1. 在所有实例的内存中镜像相同的表数据。这样每个实例都会读取自己的本地内存,通常这用于较小的表。 2. 表数据分布在所有实例的内存中。这样每个实例内存中只会保存表中的一部分数据,没有冗余复制。 3. 表数据分布在所有实例的内存中,并且为高可用性保留2份镜像。这种工作机制很像ASM的条带化和冗余性。

17:19:18 INTROSPECTION INIT: Product: IntelliJ IDEA 2024.1 Project: huacai-blog DBMS: MySQL Accessibility matcher: none Connection bounds: null 17:19:18 Given model is accepted 17:19:18 Introspection scope is specified explicitly, but it is the same as the data source's one: Pattern: kind: schema name: `@`, `blog` 17:19:18 Introspector version: 0 17:19:18 Executing query: -- 8< -- select database() -- >8 -- 17:19:18 execution time: 2 ms fetching time: 3 ms 17:19:18 Attached to database DBMS: MySQL Server version: 5.7.21 Driver version: 8.2 17:19:18 Memory: 859 M available from allocated 1640 M (max 4048 M) 17:19:18 Executing query: -- 8< -- select @@event_scheduler -- >8 -- 17:19:18 execution time: 2 ms fetching time: 3 ms 17:19:18 Connection-related state is initialized. The parameters map: empty map 17:19:18 Detaching from DB 17:19:18 Memory: 856 M available from allocated 1640 M (max 4048 M) 17:19:18 Query Performance Statistics: -------------------------------------------------------------------------------------------------------------------------------------------- ## count err T.min T.avg T.max T.sum % rows packs Query -------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------- Total duration of all queries: 0.000 s. 17:19:18 Dropping the info 17:19:18 Attached to database DBMS: MySQL Server version: 5.7.21 Driver version: 8.2 17:19:18 Memory: 856 M available from allocated 1640 M (max 4048 M) 17:19:18 Executing query: -- 8< -- select @@event_scheduler -- >8 -- 17:19:18 execution time: 1 ms fetching time: 2 ms 17:19:18 Connection-related state is initialized. The parameters map: empty map 17:19:18 ==================================================== REQUEST WITH 1 INTROSPECTION TASKS ==================================================== 17:19:18 Requested tasks: Introspect schema blog in the database 17:19:18 =============================================== DOING A TASK [1/1]: SchemasIntrospectionTask =============================================== 17:19:18 Task description: Introspect schema blog in the database 17:19:18 Retrieving server info 17:19:18 Executing query: -- 8< -- select @@default_storage_engine, @@default_tmp_storage_engine -- >8 -- 17:19:18 execution time: 2 ms fetching time: 1 ms 17:19:18 Executing query: -- 8< -- select table_name from information_schema.tables where lower(table_schema) = 'information_schema' and lower(table_name) = 'parameters' -- >8 -- 17:19:18 execution time: 6 ms fetching time: 1 ms 17:19:18 Retrieving session info 17:19:18 ---------------------------------------------------------- SCHEMA RETRIEVER: blog ---------------------------------------------------------- 17:19:18 Schema has children: true Incremental is possible: false Asked mode: null Decided mode: FULL 17:19:18 Configuration info: - schema id: no - schema has children: yes - mode: FULL - with sources: yes 17:19:18 Families before introspection: - table: 48 17:19:18 Retrieving tables and views 17:19:18 Executing query: -- 8< -- select table_name, table_type, table_comment, engine, table_collation, create_options from information_schema.tables where table_schema = ? -- >8 -- 17:19:18 execution time: 3 ms fetching time: 3 ms 17:19:18 Retrieving columns 17:19:18 Executing query: -- 8< -- select ordinal_position, column_name, column_type, column_default, generation_expression, table_name, column_comment, is_nullable, extra, collation_name from information_schema.columns where table_schema = ? order by table_name, ordinal_position -- >8 -- 17:19:18 execution time: 8 ms fetching time: 5 ms 17:19:18 Executing query: -- 8< -- select table_name, auto_increment from information_schema.tables where table_schema = ? and auto_increment is not null -- >8 -- 17:19:18 execution time: 106 ms fetching time: 4 ms 17:19:18 Retrieving indices 17:19:18 Executing query: -- 8< -- select table_name, index_name, index_comment, index_type, non_unique, column_name, sub_part, collation, null expression from information_schema.statistics where table_schema = ? and index_schema = ? order by index_schema, table_name, index_name, index_type, seq_in_index -- >8 -- 17:19:18 execution time: 2 ms fetching time: 4 ms 17:19:18 Retrieving constraints 17:19:18 Executing query: -- 8< -- select c.constraint_name, c.constraint_schema, c.table_name, c.constraint_type, false enforced from information_schema.table_constraints c where c.table_schema = ? -- >8 -- 17:19:18 execution time: 2 ms fetching time: 3 ms 17:19:18 Executing query: -- 8< -- select r.constraint_name, null table_name, r.match_option, r.update_rule, r.delete_rule from information_schema.referential_constraints r where r.constraint_schema = ? -- >8 -- 17:19:18 execution time: 2 ms fetching time: 1 ms 17:19:18 Retrieving constraint columns 17:19:18 Executing query: -- 8< -- select constraint_name, table_name, column_name, referenced_table_schema, referenced_table_name, referenced_column_name from information_schema.key_column_usage where table_schema = ? and referenced_column_name is not null order by table_name , constraint_name , ordinal_position -- >8 -- 17:19:18 execution time: 3 ms fetching time: 3 ms 17:19:18 Retrieving partitions 17:19:18 Executing query: -- 8< -- select table_name, partition_name, subpartition_name, partition_ordinal_position, subpartition_ordinal_position, partition_method, subpartition_method, partition_expression, subpartition_expression, partition_description, partition_comment/*, tablespace_name*/ from information_schema.partitions where partition_name is not null and table_schema = ? -- >8 -- 17:19:18 execution time: 98 ms fetching time: 1 ms 17:19:18 Retrieving triggers 17:19:18 Executing query: -- 8< -- select trigger_name, event_object_table, event_manipulation, action_timing, definer from information_schema.triggers where trigger_schema = ? -- >8 -- 17:19:18 execution time: 9 ms fetching time: 2 ms 17:19:18 Retrieving scheduled events 17:19:18 Retrieving routines 17:19:18 Executing query: -- 8< -- select routine_name, routine_type, routine_definition, routine_comment, dtd_identifier, definer, is_deterministic = 'YES' is_deterministic, cast(sql_data_access as char(1)) sql_data_access, cast(security_type as char(1)) security_type from information_schema.routines where routine_schema = ? -- >8 -- 17:19:18 execution time: 4 ms fetching time: 1 ms 17:19:18 Retrieving routine permissions 17:19:18 Executing query: -- 8< -- select Host, User, Routine_name, Proc_priv, Routine_type = 'PROCEDURE' as is_proc from mysql.procs_priv where Db = ?; -- >8 -- 17:19:18 execution time: 1 ms fetching time: 2 ms 17:19:18 Retrieving column permissions 17:19:18 Executing query: -- 8< -- select grantee, table_name, column_name, privilege_type, is_grantable from information_schema.column_privileges where table_schema = ? union all select grantee, table_name, '' column_name, privilege_type, is_grantable from information_schema.table_privileges where table_schema = ? order by table_name, grantee, privilege_type -- >8 -- 17:19:18 execution time: 1 ms fetching time: 1 ms 17:19:18 Retrieving arguments 17:19:18 Executing query: -- 8< -- select specific_name, ordinal_position, parameter_name, parameter_mode, dtd_identifier from information_schema.parameters where specific_schema = ? and ordinal_position > 0 order by specific_name, ordinal_position -- >8 -- 17:19:18 execution time: 2 ms fetching time: 1 ms 17:19:18 Retrieving view sources 17:19:18 Executing query: -- 8< -- select table_name, view_definition, definer from information_schema.views where table_schema = ? -- >8 -- 17:19:18 execution time: 3 ms fetching time: 2 ms 17:19:18 Retrieving routine sources 17:19:18 Retrieving routine sources (circumventing MySQL bugs) 17:19:18 Retrieving trigger sources 17:19:18 Retrieving trigger sources (circumventing MySQL bugs) 17:19:18 Retrieving event sources 17:19:18 Retrieving event sources (circumventing MySQL bugs) 17:19:18 Status details: Finishing retrieving the schema blog 17:19:18 No deferred tasks to process. 17:19:18 Detaching from DB 17:19:18 Memory: 844 M available from allocated 1640 M (max 4048 M) 17:19:18 Query Performance Statistics: -------------------------------------------------------------------------------------------------------------------------------------------- ## count err T.min T.avg T.max T.sum % rows packs Query -------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------- Total duration of all queries: 0.000 s. 17:19:18 Dropping the info 17:19:18 Metrics: ================================== Operation Cnt Min Avg Max Sum ---------------------------------- ---------------------------------- Total: 0.000
最新发布
09-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值