Kill a session and release all locks immediatly

Hi,
How to kill a session and release all locks immediately.
Thank you
AK

> Actually I am working on development envrionment (Not
production) with oracle 10g DB. What heppened is that
I needed to replace a stored DB Package, but I
couldn't even when I am the only connected user.
A read lock is placed on data dictionary objects when used - that prevents someone else from changing that data dictionary object and in effect pull the carpet from beneath the feet of the process using that object.
When trying to replace a package, it will fail if another session is busy using that package.
As for being the only user on the database and still running into this problem - there could have been a DBMS_JOB executing that package.
> I killed all sessions, and even next day still the
locks are there from a session I killed 1 day
before!
Unusual. But a killed session can take 24+ hours to rollback. A rollback is often a lot more time consuming than the elapsed run-time of the session at the time it was killed.
Back with Oracle 8i and prior, it was not uncommon to see a killed session lingering forever until the instance was bounced. But I have not yet seen this in 10G.
Suggest that when you run into this situation again, you monitor the killed session to determine just what it is doing (looking at its current wait states and events) - and whether it is indeed hanging and not releasing any locks that should have been released.

Similar Messages

  • Many, many times in a session, I get this: Mozilla Firefox (Not Responding). Frustration is setting in when I have to kill the computer, and start all over again. Anger is beginning a slow burn, too.

    Since the latest version (don't even ask me) was downloaded and installed, many times in a session when I am browsing the net, or opening a text document or a spreadsheet, flipping back and forth, I'll have to stop and sit for an indeterminate amount of time because up on the header, I'll get the message Mozilla Firefox (Not Responding). When looking down toward the front of the laptop, I note the hard drive is going full bore, whole hog, whatever you want to call it. Sometimes after repeated hitting the "enter" key, the program will catch up, and begin functioning again. Other times, because the program is stuck, the laptop will overheat, causing me to manually shut down, wait a while while the hard drive cools, then restarting. When I have to manually kill the session, I cannot, repeat CANNOT get the machine shutdown programs to work.
    What the hell is wrong with Firefox with this crap?

    Hello jesterabk, '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * You can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • Killing User sessions and user calcs

    Hi all,
    We have a situation where users run their business rules during evening and at times in night.
    We also have a maxl script which does aggregation and other calcs daily in night and it does not run as other calcs are launched by users.
    Is it possible to kill the user session and calcs launched by users before running maxl calculation for consolidations?
    I know I can do in in EAS, but want to try to do it in MAxL for automation.
    Thanks in advance

    You would be better off locking people out. After you kick off the automated calc, killing sessions doesn't stop them from initiating calcs while your automated calc is running. In answer to your question, yes, you can do that in maxl.
    alter system kill request all;
    You have other options if you want to be more selective on what you kill.
    kill request <session-id>
    kill request by user
    kill request on application
    kill request on database
    Check out the technical documentation for more info - http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/launch.html.
    Kyle Goodfriend
    http://www.in2hyperion.com
    Please make sure to assign helpful/answered to responses if applicable - it rewards those who help and benefits the user community.

  • On-Lock Trigger and Releasing the Lock

    I have a data block which has a View as a Datasource.
    I want to update some fields from that View so I use On-Lock and On-Update triggers.
    In the On-Lock trigger I use a select for update nowait to lock the row.
    My problem is that if I don't save the changes the lock is not released.
    My problem is reproduced with the Following steps
    1. Open two sessions of the form
    2. Update field in one session. (The On-Lock trigger is fired)
    3. Try to enter query in the Form.
    4. The message Do you want to save the Changes? appears.
    5. I answer No
    6. I go to the second session
    7. I try to update the same row and I get an error cause the Row is Locked.
    Should I code another trigger? Should I issue a rollback somewhere ?
    Thanks in advance.

    Francois wrote:
    Forms_ddl('ROLLBACK') will only rollback explicit SQL orders (Nothind done by Forms itself), so the risk is minimum because you lock the record when entering it then unlock it when exiting it.Is that documented anywhere? How can the Oracle database server tell the difference between row locks set by Forms automatic processing and locks expressly set by his "select for update"? Unless things have changed, a ROLLBACK removes everything... all locks, all posted changes, etc. You get a clean slate, ready to start over.
    Dimitris:
    I think you're going to have to re-think your application. I do not believe there is any way to unlock specific rows from one block, while preserving your uncommitted changes in others. Oracle and Forms simply do not work that way.
    ...unless you start setting savepoints each time the user goes in and updates a different block. Then you could potentially determine which savepoint was set, and do a rollback to savepoint. And managing that on a form with multiple updateable blocks could be a nightmare if the user bounces around from block to block making changes here and there.
    It would be easier to just stop the user when he decides to enter a new query. If he has updated any other blocks, or even made changes to the block in question, then he needs to first commit, or you need to clear the entire form with a CLEAR_FORM(NO_VALIDATE,FULL_ROLLBACK);

  • Killing user session & and update v$session

    i use
    alter system kill session 'sid,serial#) immediate.
    user session killed but not clean, V$session show that user connect
    i also want clean user session and remove form V$session
    Any one who can do this ...
    Thanks

    Hi,
    >>how remove on killing user session
    As I said before, you just need to wait ... Don't worry about. On the other hand, by finding the SPID, you can force the process to be killed instead of waiting for PMON to wake up and kill it, but I think that it is not necessary.
    Cheers
    Legatti

  • Kill inactiv session and process automatically

    Hello!
    I have made a JSP (JavaServerPages) Application witch can made a connection to a oracle database. Wenn I open the connection the database generates a new process and makes a session.
    Now, I have the problem, when I never close the connection, the session and the process are still alive but inactiv.
    How can I automatically kill sessions and the appropriate process after a time?

    Sorry, but it doesnt work. I have set sqlnet.expire_time=60, to keep alive the connection for one hour. But now I found a lot of sessions witch are inactiv and where the last SQl-quere was more than one hour...
    any other idea?

  • Integrated ITS: multiple sessions and locking issue

    We are upgrading to ECC 6.0 from 4.6C and have Integrated ITS turned on. We have built a custom PZM3 as one entry and exit point for our ESS services. But we have issues with session management when navigating between some services like PZ14 and PZ02. The PZ14 session and the corresponding lock are not released upon going to the PZ02 service directly. But this happens for only some services. If you navigate between PZ02 and PZ12 it works fine. I followed the instructions of note# 959417, but it didn't work. Not only it is causing locking issues, but also memory usage issues as multiple user sessions are being created on the server. I did check some of posts similar to this one, but the issue still persists.
    Our WAS release: 7.00; ABAP support package: SAPKB70009; Patch level: 75.
    I would appreciate if anyone could shed some light on this issue. Thank you for your time and consideration.
    Kshitij

    Our Basis admin found out that using a parameter ~DISCONNECTONCLOSE = 1 would resolve most of this issues -- and it did. But now we are having issues with some users having popup blockers turned on. We referred to SAP notes 892250/596698-- followed it -- implemented it-- but some users
    still have issues -- like today while working from home via VPN, I am having issues with session management. But working from office yesterday,
    the sessions worked just fine.

  • Release of locks when transaction commits

    hi guys,
    I am reading Expert Oracle by Tom Kyte, and I am a bit confused. I have checked the errata (http://www.apress.com/book/downloadfile/2421), and no one has pointed the bit I am confused about as an error, so maybe it is just my understanding that is flawed.
    Tom says that when a COMMIT happens, amongst other things:
    "*all locks held by our session are released*".
    Now this is confusing me. Why are all locks held by the SESSION released? I thought we would just release the locks held by the transaction. I mean, our session could have many transactions happening in it, yes? Why then would we need to release all locks?
    thanks

    A single session has a single transaction (barring the corner case of autonomous transactions-- I don't recall off the top of my head if autonomous transactions were available when this book was first released). Oracle doesn't support nested transactions, though you can set savepoints and roll back to a savepoint.
    JustinNow I am confused! Say I open up my PL/SQL Developer, and connect to a database. I now have one session running. I can then open up the "SQL window", and do a transaction, and at the same time, within the same PL/SQL Developer, I can open up another "SQL Window" and do another transaction (I havent done this yet, transactions is a topic I have not yet covered in depth, I am just learning about rollbacks and redo at the moment). So I am assuming I can have two concurrent transactions running from the same session. Is this incorrect? Judging from your response, this is wrong, and I cannot do the above in PL/SQL Developer.
    thanks

  • BPEL Toplink Adapter not releasing table lock

    We have a bpel process that attempts to do a merge on an Oracle table through the database adapter. If the merge operation is unsuccessful for any reason the process retries for a set number of times. We have found that a lock is generated on the tables in question and not released the first time. When the process retries it then hangs as it is waiting for the locks to be released.
    We are using version 10.1.2.0.2
    Thanks,
    Ashley

    Hi Ashley,
    I don't believe this is related to cache settings.
    Lets say a merge writes several rows and then fails updating the last row, at this point it has locks on the first n - 1 rows. The merge never acquires read locks.
    Because the merge failed though, the transaction is rolled back, locks always get released on a roll back.
    I confirmed with Glenn that when the bpel engine catches an exception, that transaction is ended (releasing all locks either way), and the next retry occurs in a new transaction.
    Some guesses I have:
    -in 10.1.2.0.2 turn on usesBatchWriting="true", then all the writes will happen in one statement.
    -whenever a bpel process waits between steps, if the wait time is very small the instance may be kept in memory. This could mean that the next retry occurs in the same transaction as the first, so maybe you could try increasing the retry interval?
    -investigate why merge is failing at all, maybe it failed in the first place because another process had a lock on the rows.
    Thanks
    Steve

  • Who killed my session & when?

    Hi Gurus,
    Could you tell me how can i check who killed my session and when two days before? Which table should i query?
    Any input will appreciated.
    Thank you.

    Yes indeed thanks.
    Some procedure like below
    CREATE OR REPLACE PROCEDURE kill_session_sp
              pn_sid IN number
            , pn_serial IN number)
    AS
    lv_user varchar2(30);
    BEGIN
      SELECT username INTO lv_user FROM v$session WHERE sid = pn_sid AND serial# = pn_serial;
    IF lv_user IS NOT NULL AND
        lv_user NOT IN  ('SYS','SYSTEM') AND
        lv_user NOT IN (SELECT user_name from privileged_users)  -- stop users kiiling System and DBA accounts
    THEN
      EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION '''||pn_sid||','||pn_serial||'''';
    ELSE
      RAISE_APPLICATION_ERROR(-20099,'Attempt to kill protected system session has been blocked for user '||lv_user);
    END IF;
    END kill_session_sp;Obviously a grant execute on that procedure should be given to someone. Normally only DBAs and production sypport may have that level of access
    Why is Oracle not record the kill processes in alert log?
    Cheers,
    Mich

  • Reset JSF session and the managed beans with sesison scope

    Hi,
    this is a very general question and maybe stupid for most of you. I have my jsf/facelets web application and i use inside of this application some managed beans, which are session beans. I want to know how is it possible to reset this beans. I'm asking this question beacuse i have this kind of problem: i built my web application which has a login form and i use the browser to test it. When i browse to the login page and I login with my credentials i get my customized home page. Then i open another istance of the browser and i browse to the login page again but this time i login as a different user. The result home page is the same as i got before with my login credentials, so the session is always the same. Instead i want the session and all its objects to be resetted for the new user! Do youn know which is the solution?

    The fact is that i want to have two sessions in parallel, so using the same browser and opening two tabs, i want to browse to the login page and access as two totaly different users and using in parallel the application without the problem of one user's action affecting the other user beacuse of session sharing. So I want to force the application to create two different session for the two users logins, because as i told you before as it is now, they are sharing the same sesison. And i think that if i at the login time I iterate thorugh the session and delete all the objects i will be able to have only one session per time. Isn't it?

  • Procedure to kill a session

    I do not have priviledge to kill the session, and i have checked the forums to create a procedure to kill the session,
    so how can i use that procedure to kill the session.
    Thanks

    If you should be allowed to kill sessions, then your DBA will grant you the ALTER SYSTEM privilege. Or, you could request your DBA to create a stored procedure for it and then grant you execute permission on that procedure. Of course, if your DBA does not choose to do this, then this is a discussion you should be having with your management.

  • Kill a session that is holding library cache lock!!

    Hi, all.
    What will happen if I kill a session that is holding library cache lock??
    Currently, the session is pending with library cache lock.
    I cannot see any locks in v$lock.
    If I kill the session, will oracle release the library cache lock??
    Thanks and Regards.

    What output do you get from the following script?
    liblock.sql:
    select decode(lob.kglobtyp, 0, 'NEXT OBJECT', 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER',
                          4, 'VIEW', 5, 'SYNONYM', 6, 'SEQUENCE',
                          7, 'PROCEDURE', 8, 'FUNCTION', 9, 'PACKAGE',
                          11, 'PACKAGE BODY', 12, 'TRIGGER',
                          13, 'TYPE', 14, 'TYPE BODY',
                          19, 'TABLE PARTITION', 20, 'INDEX PARTITION', 21, 'LOB',
                          22, 'LIBRARY', 23, 'DIRECTORY', 24, 'QUEUE',
                          28, 'JAVA SOURCE', 29, 'JAVA CLASS', 30, 'JAVA RESOURCE',
                          32, 'INDEXTYPE', 33, 'OPERATOR',
                          34, 'TABLE SUBPARTITION', 35, 'INDEX SUBPARTITION',
                          40, 'LOB PARTITION', 41, 'LOB SUBPARTITION',
                          42, 'MATERIALIZED VIEW',
                          43, 'DIMENSION',
                          44, 'CONTEXT', 46, 'RULE SET', 47, 'RESOURCE PLAN',
                          48, 'CONSUMER GROUP',
                          51, 'SUBSCRIPTION', 52, 'LOCATION',
                          55, 'XML SCHEMA', 56, 'JAVA DATA',
                          57, 'SECURITY PROFILE', 59, 'RULE',
                          62, 'EVALUATION CONTEXT',
                         'UNDEFINED') object_type,
           lob.KGLNAOBJ object_name,
           lk.KGLLKMOD lock_mode_held,
           lk.KGLLKREQ lock_mode_requested,
           ses.sid,
           ses.serial#,
           ses.username
      FROM
           x$kgllk lk,
           v$session ses,
           x$kglob lob,
           v$session_wait vsw
      WHERE
       lk.KGLLKUSE = ses.saddr and
       lk.KGLLKHDL = lob.KGLHDADR
       and lob.kglhdadr = vsw.p1raw
       and vsw.event = 'library cache lock'
    order by lock_mode_held desc
    /It should provide a locking graph of all sessions that are blocked on the 'library cache lock' event, and what sessions are the blockers.
    Hope that helps,
    -Mark
    PS It needs to run as SYSDBA, due to the X$KGLLK reference.

  • Will the resource of  'SNIPED, KILLED' sessions be released?

    Hi Guys,
    I have a couple of questions regard to session status and the limit of session numbers which is set in parameter SESSIONS.
    1) these are the Status of the session:
    ACTIVE - Session currently executing SQL
    INACTIVE
    KILLED - Session marked to be killed
    CACHED - Session temporarily cached for use by Oracle*XA
    SNIPED - Session inactive, waiting on the clientMy question is, are the resource consumed by the sessions which are in 'SNIPED', 'KILLED' released?
    what about 'INACTIVE'?
    2) there is a parameter called 'SESSIONS' which is used to set the limit of session numbers.
    So, my question is, the sessions in which status, will be counted into the total number of sessions, which in turn, will be compared against parameter SESSIONS?
    any input will be highly appreciated.
    Thanks in advance!

    >
    Google is your friend....
    >
    Yep, couldn`t agree more.
    for your link, I definitely read that before posted here and it seems vague about the things that I am asking here.
    Here is my question:
    first question, are the resource consumed by the sessions which are in 'SNIPED', 'KILLED' released?
    what about 'INACTIVE'?the link said 'At this time all oracle resources are released but the shadow processes remains and OS resources are not released'.
    So, I get that the oracle resource will be released when the sessions in 'SNIPED' status.
    but, what about the 'KILLED' and 'INACTIVE' ones?
    You said:
    >
    Sniped and killed sessions' resources should be cleaned up (eventually).
    >
    again, very vague.
    I want to know if the resources are released when the sessions are marked as 'SNIPED OR KILLED'.
    2) there is a parameter called 'SESSIONS' which is used to set the limit of session numbers.
    So, my question is, the sessions in which status, will be counted into the total number of sessions, which in turn, will be compared against parameter SESSIONS?I failed to find anything about this one. that`s why i am asking here.
    one more question,
    what`s the difference between 'INACTIVE' and 'SNIPED'? I can`t tell the difference by reading the doc.
    thanks

  • Question about BC4J data tags, Oracle sessions and Locking!

    Hi ,
    I have seen numerous examples of JSPs using data tags and in all the examples the data tag for the application module has the "username" and "password" harcoded in it.
    My questions are:
    1) For a stateful application should we be including the username and password in every JSP page. I personally believe that we should not.
    2) If we have a username and password in every JSP page will it not start a new ORACLE user session and if so will it not cause locking problems?
    3) If we don't hard code the username and password in every JSP page, will it reuse the same ORACLE session ?
    4) How do we avoid locking problems when we use data tags?
    5)I can understand the inclusion of username and password in every JSP page if it is a stateless application but again Is there a way we can avoid hardcoding the username and password in every single page?
    I would appreciate if some one can let me know if any of my assumptions are incorrect.
    JDeveloper Team/Juan any advice?

    The username and password are optional. They can be provided via the connections.properties file. The multple entries for username and password don't mean that separate connection are made. The first time the ApplicationModule tag is encountered, your application instance is created. If you are running in reserved mode (look at your releasePageResources tag) the application instance is kept until your Http session times out. If you are running in Stateful or Stateless mode, you application instance is returned to the application pool and retrieved the next time you need an instance. Please refer to the application pool documentation and to the source in oracle\jbo\common\ampool provided in jbohtmlsrc.zip.

Maybe you are looking for