session状态:
STATUS VARCHAR2(8) Status of the session:
ACTIVE - Session currently executing SQL
INACTIVE - sql及其session没有释放或正常退出......
KILLED - Session marked to be killed
CACHED - Session temporarily cached for use by Oracle*XA
SNIPED - Session inactive, waiting on the client
查询数据库中持锁和等待锁的用户信息
select distinct o.object_name, sh.sid "SID", sh.SERIAL# "SERIAL", sh.username||'('||sh.sid||','||sh.SERIAL#||')' "Holder",
sw.username||'('||sw.sid||','||sw.SERIAL#||')' "Waiter",
decode(lh.lmode, 1, 'null', 2,
'row share', 3, 'row exclusive', 4, 'share',
5, 'share row exclusive' , 6, 'exclusive') "Lock Type"
from v$session sw, v$lock lw,all_objects o, v$session sh, v$lock lh
where lh.id1 = o.object_id
and lh.id1 = lw.id1
and sh.sid = lh.sid
and sw.sid = lw.sid
and sh.lockwait is null
and sw.lockwait is not null
and lh.type = 'TM'
and lw.type = 'TM';
select /*+ NO_MERGE(a) NO_MERGE(b) NO_MERGE(c) */ 'Wait' "Status", a.username, a.machine, a.sid, a.serial#, a.last_call_et "Seconds", b.id1, c.sql_text "SQL"
from v$session a, v$lock b, v$sqltext c
where a.username is not null
and a.lockwait = b.kaddr
and c.hash_value =a.sql_hash_value
union
select /*+ NO_MERGE(a) NO_MERGE(b) NO_MERGE(c) */ 'Lock' "Status", a.username, a.machine, a.sid, a.serial#, a.last_call_et "Seconds", b.id1, c.sql_text "SQL"
from v$session a, v$lock b, v$sqltext c
where b.id1 in
(select /*+ NO_MERGE(d) NO_MERGE(e) */ distinct e.id1
from v$session d, v$lock e
where d.lockwait = e.kaddr)
and a.username is not null
and a.sid = b.sid
and b.request=0
and c.ha
sql在多方摸索和朋友的帮助下,终于可以连接成功,这对我来说是个里程碑来的,在工作的过程中我总是没有机会可以碰触到SQL,当我鼓起勇气勇气想学习的时候我连怎么用都不会,进来终于链接成功,开心地和朋友分享我的成果。
1.安装sql,学习SQl,因为一般我是想要用于VS2005项目的,所以一般最后就先安装VS软件,以便 ......