Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Session Killed...!!

RE: Session Killed...!!

From: Allen, Brandon <Brandon.Allen_at_OneNeck.com>
Date: Thu, 15 Sep 2005 09:11:41 -0700
Message-ID: <04DDF147ED3A0D42B48A48A18D574C45023615CF@NT15.oneneck.corp>


Chirag, you can use the following query to see if any transaction is actually rolling back:  

select s.username, s.sid, t.addr, t.status, t.used_ublk, decode(bitand(t.flag,128),0,'NO','YES') rolling_back from v$session s, v$transaction t where s.taddr=t.addr;  

(Thanks to Mark Powell for telling me about this flag a few weeks ago)    

And you can query v$transaction.used_ublk at an interval to calculate the remaining time to complete the rollback - here is a query that will do it for you:  

http://www.ixora.com.au/scripts/rbs.htm

(Thanks to Jared Still for pointing me to this script last month, and thanks to Steve Adams for writing and sharing it)  

-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Chirag DBA Sent: Thursday, September 15, 2005 8:24 AM To: Chen, Sarah
Cc: yaoyongping_at_gmail.com; Thomas.Mercadante_at_labor.state.ny.us; Oracle-L Freelists Subject: Re: Session Killed...!!

well, that is understandable. But the question is why it is taking too long to roll back.  

It is more than 10 hrs now.  

What is it rolling back for this long?  

regards - chirag  

On 9/15/05, Chen, Sarah < Sarah_Chen_at_budco.com> wrote:

I did some research according to this issue before. Here is from my notes(I don't know where I got it, but must from one of the Oracle experts):

when a session is killed, oracle needs to rollback whatever work it had been doing - that's why it waits.

going to the o/s and killing the processes won't speed this up. However, when you use "alter system kill session", the session doesn't know it's killed until it makes another request to the database - if it was waiting for a response (particularly to a remote operation), it may not make a request for a long time, in which case killing the process from the o/s may help to stop the session. at that time, the database still needs to rollback whatever had happened already.

Sarah

-----Original Message-----
From: Yongping Yao [mailto: <mailto:yaoyongping_at_gmail.com> yaoyongping_at_gmail.com] Sent: Thursday, September 15, 2005 11:06 AM To: Chen, Sarah
Cc: Thomas.Mercadante_at_labor.state.ny.us; chiragdba_at_gmail.com; Oracle-L Freelists
Subject: Re: Session Killed...!!

I agree that it's very strange to kill a session in Oracle. As I experienced, SELECTs are more easier to kill than DMLs and SELECTs running after a long time are more difficult to kill. UPDATE is the most difficult to kill. Oracle always reponds as "we have marked the session killed" but the session is still there and the lock remained hold. Anyone with good recommendations?

2005/9/15, Chen, Sarah < Sarah_Chen_at_budco.com>:
>
> I always check process id as well as sid and serial# while killing a
session
> from Oracle.
>
> I will always query v$session before and after, and if the status of
> v$session marked "killed", and then I will go ahead kill OS process to
clean
> this session. It always works on Solaris.
>
> Sarah
>
>
> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org

[mailto: <mailto:oracle-l-bounce_at_freelists.org> oracle-l-bounce_at_freelists.org]On
> Behalf Of Mercadante, Thomas F (LABOR)
> Sent: Thursday, September 15, 2005 10:47 AM
> To: chiragdba_at_gmail.com; Oracle-L Freelists
> Subject: RE: Session Killed...!!
>
>
>
>
> If you kill the unix process associated with this session first, and then
> the session it will go away.
>
>
>
> Killing sessions in Oracle has always been weird. Sometimes they go away
> and sometimes not, depending on OS. In Windows, use orakill to kill the
> session ĘC this always seems to work in windows. And killing the unix
> session then the Oracle session seems to work just fine in AIX.
>
>
>
> ________________________________
>
>
> From: oracle-l-bounce_at_freelists.org [mailto: <mailto:oracle-l-bounce_at_freelists.org> oracle-l-bounce_at_freelists.org]
> On Behalf Of Chirag DBA
> Sent: Thursday, September 15, 2005 10:36 AM
> To: askdba_at_freelists.org; Oracle-L Freelists
> Subject: Session Killed...!!
>
>
>
>
> Hi ,
>
>
>
>
>
> I saw many users on my database connected for more than 6 days without any
> activity.
>
>
>
>
>
> I killed 1 user and still the status in v$session is showing as killed.
>
>
>
>
>
> but it it not getting removed from the v$session.
>
>
>
>
>
> I am running 9.0.1.3 on solaris.
>
>
>
>
>
> any idea? We already hit the bug ora-07442.
>
>
>
>
>
> regards - chirag

--
Yao Yongping
Learning Oracle, UNIX/Linux...
Love Reading, Classical Music, Philosophy, Economics etc.
Blog: http://blog.csdn.net/ern
          <http://spaces.msn.com/members/yaoyp/> http://spaces.msn.com/members/yaoyp/




Privileged/Confidential Information may be contained in this message or attachments hereto. Please advise immediately if you or your employer do not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of this company shall be understood as neither given nor endorsed by it.


--
http://www.freelists.org/webpage/oracle-l
Received on Thu Sep 15 2005 - 11:12:43 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US