search
HomeDatabaseMysql TutorialHeat Map and Automatic Data Optimization : part-2

上一篇测试了ADO的压缩功能 Heat Map and Automatic Data Optimization : part-1 下面测下ADO的存储层功能 简单的说下就是使用ado move 表、分区操作,把不是热数据的数据移动到性能低下的存储上 下面是工作的示意图 准备环境 SQL conn travel/aaConnected.?

上一篇测试了ADO的压缩功能 Heat Map and Automatic Data Optimization : part-1
下面测下ADO的存储层功能
简单的说下就是使用ado move 表、分区操作,把不是热数据的数据移动到性能低下的存储上
下面是工作的示意图

ado2

准备环境

SQL> conn travel/aa
Connected.
?
USERNAME             INST_NAME    HOST_NAME                 SID   SERIAL#  VERSION    STARTED  SPID            OPID  CPID            SADDR            PADDR
-------------------- ------------ ------------------------- ----- -------- ---------- -------- --------------- ----- --------------- ---------------- ----------------
TRAVEL               noncdb       localhost.localdomain     1     7        12.1.0.1.0 20140526 3209            7     2927            000000009F6CA108 000000009F9865B8
?
?
SQL> SELECT * FROM tab;
?
TNAME                                                                                                                                                                                                                                                            TABTYPE         CLUSTERID
----------------------------------- -------------- ----------
HEAT_TEST                           TABLE
?
SQL> 
SQL> conn / AS sysdba
Connected.
?
USERNAME             INST_NAME    HOST_NAME                 SID   SERIAL#  VERSION    STARTED  SPID            OPID  CPID            SADDR            PADDR
-------------------- ------------ ------------------------- ----- -------- ---------- -------- --------------- ----- --------------- ---------------- ----------------
SYS                  noncdb       localhost.localdomain     1     9        12.1.0.1.0 20140526 3234            7     2927            000000009F6CA108 000000009F9865B8
?
?
SQL> CREATE tablespace ado_t1 datafile '/oradata/noncdb/ado_t1.dbf' SIZE 200M;
?
Tablespace created.
?
?
SQL> CREATE tablespace ado_t2 datafile '/oradata/noncdb/ado_t2.dbf' SIZE 200M;
?
Tablespace created.
?
SQL> 
?
SQL> CREATE TABLE ado_move tablespace ado_t1 AS SELECT * FROM dba_objects;
?
TABLE created.
?
SQL> INSERT INTO ado_move SELECT * FROM ado_move;
?
90764 ROWS created.
?
SQL> commit;
?
Commit complete.
?
SQL> INSERT INTO ado_move SELECT * FROM ado_move;
?
181528 ROWS created.
?
SQL> commit;
?
Commit complete.
?
SQL> INSERT INTO ado_move SELECT * FROM ado_move;
?
363056 ROWS created.
?
SQL> INSERT INTO ado_move SELECT * FROM ado_move;
?
726112 ROWS created.
?
SQL> commit;
?
Commit complete.
?
SQL> @dba_tablespaces
?
+------------------------------------------------------------------------+
| Report   : Tablespaces                                                 |
| Instance : noncdb                                                      |
| USER     : TRAVEL                                                      |
+------------------------------------------------------------------------+
?
STATUS    Tablespace Name           TS TYPE         Ext. Mgt.  Seg. Mgt.     Tablespace SIZE    Used (IN bytes) Pct. Used
--------- ------------------------- --------------- ---------- ---------- ------------------ ------------------ ---------
ONLINE    ADO_T1                    PERMANENT       LOCAL      AUTO              209,715,200        202,375,168        97
ONLINE    ADO_T2                    PERMANENT       LOCAL      AUTO              209,715,200          1,048,576         1
ONLINE    SYSAUX                    PERMANENT       LOCAL      AUTO              765,460,480        760,086,528        99
ONLINE    SYSTEM                    PERMANENT       LOCAL      MANUAL            817,889,280        811,401,216        99
ONLINE    TEMP                      TEMPORARY       LOCAL      MANUAL             91,226,112         90,177,536        99
ONLINE    UNDOTBS1                  UNDO            LOCAL      MANUAL            152,043,520        151,257,088        99
ONLINE    USERS                     PERMANENT       LOCAL      AUTO               66,846,720         15,400,960        23
                                                                          ------------------ ------------------ ---------
avg                                                                                                                    74
SUM                                                                            2,312,896,512      2,031,747,072
?
7 ROWS selected.

上面创建了2个表空间,并在表空间ADO_T1上创建了一个张表,插入大量数据,是空间使用率得到97%

下面查看下表的Heat map情况

SQL> ALTER system SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
  2  
SQL> col owner FOR a20
SQL> col object_name FOR a20
SQL> col "Tracking Time" FOR a40
SQL> col "Seg write" FOR a20
SQL> 
SQL> pro DBA_HEAT_MAP_SEG_HISTOGRAM
DBA_HEAT_MAP_SEG_HISTOGRAM
SQL> SELECT object_name, to_char(track_time,'YYYY-MM-DD HH:MI:SS') "Tracking Time", 
  2  segment_write "Seg write", 
  3  FULL_SCAN "Full Scan", 
  4  lookup_scan "Lookup Scan"
  5  FROM DBA_HEAT_MAP_SEG_HISTOGRAM
  6  WHERE object_name=UPPER('ado_move');
?
OBJECT_NAME          Tracking TIME                            Seg WRITE            FULL S Lookup
-------------------- ---------------------------------------- -------------------- ------ ------
ADO_MOVE             2014-05-26 11:26:52                      YES                  YES    NO
?
SQL> 
SQL> 
SQL> pro DBA_HEAT_MAP_SEGMENT
DBA_HEAT_MAP_SEGMENT
SQL> 
SQL> SELECT owner,object_name,SEGMENT_WRITE_TIME,SEGMENT_READ_TIME,FULL_SCAN,LOOKUP_SCAN  
  2  FROM DBA_HEAT_MAP_SEGMENT
  3  WHERE object_name=UPPER('ado_move');
?
OWNER                OBJECT_NAME          SEGMENT_WRITE_TIM SEGMENT_READ_TIME FULL_SCAN         LOOKUP_SCAN
-------------------- -------------------- ----------------- ----------------- ----------------- -----------------
TRAVEL               ADO_MOVE             20140526 11:26:53                   20140526 11:26:53
?
SQL> 
?
SQL> 
SQL> SELECT OBJECT_NAME, TRACK_TIME, SEGMENT_WRITE "Seg_write", SEGMENT_READ "Seg_read", FULL_SCAN, LOOKUP_SCAN
  2       FROM v$heat_map_segment
  3       WHERE object_name=UPPER('ado_move');
?
OBJECT_NAME          TRACK_TIME        Seg_wr Seg_read             FULL_S LOOKUP
-------------------- ----------------- ------ -------------------- ------ ------
ADO_MOVE             20140526 11:28:49 YES    NO                   YES    NO
创建策略
SQL> ALTER TABLE ADO_MOVE ILM ADD POLICY TIER TO ADO_T2;
?
TABLE altered.
查看策略
SQL> COL policy_name format A12
SQL> COL TIER_TBS format A20
SQL> SELECT policy_name, action_type, scope,
  2               tier_tablespace "TIER_TBS"
  3       FROM  user_ilmdatamovementpolicies
  4       ORDER BY policy_name;
?
POLICY_NAME  ACTION_TYPE            SCOPE          TIER_TBS
------------ ---------------------- -------------- --------------------
P1           COMPRESSION            SEGMENT
P21          STORAGE                SEGMENT        ADO_T2
?
SQL> SELECT policy_name, object_name, inherited_from, enabled FROM user_ilmobjects;
?
POLICY_NAME  OBJECT_NAME          INHERITED_FROM                           ENABLE
------------ -------------------- ---------------------------------------- ------
P1           HEAT_TEST            POLICY NOT INHERITED                     NO
P21          ADO_MOVE             POLICY NOT INHERITED                     YES
?
SQL> SELECT * FROM dba_ilmparameters;
?
Tablespace Name                VALUE
------------------------- ----------
ENABLED                            1
JOB LIMIT                         10
EXECUTION MODE                     3
EXECUTION INTERVAL                15
TBS PERCENT USED                  85
TBS PERCENT FREE                  25
?
6 ROWS selected.
?
执行操作
SQL> DECLARE
  2  v_executionid NUMBER;
  3  BEGIN
  4  dbms_ilm.execute_ILM (ILM_SCOPE => dbms_ilm.SCOPE_SCHEMA,
  5              execution_mode => dbms_ilm.ilm_execution_offline,
  6              task_id   => v_executionid);
  7  END;
  8   /
?
PL/SQL PROCEDURE successfully completed.
?
SQL> @dba_tablespaces
?
+------------------------------------------------------------------------+
| Report   : Tablespaces                                                 |
| Instance : noncdb                                                      |
| USER     : TRAVEL                                                      |
+------------------------------------------------------------------------+
?
STATUS    Tablespace Name           TS TYPE         Ext. Mgt.  Seg. Mgt.     Tablespace SIZE    Used (IN bytes) Pct. Used
--------- ------------------------- --------------- ---------- ---------- ------------------ ------------------ ---------
ONLINE    ADO_T1                    PERMANENT       LOCAL      AUTO              209,715,200        202,375,168        97
ONLINE    ADO_T2                    PERMANENT       LOCAL      AUTO              209,715,200          1,048,576         1
ONLINE    SYSAUX                    PERMANENT       LOCAL      AUTO              807,403,520        763,428,864        95
ONLINE    SYSTEM                    PERMANENT       LOCAL      MANUAL            817,889,280        811,401,216        99
ONLINE    TEMP                      TEMPORARY       LOCAL      MANUAL             91,226,112         90,177,536        99
ONLINE    UNDOTBS1                  UNDO            LOCAL      MANUAL            152,043,520        151,846,912       100
ONLINE    USERS                     PERMANENT       LOCAL      AUTO               66,846,720         15,400,960        23
                                                                          ------------------ ------------------ ---------
avg                                                                                                                    73
SUM                                                                            2,354,839,552      2,035,679,232
?
7 ROWS selected.
?
?
?
SQL>  COL job_name format A20
SQL>  COL object_name format A8
SQL>  COL task_id format 99999
SQL> 
SQL> SELECT task_id, state FROM user_ilmtasks;
?
TASK_ID STATE
------- ------------------
      2 COMPLETED
     62 COMPLETED
?
SQL> 
SQL> 
SQL>  COL object_name format A20
SQL>  col POLICY_NAME  FOR a10
SQL>  col SELECTED_FOR_EXECUTION FOR a80
SQL>  SELECT TASK_ID, POLICY_NAME, OBJECT_NAME,
  2  SELECTED_FOR_EXECUTION, JOB_NAME
  3   FROM user_ilmevaluationdetails;
?
TASK_ID POLICY_NAM OBJECT_NAME          SELECTED_FOR_EXECUTION                                                           JOB_NAME
------- ---------- -------------------- -------------------------------------------------------------------------------- --------------------
     62 P21        ADO_MOVE             SELECTED FOR EXECUTION                                                           ILMJOB122
     62 P1         HEAT_TEST            POLICY DISABLED
      2 P1         HEAT_TEST            SELECTED FOR EXECUTION                                                           ILMJOB42
?
SQL> 
SQL>  COL job_name format A20
SQL>  COL object_name format A8
SQL>  COL task_id format 99999
SQL> 
SQL> 
SQL> SELECT task_id, job_name, job_state FROM user_ilmresults;
?
TASK_ID JOB_NAME             JOB_STATE
------- -------------------- ----------------------------------------------------------------------
      2 ILMJOB42             COMPLETED SUCCESSFULLY
     62 ILMJOB122            FAILED
--发现任务失败,查看失败原因
?
?
?
SQL> col COMMENTS FOR a80
SQL> SELECT task_id, job_name, job_state,COMMENTS FROM user_ilmresults;
?
TASK_ID JOB_NAME             JOB_STATE                                                              COMMENTS
------- -------------------- ---------------------------------------------------------------------- --------------------------------------------------------------------------------
      2 ILMJOB42             COMPLETED SUCCESSFULLY
     62 ILMJOB122            FAILED                                                                 ORA-01652: unable TO extend temp segment BY 1024 IN tablespace ADO_T2
                                                                                                    ORA-06512: at line 1
?
     82 ILMJOB162            FAILED                                                                 ORA-01652: unable TO extend temp segment BY 1024 IN tablespace ADO_T2
                                                                                                    ORA-06512: at line 1
原因为表空间存储空间不够。。。。
?
SQL> 
?
?
增大数据文件
SQL> ALTER DATABASE datafile '/oradata/noncdb/ado_t2.dbf' resize 400m;
?
DATABASE altered.
?
?
在此执行
SQL> DECLARE
  2  v_executionid NUMBER;
  3  BEGIN
  4  dbms_ilm.execute_ILM (ILM_SCOPE => dbms_ilm.SCOPE_SCHEMA,
  5              execution_mode => dbms_ilm.ilm_execution_offline,
  6              task_id   => v_executionid);
  7  END;
  8   /
?
PL/SQL PROCEDURE successfully completed.
?
SQL> 
SQL> SELECT task_id, job_name, job_state,COMMENTS FROM user_ilmresults;
?
TASK_ID JOB_NAME             JOB_STATE                                                              COMMENTS
------- -------------------- ---------------------------------------------------------------------- --------------------------------------------------------------------------------
      2 ILMJOB42             COMPLETED SUCCESSFULLY
     62 ILMJOB122            FAILED                                                                 ORA-01652: unable TO extend temp segment BY 1024 IN tablespace ADO_T2
                                                                                                    ORA-06512: at line 1
?
     82 ILMJOB162            FAILED                                                                 ORA-01652: unable TO extend temp segment BY 1024 IN tablespace ADO_T2
                                                                                                    ORA-06512: at line 1
?
    103 ILMJOB242            COMPLETED SUCCESSFULLY
?
成功完成
SQL> col TABLE_NAME FOR a20
SQL> /
?
TABLE_NAME           TABLESPACE_NAME
-------------------- ------------------------------------------------------------
ADO_MOVE             ADO_T2
HEAT_TEST            USERS
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
springboot怎么读取yml文件中的list列表、数组、map集合和对象springboot怎么读取yml文件中的list列表、数组、map集合和对象May 11, 2023 am 10:46 AM

application.yml定义list集合第一种方式使用@ConfigurationProperties注解获取list集合的所有值type:code:status:-200-300-400-500编写配置文件对应的实体类,这里需要注意的是,定义list集合,先定义一个配置类Bean,然后使用注解@ConfigurationProperties注解来获取list集合值,这里给大家讲解下相关注解的作用@Component将实体类交给Spring管理@ConfigurationPropertie

Java怎么设置过期时间的mapJava怎么设置过期时间的mapMay 04, 2023 am 10:13 AM

一、技术背景在实际的项目开发中,我们经常会使用到缓存中间件(如redis、MemCache等)来帮助我们提高系统的可用性和健壮性。但是很多时候如果项目比较简单,就没有必要为了使用缓存而专门引入Redis等等中间件来加重系统的复杂性。那么Java本身有没有好用的轻量级的缓存组件呢。答案当然是有喽,而且方法不止一种。常见的解决方法有:ExpiringMap、LoadingCache及基于HashMap的封装三种。二、技术效果实现缓存的常见功能,如过时删除策略热点数据预热三、ExpiringMap3.

Java中Map实现线程安全的方式有哪些Java中Map实现线程安全的方式有哪些Apr 19, 2023 pm 07:52 PM

方式1.使用HashtableMaphashtable=newHashtable();这是所有人最先想到的,那为什么它是线程安全的?那就看看它的源码,我们可以看出我们常用的put,get,containsKey等方法都是同步的,所以它是线程安全的publicsynchronizedbooleancontainsKey(Objectkey){Entrytab[]=table;inthash=key.hashCode();intindex=(hash&0x7FFFFFFF)%tab.leng

Nginx服务器中map模块怎么配置与使用Nginx服务器中map模块怎么配置与使用May 21, 2023 pm 05:14 PM

map指令使用ngx_http_map_module模块提供的。默认情况下,nginx有加载这个模块,除非人为的--without-http_map_module。ngx_http_map_module模块可以创建变量,这些变量的值与另外的变量值相关联。允许分类或者同时映射多个值到多个不同值并储存到一个变量中,map指令用来创建变量,但是仅在变量被接受的时候执行视图映射操作,对于处理没有引用变量的请求时,这个模块并没有性能上的缺失。一.ngx_http_map_module模块指令说明map语法

Java中将对象与Map相互转换的实现方式 - 使用BeanMapJava中将对象与Map相互转换的实现方式 - 使用BeanMapMay 08, 2023 pm 03:49 PM

javabean与map的转换有很多种方式,比如:1、通过ObjectMapper先将bean转换为json,再将json转换为map,但是这种方法比较绕,且效率很低,经测试,循环转换10000个bean,就需要12秒!!!不推荐使用2、通过Java反射,获取bean类的属性和值,再转换到map对应的键值对中,这种方法次之,但稍微有点麻烦3、通过net.sf.cglib.beans.BeanMap类中的方法,这种方式效率极高,它跟第二种方式的区别就是因为使用了缓存,初次创建bean时需要初始化,

go语言怎么获取map元素go语言怎么获取map元素Jan 16, 2023 am 10:38 AM

两种方法:1、利用“for range”语句遍历map来获取全部元素,语法“for key, value := range mapName{...}”。2、使用key做为索引的形式来获取指定元素,语法“value, isOk := mapName[key]”;返回两个返回值,第一个返回值是获取的值,如果key不存在,返回空值,第二个参数是一个bool值,表示获取值是否获取成功。

使用php开发Websocket,实现实时地图定位功能使用php开发Websocket,实现实时地图定位功能Dec 17, 2023 pm 08:09 PM

标题:使用PHP开发Websocket实现实时地图定位功能简介:Websocket是一种实现持久连接,实时双向通信的协议,能够实现实时的数据传输和更新。本文将使用PHP开发Websocket,结合地图定位功能,实现实时地图定位功能。下面将详细介绍具体的代码实现过程。一、准备工作安装PHP环境(版本要求:PHP5.3.0+)安装Composer(PHP第三方

Java 8中的Stream API:如何使用collect()方法将集合收集为Map对象Java 8中的Stream API:如何使用collect()方法将集合收集为Map对象Jul 31, 2023 pm 03:24 PM

Java8中引入了新的StreamAPI,它提供了一种更加高效、简洁的方式来处理集合数据。StreamAPI提供了各种方法来对数据进行处理和转换,其中collect()方法是一个非常重要且常用的方法之一。本文将介绍如何使用collect()方法将集合收集为Map对象,并提供相应的代码示例。在Java8之前,如果我们想将一个集合转

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!