码迷,mamicode.com
首页 > 数据库 > 详细

查询、释放数据库锁、 约束

时间:2015-06-01 14:42:02      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:

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;

--释放SESSION SQL:
--alter system kill session ‘sid, serial#‘;
ALTER system kill session ‘70, 4397‘;

 

select
A.OWNER "用户名称",
c.TABLE_NAME "主键表",
d.COLUMN_NAME "主键字段",
B.R_CONSTRAINT_NAME "主键约束",
a.TABLE_NAME "外键表",
a.COLUMN_NAME "外键字段",
A.constraint_name "外键约束"
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 "用户名称","主键表","主键字段","主键约束","外键表","外键字段","外键约束"

查询、释放数据库锁、 约束

标签:

原文地址:http://www.cnblogs.com/dapeng520/p/4543839.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!