[20190416]process allocation latch.txt
--//看链接:http://andreynikolaev.wordpress.com/2010/12/16/hidden-latch-wait-revolution-that-we-missed/
--//里面提到:
Oracle no longer uses "repeatedly spin and sleep" approach. The process spins and waits only once. The pseudo code for
contemporary latch acquisition should looks like:
--//Oracle不再使用"反复旋转和睡眠"的方法。进程只旋转一次并等待一次。当代锁存获取的伪代码应该如下所示:
Immediate latch get
Spin latch get
Add the process to the queue of latch waiters
Sleep until posted
Only "process allocation" latch shows different system calls. On Solaris this latch waits using pollsys() system call.
On Linux and HP-UX it uses select():
--//只有"process allocation"锁存显示不同的系统调用。在Solaris上,这个闩锁使用pollsys()系统调用等待。在Linux和HP-UX上,它
--//使用select():
--//先不管其它latch的改进,先看看process allocation的情况,通过测试说明问题.
--//另外说明千万不要在生产系统做这样的测试,阻塞process allocation 拴锁会导致全部用户无法登录!!
1.环境:
SCOTT@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@book> @ laddr 'process allocation'
old 1: select addr,name,level#,latch#,gets,misses,sleeps,immediate_gets,immediate_misses,waiters_woken,waits_holding_latch,spin_gets,wait_time from v$latch where lower(name) like '%'||lower('&&1')||'%'
new 1: select addr,name,level#,latch#,gets,misses,sleeps,immediate_gets,immediate_misses,waiters_woken,waits_holding_latch,spin_gets,wait_time from v$latch where lower(name) like '%'||lower('process allocation')||'%'
ADDR NAME LEVEL# LATCH# GETS MISSES SLEEPS IMMEDIATE_GETS IMMEDIATE_MISSES WAITERS_WOKEN WAITS_HOLDING_LATCH SPIN_GETS WAIT_TIME
---------------- ---------------------------------------- ---------- ---------- ---------- ---------- ---------- -------------- ---------------- ------------- ------------------- ---------- ----------
0000000060009F88 process allocation 7