-- sys_revoke.grt BEGIN /* Revoke MISH rola od shema SYS i SYSTEM */ FOR c IN ( SELECT granted_role, grantee FROM dba_role_privs WHERE grantee IN ('SYS', 'SYSTEM') AND ( SUBSTR (granted_role, 1, 4) IN ('ZMP_', 'PKA_', 'REC_', 'GAS_', 'NST_') OR SUBSTR (granted_role, 1, 10) IN ('POSSUS_ZMP', 'POSSUS_GAS') ) ORDER BY granted_role) LOOP EXECUTE IMMEDIATE 'REVOKE ' || c.granted_role || ' FROM ' || c.grantee; END LOOP; END; /