This discussion is archived
6 Replies Latest reply: Feb 5, 2013 8:52 AM by karan RSS

shared lock in oracle

951290 Newbie
Currently Being Moderated
hi gurus

what is shared lock in oracle ?? when it comes to play? why it is called read lock ? i go through a lots of docs but still i am not clear about this.

please guide me
  • 1. Re: shared lock in oracle
    LaserSoft Journeyer
    Currently Being Moderated
    948287 wrote:
    hi gurus

    what is shared lock in oracle ?? when it comes to play? why it is called read lock ? i go through a lots of docs but still i am not clear about this.

    please guide me
    it allows the associated resource to be shared, depending on the operations involved. Multiple users reading data can share the data, holding share locks to prevent concurrent access by a writer (who needs an exclusive lock). Several transactions can acquire share locks on the same resource.

    -- LaserSoft.
  • 2. Re: shared lock in oracle
    asahide Expert
    Currently Being Moderated
    Hello,

    Is this help for you?
    <<https://www.indiana.edu/~dbateam/resources/tips/oracle_locking.ppt>>

    Rds,
  • 3. Re: shared lock in oracle
    951290 Newbie
    Currently Being Moderated
    hi,
    i already went through all this article you mentioned , that defines the shared lock .
    can anybody please elaborate it with some example.

    thanks for any help
    mahesh
  • 4. Re: shared lock in oracle
    sb92075 Guru
    Currently Being Moderated
    948287 wrote:
    hi,
    i already went through all this article you mentioned , that defines the shared lock .
    can anybody please elaborate it with some example.

    thanks for any help
    mahesh
    http://www.oracle.com/pls/db112/search?remark=quick_search&word=shared+lock&partno=
  • 5. Re: shared lock in oracle
    karan Pro
    Currently Being Moderated
    An EXAMPLE := Shared lock simply means it is shared by all , isnt it ..So some people are accessing a table whose rows are not locked exclusively with DML's lets say and others are locking as well simultaneously to do some DML's but on some rows not all, So this means that oracle is allowing some to access some part, and some to lock some part with DML's to disallow drop and alter operations while it is happening. hope it helps
  • 6. Re: shared lock in oracle
    karan Pro
    Currently Being Moderated
    Or suppose a user selects a row or some rows using FOR UPDATE clause and in that case two locks will be placed isnt it, one will be exclusive lock on the row and the other would be a a ROW SHARE LOCK on the table itself. This will disallow other users putting an exclusive lock on the table, thus preventing them from altering the table structure.

    Karan

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points