QuestionQ198

VerifiedManaging Schema Objects

A view and a synonym are created as follows:

create view dept_v as select * from dept;  
create synonym dept_s for dept_v;  

The table DEPT is subsequently dropped. What happens if you query the synonym DEPT_S?

Explanation

When a base table of a view is dropped, Oracle invalidates the dependent view but retains its definition and objects, including synonyms, that reference it. The invalid view cannot be used until its required base table exists again, so a query through the synonym fails because the view is invalid.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!