SELECT FOR UPDATE SKIP LOCKED 选项是ORACLE的一个未公开的特性,它的含义是SELECT时跳过被锁的记录。
考虑下面的例子:
会话1:
SQL> select * from sex_dict ;
SERIAL_NO S SEX_ INPUT_CO
---------- - ---- --------
1 1 男 N
9 0 未知 WZ
2 2 女 N
4 9 未定 WD
SQL> select * from sex_dict where serial_no = 1 for update ;
SERIAL_NO S SEX_ INPUT_CO
---------- - ---- --------
1 1 男 N
会话2:
查询并锁住serial_no in (1,2) 的记录
SQL> select * from sex_dict where serial_no in ( 1, 2) for update ;
此时会话2挂住,直到会话1事务结束。
加上”NOWAIT”选项
SQL> select * from sex_dict where serial_no in ( 1, 2) for update nowait ;
select * from sex_dict where serial_no in ( 1, 2) for update nowait
*
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified
因为serial_no = 1的记录被会话锁住,所以这个操作没有成功。
加上SKIP LOCKED选项
SQL> select * from sex_dict where serial_no in ( 1, 2) for update nowait skip locked;
SERIAL_NO S SEX_ INPUT_CO
---------- - ---- --------
2 2 女 N
会话2只锁住serial_no=2的记录,跳过serial_no=1的记录。
这个特性适合例如消息队列的操作,当消息到达时,处理消息的各个客户选取并锁住一个消息处理,但不能阻塞其它客户处理消息。其它客户则处理没有被锁的消息。这个可以参考AnySQL.net的《在Oracle中如何跳过被别人锁住的记录?》
相关推荐
stm32 flash解锁,我的是开发板,在按键中断中解锁flash,具体的见源代码,使用ram.icf,把程序烧录在ram中,环境是IAR6.10,库版本是3.0,成功解决Core is locked-up问题。~
SVN在客户端执行UPDATE报locked的处理办法,这里报错是提示工作拷贝“D:\svn_repository\cmout\cm\SVN\SVN客户端\TortoiseSVN\download”锁住了
iOS实例开发源码——imrank1-Locked-7160518.zip
iOS游戏应用源代码——imrank1-Locked-7160518.zip
CD-Rom for the book "Phase-Locked Loops Design,Simulation and Applications by R.E.Best. A design program for Phase-locked loops circuits
下载该存储库并将其复制到/site/plugins/kirby-locked-pages 。 Git子模块 git submodule add https://github.com/johannschopplich/kirby-locked-pages.git site/plugins/kirby-locked-pages 作曲家 composer ...
关于锁相环设计经常遇到的一些问题的官方解答.为设计者提供一些参考.
利用Altera公司推出的FPGA开发工具DSP Builder,对锁相解调算法中的主要部件:数控振荡器(NCO)、计算反正切的CORDIC模块和FIR低通滤波器进行了单独设计和仿真,最终完成了锁相解调系统的整体设计。
语言:日本語 使用Chrome Extension登录合作系统 --------------------------- ---------------------------------------------------------------- ------------------------------------------... https://locked.jp.
4、然后分别加载locked-secret.bin与unfixed-info.bin两个文件,加载成功的话Have retail locked keys与Have retail unfixed keys两个文字后面会显示true 5、再点击右上角菜单按钮,选择load tag file选项,然后选择想...
1.安装好TagMO软件之后载入key locked-secret.bin unfixed-info.bin 2.点击LOAD TAG选取你要刷入的amiibo,名字应该是 ******.bin. 3.选择Write TAG,将NFC白卡放在手机NFC区域
2006 (绑定等具体制作)Mode-Locked Vertical-External-Cavity Surface Emitting Laser.pdf VECSEL关键技术文章
锁相环经典书籍,对于想了解无线电,激光器锁相或许有帮助。
We report a passively Q-switched and mode-locked erbium-doped fiber laser (EDFL) based on PtSe2, a new two-dimensional material, as a saturable absorber (SA). Self-started Q-switching at 1560 nm in ...
解决sqlite死锁示例异常database is locked示例
用于解决单相并网中的锁相环问题,并实现相应的仿真验证探究。
Data converters, phase-locked loops, and their applicationsNdjountche, Tertulien"With a focus on designing and verifying analog integrated circuits, the book reviews design techniques for more complex...
模拟集成电路的分析与设计:Chapter 15-Phase-Locked Loops.ppt
The fundamental design concepts for phase-locked loops implemented with integrated circuits are outlined. The necessary equations required to evaluate the basic loop performance are given in ...
介绍RF仿真,可以用于微博专业同学学习之用。。。