1 说明
In-Memory Column Store allows objects (for example, tables, partitions, and subpartitions) to be populated in-memory in a compressed columnar format. Until now, the columnar format has only been available in-memory. That meant that after a database restart, the In-Memory Column Store would have to be populated from scratch using a multiple step process that converts traditional row formatted data into the compressed columnar format and placed in-memory. In-Memory FastStart enables data to be repopulated into the In-Memory Column Store at a much faster rate than previously possible by saving a copy of the data currently populated in the In-Memory Column Store on disk in its compressed columnar format.
IM中的数据,在数据库重启之后需要重新加载到数据库中,通过保存IM中对象的备份文件到磁盘上大大加快加载速度,从而缩短打开数据库时间。
In-Memory FastStart significantly reduces the time it takes to repopulate data into the In-Memory Column Store after a system restart. This allows businesses to start taking advantage of the analytic query performance benefits of accessing data in a columnar format much sooner than before.
多租户环境下,所有PDB都共享一个FastStart区域和一个FastStart表空间。在RAC环境下,所有节点共享同一份FastStart数据。
通过DBMS_INMEMORY_ADMIN.FASTSTART_ENABLE存储过程启用一个FastStart表空间,Space Management Worker Processes (Wnnn)会创建一个空的SecureFiles LOB,叫SYSDBinstance_name_LOBSEG$。
注意:该表空间不需要DBA来维护,Oracle自动维护。
Oracle按以下规则来自动管理FastStart区域:
- Whenever population or repopulation of an object occurs, the database writes its columnar data to the FastStart area.
- If you define an ADO policy on a segment, then the database manages the segment in the FastStart area based on the rule in the policy. For example, if ADO specifies that an object changes its attribute to NO INMEMORY based on a policy, then the IM column store removes its data from the FastStart area.
- If the attribute of a populated object is changed to NOINMEMORY, then the database automatically removes its IMCUs from the FastStart area.
- If the FastStart tablespace runs out of space, then the database uses an internal algorithm to drop the oldest segments, and continues writing to the FastStart area. If no space remains, then the database stops writing to the FastStart area.
图1 表示FastStart Area
1.1 启用IM FastStart条件
- The tablespace that will be designated as the FastStart area must exist.
- This tablespace must have enough space to store data for the IM column store, and it must not contain any other data before you designate it as the FastStart area. Oracle recommends that you create the FastStart tablespace with twice the size of the INMEMORY_SIZE setting.
- You must have administrator privileges.
2 实验
注意:下面所有操作都是PDB级别,或者是在non-CDB下进行。不要在CDB下进行。
2.1 创建FastStart表空间
2.2 启用IM FastStart
2.3 查看FastStart区域大小
2.4 查看FastStart logging模式
2.5 强行使IM列式存储重新插入所有IM中的对象
2.6 再次查看FastStart区域大小