DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Disabling Referencial Constraint

  1. #1
    Join Date
    Mar 2001
    Posts
    77
    I am trying to disable the primary key constraint of DEPT table. That didn't work out. So I thought may be I could disable the foreign key of the referenced table (EMP)... .

    However, it turned out that when I am working on the parent table, the child table is locked. Now, can anyone tell me how I can unlock from either EMP or DEPT table? Thanks!

    The following errors demonstrate how the EMP table is locked.

    1* ALTER TABLE scott.dept DISABLE CONSTRAINT DEPT_PRIMARY_KEY
    2 /
    ALTER TABLE scott.dept DISABLE CONSTRAINT DEPT_PRIMARY_KEY
    *
    ERROR at line 1:
    ORA-02297: cannot disable constraint (SCOTT.DEPT_PRIMARY_KEY) - dependencies exist

    ------------------------------------------------------------------

    SQL>* ALTER TABLE scott.emp DISABLE CONSTRAINT EMP_FOREIGN_KEY
    SQL> /
    ALTER TABLE scott.emp DISABLE CONSTRAINT EMP_FOREIGN_KEY
    *
    ERROR at line 1:
    ORA-00069: cannot acquire lock -- table locks disabled for EMP

  2. #2
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    Use
    ALTER TABLE emp ENABLE TABLE LOCK;
    and try again.

    Sanjay

  3. #3
    Join Date
    Jan 2013
    Posts
    1

    i have same problem

    my table has inner relation and when i enable table lock after 60 second show error
    ALTER TABLE table_name ENABLE TABLE LOCK;
    >>ora-00054 resource busy and acquire with NOWAIT specified or timeout expired

  4. #4
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Quote Originally Posted by MEHRDAD27 View Post
    my table has inner relation and when i enable table lock after 60 second show error
    ALTER TABLE table_name ENABLE TABLE LOCK;
    >>ora-00054 resource busy and acquire with NOWAIT specified or timeout expired
    There is/are open transaction/s affecting targetted table.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

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


Click Here to Expand Forum to Full Width