How to view the Oracle database lock and unlock

Source: Internet
Author: User
-- View database lock details select. sid, B. serial #, B. username, B. osuser, B. machine, B. program, C. object_name, D. spid, decode (. type, 'Mr ', 'Media recovery', 'rt ', 'redo thread', 'UN', 'user name', 'tx ', 'Transaction ', 'Tm ', 'dml', 'U', 'pl/SQL user lock', 'dx', 'distributed xaction', 'cf', 'control file ', 'Is ', 'instance State', 'fs', 'file set', 'ir', 'instance recovery ', 'st', 'disk space transaction ', 'ts', 'temp segment ', 'iv', 'library cache invalida-tion ', 'Ls', 'Log start or switch', 'rw ', 'row wait', 'sq ', 'sequence number', 'te', 'extend table', 'TT', 'temp table', 'unknown') locktype, decode (. lmode, 0, 'none', 1, 'null', 2, 'row-S', 3, 'row-x', 4, 'share', 5, 's/row-x', 6, 'clusive ', 'unknown') lockmode from V $ lock a, V $ session B, all_objects C, V $ process d Where. SID = B. sid and. type in ('TT', 'tx ') and C. object_id =. id1 and B. paddr = D. ADDR; -- kill the process -- alter system kill session 'sid, serial #';

 

 

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.