12
返回列表 发新帖
楼主: fjhello2002

如何查出数据库中哪些SESSION在使用DBLINK?

[复制链接]
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
11#
发表于 2006-6-26 12:56 | 只看该作者

Re: 如何查出数据库中哪些SESSION在使用DBLINK?

最初由 fjhello2002 发布
[B]如何查出数据库中
哪些SESSION通过DBLINK访问其它数据库?
哪些SESSION是其它数据库上通过DB_LINK连接进来的? [/B]


Hope this thread helps.

http://groups.google.com/group/c ... ad/a7c87c2daeb82f95

Yong Huang

使用道具 举报

回复
论坛徽章:
22
2010新春纪念徽章
日期:2010-03-01 11:08:33马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:09
12#
发表于 2006-6-27 12:30 | 只看该作者
调整了一下....

column ORIGIN format a39
column GTXID format a39 heading "GLOBAL TXN ID"
column LSESSION format a10 heading "SID,SER#"
column WAITING format a55 heading "WAITING FOR EVENT"
column STATUS format a10 heading "STATUS"

Select /*+ ORDERED */
substr(s.ksusemnm,1,23)||'-'|| substr(s.ksusepid,1,15) "ORIGIN",
substr(g.K2GTITID_ORA,1,35) "GTXID",
substr(s.indx,1,4)||','|| substr(s.ksuseser,1,5) "LSESSION" ,
substr(decode(bitand(ksuseidl,11),1,'ACTIVE',0,
decode(bitand(ksuseflg,4096),0,'INACTIVE','CACHED'),
2,'SNIPED',3,'SNIPED', 'KILLED'),1,10) "STATUS",
event "WAITING"
from sys.x$k2gte g, sys.x$ktcxb t, sys.x$ksuse s, v$session_wait w
where g.K2GTDXCB =t.ktcxbxba
and g.K2GTDSES=t.ktcxbses
and s.addr=g.K2GTDSES
and s.indx = w.sid

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
13#
发表于 2006-6-27 22:01 | 只看该作者
最初由 jametong 发布
[B]调整了一下....

column ORIGIN format a39
column GTXID format a39 heading "GLOBAL TXN ID"
column LSESSION format a10 heading "SID,SER#"
column WAITING format a55 heading "WAITING FOR EVENT"
column STATUS format a10 heading "STATUS"

Select /*+ ORDERED */
substr(s.ksusemnm,1,23)||'-'|| substr(s.ksusepid,1,15) "ORIGIN",
substr(g.K2GTITID_ORA,1,35) "GTXID",
substr(s.indx,1,4)||','|| substr(s.ksuseser,1,5) "LSESSION" ,
substr(decode(bitand(ksuseidl,11),1,'ACTIVE',0,
decode(bitand(ksuseflg,4096),0,'INACTIVE','CACHED'),
2,'SNIPED',3,'SNIPED', 'KILLED'),1,10) "STATUS",
event "WAITING"
from sys.x$k2gte g, sys.x$ktcxb t, sys.x$ksuse s, v$session_wait w
where g.K2GTDXCB =t.ktcxbxba
and g.K2GTDSES=t.ktcxbses
and s.addr=g.K2GTDSES
and s.indx = w.sid [/B]


This is an excellent query.

Just a friendly reminder. It's absolutely important to give credit to the original author, unless you claim to be the author. In this case, I find this query at

http://www.freelists.org/archives/oracle-l/02-2005/msg00613.html

where the message poster attributed to Mark Bobak, who posted the query in Metalink forum thread 524821.994. In there, Mark attributed the authorship to Tom Kyte. For obvious reason, Tom can't post that query at asktom.oracle.com.

Yong Huang

使用道具 举报

回复
论坛徽章:
22
2010新春纪念徽章
日期:2010-03-01 11:08:33马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:09
14#
发表于 2006-6-28 02:22 | 只看该作者
I have claimed i got it from the web.

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
15#
发表于 2006-6-28 06:01 | 只看该作者
最初由 jametong 发布
[B]I have claimed i got it from the web. [/B]


Thanks. I just notice you said "从别的地方cp的". Sorry I missed that part earlier. Would be better if you could tell us the exact location in that message.

Yong Huang

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表