Querying, freeing database locks, constraints

Source: Internet
Author: User

SELECT object_name, Machine, S.sid, s.serial#
From Gv$locked_object L, dba_objects O, gv$session s
WHERE l.object_id = o.object_id
and l.session_id = S.sid;

--Release session SQL:
--alter system kill session ' Sid, Serial# ';
ALTER system kill session ' 70, 4397 ';

A.owner "User name",
C.table_name "PRIMARY key table",
D.column_name "PRIMARY key field",
B.r_constraint_name "PRIMARY KEY constraint",
A.table_name "foreign key Table",
A.column_name "Foreign key Field",
A.constraint_name "FOREIGN KEY constraint"
From User_cons_columns a,user_constraints b,user_constraints c,user_cons_columns D
where a.constraint_name = B.constraint_name
and B.constraint_type = ' R '
and B.r_constraint_name=c.constraint_name
and C.constraint_type = ' P '
and C.constraint_name =d.constraint_name
ORDER BY "User name", "PRIMARY key table", "Primary key Field", "PRIMARY KEY constraint", "foreign key Table", "Foreign key Field", "FOREIGN KEY constraint"

Querying, freeing database locks, constraints

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.