数据库性能提升实践之基本技术

上传人:蜀歌 文档编号:149221211 上传时间:2020-10-25 格式:PDF 页数:46 大小:3.42MB
返回 下载 相关 举报
数据库性能提升实践之基本技术_第1页
第1页 / 共46页
数据库性能提升实践之基本技术_第2页
第2页 / 共46页
数据库性能提升实践之基本技术_第3页
第3页 / 共46页
数据库性能提升实践之基本技术_第4页
第4页 / 共46页
数据库性能提升实践之基本技术_第5页
第5页 / 共46页
点击查看更多>>
资源描述

《数据库性能提升实践之基本技术》由会员分享,可在线阅读,更多相关《数据库性能提升实践之基本技术(46页珍藏版)》请在金锄头文库上搜索。

1、Copyright 2014,Oracle and/or its affiliates. All rights reserved. | 甲骨文数据中心云化、性能与安全 高级演示会 数据库数据库性能提升实践之基本技术性能提升实践之基本技术 Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted2/45 日程 人工诊断与优化模式 自动性能诊断 必须知道的概念 ASH/AWR/ADDM 实时ADDM/比较AD

2、DM 自动SQL优化 SQL监控 SQL优化顾问 SQL访问顾问 SQL自动优化 Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted3/45 手工性能分析 最: 最高者 最大者 持续时间最长者 “谁”在“做什么”造成了 性能瓶颈? Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidentia

3、l Internal/Restricted/Highly Restricted4/45 Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted5/45 Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted6/4

4、5 Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted7/45 CPU、IO、锁 或者并行问题? Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted8/45 性能诊断 Copyright 2014 Ora

5、cle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted9/45 Oracle的性能方法论 基于“数据库时间”的方法论 对于一个指定的工作负载,如何进行数据库调优? 找出最消耗数据库时间的操作 找出相应的资源/计算能力的瓶颈 减少该工作负载的“数据库时间”消耗 分析范围可控 实例级别 特定的会话/进程或SQL语句等等 Copyright 2014 Oracle and/or its affiliates. All rights reserv

6、ed. |Oracle Confidential Internal/Restricted/Highly Restricted10/45 数据库时间(DB Time)分析法 前端会话进行数据库调用消耗的总时间 包括CPU时间, IO时间以及非空闲等待时间 数据库时间 不等于 响应时间 针对Oracle数据库性能的新指标 数据库时间是用户进程消耗的总时间,包括积极等待 数据库调用时间和主动处理时间。 Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Rest

7、ricted/Highly Restricted11/45 真实时间 = 花在数据库上的时间 看书看某本书的评论加到购物车中买单 基础概念 活动会话 = 目前正花时间在数据库调用上的会话 数据库时间 (DB Time) = 会话花费在所有数据库调用上的总时间 会话平均活动 (% Activity) = DB时间除以总真实时间 Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted12/45 多个会话 =

8、 花在数据库上的时间 真实时间 用户1 用户2 用户3 用户n DB Time = 所有会话的数据库时间之和 平均活动会话 = 所有会话的平均活动之和 总真实时间 总数据库时间 = 在t时刻,有两个活动会话 t Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted13/45 平均活动会话与DB Time Copyright 2014 Oracle and/or its affiliates. All

9、rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted14/45 DB Time:ASH与时间模型 Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted15/45 基本性能诊断流程 性能和工作负载数据的捕获 系统、等待、DB CPU、DB IO、SQL等 分析 最耗时操作? 瓶颈在何处? 根本问题在哪? 如

10、何解决问题? 问题的解决 多个问题中,哪个是关键问题? 哪种解决方案最有效? ASH/AWR AWR Report ADDM Report ASH Report ASH Analysis ADDM Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted16/45 问题“点”分析ASH ASH用于对瞬时性事件进行针对性“点”分析 还能回答关于SQL语句在时点间的比对问题,“这条SQL语句是不是性能随时间

11、下降?” Performance Time * Range Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted17/45 活动会话历史(ASH) 所有“活动”会话,每秒捕获 前台会话与后台会话都抽样 所有前台会话就是DB Time 内存中:V$ACTIVE_SESSION_HISTORY 抽样间隔 = 1秒 磁盘上:DBA_HIST_ACTIVE_SESS_HISTORY 抽样间隔 = 10秒,存放

12、在AWR中 ASH是数据库活动的系统范围信息记录 带有多个维度的事实表有助于诊断问题 Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted18/45 ASH分析 Flexible Time Picker Flexible Activity Chart Flexible Top ChartFlexible Top Chart Copyright 2014 Oracle and/or its affili

13、ates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted19/45 下钻到各个逻辑维度 ASH SQL PL/SQL Resource Usage Session Identifiers Session Attributes SQL SQL ID Plan Hash Operation OpCode PL/SQL PL/SQL Top Level PL/SQL Resources Wait Class Wait Event Object Blocking Session Ident

14、ifiers Instance Services User Session Parallel Process Program Session Type Attributes Cons. Group Module Action Client Trans. ID Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted20/45 ASH多维度分析 Copyright 2014 Oracle and/or it

15、s affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted21/45 自动负载库AWR/AWR Report:快照的延伸 AWR报告:数据级 Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted22/45 EM新特性:AWR Warehouse 长期保留性能信息,在线或离线分

16、析,对源生产库无影响 数据库1 加载AWR数据 到AWR仓库 集中的AWR仓库 Database 1 Snapshots 数据库2 数据库3 数据库管理员广泛使用AWR报告来诊断数据库 Performance Home ASH Analytics AWR Report Compare Period ADDM Compare Period Report Database 2 Snapshots Database 3 Snapshots Database n Snapshots Copyright 2014 Oracle and/or its affiliates. All rights reserved. |Oracle Confidential Internal/Restricted/Highly Restricted23/45 提高管理员工作效率 消除性能瓶颈 降低管理成本 提供高服务质量 自动性能

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 商业/管理/HR > 经营企划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号