Use the LOCK TABLE statement to lock one or more tables (or table partitions or
subpartitions) in a specified mode. This lock manually overrides automatic locking
and permits or denies access to a table or view by other users for the duration of
your operation.Some forms of locks can be placed on the same table at the same time. Other locks
allow only one lock for a table.
///////////////////////////
A locked table remains locked until you either commit your transaction or roll it
back, either entirely or to a savepoint before you locked the table.
//////////////////////////////////////////A lock never prevents other users from querying the table. A query never places a
lock on a table. Readers never block writers and writers never block readers.提交或者会滚事务即可。
subpartitions) in a specified mode. This lock manually overrides automatic locking
and permits or denies access to a table or view by other users for the duration of
your operation.Some forms of locks can be placed on the same table at the same time. Other locks
allow only one lock for a table.
///////////////////////////
A locked table remains locked until you either commit your transaction or roll it
back, either entirely or to a savepoint before you locked the table.
//////////////////////////////////////////A lock never prevents other users from querying the table. A query never places a
lock on a table. Readers never block writers and writers never block readers.提交或者会滚事务即可。
解决方案 »
- oracle 零时表扫描,完成数据验证后,插入到其他表
- 查看运行过程中的更新程序
- 我现在就RMAN还有一些问题需要大家帮忙。
- 怎么会显示字段不属于表呢?(新手,谢谢)
- 救急!!! 那位高手研究过Oracle9i中实现邮件程序自动转发
- 卸载ORACLE后还有services不能卸掉怎么办
- REDHAT8上安装oracle817,不能找到JRE
- 谁有RapidSQL5.7的下载地址?(高分)
- 请大家帮忙
- 在sqlplus知道连接的是哪个数据库?
- 如何将任意格式的数据(Excel,FoxPro,Access,SQL-Server......)导入Oracle?
- 各位高手 请问在OCI里面怎样调用 procedure 啊? 我为什么老是不成功
A locked table remains locked until you either commit your transaction or roll it
back, either entirely or to a savepoint before you locked the table.
//////////////////////////////////////////
或者程序里面怎么实现??
commit
/
或者
rollback
/
据个例子,我初学 oracle
语法:
LOCK TABLE table_1 [,table_2, ..., table_n] IN lock_mode MODE
NOWAIT
变量:
table_1,...,table_n: 一系列你想通过使用LOCK TABLE语句锁住的数据库表。
lock_mode: 对于某一数据库表你要设定的锁定模式。你可以从如下的锁定模式中任选一个。
EXCLUSIVE
SHARE ROW EXCLUSIVE
SHARE
SHARE UPDATE
ROW SHARE
ROW EXCLUSIVE
NOWAIT: Oracle will not wait to lock the given Table(s), if the Table(s) is(are) not
available
例子:
SQL
LOCK TABLE loan IN SHARE MODE ;
LOCK TABLE region IN EXCLUSIVE MODE NOWAIT;
LOCK TABLE acct IN SHARE UPDATE MODE;
LOCK TABLE bank IN ROW EXCLUSIVE MODE NOWAIT;
LOCK TABLE user IN SHARE ROW EXCLUSIVE MODE;
LOCK TABLE branch IN ROW SHARE MODE NOWAIT;commit
/