Locks en oracle

Solo disponible en BuenasTareas
  • Páginas : 1 (250 palabras )
  • Descarga(s) : 0
  • Publicado : 22 de marzo de 2011
Leer documento completo
Vista previa del texto
#tablas bloqueadas

set linesize 120
ttitle "tablas bloqueadas"
column OBJECT_NAME format a30
column username format a40
select v$session.username||'('||v$lock.sid||','||v$session.serial#||'/'||v$session.terminal||')' username, v$session.status,
owner||'.'||object_name object_name, object_type||'('||v$lock.type||')' object_type
from dba_objects,v$lock, v$session
where owner not in ('SYS','SYSTEM')
and object_id = v$lock.id1
and v$lock.sid = v$session.sid
order by username, status
/

column usernameformat a15
column object_name format a25
select b.sid,
c.username,
c.osuser,
c.terminal,
decode(b.id2, 0, a.object_name, 'Trans-'||to_char(b.id1)) object_name,
b.type,decode(b.lmode,
0, '--Waiting--',
1, 'Null',
2, 'Row Share',
3, 'Row Excl',
4, 'Share',
5, 'Sha Row Exc',
6, 'Exclusive',
'Other') "Lock Mode",
decode(b.request,
0, ' ',
1, 'Null',2, 'Row Share',
3, 'Row Excl',
4, 'Share',
5, 'Sha Row Exc',
6, 'Exclusive',
'Other') "Req Mode"
from dba_objects a,
v$lock b,
v$session c
where a.object_id (+) = b.id1
andb.sid = c.sid
and c.username is not null
order by
b.sid,
b.id2
/

Locks

SET LINESIZE 120
column MODE_HELD format a15
column MODE_REQUESTED format a15
column LOCK_ID1format a10
column LOCK_ID2 format a10
column BLOCKING_OTHERS fomat a10
select SESSION_ID SESS_ID, LOCK_TYPE, MODE_HELD, MODE_REQUESTED, LOCK_ID1,
LOCK_ID2, LAST_CONVERT,BLOCKING_OTHERS
from sys.dba_locks
/

lock ddl

COLUMN OBJECT_NAME FORMAT A30
SELECT SESSION_ID, OWNER||'.'||NAME OBJECT_NAME, TYPE, MODE_HELD, MODE_REQUESTED
FROMSYS.DBA_DDL_LOCKS
/

lock dml

COLUMN OBJECT_NAME FORMAT A30
SELECT SESSION_ID, OWNER||'.'||NAME OBJECT_NAME, MODE_HELD, MODE_REQUESTED, LAST_CONVERT, BLOCKING_OTHERS
FROM SYS.DBA_DML_LOCKS
tracking img