6 Replies Latest reply: Feb 5, 2013 10:52 AM by Karan RSS

    shared lock in oracle

    951290
      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
          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
            Hello,

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

            Rds,
            • 3. Re: shared lock in oracle
              951290
              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
                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
                  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
                    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