Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Drop foreign key constraint

Posted on 2016-07-15
8
Medium Priority
?
79 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 71

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 71

Accepted Solution

by:
Qlemo earned 2000 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 71

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to recover a database from a user managed backup
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

604 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