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: synonym creation

Re: synonym creation

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 19 Oct 2005 08:17:22 -0700
Message-ID: <1129735042.070207.8730@g43g2000cwa.googlegroups.com>


Chris, generating create synonym statements for a specific user including PUBLIC is very easy to do in SQL just by selecting on dba_synonyms. If you want to generate synonyms where none exist then you can use dba_tables as the driving view.

I am not at work where I have the script but it would go something like:
select 'create '||decode(owner,'PUBLIC',public synonym ','synonym ')||synonym_name||' for '||chr(10)||

table_owner||'.'||table_name||decode(db_link,NULL,NULL,'@'||db_link)||';' from dba_synonyms
where table_owner = 'TARGET'

Or similiar. I am bound to have made a typo or two but you should be able to figure it out from here.

HTH -- Mark D Powell -- Received on Wed Oct 19 2005 - 10:17:22 CDT

Original text of this message

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