Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Ways to fake table in own scema.
Your problem is probobly the part where you have to do a manual grant
for each table, you can do something like this.
connect user1/passwd
select 'GRANT SELECT ON '||table_name||' TO USER2;' from USER_TABLES;
(now run the generated script)
connect user2/passed
select 'CREATE SYNONYM '||table_name||' FOR
'||owner||'.'|||table_name||';' from all_tables;
(run this generated script)
On Fri, 27 Aug 1999 12:08:24 GMT, gm_at_offline.no (G. Mjoen) wrote:
>I have a user (USER1) with a lot of tabes. I created a new user
>(USER2) with no tables in his/hers schema. USER2 is granted select on
>all of USER1's tables.
>
>The problem is:
>
>USER2 needs to write 'select * from USER1.TABLE1' instead of 'select *
>from TABLE1'.
>
>I am able to fix this by creating a synonym for each table. Is there
>som other way of doing this?
>
>--
>Gaute
Andrey Dmitriev eFax: (978) 383-5892 Daytime: (917) 373-5417 AOL: NetComrade ICQ: 11340726 remove NSPAM to emailReceived on Tue Aug 31 1999 - 13:36:47 CDT