Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    Jordan
    Posts
    137

    Unhappy Unanswered: Lock Problem while altre-add constraint

    Hi all

    When I try to add FOREIGN KEY constraint to a table xxx, It give me this error message :
    timeout occurred while waiting to lock object xxx

    then I applied lock command as folwing :

    sql> lock table xxx in exclusive mode nowait;

    it gave me this message( Table(s) locked)

    then I try to add the constraint again, the same error message appear



    this is the alter command:

    alter table xxx add constraint xxx_fk
    foreign key (fld1,fld2) references table1(f1,f2);




    can anyone help


    thanx

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    I may be trying to lock the parent table also

  3. #3
    Join Date
    Feb 2004
    Location
    Jordan
    Posts
    137
    Originally posted by gbrabham
    I may be trying to lock the parent table also


    there was error in my question
    I made lock to the parent table >>> which table1 not xxx

    as my example ....




    any way I made lock for both but the problem still appear

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    query V$LOCK to see who has the tabled locked.
    More than likely some session has an uncommitted transaction pending.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •