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: farkasb <farkasb_at_dss.hu>
Date: Mon, 03 Jun 2002 00:58:20 -0800
Message-ID: <F001.0047218A.20020603005820@fatcity.com>

If you don't want to grant select any table to owner2, try this :

select 'grant select on '||table_name from all_tables where owner = 'OWNER1'

It selects all grant statements, you have to execute them. For this, you may write a pl/sql block or just execute it as script.

Balazs Farkas

On 2002.05.31 11:33 "Mandal, Ashoke" wrote:
> 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.
>

Yes, it is possible to do that:

      grant dba,sysdba to owner2;

Now, owner2 will have select/insert/delete access to all tables owned by owner1.

--
Mladen Gogala
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Mladen Gogala
  INET: mgogala_at_adelphia.net

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: farkasb
  INET: farkasb_at_dss.hu

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 Mon Jun 03 2002 - 03:58:20 CDT

Original text of this message

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