Skip to content

Commit 3a02c4c

Browse files
Merge pull request #401 from oracle-devrel/uschwinn-performance
Uschwinn performance
2 parents baada36 + 73f4f64 commit 3a02c4c

File tree

5 files changed

+114
-0
lines changed

5 files changed

+114
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Database Performance
2+
3+
4+
Effective data collection and analysis is essential for identifying and correcting performance problems. Oracle Database provides several tools that allow a performance engineer to gather information regarding database performance. In addition to gathering data, Oracle Database provides tools to monitor performance, diagnose problems, and tune applications.
5+
They are usually available through different methods: Graphical tools such as Oracle Enterprise Manager Cloud Control, SQL Developer, Oracle scripts, PL/SQL packages, initialization parameters or through corresponding v$ views. Most of them are available without additional installation and can be used immediately. Others can be loaded separately from My Oracle Support (MOS) or can be activated and used via Cloud Console.
6+
7+
Examples are:
8+
- Automatic Workload Repository (AWR) collects, processes, and maintains performance statistics for problem detection and self-tuning purposes.
9+
- Automatic Database Diagnostic Monitor (ADDM) analyzes the information collected by AWR for possible performance problems with the Oracle database.
10+
- SQL Tuning Advisor allows a quick and efficient technique for optimizing SQL statements without modifying any statements.
11+
- SQL Access Advisor provides advice on materialized views, indexes, and materialized view logs.
12+
- SQL Performance Analyzer as part of Real Application Testing assesses the impact of system changes on the response time of SQL statements.
13+
- Real-time SQL Monitoring gives an up-to-date overview of operations and displays statements that are currently active or in a queue.
14+
- Explain Plan displays execution plans chosen by the optimizer.
15+
- Special Performance pages (aka Performance Hub) in Cloud Control or OCI Console and associated reports deliver a consolidated view of all performance data for
16+
and provide summary information not only on overall IO, CPU and Memory usage by the database but also detailed SQL monitoring information.
17+
18+
19+
## Useful Links
20+
21+
### Documentation
22+
23+
- [Oracle Database 19c Performance](https://docs.oracle.com/en/database/oracle/oracle-database/19/performance.html)
24+
- [PL/SQL Packages and Types Reference DBMS_PERF](https://docs.oracle.com/en/database/oracle/oracle-database/19/arpls/DBMS_PERF.html#GUID-290C18B9-A2EF-468D-9D6E-B31D717082BB)
25+
- [Oracle Cloud Infrastructure Documentation - Performance Hub Report](https://docs.oracle.com/en-us/iaas/autonomous-database/doc/use-perf-hub-monitor-databases.html)
26+
27+
28+
### Team Publications
29+
30+
- [Performance Hub - the database tuning gem](https://blogs.oracle.com/coretec/post/oracle-performance-hub)
31+
- [Real-time SQL Monitoring on github](https://github.com/oracle-devrel/technology-engineering/tree/main/data-platform/core-converged-db/sql-performance/sql-monitoring)
32+
- [SQL Performance Analyzer on github](https://github.com/oracle-devrel/technology-engineering/tree/main/data-platform/core-converged-db/real-application-testing/sql-performance-analyzer)
33+
34+
### Blogs and technical briefs
35+
- [Monitoring Database Performance Using Performance Hub Report (Doc ID 2436566.1)](https://support.oracle.com/epmos/faces/SearchDocDisplay?_afrLoop=459842075147901&_afrWindowMode=0&_adf.ctrl-state=p9nyc4tf7_4)
36+
- [The performance report you are NOT using](https://connor-mcdonald.com/2021/04/30/the-performance-report-you-are-not-using/)
37+
38+
# License
39+
40+
Copyright (c) 2023 Oracle and/or its affiliates.
41+
42+
Licensed under the Universal Permissive License (UPL), Version 1.0.
43+
44+
See LICENSE for more details.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Performance Hub
2+
This folder provides SQL scripts to generate active Performance Hub reports. The Oracle provided script perfhubrpt.sql and the PL/SQL package DBMS_PERF especially REPORT_PERFHUB will be used.
3+
Information on the script usage can also be found in the blog posting [Performance Hub - the database tuning gem](https://blogs.oracle.com/coretec/post/oracle-performance-hub).
4+
5+
6+
Please refer to the [DBMS_PERF documentation](https://docs.oracle.com/en/database/oracle/oracle-database/21/arpls/DBMS_PERF.html#GUID-85CD8AB9-B6E0-444F-91A5-762EB92A74E9) to get detailled information on the parameters which can be used.
7+
8+
Before you start make sure that the user has DBA privileges.
9+
10+
### Performance Hub scripts
11+
12+
- perfhubscript.sql: Use the Oracle provided script perfhubrpt.sql
13+
- dbmsperf_def.sql: Example for DBMS_PERF.REPORT_PERFHUB with default settings
14+
- dbmsperf_1.sql: Example for DBMS_PERF.REPORT_PERFHUB with parameters
15+
16+
17+
# License
18+
19+
Copyright (c) 2023 Oracle and/or its affiliates.
20+
21+
Licensed under the Universal Permissive License (UPL), Version 1.0.
22+
23+
See LICENSE for more details.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
REM Script: dbmsperf_1.sql
2+
REM example for DBMS_PERF.REPORT_PERFHUB with parameters
3+
4+
REM REPORT_PERFHUB generates an active performance report of the entire database system for a specified time period.
5+
REM Arguments in this example define the report mode (historical or real-time) and start and end time for the time selection and outer time.
6+
REM Different tabs are available in the Performance Hub, depending on whether is_real-time is 1 for real-time mode or 0 for historical mode.
7+
REM When real-time data is selected, more granular data is presented because data points are available every minute.
8+
REM If historical data is chosen, more detailed data is presented, but the data points are averaged out to the AWR interval (usually an hour).
9+
10+
11+
set pages 0 linesize 32767 trimspool on trim on long 1000000 longchunksize 10000000
12+
13+
spool sql_details_1.html
14+
15+
select dbms_perf.report_perfhub (
16+
is_realtime => &realtime,
17+
outer_start_time => to_date('&outerstart','dd-MON-YYYY hh24:mi:ss'),
18+
outer_end_time => to_date('&outerend','dd-MON-YYYY hh24:mi:ss'),
19+
selected_start_time => to_date('&starttime','dd-MON-YYYY hh24:mi:ss'),
20+
selected_end_time => to_date('&endtime','dd-MON-YYYY hh24:mi:ss'))
21+
from dual;
22+
23+
spool off
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
REM Script: dbmsperf_def.sql
2+
REM example for DBMS_PERF.REPORT_PERFHUB with defaults
3+
REM REPORT_PERFHUB generates an active performance report of the entire database system for a specified time period.
4+
REM If you choose the defaults, report mode is historical, selected time is 1 hour before latest AWR and outer time period starts 24 hours before.
5+
6+
7+
set pages 0 linesize 32767 trimspool on trim on long 1000000 longchunksize 10000000
8+
9+
spool sql_details_def.html
10+
11+
select dbms_perf.report_perfhub()
12+
from dual;
13+
14+
spool off
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
REM Script: perfhubscript.sql
2+
REM Oracle script perfhubrpt.sql
3+
REM The Performance Hub Report can be generated in Single-Instance Database, in RAC and for PDBs and root containers.
4+
5+
REM Connect with DBA privileges
6+
REM Start the perfhubrpt.sql from $ORACLE_HOME/rdbms/admin
7+
REM You will be prompted for report level (basic, typical or all), database id, instance id and time range.
8+
REM An active HTML report will be generated in the dirctory
9+
10+
@?/rdbms/admin/perfhubrpt.sql

0 commit comments

Comments
 (0)