phantom synonyms
537728Feb 6 2007 — edited Feb 6 2007I have found this script that will generate the ddl needed to drop phantom synonyms, but, what is a phantom synonym? is it safe to remove them?
thanks.
SELECT 'drop '||decode(owner,'PUBLIC',' public ',null)||' synonym '||decode(owner,'PUBLIC',null,owner||'.')||synonym_name||';'
FROM dba_synonyms s where owner not in('SYSTEM','SYS') and db_link is null and not exists
(SELECT 1 FROM all_objects o WHERE object_type in('TABLE','VIEW','SYNONYM', 'SEQUENCE','PROCEDURE', 'PACKAGE','FUNCTION')
and s.table_owner=o.owner and s.table_name=o.object_name);