6
Oracle Database Performance Tuning for Beginners Performance issue is one of the most challenging issues faced by a Database Administrator Everyday. I am providing the basic steps how to get started with the situation when our users start complaining about the Database running slow. TOP Command:- This command provides an ongoing look at processor activity in real time. Check for the Oracle processes which are consuming maximum CPU. Get the SID from PID:- You may use this query to find the sid from the pid of the process. This query is simple, you may customize your own query using the objects v$session and v$process.

Database tuning basics

Embed Size (px)

DESCRIPTION

Oracle Performance tuning Basics

Citation preview

Page 1: Database tuning basics

Oracle Database Performance Tuning for Beginners

Performance issue is one of the most challenging issues faced by a Database Administrator Everyday. I am providing the basic steps how to get started with the situation when our users start complaining about the Database running slow.

TOP Command:-This command provides an ongoing look at processor activity in real time. Check for the Oracle processes which are consuming maximum CPU.

Get the SID from PID:-You may use this query to find the sid from the pid of the process. This query is simple, you may customize your own query using the objects v$session and v$process. select sidfrom v$session s, v$process pwhere p.spid = <process Id>and s.paddr = p.addr;

Page 2: Database tuning basics

Get the details of the waits:-Find out the details of the wait from v$session_event

set lines 120 trimspool oncol event head "Waited for" format a30col total_waits head "Total|Waits" format 999,999col tw_ms head "Waited|for (ms)" format 999,999.99col aw_ms head "Average|Wait (ms)" format 999,999.99col mw_ms head "Max|Wait (ms)" format 999,999.99select event, total_waits, time_waited*10 tw_ms, average_wait*10 aw_ms, max_wait*10 mw_msfrom v$session_eventwhere sid = 2844; ---<put your SID>

Output shall be like:-

Page 3: Database tuning basics

Other objects which also provide important information are:-

V$ACTIVE_SESSION_HISTORY, V$SESSTAT, etc

These are the other OS commands which provide useful statistics.

Check iostat:-The iostat command gives the performance metrics of the storage interfaces.

Check ipcs:- When a process runs, it grabs from the “shared memory”. There could be one or many shared memory segments by this process. The processes send messages to each other (“inter-process communication”, or IPC) and use semaphores. To display information about shared memory segments, IPC message queues, and semaphores, you can use a single command: ipcs.

Page 4: Database tuning basics

Check vmstat:-vmstat, continuously runs and posts its information. It takes two arguments:

# vmstat <interval> <count>

Check free:-One common question is, “How much memory is being used by my applications and various server, user, and system processes?” Or, “How much memory is free right now?” If the memory used by the running processes is more than the available RAM, the processes are moved to swap. So an ancillary question is, “How much swap is being used?”The free command answers all those questions. What’s more, a very useful option, –m, and shows free memory in megabytes:-

Page 5: Database tuning basics

There is much more in Database tuning, but I believe this document shall act as a good reference document for beginners in Oracle Database tuning.

Author – Akash Pramanik.Database Administrator – IBM

Mail – [email protected] – +91 9804944189

Follow – http://akashpramanik.blogspot.in