Knowledge about volume El locks

Source: Internet
Author: User

Knowledge about volume El locks 1. view which session locks: SQL statement: select 'alter system kill session ''' | sid | ',' | serial # | '''; 'From v $ session where sid in (select sid from v $ lock where block = 1); SQL> select 'alter system kill session ''' | sid | ', '| serial # | ''';' from v $ session where sid in (select sid from v $ lock where block = 1 ); 'altersystemkillsession ''' | SID | ',' | SERIAL # | ''';'--------------------------------------- ------------------------------------- Alter system kill session '20160301'; alter system kill session '20160302'; alter system kill session '20160301'; alter system kill session '20160302'; 2. view the session lock. SQL statement: select s. sid, q. SQL _text from v $ sqltext q, v $ session s where q. address = s. SQL _address and s. sid = & sid order by piece; SQL> select s. sid, q. SQL _text from v $ sqltext q, v $ session s where q. Address = s. SQL _address and s. sid in (select sid from v $ lock where block = 1) order by piece; SID SQL _TEXT ---------- 77 UPDATE PROFILE_USER SET ID = 1, COMPANY_ID = 2, CUSTOMER_ID = 3, NAMED 77 _ INSURED_ID = 4, LOGIN = 5, ROLE_ID = 6, PASSWORD = 7, EMAIL = 8, TIME_ZON 77 E = 9 WHERE PROFILE_USER.ID =: 34 3 rows selected. 3. kill the lock process. SQL statement: alter system kill s Ession '000000'; SQL> alter system kill session '000000'; System altered. 4. Check who has locked the session. Select s1.username | [email = '@'] '@' [/email] | s1.machine | '(SID =' | s1.sid | ') is blocking '| s2.username | [email =' @ ']' @ '[/email] | s2.machine |' (SID = '| s2.sid | ') 'As blocking_status from v $ lock l1, v $ session s1, v $ lock l2, v $ session s2 where s1.sid = l1.sid and s2.sid = l2.sid and l1.BLOCK = 1 and l2.request> 0 and l1.id1 = l2.id1 and l2.id2 = l2.id2;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.