你们首先把lock和deadlock分清楚。 lock是靠自己释放的,但deadlock是系统检测并释放的。当然deadlock也可以自己通过kill session来解决 这是pmon的解释 Process Monitor (PMON) The process monitor (PMON) performs process recovery when a user process fails. PMON is responsible for cleaning up the database buffer cache and freeing resources that the user process was using. For example, it resets the status of the active transaction table, releases locks, and removes the process ID from the list of active processes. PMON also periodically checks the status of dispatcher and server processes, and restarts any that have died (but not any that Oracle has terminated intentionally). Like SMON, PMON "wakes up" regularly to check whether it is needed, and can be called if another process detects the need for it. 它可以检测并释放锁资源 如果仅仅是lock,以下语句可以发现所有用户锁 select s.username, decode(l.type,'TM','TABLE LOCK', 'TX','ROW LOCK', NULL) LOCK_LEVEL, o.owner,o.object_name,o.object_type,s.terminal,s.machine,s.program,s.osuser from v$session s,v$lock l,dba_objects o where s.sid=l.sid and o.object_id=l.id1 and s.username is not null如果有锁等待或死锁,可以通过以下语句发现 select lpad(' ',decode(l.xidusn,0,3,0))||l.oracle_username User_name, o.owner,o.object_name,o.object_type from v$locked_object l,dba_objects o where l.object_id=o.object_id order by o.object_id desc
有系统监控作用的只有smon and pmon,smon 是系统监控,主要是系统级的恢复进程,清除临时段,合并碎片,唤醒进程,别的进程也可以调用smon来唤醒进程。
应该不是pmon吧,pmon只负责用户进程的异常终结,如connection异常终断等。
lock是靠自己释放的,但deadlock是系统检测并释放的。当然deadlock也可以自己通过kill session来解决
这是pmon的解释
Process Monitor (PMON)
The process monitor (PMON) performs process recovery when a user process fails. PMON is responsible for cleaning up the database buffer cache and freeing resources that the user process was using. For example, it resets the status of the active transaction table, releases locks, and removes the process ID from the list of active processes. PMON also periodically checks the status of dispatcher and server processes, and restarts any that have died (but not any that Oracle has terminated intentionally). Like SMON, PMON "wakes up" regularly to check whether it is needed, and can be called if another process detects the need for it.
它可以检测并释放锁资源
如果仅仅是lock,以下语句可以发现所有用户锁
select s.username,
decode(l.type,'TM','TABLE LOCK',
'TX','ROW LOCK',
NULL) LOCK_LEVEL,
o.owner,o.object_name,o.object_type,s.terminal,s.machine,s.program,s.osuser
from v$session s,v$lock l,dba_objects o
where s.sid=l.sid
and o.object_id=l.id1
and s.username is not null如果有锁等待或死锁,可以通过以下语句发现
select lpad(' ',decode(l.xidusn,0,3,0))||l.oracle_username User_name,
o.owner,o.object_name,o.object_type
from v$locked_object l,dba_objects o
where l.object_id=o.object_id
order by o.object_id desc
谢谢关心,希望以后多交流!