//CONCEDER PRIVILEGIOS:
SELECT TABLE_NAME FROM DBA_TABLES WHERE OWNER='SEI';
SELECT 'GRANT SELECT ON '||OWNER||'.'||TABLE_NAME||' TO XXXXXX;' FROM DBA_TABLES P WHERE P.OWNER = 'SEI' ORDER BY 1;
SELECT 'GRANT ' ||PRIVILEGE||' ON '||OWNER||'.'||TABLE_NAME||' TO '||GRANTEE||';' FROM DBA_TAB_PRIVS P WHERE P.OWNER = 'SEI' ORDER BY GRANTEE ASC;
//Acesso de leitura em todos os objetos (tabelas, views, packages, procedures e functions) do schema SRH2 para o usuário userRecebedor no ambiente de produção
SELECT 'GRANT select on '||owner||'.'||object_name||' to userRecebedor;' FROM dba_objects p where p.owner = 'SRH2' ORDER BY 1;
SELECT 'GRANT EXECUTE ON '||owner||'.'||object_name||' to userRecebedor;' FROM dba_objects p where p.owner = 'SRH2' AND object_TYPE IN ('PACKAGE','PACKAGE BODY') ;