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 ';
Select
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