关于RAC环境下锁查询的测试案例1-2

Normal07.8 磅02falsefalsefalseMicrosoftInternetExplorer4

set linesize 120

set pagesize 66

col c0 for 999

col c0 heading "INS"

col c1 for a9

col c1 heading "OS User"

col c2 for a9

col c2 heading "Oracle User"

col c3 for a15

col c3 heading "Program Name"

col b1 for a9

col b1 heading "Unix PID"

col b2 for 9999 justify left

col b2 heading "ORA SID"

col b3 for 999999 justify left

col b3 heading "SERIAL#"

col sql_text for a45

set space 1

break on b1 nodup on c0 nodup on c3 nodup on c1 nodup on c2 nodup on b2 nodup on b3 skip 2

select a.inst_id c0,b.sid b2,c.spid b1, b.program c3, b.username c2,b.serial# b3, a.sql_text

from gv$sql a, gv$session b, gv$process c

where

a.address = b.sql_address

and b.paddr = c.addr

and a.hash_value = b.sql_hash_value

and a.inst_id=b.inst_id and a.inst_id=c.inst_id

and a.inst_id like '&inst_id' and b.sid like '&sid'

order by c.spid,a.hash_value

/

查询第一个节点上的业务可能查不到,因为第一个节点上应用处于空闲状态,可以查看到第二个节点上的业务应用

Enter value for inst_id: 1

Enter value for sid: 2148

old 8: and a.inst_id like '&inst_id' and b.sid like '&sid'

new 8: and a.inst_id like '1' and b.sid like '2148'

no rows selected

SQL> /

Enter value for inst_id: 2

Enter value for sid: 1051

old 8: and a.inst_id like '&inst_id' and b.sid like '&sid'

new 8: and a.inst_id like '2' and b.sid like '1051'

INS ORA SID Unix PID Program Name Oracle Us SERIAL# SQL_TEXT

---- ------- --------- --------------- --------- ------- ---------------------------------------------

2 1051 25066 sqlplus@SERV-TEST SYS 31100 update system.akdas set a1=11 where a1=6

2 (TNS V1-V3)[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/48010/viewspace-1015840/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/48010/viewspace-1015840/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值