set heading off
set feedback off
set verify off
accept owner prompt 'Esquema? '
spool all_grants.sql
prompt define role="SISTEMAS"
prompt set verify off
select 'GRANT ALL ON '||object_name||' TO &'||'ROLE;'
   from all_objects
   where owner='&owner'
     and object_type in ('SEQUENCE','TABLE','VIEW');
select 'GRANT EXECUTE ON '||object_name||' TO &'||'ROLE;'
   from all_objects
   where owner='&owner'
     and object_type in ('FUNCTION','LIBRARY','PACKAGE','PROCEDURE');
prompt set verify on
spool off
set heading on
set feedback on
set verify on
