Oracle Database Performance Tuning Using ORATOP - Tips & Tricks
Oracle Database Performance Tuning Using ORATOP - Tips & Tricks
Myself Rahul Kurkute. Think of this scenario, you are working on the PROD environment where Database sessions never
crossed 20+ Avg. Active sessions. Suddenly In the middle of fine day, Sessions started to increase 300+ 400+ crossed and
your boss comes and says my application is running very slow check urgently and you start looking at what's happening
the problem with lots of your scripts, monitoring views and with the other tools like ASH AWR ADM report etc. Seems
like quite difficult situation to decide what and where to look.
Further You’ve to take a report and then look at the report by the time you look at the report the system might have
changed and you're no longer looking at the problem.
What if I told you that you can efficiently monitor live performance issues with all the necessary data consolidated in
one place? YES, you heard correctly ….
Indeed, you can achieve this with the ORATOP utility. While many have heard of ORATOP, there are quite a few who
haven't utilized it, and some who have used it but haven't fully grasped its functionality.
After going through this document, you will discover the power of this tool and you will find yourselves using it into
numerous performance monitoring tasks that you currently handle manually or through your scripts or other tools.
Subsequently, you'll no longer require any other guides to navigate ORATOP.
ORATOP is a text based interactive interface utility. it's just like TOP command but it's a database interface which can be
run against RAC databases or single instance databases. Furthermore, it offers the capability to monitor the database in
near real-time, with the data being continuously refreshed.
ORATOP is a read-only utility that relies on access to v$ views to gather all necessary information. It's exceptionally
lightweight and designed to analyze issues without inducing any additional strain on the database system.
What's really cool about this tool is that you can access all the information without having to leave the tool itself. This is
unlike traditional performance tuning, where you typically have to consult numerous performance monitoring views and
run multiple scripts. With ORATOP, you gain comprehensive insights without the hassle of running 10 or 20 separate
scripts.
You can find it readily available in your $ORACLE_HOME/suptools/oratop directory, so there's no need for installation.
It's been available since version 11.2.0.4, and with each subsequent release, it introduces new features such as in 18c
PDB support, Data Guard (DG) support, and support for Real Application Clusters (RAC) added.
How to connect?
To allow the non-privileged user to use ORATOP, the system administrator with a DBA role may issue the grant:
Output of ORATOP consist of 4 Sections. Database, Instance Activity, AWR like top 5 wait events, Process/ SQL
With ORATOP, you have the capability to monitor various aspects in real-time, including live sessions, tablespace
information, SQL plans, OS and instance statistics, and OS crucial metrics like physical and logical reads/writes,
temporary and PGA (Program Global Area) utilization, user transactions and calls per second, database CPU time ratio,
database time per second, I/O requests per second, and I/O megabytes per second (throughput) and so many other
metrics.
Don't stress about all the numbers and columns. I've made a simple diagram that's easy to understand. Just print it out
and stick it near your desk. It will only take about 30 minutes to get familiar with ORATOP.
1) Database Section:
2) Instance Section:
Now, let's take a closer look at those metrics and get detailed information about them.
%DCU (Database instance CPU Consumption) instance CPU consumption as a percentage of the host consumption so we
can see how much this database is consuming when compared to the entire machine CPU utilization.
Section 3 - Top 5 Timed Events ordered by wait time desc (Cluster-wide, non-idle)
EVENT(C/RT) : wait event name
(C) : Cumulative since instance startup
(RT) : Real time
WAITS : total waits
TIME(s) : total wait time in seconds
AVG_MS : average wait time in milliseconds
PCT : percent of wait time (all events)
WAIT_CLASS : name of the wait class
ORATOP help.
[oracle@celvpvm04819 oratop]$ ./oratop -h
oratop: Release 14.3.1
Usage:
oratop [ [Options] [Logon] ]
Logon:
PM|CMD : {username[@connect_identifier] | / } [AS SYSDBA]
PM only: {password[@connect_identifier] } [AS SYSDBA]
connect_identifier:
o Net Service Name, (TNS) or
o Easy Connect (host[:port]/[service_name])
Note. either can be set using TWO_TASK
Options:
-r : real-time (RT) wait events. (sec 3, default: Cumulative)
-k : FILE#:BLOCK# (sec 4/process mode, default: EVENT/LATCH)
-m : MODULE/ACTION. (sec 4/process mode, default: USERNAME/PROGRAM)
-s : SQL mode. (sec 4, default: process mode)
-f : detailed format, 132 columns. (default: standard, 80 columns)
-b : batch mode. (default is text-based user interface)
-n : maximum number of iterations. (requires number)
-i : interval delay, requires value in seconds. (default: 5s)
-v : oratop release oraversion number
-h : this help
You can also utilize ORATOP in batch mode, where it generates snapshots at regular intervals, allowing you to save the
output to a file. To delve deeper into its functionalities, simply explore the interactive mode. It's quite easy to grasp
through hands-on experimentation.
Key Notes:
1) This utility is exclusively designed for Linux systems and isn't available on other platforms. However, you can
still utilize it by remotely connecting to the non-Linux based system’s DB using EZconnect.
2) “X” key shows the basic execution plan, I will recommend use below command to check execution plan.
select * from table(DBMS_XPLAN.DISPLAY_CURSOR('&a',’&Child_number’));
3) ORATOP shows highly consumed metric’s values in RED color.
4) As it shows Real Time metrics you can’t monitor old/past data other than wait events.
5) When you connect ORATOP to a mounted instance that isn't open, only the instance ID will be highlighted in
red. This is because the necessary statistics aren't available until the instance is opened. (Specially for DG env)
6) Currently, the number of instances that can be listed dynamically by ORATOP is limited to 5. To see all
instances, please run ORATOP in batch mode with -bn option.
7) According to the AHF development team, ORATOP is not compatible with PDB(s), ORATOP will only work for
the root container. Reason, PDB does not have the needed DB dictionary views, it has only a subset.
Therefore, you cannot run ORATOP directly for a PDB.
8) ORATOP connects to one database at a time if having multiple databases on single server. You can use
multiple sessions of ORATOP.
Thanks Mr. Sandesh Rao Sir ( LinkedIn Profile ) for granting me permission to create a document based on your
valuable content.
https://chat.whatsapp.com/FK5uiqb22kG6cfsGGX6pbQ
Reference:
https://youtu.be/lsqpJ9L9e20?si=GDoEnxWb6l01vcqA