set long 90000
set linesize 32000
set trimspool on
set heading off
set tab off
set feedback off
SET echo off
set pagesize 0
column TBL format a121 word_wrapped
select 'alter synonym '||'"'||owner||'"'||'.'||'"'||object_name||'"'||' compile;' TBL from dba_objects where status='INVALID' and object_type='SYNONYM' order by 1;
SQL