Orcle 12c new features --- IM Quick Start

1 Description

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.

The IM data, after the restart of the database needs to be reloaded into the database, saving the backup file through IM object to disk much faster loading speed, thus shortening the time to open the database.

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.

Multi-tenant environment, all share a PDB FastStart FastStart area and a table space. In the RAC environment, all nodes share the same copy of FastStart data.

Enable FastStart a table space by DBMS_INMEMORY_ADMIN.FASTSTART_ENABLE stored procedures, Space Management Worker Processes (Wnnn) creates an empty SecureFiles LOB, called SYSDBinstance_name_LOBSEG $.

Note: The table space does not need to maintain DBA, Oracle maintained automatically.

Oracle the following rules to automatically manage FastStart area:

  • 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.

Figure 1 shows FastStart Area
Here Insert Picture Description

1.1 Enabling IM FastStart conditions

  1. The tablespace that will be designated as the FastStart area must exist.

  2. 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.

  3. You must have administrator privileges.

Experiment 2

Note: All the following operations are PDB level, or is in the non-CDB. Do not be under the CDB.

2.1 FastStart create table space

CREATE TABLESPACE fs_tbs
  DATAFILE '/u01/app/oracle/oradata/orcl/fs_tbs.dbf' SIZE 500M REUSE
  AUTOEXTEND ON NEXT 500K MAXSIZE 1G;

Tablespace created.

2.2 Enabling IM FastStart

SQL> EXEC DBMS_INMEMORY_ADMIN.FASTSTART_ENABLE('fs_tbs');

PL/SQL procedure successfully completed.

2.3 View FastStart area size

SQL> SELECT TABLESPACE_NAME, STATUS,
       ( (ALLOCATED_SIZE/1024) / 1024 ) AS ALLOC_MB,
       ( (USED_SIZE/1024) / 1024 ) AS USED_MB
FROM   V$INMEMORY_FASTSTART_AREA  2    3    4  
  5  ;

TABLESPACE_NAME STATUS	 ALLOC_MB    USED_MB
--------------- ----------------------- --------------------- ---------------
FS_TBS	ENABLE	    500  1

2.4 View FastStart logging mode

COL SEGMENT_NAME FORMAT a20
SELECT SEGMENT_NAME, LOGGING
FROM   DBA_LOBS
WHERE  TABLESPACE_NAME = 'FS_TBS';
SEGMENT_NAME	     LOGGING
-------------------- --------------
SYSDBIMFS_LOBSEG$    NO

2.5 IM force the columnar storage reinsert all objects in the IM

SQL> SELECT /*+ FULL(s) NO_PARALLEL(s) */ COUNT(*) FROM lei.bonus s;

  COUNT(*)
----------
27

SQL> SELECT /*+ FULL(s) NO_PARALLEL(s) */ COUNT(*) FROM lei.cndba s;

  COUNT(*)
----------
 1

2.6 FastStart again to see the size of the area

SQL> SELECT TABLESPACE_NAME, STATUS,
       ( (ALLOCATED_SIZE/1024) / 1024 ) AS ALLOC_MB,
       ( (USED_SIZE/1024) / 1024 ) AS USED_MB
FROM   V$INMEMORY_FASTSTART_AREA  2    3    4  
  5  ;
TABLESPACE_NAME STATUS	 ALLOC_MB    USED_MB
--------------- ----------------------- --------------------- ---------------
FS_TBS	ENABLE	    500     1.1875

For more information, refer to the official document:
http://docs.oracle.com/database/122/INMEM/managing-im-faststart-for-im-column-store.htm#INMEM-GUID-CAA790EA-0CF6-44A8- A332-3CE23EC0FE79

Guess you like

Origin blog.csdn.net/qianglei6077/article/details/92794935