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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How do I grant priveledges to multiple tables?

Re: How do I grant priveledges to multiple tables?

From: Kumar, Sai (EXCHANGE:PERPK:3374) <saikumar_at_nortel.com>
Date: Tue, 15 Dec 1998 14:49:20 -0500
Message-ID: <3676BD40.A83F18A@nortel.com>


Brian Lavender wrote:

> Say I have the tables named in my database: FRED, BARNEY, WILMA,
> BETTY. I know I can issue the statement to grant priveledges to a
> single table:
>
> grant select, update, delete, insert on FRED to role_foo;
>
> Is there a shortcut to granting these priveledges to all the tables in
> a simple step?
>
> brian
> --------
> Brian E. Lavender
> http://www.brie.com/brian/
>
> "For every complex problem, there is
> a solution that is simple, neat, and
> wrong." -- H. L. Mencken

One Way to grant privileges to all the tables is :-

set verify off
set feedback off
set pages 1000
set lines 132
set head off
spool grant.sql
select 'grant select,insert,delete,update on ' || tname || ' to role_foo;' from tab;
spool off;
exit

Run this u will get grant.sql as the output with just the grant statements
on it. Run the grant.sql on the sql*plus and that will grant privileges in one step.

Thanks
Sai Received on Tue Dec 15 1998 - 13:49:20 CST

Original text of this message

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