0% found this document useful (0 votes)
120 views

Oracle Database Performance Tuning Using ORATOP - Tips & Tricks

The document discusses the ORATOP utility which provides a real-time interactive interface to monitor Oracle database performance. It describes how to connect to databases using ORATOP and explains the different sections of its output including database information, instance activity, wait events, and active SQL. The summary also mentions some interactive features of ORATOP.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views

Oracle Database Performance Tuning Using ORATOP - Tips & Tricks

The document discusses the ORATOP utility which provides a real-time interactive interface to monitor Oracle database performance. It describes how to connect to databases using ORATOP and explains the different sections of its output including database information, instance activity, wait events, and active SQL. The summary also mentions some interactive features of ORATOP.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Hello DBA,

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.

So, what is 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.

Where this available?

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 connect DB on local machine you can simply use below command.

[oracle@celvpvm04819 oratop]$ ./oratop / as sysdba


Whereas for remote database, requires setting the parameter "REMOTE_LOGIN_PASSWORD" Paired with the
availability of an oracle password file.

[oracle@celvpvm04819 oratop]$ ./oratop [email protected]:1521/PRIMARY

To allow the non-privileged user to use ORATOP, the system administrator with a DBA role may issue the grant:

"GRANT SELECT ANY DICTIONARY TO;"

Detailed Layout of ORATOP

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:

3) DB Wait events Section:

Now, let's take a closer look at those metrics and get detailed information about them.

Section 1 - Global Database information


version : Oracle major version
time [60s]: Current time from system metric
role : Role (Primary, Physical standby)
cdb name : cdb container name
db name : db_unique_name
open mode : Read write, read only w/apply (active)
name : Unique name (substr)
up : Database uptime
sn : Total user sessions
us : number of distinct users
ins : Total number of instance(s)
er : Diag active problem count (static)
sz : Total db size (static)
sga : Largest System Global Area
fra : %used Flashback Recovery Area (static)
log mode : Archive log mode
%db [60s]: Database utilization (%busy)
archive log, er, FRA incidents are static they're only acquired when you start the ORATOP session, they don't auto
refresh because they're expensive recursive queries hence those values do not change frequently.

Section 2 - Top 5 Instance(s) Activity ordered by Database Time.


ID : Instance Id.
CPU : Host CPU Count
%CPU : Host CPU Utilization (%) (busy)
%DCU : db cpu usage as %host cpu
LOAD : Current OS Load
AAS : Average Active Sessions
ASC : Active Sessions on CPU
ASI : Active Sessions waiting on User I/O
ASW : Active Sessions Waiting on other events
ASP : Active Parallel Sessions (F/G)
MBPS : I/O Megabytes per Second (throughput)
IORL : Average Synchronous Single-Block Read Latency (Threshold: 20ms)
IOPS : I/O Requests per second
LOGR : Logical Reads Per Sec
PHYR : Physical Reads Per Sec
PHYW : Physical Writes Per Sec
%FR : Shared Pool Free %
PGA : Total PGA Allocated
TEMP : Temp Space Used
UTPS : User Transaction Per Sec
UCPS : User Calls Per Sec
SSRT : SQL Service Response Time/Call
DCTR : Database CPU Time Ratio
DWTR : Database Wait Time Ratio
DBTM : Database Time Per Sec

%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

Section 4 - Active user's SQLs currently executing (Ordered by ELAPSED Desc)


ID : inst_id
CID : container id (CON_ID)
USER : parsing_schema_name
SID : session identifier
SPID : oraserver process os id
USERNAME : Oracle user name
PROGRAM : process program name
SRV : SERVER (dedicated, shared, etc.)
SERVICE : db service_name
%CPU [15s]: Session %CPU
PGA : pga_used_mem
SQL_ID/BLOCKER : sql_id or the final blocker's (inst:sid)
SQL_TEXT : sql_text (partial)
X : eXecution mode; 'P' Parallel, 'S' serial
ELAP : elapsed_time/EXEC (parsing, exec, and fetch, px is cumulative)
EXEC : executions
ROWS : rows_processed/EXEC
BH% : sql buffer hit ratio
LOAD : users currently executing
OPN : operation name, e.g. select
E/T : session elapsed time (active/inactive)
STA : ACTive|INActive|KILled|CAChed|SNIped
STE : process state, e.g. on CPU or user I/O or WAIting
WAIT_CLASS : wait_class for the named event
EVENT/*LATCH : session wait event name. Auto toggle with *latch name
W/T : event wait time (Threshold: 1s)

Interactive Keys: [default]


f : toggle between [standard] & detailed format.
r : toggle between [Cumulative (C)] & Real-Time (RT) (section 3)
s : switch to SQL mode (section 4)
p : switch to [process] mode (section 4)
k : toggle between [EVENT/LATCH] & object FILE#:BLOCK# (process section 4)
m : Toggle between [USERNAME/PROGRAM] & MODULE/ACTION (process section 4)
t : tablespace information
x : basic SQL plan table (requires sql_id input)
i : refresh interval, requires value in seconds [Default -5s, Min 3 sec]
q : quit/ exit program (also, { Q | Esc | function keys })
a : key displays the database's ASM information.
Symbols:
(B)yte, (k)illo, (M)ega, (G)iga, (T)erra, [PEZY]
(u)micro, (m)illi, (s)econd, minu(t)e, (h)our, (d)ay, (y)ear

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.

That’s it from my side.

Thanks Mr. Sandesh Rao Sir ( LinkedIn Profile ) for granting me permission to create a document based on your
valuable content.

Thank you for investing your time in reading this.

Please share your opinions, results, suggestions if any.

Join Our WhatsApp DBA community:

https://chat.whatsapp.com/FK5uiqb22kG6cfsGGX6pbQ

LinkedIn Profile: Rahul Kurkute

Reference:

https://youtu.be/lsqpJ9L9e20?si=GDoEnxWb6l01vcqA

You might also like