场景3 Data Management

数据管理

性能优化

OLTP OLAP

物化视图 :表的快照

传输表空间 :异构平台的数据迁移

星型转换 :事实表

OLTP : 在线事务处理

1. transaction —> DML

2. 数据量小

3. 处理时间短 —> SQL 共享,绑定变量

4. 并发量大

OLAP,DSS

1. 以查询为主(海量)—> 数据汇总 —> 结果放到表(物化视图)里

2. 处理时间长

3. 几乎无并发

4. 做并行处理

SGA + PGA

memory_target : 自动按需分配SGA和PGA

eg :

set autotrace on

set linesize 120

set time on

set timing on

set pagesize 20

set sqlprompt

db link :连接前置数据库和后台数据库

前置database(查询)

后台database(统计)

物化视图 —> 读写分离

eg :

grant create materialized view to scott

set auto trace off

create materialized view emp_mv1 as select sum(sal) sum_al, avg(sal) avg_sal, min(sal) min_al, dept no from emp group by deptno;

desc user_segments

col segment_name for a20

select segment_name, segment_type, tablespace_name, extents, bytes/1024 from user_segments where segment_name=‘EMP_MV1’;

eg :

set autotrace on

select …; (查看资源消耗)执行计划 execution plan

将复杂的查询结果存储到物化视图里

PCTFREE : 一般表预留10%的空间来做update等DML操作

eg:show parameter rewrite

drop materialized view emp_mv1

create materialized view emp_mv1 enable query rewrite as select sum(sal) sum_al, avg(sal) avg_sal, min(sal) min_al, dept no from emp group by deptno;

李全新 邮箱 :quanxin.li@enmotech.com

手工建库脚本从官方文档拷贝修改

eg : desc dbms_mview

set autotrace off;

select * from emp;

update emp set deptno=40 where empno = …;

commit;

select * from emp;

select * from emp_mv1;

exec dbms_mview.refresh(‘emp_mv1’);

select * from emp_mv1;

物化视图日志记录基表数据的变化以便进行快速刷新

eg :

select * from tab;

create index emp_mv1_ind on emp_mv1(deptno) tablespace indx;

analyze index emp_mv1_ind compute …;

PCT Refresh

表空间移动

数据迁移 :

1. expdp, impdp(exp, imp)(异构平台)

2. tablespace transport(异构平台)expdp metadata, copu datafile

3. dg (Data Guard) :容灾 数据克隆 (同构平台)

4. ogg (Oracle Golden Gate) : 收费软件

5. 存储镜像

表空间自包含的检测 :

execute dbms_tts.transport_set_check(‘users’);

eg :

create table emp1 as select * from emp;

create index emp1_empno on emp1(empno) tablespace indx;

alter table emp1 add constraint pk_emp1 primary key(empno);

alter table emp1 move tablespace indx;

execute dbms_tts.transport_set_check(‘users’);

会用expdp

外部表 external table

重建 OEM :

emca -config dbcontrol db -repos -recreate

解锁sh用户

事实表

维度表

select constraint_name, table_name from user_constraints;

desc user_indexes

select index_name, table_name from user_indexes;

星型查询 : 在事实表和维度表之间进行连接查询

bitmap index

show parameter star

set star_tranformation_enabled to true

eg :

emctl status dbconsole

emctl start dbconsole

merge join cartesian

对表 t2 做分析 :

analyze table t2 compute statistatics;

星型转换

并行查询

设置并行度(DOP degree of parallelism)

eg :

alter session force parallel query;

alter session set parallel_degree_policy=limited;(设置所有SQL执行并行)

eg :

show parameter parallel

parallel_min_servers : 指定最少启用几个并行进程

set autotrace on

r

eg :

alter session enable parallel dml;

set autotrace on

insert /*+ parallel(4) */ into emp1 select /*+ parallel(4) */ from emp;

eg :alter table sh.sales parallel 8; (设置表sales的并行度为8)

parallel_min_time_threshold : 指定执行时间,超过则自动开启并行查询,DOP

场景3 Data Management的更多相关文章

  1. 场景4 Data Warehouse Management 数据仓库

    场景4 Data Warehouse Management 数据仓库 parallel 4 100% —> 必须获得指定的4个并行度,如果获得的进程个数小于设置的并行度个数,则操作失败 para ...

  2. 场景7 Data Guard

    场景7  Data Guard 官方文档 :Oracle Data Guard Concepts and Administration 用于数据容灾,通过主备库同步(主库将redo日志传送到备库,一个 ...

  3. 场景5 Performance Management

    场景5 Performance Management 性能调优(不能重启数据库) 索引 资源管理器 性能优化 统计分析 SQL性能分析 SPM (SQL执行计划管理) 堆表 :数据存储无序 位图索引 ...

  4. MySQL vs. MongoDB: Choosing a Data Management Solution

    原文地址:http://www.javacodegeeks.com/2015/07/mysql-vs-mongodb.html 1. Introduction It would be fair to ...

  5. [Windows Azure] Data Management and Business Analytics

    http://www.windowsazure.com/en-us/develop/net/fundamentals/cloud-storage/ Managing and analyzing dat ...

  6. Data Management Technology(1) -- Introduction

    1.Database concepts (1)Data & Information Information Is any kind of event that affects the stat ...

  7. Data Management and Data Management Tools

    Data Management ObjectivesBy the end o this module, you should understand the fundamentals of data m ...

  8. Building Applications with Force.com and VisualForce(Dev401)(十七):Data Management: Data management Tools

    ev401-018:Data Management: Data management ToolsModule Objectives1.List objects exposed in the impor ...

  9. Building Applications with Force.com and VisualForce(Dev401)(十六):Data Management: Introduction to Upsert

    Dev401-017:Data Management: Introduction to Upsert Module Objectives1.Define upsert.2.Define externa ...

随机推荐

  1. RequireJS 快速入门

      说明:本文只提供快速入门内容,方便快速进入实战状态.更高级的配置,请参考官网文档. 当初之所以使用 RequireJS 等工具,是因为想提高js的加载速度,避免不必要的堵塞.但通过一段时间的使用, ...

  2. github项目配置

    准备工作: 下载一个git:  https://git-scm.com/downloads 1.登陆到github 登陆地址:https://github.com/login 2.创建新项目 3.配置 ...

  3. django一对多关系的小例题

    urls.py from django.conf.urls import urlfrom django.contrib import adminfrom son1.views import * url ...

  4. mysql 基础篇5(mysql语法---数据)

    6 增删改数据 -- ********一.增删改数据********* --- -- 1.1 增加数据 -- 插入所有字段.一定依次按顺序插入 INSERT INTO student VALUES(1 ...

  5. 解析json串,利用正则表达式,split

    public class SplitJson { public static void main(String[] args) {        // TODO Auto-generated meth ...

  6. BIOS MCSDK 2.0 学习笔记(二)————使用Platform Library创建工程

    [TOC] Platform Library提供了一组适用于开发板的API函数.我们可以使用它来快速入手开发板. 1.启动CCS,建立一个空的工程 2.添加include路径 "C:\Pro ...

  7. Windows下搭建NodeJS绿色版开发环境

    文章最初发布于szhshp的第三边境研究所, 转载请注明 开发背景 博客一直用的是Jekyll, 突然想玩玩NodeJS和Hexo, 于是就试着搭建一下 绿色环境, 基于Window8, 不需要管理员 ...

  8. js--内容判断(依赖于jq)

    /** * 判断是否为空 * @param {Object} $element */ function nullVerify($element) { if(!$element.val() && ...

  9. [HTML/CSS] ul元素居中处理

    CSS: <style type="text/css"> #nav_sub_page { text-align: center; width: 80%; } #nav_ ...

  10. 深入剖析tomcat 笔记——第8章 载入器

    深入剖析tomcat 笔记 目录: