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

Home -> Community -> Usenet -> c.d.o.server -> Re: grant select with grant option to system

Re: grant select with grant option to system

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Sun, 11 Jul 2004 21:06:56 +0200
Message-ID: <40f18f56$1$27296$626a14ce@news.free.fr>

"bonminh lam" <hansmayer1962_at_hotmail.com> a écrit dans le message de news:3c6b1bcf.0407110829.4992f982_at_posting.google.com...
> Hello,
>
> this is a script I would like to be able to grab from the net no
> matter where I am and run it as SYS.
>
> Basically so far I always have to log on to the host machine as SYS in
> case an user XZY happens to need to select from view e.g. V$INSTANCE,
> am I am getting tired of that.
>
>
> begin
> for rec in (
> select replace(table_name, 'V$', 'V_$') table_name
> from dict
> where table_name like 'V$%'
> ) loop
> begin
> execute immediate 'grant select on '
> ||rec.table_name||' to system with grant
> option';
> dbms_output.put_line(rec.table_name||' succeeded');
> exception
> when others then
> dbms_output.put_line(
> substr('table_name='||rec.table_name
> ||' '||sqlcode||' '||sqlerrm, 1, 255));
> end;
> end loop;
> end;
> /

Grant select_catalog_role to XYZ.

--
Regards
Michel Cadot
Received on Sun Jul 11 2004 - 14:06:56 CDT

Original text of this message

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