About Oracle Database Performance Method

news2024/9/25 21:25:38

bottleneck(瓶颈):  a point where resource contention is highest

throughput(吞吐量): the amount of work that can be completed in a specified time.

response time (响应时间): the time to complete a specified workload

2.1 Gathering Database Statistics Using the Automatic Workload Repository(AWR)

Automatic Workload Repository (AWR) automates database statistics gathering by collecting, processing, and maintaining performance statistics for database problem detection and self-tuning purposes.

the database gathers statistics every hour and creates an AWR snapshot, which is a set of data for a specific time that is used for performance comparisons. 

The following initialization parameters are relevant for AWR:

  • STATISTICS_LEVEL
  • CONTROL_MANAGEMENT_PACK_ACCESS

The database statistics collected and processed by AWR include:

2.1.1 Time Model Statistics

Time model statistics measure the time spent in the database by operation type. The most important time model statistic is database time (DB time). DB time represents the total time spent in database calls by foreground sessions, and is an indicator of the total instance workload.

 

 A session is a logical entity in the database instance memory that represents the state of a current user login to a database.Database time is calculated by aggregating the CPU time and wait time of all active sessions (sessions that are not idle).

The objective of database tuning is to reduce DB time. In this way, you can improve the overall response time of user transactions in the application.

2.1.2 Wait Event Statistics

Wait events are incremented by a session to indicate that the session had to wait for an event to complete before being able to continue processing. When a session has to wait while processing a user request, the database records the wait by using one of a set of predefined wait events. The events are then grouped into wait classes, such as User I/O and Network. Wait event data reveals symptoms of problems that might be affecting performance, such as latch, buffer, or I/O contention.

2.1.3 Session and System Statistics

A large number of cumulative database statistics are available on a system and session level. Some of these statistics are collected by AWR.

2.1.4 Active Session History Statistics

The Active Session History (ASH) statistics are samples of session activity in the database. The database samples active sessions every second and stores them in a circular buffer in the System Global Area (SGA). 

2.1.5 High-Load SQL Statistics

SQL statements that are consuming the most resources produce the highest load on the system, based on criteria such as elapsed time and CPU time.

2.2 Using the Oracle Performance Method

Performance tuning using the Oracle performance method is driven by identifying and eliminating bottlenecks in the database, and by developing efficient SQL statements. Database tuning is performed in two phases: proactively and reactively.

In the proactive tuning phase, you must perform tuning tasks as part of your daily database maintenance routine, such as reviewing ADDM analysis and findings, monitoring the real-time performance of the database, and responding to alerts.

In the reactive tuning phase, you must respond to issues reported by users, such as performance problems that may occur for only a short duration of time, or performance degradation to the database over a period of time.

SQL tuning is an iterative process to identify, tune, and improve the efficiency of high-load SQL statements.

To improve database performance, you must apply these principles iteratively.

2.2.1 Preparing the Database for Tuning

To prepare the database for tuning:

  1. Get feedback from users.

Determine the scope of the performance project and subsequent performance goals, and determine performance goals for the future. This process is key for future capacity planning.

  2. Check the operating systems of all systems involved with user performance.

Check for hardware or operating system resources that are fully utilized. List any overused resources for possible later analysis. In addition, ensure that all hardware is functioning properly.

 3.Ensure that the STATISTICS_LEVEL initialization parameter is set to TYPICAL (default) or ALL to enable the automatic performance tuning features of Oracle Database, including AWR and ADDM.

4.Ensure that the CONTROL_MANAGEMENT_PACK_ACCESS initialization parameter is set to DIAGNOSTIC+TUNING (default) or DIAGNOSTIC to enable ADDM.

2.2.2 Tuning the Database Proactively

To tune the database proactively:

  1. Review the ADDM findings
  2. Implement the ADDM recommendations
  3. Monitor performance problems with the database in real time
  4. Respond to performance-related alerts
  5. Validate that any changes have produced the desired effect, and verify that the users experience performance improvements.

2.2.3 Tuning the Database Reactively

This section lists and describes the steps required to tune the database based on user feedback. This tuning procedure is considered reactive. Perform this procedure periodically when performance problems are reported by the users.

To tune the database reactively:

  1. Run ADDM manually to diagnose current and historical database performance when performance problems are reported by the users
  2. Resolve transient performance problems.(ASH reports enable you to analyze trainsient performance problems with the database that are short-lived and do not appear in the ADDM analysis)
  3. Resolve performance degradation over time
  4. Validate that the changes made have produced the desired effect, and verify that the users experience performance improvements.

  5. Repeat these steps until your performance goals are met or become impossible to achieve due to other constraints.

2.2.4 Tuning SQL Statements

This section lists and describes the steps required to identify, tune, and optimize high-load SQL statements.

To tune SQL statements:

  1. Identify high-load SQL statements
  2. Tune high-load SQL statements
  3. Optimize data access paths(creating the proper set of materialized views, materialized view logs, and indexes for a given workload by using SQL Access Advisor)
  4. Analyze the SQL performance impact of SQL tuning and other system changes by using SQL Performance Analyzer.
  5. Repeat these steps until all high-load SQL statements are tuned for greatest efficiency.

2.3 Common Performance Problems Found in Databases

consult the appropriate section that addresses these problems:

  • CPU bottlenecks 

Performance problems caused by CPU bottlenecks are diagnosed by ADDM,you can also identify CPU bottlenecks by using the Performance page in Cloud Control

  • Undersized memory structures

Are the Oracle memory structures such as the System Global Area (SGA), Program Global Area (PGA), and buffer cache adequately sized? Performance problems caused by undersized memory structures are diagnosed by ADDM.You can also identify memory usage issues by using the Performance page in Cloud Control

  • I/O capacity issues

Is the I/O subsystem performing as expected? Performance problems caused by I/O capacity issues are diagnosed by ADDM.You can also identify disk I/O issues by using the Performance page in Cloud Control

  • Suboptimal use of Oracle Database by the application

Problems such as establishing new database connections repeatedly, excessive SQL parsing, and high levels of contention for a small amount of data (also known as application-level block contention) can degrade the application performance significantly. Performance problems caused by suboptimal use of Oracle Database by the application are diagnosed by ADDM.You can also monitor top activity in various dimensions—including SQL, session, services, modules, and actions—by using the Performance page in Cloud Control.

  • Concurrency issues

 A high degree of concurrent activities might result in contention for shared resources that can manifest in the form of locks or waits for buffer cache. Performance problems caused by concurrency issues are diagnosed by ADDM.You can also identify concurrency issues by using Top Sessions in Cloud Control

  • Database configuration issues

For example, is there evidence of incorrect sizing of log files, archiving issues, too many checkpoints, or suboptimal parameter settings? Performance problems caused by database configuration issues are diagnosed by ADDM.

  • Short-lived performance problems

Depending on the interval between snapshots taken by AWR, performance problems that have a short duration may not be captured by ADDM. You can identify short-lived performance problems by using the Active Session History report.

  • Degradation of database performance over time

You can generate an AWR Compare Periods report to compare the period when the performance was poor to a period when the performance is stable to identify configuration settings, workload profile, and statistics that are different between these two time periods. This technique helps you identify the cause of the performance degradation

  • Inefficient or high-load SQL statements

Performance problems caused by high-load SQL statements are diagnosed by ADDM.You can also identify high-load SQL statements by using Top SQL in Cloud Control.You can tune the high-load SQL statements using SQL Tuning Advisor

  • Object contention

Are any database objects the source of bottlenecks because they are continuously accessed?Performance problems caused by object contention are diagnosed by ADDM.You can also optimize the data access path to these objects using SQL Access Advisor.

  • Unexpected performance regression after tuning SQL statements

Tuning SQL statements may cause changes to their execution plans, resulting in a significant impact on SQL performance. In some cases, the changes may result in the improvement of SQL performance. In other cases, the changes may cause SQL statements to regress, resulting in a degradation of SQL performance.

Before making changes on a production system, you can analyze the impact of SQL tuning on a test system by using SQL Performance Analyzer. This feature enables you to forecast the impact of system changes on a SQL workload by:

  • Measuring the performance before and after the change

  • Generating a report that describes the change in performance

  • Identifying the SQL statements that regressed or improved

  • Providing tuning recommendations for each SQL statement that regressed

  • Enabling you to implement the tuning recommendations when appropriate

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/354619.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Java 日志简介

目录1、Slf4j2、Log4j3、LogBack4、Logback 优点5、ELK1、Slf4j slf4j 的全称是 Simple Loging Facade For Java,即它仅仅是一个为 Java 程序提供日志输出的统一接口,并不是一个具体的日志实现方案,就比如 JDBC 一样,只是一种规则…

解决:eclipse绿化版Resource注解报Resource cannot be resolved to a type问题

如图: 网上解决教程很多,我的eclipse是绿化版的,不需要安装 解决办法如下: 1、在eclipse中,进入到Window->Preferences->Java->Installed JREs中 默认显示如下: 2、点击Add-->Standard VM--…

分页插件

引入依赖 注意需要和SpringBoot的版本对应&#xff0c;否则分页可能不生效 使用的分页依赖&#xff1a; <!-- pagehelper 插件--><dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper-spring-boot-starter</arti…

Dockerfile详解及优化技巧

写在前面 Dockerfile的默认相对路径是Dockerfile所在的目录&#xff1b;Dockerfile中的每一行会被视为一层镜像 一、Dockerfile 原理 1.1 镜像定义 首先我们先来回顾一下 Docker 镜像&#xff0c;它由多个只读层堆叠到一起&#xff0c;每一层是上一层的增量修改。基于镜像创…

深度学习炼丹-数据标准化

前言 一般机器学习任务其工作流程可总结为如下所示 pipeline。 在工业界,数据预处理步骤对模型精度的提高的发挥着重要作用。对于机器学习任务来说,广泛的数据预处理一般有四个阶段(视觉任务一般只需 Data Transformation): 数据清洗(Data Cleaning)、数据整合(Data Integ…

【c语言进阶】深度剖析整形数据

&#x1f680;write in front&#x1f680; &#x1f4dc;所属专栏&#xff1a; &#x1f6f0;️博客主页&#xff1a;睿睿的博客主页 &#x1f6f0;️代码仓库&#xff1a;&#x1f389;VS2022_C语言仓库 &#x1f3a1;您的点赞、关注、收藏、评论&#xff0c;是对我最大的激励…

C++010-C++嵌套循环

文章目录C010-C嵌套循环嵌套循环嵌套循环举例题目描述 输出1的个数题目描述 输出n行99乘法表题目描述 求s1!2!...10!作业在线练习&#xff1a;总结C010-C嵌套循环 在线练习&#xff1a; http://noi.openjudge.cn/ https://www.luogu.com.cn/ 嵌套循环 循环可以指挥计算机重复去…

自命为缓存之王的Caffeine(6)

您好&#xff0c;我是湘王&#xff0c;这是我的CSDN博客&#xff0c;欢迎您来&#xff0c;欢迎您再来&#xff5e;之前用Caffeine替代Redis的时候&#xff0c;发现先保存KV&#xff0c;再获取key&#xff0c;过期时间为3秒。但即使过了3秒&#xff0c;还是能获取到保存的数据。…

网络爬虫简介

前言 没什么可以讲的所以就介绍爬虫吧 介绍 网络爬虫&#xff08;英语&#xff1a;web crawler&#xff09;&#xff0c;也叫网路蜘蛛&#xff08;spider&#xff09;&#xff0c;是一种用来自动浏览万维网的网络机器人。其目的一般为编纂网络索引。 网路搜索引擎等站点通过…

Windows 环境下,cmake工程导入OpenCV库

目录 1、下载 OpenCV 库 2、配置环境变量 3、CmakeLists.txt 配置 1、下载 OpenCV 库 OpenCV官方下载地址&#xff1a;download | OpenCV 4.6.0 下载完毕后解压&#xff0c;便可以得到下面的文件 2、配置环境变量 我们需要添加两个环境变量&#xff0c;一个是 OpenCVConfi…

小红书达人选择,投放指南4注意!

为什么达人投放后反响平平&#xff0c;别的品牌为什么曝光这么高&#xff0c;我投放的钱是打水漂了吗&#xff1f;怎么能达到高曝光投放&#xff1f;今天就跟大家来聊聊如何让小红书达人投放达到高曝光&#xff1f;随着消费升级&#xff0c;在这场营销中&#xff0c;平台日渐爆…

数据结构与算法】链表2:节点交换与删除 链表相交 环形链表

文章目录今日任务1.Leetcode24&#xff1a;两两交换链表中的节点&#xff08;1&#xff09;题目&#xff08;2&#xff09;思路&#xff08;3&#xff09;代码实现2.Leetcode19&#xff1a;删除链表的倒数第N个节点&#xff08;1&#xff09;题目&#xff08;2&#xff09;思路…

机试_6_数据结构(二)

本文介绍机试中考查的一些非线性数据结构&#xff0c;包括二叉树、二叉排序树、优先队列和散列表等较为高级的数据结构。 一、二叉树 树的结构有诸多变体&#xff0c;它们在各种应用中发挥着重要作用。 作为树的特例的二叉树(Binary Tree)&#xff0c;虽然看似简单&#xff0…

Ubuntu安装boost库

参考链接&#xff1a;https://blog.csdn.net/zeye5731/article/details/122413193 1、下载 boost库 boost 库各大版本下载&#xff1a;boost download | hisroy versions 下面就以安装 1.78.0的版本为例 2、安装boost库 我们将下载好的boost库上传到Ubuntu&#xff0c;并解…

C++设计模式(16)——责任链模式

亦称&#xff1a; 职责链模式、命令链、CoR、Chain of Command、Chain of Responsibility 意图 责任链模式是一种行为设计模式&#xff0c; 允许你将请求沿着处理者链进行发送。 收到请求后&#xff0c; 每个处理者均可对请求进行处理&#xff0c; 或将其传递给链上的下个处理…

关闭终端后在服务器上运行代码+将终端输出打印到文件中

解决方案 首先打开一个screen # name是你想给你的项目在screen中起的名字 screen -S name 然后&#xff0c;在你的运行命令后加入 | tee xxxx.txt&#xff0c;如 python run_mujoco.py --envWalker2d-v2 --tradeoff0.2 | tee Walker2d-v2.txt 这样就可以实现题目中的目的了…

华测导航GPCHC协议ROS驱动包,CGI610、410接收机,NavSatStatus、GPSFix和普通格式

目录一、消息类型1.1 sensor_msgs/NavSatFix1.2 sensor_msgs/NavSatStatus1.3 gps_common::GPSFix1.4 sensor_msgs::Imu二、部分源码2.1 相关的依赖和库2.2 文件结构2.3 字段分割函数2.4 定义消息话题Ubuntu 20.04 noetic 华测CGI 610——RS232-C——GPCHC 一、消息类型 1.1 …

从零编写linux0.11 - 第十一章 可执行文件

从零编写linux0.11 - 第十一章 可执行文件 编程环境&#xff1a;Ubuntu 20.04、gcc-9.4.0 代码仓库&#xff1a;https://gitee.com/AprilSloan/linux0.11-project linux0.11源码下载&#xff08;不能直接编译&#xff0c;需进行修改&#xff09; 本章目标 本章会加载并运行…

SpringCloud(PS)远程调用--Feign

远程调用RestTemplate远程调用RestTemplate方式调用存在的问题Http客户端Feign实现步骤自定义配置Feign优化Feign性能优化——连接池配置最佳实践RestTemplate远程调用 Bean // LoadBalancedpublic RestTemplate restTemplate(){return new RestTemplate();}Autowiredprivat…

linux基本功系列之fdisk命令实战

文章目录前言一. fdisk命令介绍二. 语法格式及常用选项三. 参考案例3.1 列出每个分区的大小3.2 分区操作3.2.1 添加硬盘3.2.2 开启虚拟机并分区3.3.3 分区完成后进行格式化挂载四 . 设置分区自动挂载前言 大家好&#xff0c;又见面了&#xff0c;我是沐风晓月&#xff0c;本文…