Skip to Main Content
  • Questions
  • Kill Session Revert / Miss some data on commit

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, shoukat.

Asked: July 03, 2017 - 8:15 am UTC

Last updated: July 05, 2017 - 1:11 am UTC

Version: 1

Viewed 1000+ times

You Asked

Hi,

I am new to Oracle. I have one Issue. Sometime user said that the application is hungup and they can't do anything. sometime they said they are unable to generate reports. For that I have studied your answers and I am using those to resolve their issues. But In one of your answers that we have to kill the session.

1. Whenever I am killing a session some user loss there entries and they start shouting.
2. Sometime User is unable to edit a particular entry only.

I am using following queries to get the list of session and to kill the inactive one given below:

select a.*, a.SID, a.SERIAL#, c.OBJECT_NAME
from v$session a, v$locked_object b, user_objects c
where a.SID=b.SESSION_ID and b.OBJECT_ID=c.OBJECT_ID order by a.status;

and to KILL

ALTER SYSTEM KILL SESSION 'ID,SERIAL' IMMEDIATE;

Above Queries working fine but only the issue that i have stated above. Entries revert back or not saved some data and some time user unable to edit a particular entry.

Please send me the queries that I can use to find that what entry is being locked and how can I unlock that particular entry of table so that user can edit that entry?

How I can kill / removed the entries that are being locked or currently in session as inactive that are causing issues for other entries not to be saved?

What is the query to get the IP address that is locking that particular entry? so that I can go to that particular person and tell him that finish the task and close the form so that other can use the same entry and table for transactions?

Thank you so much for your help! I don't know anywhere else to go so please help me



and Connor said...

In v$session, there is are columns

BLOCKING_SESSION_STATUS
BLOCKING_INSTANCE
BLOCKING_SESSION

which tell you (when a session is blocked) who is doing the blocking. This lets you drill into *that* session and make an assessment - depending on your client tools and your applications, querying v$session for that session should give you the details you need.

And yes, if you kill a session, then any uncommitted transactions for that session will be rolled back. It is equivalent to you "pulling out the power plug" for that session. You could also explore using Resource Manager to look after this for you.


Take a look here for some examples

https://asktom.oracle.com/pls/apex/f?p=100:11:::NO:RP:P11_QUESTION_ID:9533884200346533769

https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9532001900346971948

Is this answer out of date? If it is, please let us know via a Comment