Site search

Categories

Archives

Tags





The GNU/Linux Advanced Administration

Free Linux Manuals !


A Newbie's Getting Started Guide to Linux

-- FREE --
IT Magazine
Subscriptions

Oracle Magazine Oracle Magazine Contains technology strategy articles, sample code, tips, Oracle and partner news, how-to articles for developers and DBAs

WebSite Magazine WebSite Magazine Practical advice, helpful tools and insights for website owners

Dr Dobb's Journal Dr Dobb's Journal enables coders to write the most efficient programs and help in daily programming quandaries

DM Review DM Review is recognized as the premier business intelligence, analytics and data warehousing publication
Various other Free IT magazine subscriptions
NoAdware Free Trial

NoAdware Remove
harmful
adware,
spyware,
trojans,
dialers
and worms!
- Featured ebook -

Database Normalization
by Alf Pedersen

Database Normalization ebook Understand and master how to normalize a database using methods richly documented with graphical ERD and server diagram examples

RSS
XML RSS
What is this?
AddThis Feed Button

Social
Bookmarking


Match OS process to Oracle session

Your server is under pressure and you have decided to kill the oracle session which is causing excessive
CPU or memory consumption, here’s how you can find the oracle session associated with a unix process:

Use top on the unix command line to see which process is the main culprit:
(use shift+M to sort the list in order of highest memory consumption)

$top
top – 15:35:38 up 81 days, 47 min, 2 users, load average: 0.03, 0.04, 0.06
Tasks: 148 total, 2 running, 146 sleeping, 0 stopped, 0 zombie
Cpu(s): 1.5% us, 0.0% sy, 0.0% ni, 98.5% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 993492k total, 979396k used, 14096k free, 8568k buffers
Swap: 1998840k total, 392928k used, 1605912k free, 791300k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4132 oracle 15 0 754m 149m 143m S 0.0 15.4 0:03.92 oracle
9581  oracle 15 0 754m 137m 132m S 0.0 14.2 0:01.70 oracle
5230  oracle 15 0 755m 132m 130m S 0.0 13.7 0:16.90 oracle
6404  oracle 16 0 754m 116m 111m S 0.0 12.0 0:02.75 oracle
5224  oracle 16 0 766m   99m   98m S 0.0 10.2 0:08.76 oracle
5234  oracle 16 0 754m   89m   87m S 0.0 9.2   0:06.84 oracle

Make sure the top process is a client connection shadow process:

$ps -ef | grep 4132

oracle 4132 1 0 08:52 ? 00:00:03 oracletestdb (LOCAL=NO)
oracle 23557 23472 0 15:35 pts/1 00:00:00 grep 4132


Inside the database, find out who this is :
(formatted result)

SQL>

select
p.username,
s.sid,
s.serial#,
p.spid,
s.osuser,
s.status,
p.program,
p.terminal,
to_char(s.logon_time,’dd-mon-yyyy hh24:mi:ss’) “Logon Time”,
s.module
from
v$process p,
v$session s
where
p.addr = s.paddr
and p.spid = ’4132′;

USERNAME  SID   SERIAL# SPID    OSUSER STATUS
————   —-     ——-    —–     ——     ——-
devuser      393    1178       4132     LarryE   ACTIVE

PROGRAM                            TERMINAL    Logon Time                MODULE
——————————  ————-     ———————-  —————
oracletestdb@test.world.com  UNKNOWN  16-feb-2008 13:18:20 TOAD 9.0.1.8

Kill the user:

SQL> alter system kill session ’393,1178′;

System altered.

The user will receive this message either immediately or at the next attempted SQL statement:

ORA-00028: your session has been killed

Recommended reading: