Skip to content

Instantly share code, notes, and snippets.

@wkoszycki
Created August 18, 2015 12:51
Show Gist options
  • Save wkoszycki/e9e7e2bdf9c455f65ad5 to your computer and use it in GitHub Desktop.
Save wkoszycki/e9e7e2bdf9c455f65ad5 to your computer and use it in GitHub Desktop.
Sql script to grant privileges to all tables of certain user
BEGIN
FOR R IN (SELECT owner, table_name FROM all_tables WHERE owner='<user>') LOOP
EXECUTE IMMEDIATE 'grant select,insert,update,delete on '||R.owner||'.'||R.table_name||' to <username>';
END LOOP;
END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment