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.
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
Post a Comment