REM
REM DBAToolZ NOTE:
REM This script was obtained from DBAToolZ.com
REM It's configured to work with SQL Directory (SQLDIR).
REM SQLDIR is a utility that allows easy organization and
REM execution of SQL*Plus scripts using user-friendly menu.
REM Visit DBAToolZ.com for more details and free SQL scripts.
REM
REM
REM File:
REM c_rebuild_synonymc_rebuild_synonyms.sql
REM
REM REVERSE
REM
REM Author:
REM Vitaliy Mogilevskiy
REM VMOGILEV
REM (vit100gain@earthlink.net)
REM
REM Purpose:
REM
REM Reverse engineers synonyms (DB LINKS are supported)
REM
REM
REM Usage:
REM c_rebuild_synonymc_rebuild_synonyms.sql
REM
REM Example:
REM c_rebuild_synonymc_rebuild_synonyms.sql
REM
REM
REM History:
REM 08-01-2001 VMOGILEV Created
REM
REM
set lines 300
set trims on
set feedback off
SELECT 'CREATE SYNONYM '||owner||'.'||synonym_name||
' FOR '||DECODE(db_link,NULL,table_owner||'.')||table_name||DECODE(db_link,NULL,';','@'||db_link||';')
FROM dba_synonyms
WHERE owner='&owner'
spool c_rebuild_synonyms.run
/
spool off
ed c_rebuild_synonyms.run
accept dummy prompt "Press Enter to run the script (CTL-C to cancel) ..."
set feedback on
@c_rebuild_synonyms.run