Q
Problem solve Get help with specific problems with your technologies, process and projects.

Foreign keys across database instances

Is it possible to implement a foreign key constraint in a database that resides in another Oracle database instance? If so, could you explain how?

Foreign Key constraints cannot be forced across a database link. This makes sense if your network connections go down or the remote database becomes unavailable. Constraints should not be violated due to network problems or other databases going down.

You can however force this yourself, but you will have to do some coding. You can create a trigger on a table. On INSERT into that table, make sure the the parent inserts in the table across the database link. If it does not exist in that remote table, then throw an exception. Otherwise, do nothing. So your solution is to code triggers to handle the constraint for you.

For More Information

Dig Deeper on Oracle database design and architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close