oracle 鎖資訊查詢

season0891發表於2011-01-25
[oracle@rac1 ~]$ cat lock_mon.sh
#!/bin/bash
# creator:NinGoo
# function: get sql statement by spid
# parameter: spid
# useage: get_by_spid.sh spid

sqlplus -S   /nolog < connect xinnet/H3k#dg5iJ8YdA9g
 col SERIAL# format 999999
 col sid format 99999
 col object_name format a30
 col machine format a15
 set linesize  1000
 set verify off

select object_name,machine,s.sid,s.serial#,l.locked_mode,to_char(logon_time,'yyyy/mm/dd hh24:mi:ss') as login_time  from v\$locked_object l,dba_objects o ,v\$session s
 where l.object_id=o.object_id and l.session_id=s.sid;
exit;
EOF
[oracle@rac1 ~]$ 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/90618/viewspace-684607/,如需轉載,請註明出處,否則將追究法律責任。

相關文章