Monday, June 09, 2008

ORA-00980: synonym translation is no longer valid

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

ORA-00980: synonym translation is no longer valid
This error can be seen when the object pointed to by a synonym has been dropped or renamed and the name of the synonym is different from the real object's name.

If the underlying object is restored later using the FLASHBACK TO BEFORE DROP command, the synonym resumes working normally, however if the object has been dropped and purged from the recycle bin (Oracle 10R1 or later), the synonym may or may not resume working if the object is re-created, depending on whether the real object is in the same schema or not.
If the object pointed to by the synonym is in another schema, then you must grant all the necessary privileges again.

For instance:

(User A)
create table test_table as select * from dual;
create public synonym syn_test_table for test_table; -- note that synonym's name is different
grant select on test_table to user_b;

(User B)
select 1 from syn_test_table;
---
1

(User A)
drop table test_table;

(User B)
select 1 from syn_test_table;

ORA-00980: synonym translation is no longer valid

(User A)
create table test_table as select * from dual;

(User B)
select 1 from syn_test_table;

ORA-00942: table or view does not exist -- this is caused by the lack of privileges

(User A)
grant select on test_table to user_b;

(User B)
select 1 from syn_test_table;
---
1
Note that when the underlying object has the same name as the synonym you get instead ORA-01775.

See message translations for ORA-00980 and search additional resources.

No comments:

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles