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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to grant privileges on all the tables of owner1 to owner2

RE: How to grant privileges on all the tables of owner1 to owner2

From: Mercadante, Thomas F <NDATFM_at_labor.state.ny.us>
Date: Fri, 31 May 2002 08:06:33 -0800
Message-ID: <F001.00470ED1.20020531080633@fatcity.com>


Ashoke,

Run the following script from the owner1 account:

set head off
set lines 120
set pages 200
spool grant.sql
select 'grant select,insert,update,delete on ' || table_name || ' to owner2;'
from user_tables
/
spool off
@grant.sql

good luck!

Tom Mercadante
Oracle Certified Professional

-----Original Message-----
Sent: Friday, May 31, 2002 11:33 AM
To: Multiple recipients of list ORACLE-L

Greetings,

Here is the scenario.
I have 2 users(owner1, owner2) in an oracle database. owner1 owns 150 tables.
owner2 needs select,insert,update,delete privilege on all the tables owned by owner1.

One option is : login as owner1 and

grant select,insert,update,delete on owner1.table1 to owner2;

.
.
.

grant select,insert,update,delete on owner1.table150 to owner2;

I was wondering if there is any way I can perform the same work using one sql statement instead of using 150 statements.

Thanks,
Ashoke
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Mandal, Ashoke
  INET: ashoke.k.mandal_at_medtronic.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Mercadante, Thomas F
  INET: NDATFM_at_labor.state.ny.us
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri May 31 2002 - 11:06:33 CDT

Original text of this message

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