Solved

Drop foreign key constraint

Posted on 2016-07-15
8
61 Views
Last Modified: 2016-09-10
SQL ERROR: ORA-04021: timeout occurred while waiting to lock object.
0
Comment
Question by:lium1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
8 Comments
 
LVL 70

Expert Comment

by:Qlemo
ID: 41712665
The corresponding table could not be locked within the time allowed.
0
 

Author Comment

by:lium1
ID: 41712683
I meant how to solve this issue. I am trying to add constraint foreign_key with enable and validate where I got an timeout error.
0
 
LVL 70

Accepted Solution

by:
Qlemo earned 500 total points (awarded by participants)
ID: 41712693
Since you want to have the FK validated, it needs to go thru both this and the referred table to check the constraint. You won't get that to succeed for heavy used tables (when updating/inserting a lot).
Not requesting validation is one option. Better to check manually later for mismatches - you'll have to correct them anyway, and it is better to have the FK ensured for future changes than not at all.
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 41778545
"You can't do that" can be a valid and appropriate answer. If there is no way, there is none.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question