同义词的循环链

SQL> select* from dba_synonyms  where table_name='t1';
 
OWNER                          SYNONYM_NAME                   TABLE_OWNER                    TABLE_NAME                     DB_LINK
------------------------------ ------------------------------ ------------------------------ ------------------------------ --------------------------------------------------------------------------------
 
SQL> select * From t1
  2  ;
 
select * From t1
 
ORA-01775: 同义词的循环链


SQL> select * From bosdata.t1
  2  ;
 
select * From bosdata.t1
 
ORA-00942: 表或视图不存在
 

SQL> select *
  2    from dba_synonyms
  3   where table_owner = 'BOSDATA'
  4     and synonym_name in
  5         (select a.synonym_name
  6            from dba_synonyms a where a.table_owner = 'BOSDATA'
  7          minus
  8          select object_name from DBA_objects WHERE OWNER='BOSDATA')
  9  ;
 
OWNER                          SYNONYM_NAME                   TABLE_OWNER                    TABLE_NAME                     DB_LINK
------------------------------ ------------------------------ ------------------------------ ------------------------------ --------------------------------------------------------------------------------                                 
PUBLIC                         t1      BOSDATA                        t1     
 

解决办法:
drop public synonym  t1

你可能感兴趣的:(同义词的循环链)