spool create_roles_praradb.sql.txt
--create roles
CREATE ROLE "BKP_DWH_RO";
CREATE ROLE "CORR_RAR_RO";
CREATE ROLE "CORR_RAR_RW";
CREATE ROLE "CORR_RAR_RW_GL";
CREATE ROLE "CORR_RAR_TECH_RO";
CREATE ROLE "CORR_RAR_TECH_RW";
CREATE ROLE "CORR_REF_MAIN_RO";
CREATE ROLE "CT_RAR_RO";
CREATE ROLE "CT_RTM_RO";
CREATE ROLE "DBMGR_RO";
CREATE ROLE "DM_FXCD_RO";
CREATE ROLE "DM_RISKENGINE_RO";
CREATE ROLE "DW_EDT_RW";
CREATE ROLE "DW_RAR_RO";
CREATE ROLE "DW_REF_MAIN_RO";
CREATE ROLE "DW_TMP_RO";
CREATE ROLE "ECB_OEM_DAC_DBA_ADMIN";
CREATE ROLE "ECB_OEM_DAC_SYS_ADMIN";
CREATE ROLE "ECB_THIRD_LV_SUPPORT";
CREATE ROLE "FXCD_REP_RO";
CREATE ROLE "RAR_DATAOWNER";
CREATE ROLE "RAR_DWH_ANALYST";
CREATE ROLE "RAR_DWH_ANALYST_GL";
CREATE ROLE "RAR_DWH_RTM_DATACORR_GL";
CREATE ROLE "RAR_PUBLIC";
CREATE ROLE "RAR_PUBLIC_GL";
CREATE ROLE "RAR_RO";
CREATE ROLE "RAR_SUPERUSER";
CREATE ROLE "RTM_DATACORR";
CREATE ROLE "SBI_3RD_LINE_DB_SUPPORT";
CREATE ROLE "SBI_DAC_SYSTEM_ADMINISTRATOR";
CREATE ROLE "SBI_DGIS_SERVICE_DESK";
CREATE ROLE "SF_C2D_RO";
CREATE ROLE "SF_CEPH_RO";
CREATE ROLE "SF_CSDB_RO";
CREATE ROLE "SF_FXCD_RO";
CREATE ROLE "SF_LBA_RO";
CREATE ROLE "SF_LED_RO";
CREATE ROLE "SF_LM_RO";
CREATE ROLE "SF_MDP_RO";
CREATE ROLE "SF_RIAD_RO";
CREATE ROLE "SF_SDW_RO";
CREATE ROLE "SF_TMS_PRR_RO";
CREATE ROLE "SF_TMS_RO";
CREATE ROLE "SF_TOP_RO";
CREATE ROLE "WLA_RW";

--role privs
GRANT "CONNECT" TO "BKP_DWH_RO";
GRANT "RESOURCE" TO "BKP_DWH_RO";
GRANT "CORR_RAR_RW" TO "CORR_RAR_RW_GL";
GRANT "CONNECT" TO "DM_FXCD_RO";
GRANT "CONNECT" TO "ECB_THIRD_LV_SUPPORT";
GRANT "SELECT_CATALOG_ROLE" TO "ECB_THIRD_LV_SUPPORT";
GRANT "OEM_ADVISOR" TO "ECB_THIRD_LV_SUPPORT";
GRANT "OEM_MONITOR" TO "ECB_THIRD_LV_SUPPORT";
GRANT "CONNECT" TO "RAR_DWH_ANALYST";
GRANT "CT_RAR_RO" TO "RAR_DWH_ANALYST";
GRANT "DW_RAR_RO" TO "RAR_DWH_ANALYST";
GRANT "DW_REF_MAIN_RO" TO "RAR_DWH_ANALYST";
GRANT "DW_TMP_RO" TO "RAR_DWH_ANALYST";
GRANT "DM_FXCD_RO" TO "RAR_DWH_ANALYST";
GRANT "RAR_RO" TO "RAR_DWH_ANALYST";
GRANT "CT_RTM_RO" TO "RAR_DWH_ANALYST";
GRANT "CONNECT" TO "RAR_DWH_ANALYST_GL";
GRANT "CT_RAR_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "DW_RAR_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "DW_REF_MAIN_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "DW_TMP_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "DM_FXCD_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "RAR_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "CORR_RAR_TECH_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "CORR_RAR_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "BKP_DWH_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "DBMGR_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_TMS_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_RIAD_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_CSDB_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_MDP_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_LM_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "FXCD_REP_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_SDW_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_TMS_PRR_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_CEPH_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_C2D_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_TOP_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_FXCD_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "CT_RTM_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_LED_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "DM_RISKENGINE_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "SF_LBA_RO" TO "RAR_DWH_ANALYST_GL";
GRANT "RTM_DATACORR" TO "RAR_DWH_RTM_DATACORR_GL";
GRANT "CT_RAR_RO" TO "RAR_PUBLIC_GL";
GRANT "CORR_RAR_TECH_RO" TO "RAR_PUBLIC_GL";
GRANT "DBMGR_RO" TO "RAR_PUBLIC_GL";
GRANT "RAR_PUBLIC" TO "RAR_PUBLIC_GL";
GRANT "CORR_REF_MAIN_RO" TO "RAR_PUBLIC_GL";
GRANT "DBA" TO "SBI_DAC_SYSTEM_ADMINISTRATOR";
GRANT "PDB_DBA" TO "SBI_DAC_SYSTEM_ADMINISTRATOR" WITH ADMIN OPTION;

--sys privs
GRANT SELECT ANY DICTIONARY TO "CORR_RAR_RW_GL";
GRANT ALTER SYSTEM TO "ECB_OEM_DAC_DBA_ADMIN";
GRANT CREATE SESSION TO "ECB_OEM_DAC_DBA_ADMIN";
GRANT ALTER SESSION TO "ECB_OEM_DAC_DBA_ADMIN";
GRANT CREATE TABLESPACE TO "ECB_OEM_DAC_DBA_ADMIN";
GRANT ALTER TABLESPACE TO "ECB_OEM_DAC_DBA_ADMIN";
GRANT DROP TABLESPACE TO "ECB_OEM_DAC_DBA_ADMIN";
GRANT ALTER USER TO "ECB_OEM_DAC_DBA_ADMIN";
GRANT ALTER DATABASE TO "ECB_OEM_DAC_DBA_ADMIN";
GRANT ADMINISTER SQL TUNING SET TO "ECB_OEM_DAC_DBA_ADMIN";
GRANT ALTER SYSTEM TO "ECB_OEM_DAC_SYS_ADMIN";
GRANT CREATE SESSION TO "ECB_OEM_DAC_SYS_ADMIN";
GRANT ALTER SESSION TO "ECB_OEM_DAC_SYS_ADMIN";
GRANT CREATE TABLESPACE TO "ECB_OEM_DAC_SYS_ADMIN";
GRANT ALTER TABLESPACE TO "ECB_OEM_DAC_SYS_ADMIN";
GRANT ALTER USER TO "ECB_OEM_DAC_SYS_ADMIN";
GRANT ALTER DATABASE TO "ECB_OEM_DAC_SYS_ADMIN";
GRANT ADMINISTER SQL TUNING SET TO "ECB_OEM_DAC_SYS_ADMIN";
GRANT CREATE SESSION TO "ECB_THIRD_LV_SUPPORT";
GRANT EXEMPT ACCESS POLICY TO "ECB_THIRD_LV_SUPPORT";
GRANT SELECT ANY DICTIONARY TO "ECB_THIRD_LV_SUPPORT";
GRANT ADMINISTER SQL TUNING SET TO "ECB_THIRD_LV_SUPPORT";
GRANT SELECT ANY DICTIONARY TO "RAR_DWH_ANALYST_GL";
GRANT CREATE SESSION TO "RAR_PUBLIC";
GRANT SELECT ANY DICTIONARY TO "RAR_PUBLIC";
GRANT CREATE SESSION TO "RAR_SUPERUSER";
GRANT SELECT ANY TABLE TO "RAR_SUPERUSER";
GRANT INSERT ANY TABLE TO "RAR_SUPERUSER";
GRANT UPDATE ANY TABLE TO "RAR_SUPERUSER";
GRANT DELETE ANY TABLE TO "RAR_SUPERUSER";
GRANT SELECT ANY SEQUENCE TO "RAR_SUPERUSER";
GRANT CREATE SESSION TO "SBI_3RD_LINE_DB_SUPPORT";
GRANT ALTER SESSION TO "SBI_3RD_LINE_DB_SUPPORT";
GRANT SELECT ANY DICTIONARY TO "SBI_3RD_LINE_DB_SUPPORT";
GRANT ADVISOR TO "SBI_3RD_LINE_DB_SUPPORT";
GRANT ADMINISTER SQL TUNING SET TO "SBI_3RD_LINE_DB_SUPPORT";
GRANT CREATE SESSION TO "SBI_DAC_SYSTEM_ADMINISTRATOR";
GRANT ALTER SESSION TO "SBI_DAC_SYSTEM_ADMINISTRATOR";
GRANT LOCK ANY TABLE TO "SBI_DAC_SYSTEM_ADMINISTRATOR" WITH ADMIN OPTION;
GRANT ALTER ANY INDEX TO "SBI_DAC_SYSTEM_ADMINISTRATOR" WITH ADMIN OPTION;
GRANT ANALYZE ANY TO "SBI_DAC_SYSTEM_ADMINISTRATOR" WITH ADMIN OPTION;
GRANT CREATE ANY MATERIALIZED VIEW TO "SBI_DAC_SYSTEM_ADMINISTRATOR" WITH ADMIN OPTION;
GRANT DROP ANY MATERIALIZED VIEW TO "SBI_DAC_SYSTEM_ADMINISTRATOR" WITH ADMIN OPTION;
GRANT GLOBAL QUERY REWRITE TO "SBI_DAC_SYSTEM_ADMINISTRATOR" WITH ADMIN OPTION;
GRANT ON COMMIT REFRESH TO "SBI_DAC_SYSTEM_ADMINISTRATOR" WITH ADMIN OPTION;
GRANT EXPORT FULL DATABASE TO "SBI_DAC_SYSTEM_ADMINISTRATOR" WITH ADMIN OPTION;
GRANT IMPORT FULL DATABASE TO "SBI_DAC_SYSTEM_ADMINISTRATOR" WITH ADMIN OPTION;
GRANT ANALYZE ANY DICTIONARY TO "SBI_DAC_SYSTEM_ADMINISTRATOR" WITH ADMIN OPTION;

 --external names
alter role CORR_RAR_RW_GL identified globally as 'cn=FW-P-DC-P-RAR-CORR-RW-Oracle,ou=Firewall,ou=Access Control,ou=Groups,ou=Users and Groups,ou=ECB,dc=ecb01,dc=ecb,dc=de';
alter role ECB_THIRD_LV_SUPPORT identified globally as 'cn=3rd_line_dba_support,ou=Security,ou=Groups,ou=Users and Groups,ou=ECB,dc=ecb01,dc=ecb,dc=de';
alter role RAR_DWH_ANALYST_GL identified globally as 'cn=FW-P-DC-P-RAR-DWH-Oracle,ou=Firewall,ou=Access Control,ou=Groups,ou=Users and Groups,ou=ECB,dc=ecb01,dc=ecb,dc=de';
alter role RAR_DWH_RTM_DATACORR_GL identified globally as 'cn=P_RTM_DATACORR,ou=Access Control,ou=Groups,ou=Users and Groups,ou=ECB,dc=ecb01,dc=ecb,dc=de';
alter role RAR_PUBLIC_GL identified globally as 'cn=P_RAR_METADATA,ou=Access Control,ou=Groups,ou=Users and Groups,ou=ECB,dc=ecb01,dc=ecb,dc=de';

spool off