Error: ORA-00980: synonym translation is no longer valid
Cause:
1. Synonym created on non-existing object by mistake.
2. The synonyms referencing the object is dropped but synonym is not dropped
3. Dropped a user, but the synonyms referencing the objects owned by that dropped user.
Query to find the invalid synonyms
| select * from dba_synonyms s |
select'drop '||decode (s.owner,'PUBLIC','PUBLIC SYNONYM ','SYNONYM'||s.owner||'.')||s.synonym_name||';'fromdba_synonyms swheretable_owner not in('SYSTEM','SYS')anddb_link is nullandnot exists(select 1from dba_objects owhere s.table_owner=o.ownerand s.table_name=o.object_name)The query above generate the script to drop the synonyms whose translation is no longer valid
No comments:
Post a Comment