efaah0
asked on
User Privileges to Database
I am new to oracle and this is a simple question. What command do I use to grant read only rights to a user and what commands do I use to verify the privileg has been granted?
GRANT SELECT ON ALL TO USER;
Didn't work for me:
grant select on all to jbush
*
ERROR at line 1:
ORA-00903: invalid table name
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1184235446570
"Well, there is no grant that allows a user or role access to all objects in a
schema like that"
However, this PL/SQL will work:
begin
for x in ( select tname from tab )
loop
execute immediate 'grant select on ' || x.tname || ' to {username}';
end loop;
end;
grant select on all to jbush
*
ERROR at line 1:
ORA-00903: invalid table name
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1184235446570
"Well, there is no grant that allows a user or role access to all objects in a
schema like that"
However, this PL/SQL will work:
begin
for x in ( select tname from tab )
loop
execute immediate 'grant select on ' || x.tname || ' to {username}';
end loop;
end;
I stand corrected. Actually, I messed up with "GRANT ALL ON <table> ... etc" :-(
here the link:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1184235446570
here the link:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1184235446570
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.