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.提交或者会滚事务即可。

解决方案 »

  1.   

    ///////////////////////////
    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.
    //////////////////////////////////////////
      

  2.   

    那我用SQL Plus怎么实现?
    或者程序里面怎么实现??
      

  3.   

    你在sqlplus里面
    commit
    /
    或者
    rollback
    /
      

  4.   

    wylwy11130能否
    据个例子,我初学 oracle
      

  5.   

    LOCK TABLE
    语法:
    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
    /
      

  6.   

    very good 非常明白!谢谢大家,最谢谢 wylwyl1130(落雪山林)