grant permissions on all tables to a user

Grant select  permission on all tables in logged in schema to a user/role:



declare
cursor c1 is select table_name from user_tables;
cmd varchar2(200);
begin
for c in c1 loop
cmd := 'GRANT SELECT ON '||c.table_name||' TO &&YOURUSERNAME';
execute immediate cmd;
end loop;
end;



Note :
you change the select to what ever permissions you want to grant. This will be very helpful in case of huge number of tables.

Comments

Popular posts from this blog

chr function and its values - CHR and ASCII values

IMPDP SHOW=Y, sqlfile=test.sql

ORACLE FAL_CLIENT and FAL_SERVER explained