A reader, September 06, 2017 - 3:08 pm UTC
more easy I think... the synonyms are recompiled automatically after execution a select to it...
SQL> spool kk.sql
SQL> select 'select * from '||owner||'.'||object_name||' where 1=0;' from dba_objects where status='INVALID' and object_type='SYNONYM' order by 1;
.
.
.
SQL> spool off
SQL> !vi kk.sql
SQL> @kk
SQL> select 'select * from '||owner||'.'||object_name||' where 1=0;' from dba_objects where status='INVALID' and object_type='SYNONYM' order by 1;
no rows selected
September 07, 2017 - 2:25 am UTC
nice input
Joao Amaral, July 23, 2019 - 12:32 pm UTC
select 'alter synonym '||owner||'.'||object_name||' compile; ' from dba_objects where status='INVALID' and object_type='SYNONYM' and owner='USER' order by 1;
select 'alter synonym '||owner||'.'||object_name||' compile; ' from dba_objects where status='INVALID' and object_type='SYNONYM' order by 1;