undefine username
col privilege format a150
select 'grant '||privilege||' on '||owner||'.'||table_name||' to '||grantee||';' privilege from dba_tab_privs where grantee like upper('&&username');
select 'grant '||privilege||' to '||grantee||decode(admin_option,'NO',' ',' with admin option')||';' privilege from dba_sys_privs where grantee like upper('&username');
select 'grant '||granted_role||' to '||grantee||decode(admin_option,'NO',' ',' with admin option')||';' privilege from dba_role_privs where grantee like upper('&username');