Kill Oracle session having only UNIX PID

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Post Reply
Stfish
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 3
Joined: Wed, 05 Apr 2006 10:59 am
Location: RJ

Having only the UNIX process ID, how can I identify in the V $ session or v $ process session id and serial, so that you can kill the session?
gilbertoca
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 372
Joined: Tue, 24 Jan 2006 3:33 pm
Location: Palmas - TO
Contact:

I think here http://download-west.oracle.com/docs/cd ... #sthref628
is a good place to start.

Gilberto
Stfish
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 3
Joined: Wed, 05 Apr 2006 10:59 am
Location: RJ

Gilbertoca,

grateful but, the link in question only shows me how to kill an identicated session.
I am trying to identify the session from the process (PID) of the operating system (UNIX)
User avatar
dr_gori
Moderador
Moderador
Posts: 5026
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Try the following:

OS_Process_ID is the UNIX PID:

Select all

Select SID,SERIAL#  
from v$session where paddr in (select addr from v$process where spid='OS_PROCESS_ID'); 
With these values, you can kill

Select all

alter system kill session '<SID>,<SERIAL#>';
Now, can kill in only using

Select all

kill -9 <pid>
but you should not kill the process in just without first killing in Oracle.

: -O
gilbertoca
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 372
Joined: Tue, 24 Jan 2006 3:33 pm
Location: Palmas - TO
Contact:

Good Thomas! In this you was faster than me! : lol:
Stfish
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 3
Joined: Wed, 05 Apr 2006 10:59 am
Location: RJ

That was exactly what I was wanting.

grateful !!
lobo
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 19
Joined: Tue, 09 May 2006 2:04 pm
Location: Suzano
Valeu!!!!

Look at this query to check the SID and the serial:

Select all

select d.sid,d.serial#,b.spid,d.status,decode(a.block,1,'SIM',0,'não') BLOCK, 
c.object_name,d.osuser,d.schemaname,d.program 
from v$lock a,dba_objects c, v$session d, v$process b 
where a.sid=d.sid and 
d.paddr=b.addr 
and a.id1=c.object_id(+)  
and d.osuser is not null 
and d.schemaname <> 'SYS' 
order by 1,6
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest