How Oracle queries locked tables and processes

Source: Internet
Author: User

There are several ways that Oracle queries can be used, and the following is how Oracle queries the locked tables and the processes that Oracle queries connect to, and hopefully it will help you.

First, view the locked table

Select p.spid,a.serial#, c.object_name,b.session_id,b.oracle_username,b.os_user_name from V$process p,v$session A, v$ Locked_object b,all_objects C where p.addr=a.paddr and A.process=b.process and c.object_id=b.object_id

Second, view the connected process

SELECT SID, Serial#, username, osuser from v$session;

Iii. the process of killing

Alter system kill session ' sid,serial# ';

Iv. Viewing the space occupied by the current user's table

Select segment_name, Sum (bytes)/1024/1024 from User_extents Group by segment_name

V. Query all objects occupy space

Select owner, Segment_name,sum (bytes/1024/1024) from Dba_segments GROUP by Owner,segment_name

Vi. querying the database for the size of the objects occupied space

Select segment_name,b.object_type, Sum (bytes)/1024/1024 from user_extents a,user_objects b where a.segment_name= B.object_name Group by Segment_name,b.object_type Order by Object_type, segment_name

Vii. Remove carriage returns from a field in Oracle

Update YWJ_YXGLOBJ SET table_name = replace (TABLE_NAME,CHR, ") where table_name like ' acct_info% '

How Oracle queries locked tables and processes

Related Article

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.