Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: synonym creation
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
![]() |
![]() |