场景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. Vs2012(Vs2013) 编译 64位 Qt (动态库), 并使用自编译Qt建立工程(悲催经历)。(含遗留问题)

    仅供参考. 体会:我个人此次编译不该使用Vs2013编译Qt. 使用以下程序: Qt : qt-opensource-windows-x86-msvc2012_64_opengl-5.2.1.exe ...

  2. DuiLib 源码分析之CDuiString

    duilib是一个比较常见的界面库,闲来无事看看别人写的代码,跟自己写的一比, 才看到了差距呀,感觉自己写的乱七八糟,keep moving CduiString是duilib提供的一个字符串类,功能 ...

  3. WPF的学习笔记(1) -- (积累自2016年5月1日 至 2016年6月1日)

    敬告读者:因为是事件驱动模式的高速学习,高速学习意味着,不系统,不科学,不合逻辑,不一定正确.所以要是有不对的地方,页面下面留言给我,跪谢! 背景介绍: 最近在公司的开发工作中,接手了从别的公司交代过 ...

  4. TinyOS 中的 task

    task 的目的 做过界面的编程的同学可能会有这种经历,界面不响应,那,其实程序总是在后台运行,但是后台可能是个for循环,那么界面的点击等事件都不能执行. 在windows界面编程中利用了事件机制来 ...

  5. CSS垂直居中的方法

    前端开发过程中,水平垂直居中是比较常用的.下面直接开门见山,看看不同方法实现垂直居中的各自优点和其不足之处. 1.将“line-height”和“height”设置成一致 这种方法用来实现单行垂直居中 ...

  6. Oracle 新增删除账户

    新增用户: create user test identified by 123456;grant dba,connect,resource to test; 删除账户: drop user xxx ...

  7. Deep Learning 24:读论文“Batch-normalized Maxout Network in Network”——mnist错误率为0.24%

    读本篇论文“Batch-normalized Maxout Network in Network”的原因在它的mnist错误率为0.24%,世界排名第4.并且代码是用matlab写的,本人还没装caf ...

  8. eclipse中的web环境配置

    一.tomcat的安装 直接官网下载,选择自动配置安装Exe文件. 测试: 1.启动安装目录下bin文件中的exe文件,观察是否安装完好.若出现打断文字黑框,则说明已经安装完好. 2.输入网址.htt ...

  9. ActiveReports最终报表设计器本地化方法介绍

    ActiveReports UI界面中的所有字符信息.错误提示信息.以及一些logo.图像资源,都能够通过运行batch文件来本地化.本文主要介绍资源本地化的具体步骤: 1. 资源目录 所有可本地化的 ...

  10. 浏览器地址栏背后的logic

    曾经有面试题是这样的:"描述在浏览器的地址栏中输入:http://www.baidu.com 后发生了什么?". 1.服务端返回baidu页面资源,浏览器载入html 2.浏览器开 ...