当前位置: 首页 > news >正文

About Oracle Database Performance Method

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.lryc.cn/news/12003.html

相关文章:

  • JavaScript 日期和时间的格式化大汇总(收集)
  • 【Python】缺失值可视化工具库:missingno
  • 【代码随想录二刷】Day18-二叉树-C++
  • 制造业的云ERP在外网怎么访问?内网服务器一步映射到公网
  • zookeeper 复习 ---- 练习
  • 2023年全国最新道路运输从业人员精选真题及答案1
  • Java每日一练——Java简介与基础练习
  • 解决Edge浏览器主页被篡改问题,或许可以帮你彻底解决
  • 字符设备驱动基础(一)
  • 将 Supabase 作为下一个后端服务
  • 14:高级篇 - CTK 服务工厂 简述
  • Java中的链表实现介绍
  • 演示Ansible中的角色使用方法(ansible roles)
  • Bash Shell 通过ls命令筛选文件
  • 2023-2-18 刷题情况
  • 【Linux】进程控制
  • 谷歌seo快排技术怎么做?Google排名霸屏推广原理
  • MySQL的优化
  • 实现qq群消息接收和发送功能
  • 压缩20M文件从30秒到1秒的优化过程
  • 如何选择合适的固态继电器?
  • SAP 忘记SAP系统Client 000的所有账号密码
  • Connext DDS可扩展类型Extensible Types指南
  • Docker简单使用
  • A Time Series is Worth 64 Words(PatchTST模型)论文解读
  • 微服务学习:SpringCloud+RabbitMQ+Docker+Redis+搜索+分布式
  • nginx平滑升级
  • 高可用的“异地多活”架构设计
  • 【面试题】Map和Set
  • Spring之事务底层源码解析