Oracle queries the lock table information and ends the process

Source: Internet
Author: User

Oracle query lock:

Select a. OWNER solution name,
A. OBJECT_NAME table name,
B. XIDUSN rollback segment number,
B. XIDSLOT slot number,
B. XIDSQN serial number,
B. SESSION_ID lock table SESSION_ID,
B. username of the ORACLE_USERNAME lock table,
Decode (D. type, 'xr ', 'null', 'rs', 'ss (Row-S) ', 'cf', 'ss (Row-S) ', 'TT ', 'table lock', 'PW ', 'table lock', 'to', 'table lock', 'ts', 'table lock', 'rt ', 'row lock', 'tx ', 'row lock', 'Mr','s (Share) ', NULL) Locking method,
C. MACHINE user group,
C. TERMINAL machine name,
B. OS _USER_NAME system username,
B. PROCESS system PROCESS id,
DECODE (C. STATUS, 'inactivity', 'inactivity', 'activity', 'activity') activity STATUS,
C. SERVER,
C. SID,
C. SERIAL #,
C. PROGRAM connection method,
C. LOGON_TIME
FROM ALL_OBJECTS,
V $ LOCKED_OBJECT B,
SYS. GV _ $ session c,
V $ lock d
WHERE (A. OBJECT_ID = B. OBJECT_ID)
AND (B. PROCESS = C. PROCESS)
And C. sid = d. sid
And B. LOCKED_MODE = D. LMODE
Order by 1, 2;

Oracle kill process:
Alter system kill session '123'
139: sid
182: sertal #

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.