1. Oracle12c heatmap and automatic data optimization
Information Lifecycle Management (ILM) refers to strategies for managing data during their lifecycle. Depending on the age of the data and business relevance to the application, the data can be compressed, archived or moved to low-cost storage. In short, the goal of ILM is to accomplish compressed or tiered storage, thus ensuring optimal utilization of space in an enterprise data center.
Oracle 11g ILM Assistant is sufficient to perform storage tiering and allow DBAs to migrate archive data from high-cost, high-performance storage to low-cost storage. Oracle 12c adds tiered compression and simplifies the overall implementation and, as a result, enhances the ILM approach.
2. Oracle Advanced Compression
Oracle Advanced Compression is a database option that allows data to be compressed at different levels, resulting in storage benefits. The different levels of compression are Basic, OLTP and Hybrid Columnar Compression (for query and archive). OLTP compression was introduced in Oracle11g R1 and reshaped as Advanced Row Compression in Oracle12c. Columnar compression technology is only used in engineered storage systems, namely Oracle Exadata Storage Server, ZFS and Pollar Axiom.
3. New features in Oracle 12c
Oracle 12c introduces two new features based on the ILM strategy, heat maps and automatic data optimization. The heatmap keeps track of the most recently modified information for each data block and segment. It also keeps track of when the segment was last read. The heatmap feature is controlled by the parameter heat_map, which is set to OFF by default. To enable heatmaps, set this parameter to ON.
Heatmaps capture all of this information in related dictionary views, namely [ALL | USER | DBA]HEAT_MAP_SEGMENT, [ALL | USER |DBA]_HEAT_MAP_SEQ_HISTOGRAM, DBA_HEATMAP_TOP_OBJECTS, and DBA_HEATMAP_TOP_TABLESPACES. Heatmaps schedule schedules to make the Automatic Data Optimization (ADO) strategy work . Note that heatmaps only track information for those segments that have at least one associated automatic data optimization strategy.
The automatic data optimization feature allows policies to be created on segments to define available compression policies based on a specific business age of the data. The business age of the data is determined by the information tracked and captured by the heatmap.
4. Practical cases
The students table stores information about students in a school
create table students
(
EMPNO NUMBER(4) NOT NULL,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7,2),
COMM NUMBER(7,2),
DEPTNO NUMBER(2))
tablespace USERS
/
As a school rule, new student information can only be entered and modified within 60 days. In the meantime, the DBA can create a strategy to compress "hot" data in the OLTP schema.
alter table students
ILM ADD POLICY
ROW STORE COMPRESS ADVANCED ROW
AFTER 2 DAYS OF NO MODIFICATION
/
After the data entry period, the information is for reporting purposes only. These "warm" data can be compressed using the "compress-for-query" mode.
ater table students
ILM ADD POLICY
COLUMN STORE COMPRESS FOR QUERY
HIGH SEGMENT
AFTER 60 DAYS OF NO MODIFICATION
/
After 180 days, this information is for administrative purposes only. During this time, the data is prepared for archive and can be compressed substantially using the "compress-for-archive" compression technique.
alter table students
ILM ADD POLICY
COLUMN STORE COMPRESS FOR ARCHIVE
HIGH SEGMENT
AFTER 180 DAYS OF NO MODIFICATION
/
Later, if the tablespace faces space pressure. DBAs can create another strategy to move archived data to low-cost storage systems.
alter table students
ILM ADD POLICY
TIER TO SECONDARY_COST_STORE
/
Note that we can create multiple policies on the same segment. These policies are automatically run once the age rules are met. Once they are enforced, block-level policies are also enforced. However, whenever segment-level policies are activated, they will be run during jobs during the evening maintenance window. DBAs can optionally run automatic data optimization strategies manually when needed.