Long operations session killing

hi
i want to remove a particular session which one is running a long query.ie.some user a running a query which one is taking too much time to run.how to kill such session??
regards
Edited by: you on May 19, 2010 6:02 AM

To find SQLs running for more than 5 Seconds:
col username for a30
col machine for a30
select s.sid, a.sql_text, s.username, s.machine
     from v$sqltext a,
     v$session s
     where s.sql_address = a.address
     and s.sid in (select sid
from v$session
where LAST_CALL_ET > 5
and status = 'ACTIVE'
and username = 'USERNAME' )
order by s.sid, a.piece;
check for long operations :
SET LINES 150
COLUMN sid FORMAT 9999
COLUMN serial# FORMAT 9999999
COLUMN username FORMAT A30
COLUMN machine FORMAT A30
COLUMN progress_pct FORMAT 99999999.00
COLUMN elapsed FORMAT A10
COLUMN remaining FORMAT A10
SELECT s.sid,
s.serial#,
s.username,
s.machine,
ROUND(sl.elapsed_seconds/60) || ':' || MOD(sl.elapsed_seconds,60) elapsed,
ROUND(sl.time_remaining/60) || ':' || MOD(sl.time_remaining,60) remaining,
ROUND(sl.sofar/sl.totalwork*100, 2) progress_pct
FROM v$session s,
v$session_longops sl
WHERE s.sid = sl.sid
AND s.serial# = sl.serial#
AND sl.time_remaining > 0;
the below query will tell on which object lock has been acquired , if you know the object name on which long operation is running . then after getting sid you can kill it
select session_id "sid",SERIAL# "Serial",
substr(object_name,1,20) "Object",
substr(os_user_name,1,10) "Terminal",
substr(oracle_username,1,10) "Locker",
nvl(lockwait,'active') "Wait",
decode(locked_mode,
2, 'row share',
3, 'row exclusive',
4, 'share',
5, 'share row exclusive',
6, 'exclusive', 'unknown') "Lockmode",
OBJECT_TYPE "Type"
FROM
SYS.V_$LOCKED_OBJECT A,
SYS.ALL_OBJECTS B,
SYS.V_$SESSION c
WHERE
A.OBJECT_ID = B.OBJECT_ID AND
C.SID = A.SESSION_ID
ORDER BY 1 ASC, 5 Desc
Edited by: PrafullaNath on May 19, 2010 3:15 PM
Edited by: PrafullaNath on May 19, 2010 3:16 PM
Edited by: PrafullaNath on May 19, 2010 3:17 PM

Similar Messages

  • Long Operation - OEM

    I ran a query on a table with 2 million records. When i looked in OEM the session in which the query is running is on Long operation. Selected the Long Operations tab, in which i can see three sections Active Operations, Past Operations and Details.
    My Question is in Detail section the progress bar starts with 0 and ends with a Calculated number (say 2442013). What is the Logic/calculation that oracle uses to arrive at this number (Blocks). My advance thanks for your responses

    When you run the query, it is optimizer who check optimal path to access data, it also know how many block need to scan.
    Same info you will get from v$session_longops.
    SELECT s.sid,s.serial#,s.machine,
    sl.elapsed_seconds, sl.time_remaining,
    ROUND(sl.sofar/sl.totalwork*100, 2) progress_pct
    FROM v$session s, v$session_longops sl
    WHERE s.serial# = sl.serial# and s.sid = sl.sid
    Virag

  • Long Operation

    Does anyone know what the following SQL statement is doing?
    SELECT ARGUMENT,OVERLOAD#,POSITION# POSITION,TYPE# TYPE,
    NVL(DEFAULT#,0) DEFAULT#,NVL(IN_OUT,0) IN_OUT,NVL(LEVEL#,0)
    LEVEL#,NVL(LENGTH,0) LENGTH,NVL(PRECISION#,0)
    PRECISION,NVL(SCALE,0) SCALE,NVL(RADIX,0) RADIX
    FROM ARGUMENT$ WHERE OBJ# = :b1 AND
    PROCEDURE$ = :b2 ORDER BY OBJ#,PROCEDURE$,OVERLOAD#,SEQUENCE#
    I see this when viewing the SQL tab of DBA Studio for a session involved a 'long operation' (little clock icon).
    I need to find the statement causing this operation.
    Unfortunately this is a 3rd party package written VB with 1000's of imbeded SQL statements in it.

    When you run the query, it is optimizer who check optimal path to access data, it also know how many block need to scan.
    Same info you will get from v$session_longops.
    SELECT s.sid,s.serial#,s.machine,
    sl.elapsed_seconds, sl.time_remaining,
    ROUND(sl.sofar/sl.totalwork*100, 2) progress_pct
    FROM v$session s, v$session_longops sl
    WHERE s.serial# = sl.serial# and s.sid = sl.sid
    Virag

  • Threading long operations

    Hi
    In our J2ME-project we execute long operations like parsing (with KXml) and network activity in a separate worker thread, so the UI keeps "responsive" . Whats about operations like inserting or retrieving small amount of data (until 15 KB) from the recordstore? Is the recordstore perfomant enough or do you recommend to put it's operations in a separate thread too?
    Regards
    Michael

    v$session_longops will keep only the portions it can calculate the timed operations for and that are taking over a certain period of time. These would include full table scans, parallel query, sorting and a few others. The table being queried must also meet certain criteria. A long running session could have multiple parts to it thus some portions of the execution are obtainable through v$session_longops and others or not. You have probably had a couple that were eligible, but the transaction is still taking place but is not eligible for v$session_longops.
    Lee

  • Try to catch the 'long' operation ...

    Hello,
    With the following SQL statement, I try to catch the remaining time of a long operation :
    select sid,totalwork, sofar, time_remaining, ELAPSED_SECONDS
    from v$session_longops
    where totalwork > sofar;
    The aim is to use it to warn the user when he does a long search.
    But i can't find a way to isolate one long operation concerning one user/action.
    The problem is that multiple person login into the same user (not really good, I know but ...) and with a user, I can't get his SID ...
    Any help willbe gladly appreciated.
    Miguel

    I finnaly found it! ;-)
    select sid,serial# from v$session where audsid=userenv('SESSIONID');

  • HT1420 old computer no longer operable, how do I get the contents of m iPod onto new compter

    I have an older iPod, and the computer I had it associated with is no longer operable at all. How do I get the music on my iPod onto my new computer?

    follow the steps given here...
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive

  • More on Updating Swing Components during long operations...

    After reading thru a few posts here, I've come to the conclusion that what I need is going to be much more difficult than I'd planned. Neverthess i'll try to explain...
    I have a JFrame which contains a simple JLabel and JProgressBar. While I am performing a long network operation, I am making calls to a Thread class (which contains the above components) to update the JFrame indicating the current status. Normally I have no problem with this as the paintImmediately method suffices. However, when I call this long operation from the constructor of a larger, more complex JFrame, the GUI remains unresponsive (despite the plethora of paintImmediately calls that are executed) until the user clicks in the threaded progress box.
    Unfortunately the SwingWorker solution will not work for me as I need to be completely backwards compatible with JDK 1.3 (supporting Mac OSX 10.X). Oddly enough tho, I don;t get these problems when I use the same code in JDK 1.1.8 on Mac OS9.
    Any ideas?
    thanks!

    heh...looks like it was a simple thing afterall :)
    The JDialog (not JFrame) just needed focus.
    heh...is it friday yet? ;)

  • Hyper-V Vswitch erro Microsoft Network Adapter Multiplexor Driver) is no longer operational. Eventid 24/22

    Hello
    Yesterday I got this error and I lost the connectivity with my hyper-v and  all of the VMs(60). I Solved it disabling and reenabling the nics , team and vSwitch.
    I have 4 NICS LACP Dynamic
    First error in the event viewer:
    Event id:16949
    Member Nic {ffb08f0f-1111-1111-89b8-689ce5cba3da} Disconnected.
    Then:
    Event id:22
    Media disconnected on NIC /DEVICE/{5D11FA06-1111-4851-1111-25BE3A349F7A} (Friendly Name: Microsoft Network Adapter Multiplexor Driver).
    And now the problem:
    Event id:24
    NIC /DEVICE/{5D11FA06-1111-4851-1111-25BE3A349F7A} (Friendly Name: Microsoft Network Adapter Multiplexor Driver) is no longer operational.
    Is this normal? If one member of the team fails all the team in not longer operantional?
    Thank you
    Regards

    This is not normal, this is usually cause by driver issues or Windows bugs.
    Have you installe dall Windows latest updates ?
    Are your NIC  firmware and drivers up to date ?
    Regards, Samir Farhat Infrastructure and Virtualization Consultant || Virtualization, Cloud, Azure ? Follow and Ask here https://buildwindows.wordpress.com

  • Not Connected Exception during long operation

    Hi all. My program does a very long operation - more than an hour. (import records from excel file). I create a thread, the operation runs there, and put af:poll on the page for changing progress indicator. So it's ok. The trouble is that I get
    Exception in thread "Thread-90" oracle.jbo.NotConnectedException: JBO-25200: Application module is not connected to a database.
         at oracle.jbo.server.DefaultTxnHandlerImpl.handleRollback(DefaultTxnHandlerImpl.java:145)
         at oracle.jbo.server.DBTransactionImpl.doRollback(DBTransactionImpl.java:4872)
         at oracle.jbo.server.DBTransactionImpl.rollback(DBTransactionImpl.java:2429)
         at kz.kklife.insis.modules.policyImport.ImportRunner.run(ImportRunner.java:124)
         at java.lang.Thread.run(Thread.java:619)
    after some time.
    With default jbo.ampool.timetolive (3 600 000) it throws exactly in an hour after starting developer server. So I changed it to 7 200 000. But I got an error on a production server in a random time - because I don't restart it just before importing, of course.
    So, is there any settings for weblogic not to disconnect transactions? (I get a transaction object through getDBTransaction() method of application module) I tried to uncheck "Ignore In-Use Connections" option, but it didn't help.

    Timo Hahn wrote:
    As far as I understand the framework, a transaction begins directly after the last commit or rollback.
    So I assume that the timeout is reset at this point. I would not make sense doing it otherwise. As you already mentioned if you set the timeout to e.g. 2 hours and you get the am instance from the pool after 1:59,59 of initializing the transaction it would be stale before you had any chance to do something with it.Oh. I'll try to commit new transaction just before import, thanks. Need I do something like
      DBTransaction transaction = ADFFacesUtils.getApplicationModuleForDataControl("ImportAppModuleDataControl").getDBTransaction();
      transaction.commit();
      // -- do long running stuffor you mean some another way to commit?
    I would set up a different configuration for this long running transaction (an other AM configuration) where I increase the timeout value to a higher number. Then use an instance from this configuration for the long running stuff only.I use another AM, only for long running stuff. But users can do import simultaneously.

  • Long video sessions on two monitors

    I am having three issues capturing long training sessions and teleconferences. They run 5-8 hours in length and have no natural breaking point. I have tried to capture them in one session and, without fail, the program crashes before it can even complete finalizing. It always terminates with a message about bad data or insufficient disk space (it’s being save to a blank 4Tb drive). So, apparently, saving the whole conference won’t work. So, I decided I would run two instances of Adobe Captivate. I would run one for one hour, then start the second. Once the second started, I’d terminate the first, it would finalize, then I’d save it, close it, and restart a third instance. I would continue this cycle until the conference ended and finish with a pile of slightly overlapping, slightly longer than one hour sessions and then edit and splice them together post production.
    Doing this give me the three problems. First, I am working on a two monitor system. Once a screen capture is started, it appears Adobe takes control of the monitors. The capture monitor becomes primary and everything, and I mean everything, pops up in the middle of the capture screen first which destroys the integrity of the recording. How do I turn off that feature so I can work on the other monitor and have nothing interrupt the recording? Second problem, as soon as you stop a Captivate session, it finalizes the recording. Once the finalization completes, two things happen: 1) it immediately starts auto playback, including audio, in full screen mode, and 2) the started instance after hitting escape (Windows machine) to stop, defaults to an instance of Captivate which is now covering the recording screen even though the instance was started in the non-recording screen. This gives me the pleasure of not only polluting the screen with pop-ups in the middle of the recording, but now adds unwanted audio to the capture as everything coming over the sound card is captured. So, how do I reprogram this behavior to go away so it just finalizes and saves, silently and quietly until I am done for the day and can end my day and begin post production work?
    So, I guess that’s four questions: 1) How can I record 8 hours at once, 2) how can I make the recording monitor not be the primary screen for the computer, 3) how can I get Captivate to not Auto play after finalizing and 4) how do I get the instance and recording controls to stay on the working monitor and not the recording monitor during before, during, and after a recording starts?
    This happens in “Application capture”, “Window Capture” and “Region Capture” and it doesn’t matter which monitor I use for recording and which for working. They are not playing well together. I’ve even tried to make the computer sterile so it does nothing else but this and do all my work on another machine, but Captivate itself interferes with it working because of its behavior in finalizing. Right now the only way to overcome the behavior that I can see is to capture the whole session in one long video and leave the machine untouched during the recording, but the machine can’t take those long videos. Anyone got any help they can provide?
    ---Mike

    Hi there
    WRT "Funny, that's not what the literature says", can you please provide us with a pointer to exactly what you are referring to?
    Personally, I think what you are hitting is some sort of "file size" limitation. Heck, even when you look at commercial DVD structure, you will notice that there are several VOB files. I think the split generally occurs at 2GB. So there is probably some limitation there.
    FWIW, Captivate isn't alone with this capture issue. I use TechSmith Camtasia Studio as well as Captivate and I also participate in their forums. I notice similar reports for Camtasia WRT the problems trying to record those very lengthy sessions. And for the finalizing bit, Captivate and Camtasia Studio are similar creatures. In fact, you would be hard pressed to look at the finalizing part before you edit to know exactly which application you were actually using!
    Cheers...Rick

  • Email Notification for long running session

    Dear All,
    I want to configure email notification for any long running session on my server which can be seen in SM66. Is there any possible way? Please suggest.
    Regards,
    Prem

    Hi Prem,
    I hope you doing good.
    Now, for the above query, I am not sure that we have any such MTE in CCMS for user specific session, however, a small custom code can be used to achieve such functions
    Here, you have to use some f Function Modules using CALL FUNCTION/FM in your abap code.
    These function modules are from TH* family like TH_DISPLAY_USER_LIST and TH_USER_INFO. Now the coder can file out the results based on some 'Threshold', which are in spool generated - convert this into PDF(if you want). Now schedules this custom program in background for every 10 mins, and notification will come through it on email ID or any DL.
    How to send email from job - How to email output from Background Jobs
    Regards,
    Divyanshu

  • Problems switching users and recovering from long sleep sessions

    I upgraded my 2008 MacBook Pro to Mavericks and am now having issues with switching users and recovering from sleep. I can sometimes go to the login window but the system hangs when switching from one user to another. It often hangs after long sleep sessions.
    Often I am finding that switching off and back on i sth easiest solution but I am getting a bit sick of it. Anyone have any suggestions?

    funkyblue:
    I usually leave my Pismo on and allow it to sleep. I find that waking from sleep and general functioning of the computer works a lot better if from time to time (I do it at least weekly) I shut down the computer, start up in Safe Mode, log in, empty Trash and reboot normally. The emptying Trash part clears the font caches.
    You should consider doing other maintenance procedures, if you don't already. Gulliver's Mac OS X System Maintenance has good ideas with linked resources.
    Please do not hesitate to post back with further questions or comments.
    Good luck.
    cornelius

  • Session kill

    Hi
    The database users will normally have the serial# and session id and it is possible to kill the database user session using the query
    alter system kill session 'serial#,sid'
    similarly do the oracle ebs front also application users also have a session or not.do they have a unique database session id and the serial#.is it possible to kill the application user session using the query
    alter system kill session 'serial#,sid'
    Bcoz i learnt that the application users are entirely different from the database users and they donot have any kind of relation with the database users.Is it true? can we use the same method to kill the application user session which we use to kill the database sesssion?
    please reply me

    Hi aram;
    The database users will normally have the serial# and session id and it is possible to kill the database user session using the query
    alter system kill session 'serial#,sid'
    similarly do the oracle ebs front also application users also have a session or not.do they have a unique database session id and the serial#.is it possible to kill the application user session using the query
    alter system kill session 'serial#,sid'
    Bcoz i learnt that the application users are entirely different from the database users and they donot have any kind of relation with the database users.Is it true? can we use the same method to kill the application user session which we use to kill the database sesssion?For session kill firstly i use below query
    select s.sid,s.serial#,s.username,s.osuser,p.spid,p.terminal,s.program from v$session s ,v$process p where paddr=addr and spid='PID' (PID here session number)
    Than i prefer to use toad(you can use some other) as session browser. Applicaton user and db user session can be kill from here or OS base(kill -9) but firstly you have to understand which process using what in ur enverioment. I suggest check below :
    EBS-session started time
    Re: session started time
    How to find the Culprit
    How to find the Culprit?
    Hope it helps
    Regard
    Helios

  • Getting screen to repaint() before long operation

    greetings all,
    lately, i've been having a heck of a time getting my JFrame to repaint itself before i start a long operation. In this case, i'm generating a little network traffic. What i'd like to do is be able to update a label on my JFrame so that text is displayed telling the user that a long operation is starting, and then start the operation. However, no attempt i've made so far works. i've tried calling repaint() on multiple objects in a row, i've tried calling repaint() on the same object many times in a row....nothing seems to work.
    Can anyone shed some light on this?
    peace
    ...alan lew

    I find it very disappointing that Java can;t do a simple task like this. I guess i won;t be including this status message into the app i'm writing at this point. That is, unless someone has a definitive answer that doesn;t involve re-writing code for a simple graphics update.
    I, too, had the same problem when I just started out with Swing stuff. I had a status bar that needed updated immediately. I solved it by taking good advantage of Java's multithreading abilities, and ever since then I've never had the problem.
    I don't think it comes down to Java not being able to do it, but rather to a fundamental design flaw in your program. If you would have thought about the status problem BEFORE writing it, then the threading stuff would have been no problem. Please don't take that the wrong way, I'm not knocking your program or competence or anything. I'm just saying, that some times when you've never done a particular thing before, then you don't really think about problems like that because you don't know they exist, and therefore when they come up, you're pretty unprepared and it's a pain in the ass.
    Granted, it seems like paintImmediately() should work, or at least there should be some way to do that. But, the fact remains that paint() doesn't work and it may come down to you having to rewrite part of your code.
    I still have the original code for my program that had the status bar problem. If I can figure anything out, I'll let you know. If you figure out how to do it without threads, post it here.
    Good luck,
    Jason

  • Restricted session & Kill Session

    Hello everybody,
    1) In which case do I need enabled restricted sessions?
    2)Where “ALTER SYSTEM KILL SESSION” command will be useful?
    Thanks in advance

    Salman Qureshi wrote:
    Hi,
    1) In which case do I need enabled restricted sessions?Whenever you want to perform some maintenance operations in your database and you don't want anyone to access the database except user SYS, you can enable restricted session.
    2)Where “ALTER SYSTEM KILL SESSION” command will be useful?When you want to kill a session which is no longer responding or hung or doing some long running operation which is disturbing your performance or you want to stop that processing etc.
    SalmanHi Salman,
    I think you'll find that "restricted session mode" does not limit login ability to only the SYS user as you mention.
    As an example, consider the following.
    Session 1:
    SQL*Plus: Release 11.2.0.3.0 Production on Tue Jan 1 22:07:03 2013
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    SQL> connect / as sysdba
    Connected.
    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup restrict;
    ORACLE instance started.
    Total System Global Area 2137886720 bytes
    Fixed Size                  2256912 bytes
    Variable Size            1258295280 bytes
    Database Buffers          872415232 bytes
    Redo Buffers                4919296 bytes
    Database mounted.
    Database opened.
    SQL>Session 2:
    SQL*Plus: Release 11.2.0.3.0 Production on Tue Jan 1 22:07:51 2013
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    SQL> connect markwill
    Enter password:
    Connected.
    SQL> select logins from v$instance;
    LOGINS
    RESTRICTED
    1 row selected.
    SQL>As you can see in Session 2 I am clearly not connecting as SYS user, yet I am capable of connecting to an instance started in restricted mode.
    Rather than limiting to only user SYS it limits login ability to users with the RESTRICTED SESSION System Privilege (granted directly or via role).
    Regards,
    Mark

Maybe you are looking for