Lock (up)

Source: Internet
Author: User

------------------- Check which users are currently using data
Select osuser, A. username, cpu_time/executions/1000000 |'s ', SQL _fulltext, Machine
From v $ session A, V $ sqlarea B
Where a. SQL _address = B. Address order by cpu_time/executions DESC;

-------------------- Why SQL statements cause table lock
Select L. session_id Sid,
S. Serial #,
L. locked_mode,
L. oracle_username,
S. User #,
L. OS _user_name,
S. machine,
S. Terminal,
A. SQL _text,
A. Action
From v $ sqlarea A, V $ session S, V $ locked_object L
Where l. session_id = S. Sid
And S. prev_ SQL _addr = A. Address
Order by SID, S. Serial #;

-------------------- View locked objects and Unlock methods
(1) locked object
Select a. Sid, A. Serial #, C. object_name, B. oracle_username, B. OS _user_name
V $ session,
V $ locked_object B,
All_objects C
A. Process = B. Process and
A. paddr = P. ADDR and
B. object_id = C. object_id;

Lock (up)

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.