Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: how can I get public synonym scripts , not referencing to dba_synonyms

Re: how can I get public synonym scripts , not referencing to dba_synonyms

From: Venkat <vreddy_at_ix.netcom.com>
Date: Sat, 11 Apr 1998 17:12:15 -0400
Message-ID: <6gomfa$1np@dfw-ixnews6.ix.netcom.com>


Use SQL*Plus to run the following (sppol it to a file) and it will generate all the create public synonym statements. You can change the table_owner or remove the WHERE clause altogether to generate the create statements for all public synonyms.

SPOOL filename
SET HEADING OFF
SET PAGESIZE 300
SET FEEDBACK OFF SELECT 'CREATE PUBLIC SYNONYM '||synonym_name||' FOR ' ||table_owner||'.'||table_name||';' FROM DBA_SYNONYMS WHERE table_owner='SYS';

SET HEADING ON
SET FEEDBACK ON
SPOOL OFF
> as you know , we can get "create table, index, grants related scrits
>"
>using exp tool .
>
> for example ' exp scott/tiger indexes=y grants=y rows=n show=y
>'
> produce all the scripts the user scott has.
>
>but how can I get public synonym scripts ?
>public means all user.
>so I can't get public synonym scritps at any method.
>
> the only method is referencing to dba_synonyms .
>and make new create public synonym scripts by hand.
>
>I want to get complete public synonym script
>
>not referencing to dba_synonyms
>without editing efforts.
>
> anyone knows easy method ?
>
Received on Sat Apr 11 1998 - 16:12:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US