-- Pre Merge
-- rename MOPDB_ECB_MRRNC to ODS_ECB_MRRNC and merge

  DROP ROLE MOPDB_ECB_MRRNC;
  CREATE ROLE ODS_ECB_MRRNC;

  GRANT CREATE SESSION TO ODS_ECB_MRRNC;
  GRANT SELECT ANY DICTIONARY TO ODS_ECB_MRRNC;

  GRANT SELECT ON OU_C2D.MRRNC_ITEM TO ODS_ECB_MRRNC;
  GRANT SELECT ON OU_C2D.MRRNC_HEADER TO ODS_ECB_MRRNC;
  GRANT SELECT ON OU_C2D.MRRNC_DELETIONS TO ODS_ECB_MRRNC;
  GRANT SELECT ON OU_C2D.MRRNC_ADMIN TO ODS_ECB_MRRNC;

  GRANT ODS_ECB_MRRNC TO MOPDB_ECB_MRRNC_GL;

-- rename MOPDB_ECB_RQSD to ODS_ECB_RQSD and merge  
  
  DROP ROLE MOPDB_ECB_RQSD;
  CREATE ROLE ODS_ECB_RQSD;

  GRANT CREATE SESSION TO ODS_ECB_RQSD;
  GRANT SELECT ANY DICTIONARY TO ODS_ECB_RQSD;

  GRANT SELECT ON OU_RQSD.RQSD_MAIN TO ODS_ECB_RQSD;

  GRANT ODS_ECB_RQSD TO MOPDB_ECB_RQSD_GL;
  
  
  
----- POST MERGE : fixing ODS Roles and grants

-- Assiging roles from RAR_ODS_RTM_CTREF_GL to RAR_DWH_RTM_CTREF_GL

GRANT RTM_ODS_CTREF TO RAR_RTM_DATACORR_GL;
GRANT RTM_ODS_CTREF_DQ TO RAR_RTM_DATACORR_GL;

-- Assiging roles from ODS_TMS_DATA_GL to MOPDB_TMS_DATA_GL 

GRANT ODS_TMS_DATA TO MOPDB_TMS_DATA_GL;
