Results 1 to 4 of 4

Thread: Lock in Oracle Tables

  1. #1
    Contributing Member
    Join Date
    Jul 2006
    Answers
    93

    Lock in Oracle Tables

    If there is no lock specified what is the default lock that would be present in Oracle tables? Why I ask this is if two users try to update the same table is it that user has to explicitly provide locking for preventing concurrent updates or it is taken care of internally by default.


  2. #2
    Expert Member
    Join Date
    Jun 2006
    Answers
    410

    Re: Lock in Oracle Tables

    Updated records are locked implicitly in Oracle until the user who updated the records ends the transaction.
    You can lock records explicitly in oracle by using select...for update clause.

    Regards,
    James.


  3. #3
    Junior Member
    Join Date
    Oct 2006
    Answers
    5

    Re: Lock in Oracle Tables

    Quote Originally Posted by sripri View Post
    If there is no lock specified what is the default lock that would be present in Oracle tables? Why I ask this is if two users try to update the same table is it that user has to explicitly provide locking for preventing concurrent updates or it is taken care of internally by default.


    Hi,
    First you have to lock the rows explicitly before some body update the rows
    like below query

    select * from table name
    for update no wait;

    use the above command to prevent other user from updating. but u can issue the dml command. locked rows will be released only when u commit or rollback the transaction


  4. #4
    Contributing Member
    Join Date
    Jul 2006
    Answers
    93

    Re: Lock in Oracle Tables

    Thanks you friends. I tried my hands on locking as suggested by you with the ideas given in this discussion and could get a complete idea on it.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact