Re: synonym help

From: Eric Givler <egivler_at_flash.net>
Date: Sat, 03 Feb 2001 01:37:32 GMT
Message-ID: <whJe6.3109$tv5.145539_at_news.flash.net>


Yes. You do it with SQL.

ie.
set linesize 132
set pagesize 0
set newpage 0
set term off
set trimspool on
column mystatement format a132 trunc
spool create_public_synonyms.sql
select 'create public synonym ' || table_name || ' for ' || owner || '.' || table_name mystatement
from all_tables;
spool off

same for the grants.

Watch out for the duplicate object names across users. Also, you may want to limit the owner lists.

"Steve" <schen_at_prodigy.net> wrote in message news:95fln0$4mss$1_at_newssvr05-en0.news.prodigy.com...
> I would like to have someone help with auto-populate synonym for hundreds
 of
> tables on a new db.
>
> I had used one way like:
>
> create public synonym ABC for ABC
> /
> grant insert,select,update,delete on ABC to public
> /
> create public synonym ACTION for ACTION
> /
> grant insert,select,update,delete on ACTION to public
> /
>
> and so on and so forth. But this needs to edit every table in the code.
> Is there any way to automate this code to search all tables, create public
> synonym of it and grant right on it to public?
>
> Any help and comments are very appreciated.
>
> Steve
>
>
Received on Sat Feb 03 2001 - 02:37:32 CET

Original text of this message