Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

phantom synonyms

537728Feb 6 2007 — edited Feb 6 2007
I 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);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 6 2007
Added on Feb 6 2007
3 comments
338 views