column object_name format a30
select
a.owner, a.object_name, a.object_type
from
dba_objects a
where
a.owner = '&BASE_OBJECT_SCHEMA'
-- choose the appropriate object types for the "base object"
and a.object_type in
('FUNCTION', 'MATERIALIZED VIEW', 'PACKAGE', 'PROCEDURE',
'SEQUENCE', 'TABLE', 'VIEW')
and not exists
(select null from dba_synonyms b
where
b.owner = '&SYNONYM_SCHEMA'
and a.owner = b.table_owner
and a.object_name = b.table_name
-- include this line if the synonym must have the same name as the
-- "base object"
and b.table_name = b.synonym_name
)
order by a.owner, a.object_type, a.object_name ;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/94384/viewspace-600268/
,如需转载,请注明出处,否则将追究法律责任。