Rem
Rem $Header: emcore/source/oracle/sysman/emdrep/sql/core/latest/admin/admin_grants_schema_users.sql rbali_oneoff_updated/1 2025/03/14 06:41:13 rbali Exp $
Rem
Rem admin_grants_schema_users.sql
Rem
Rem Copyright (c) 2011, 2025, Oracle and/or its affiliates. 
Rem All rights reserved.

Rem BEGIN EMRU_FILE_METADATA
Rem EMRU_SOURCE_FILE:emcore/source/oracle/sysman/emdrep/sql/core/latest/admin/admin_grants_schema_users.sql
Rem EMRU_UNIX_DELIVERABLES:
Rem emcore/source/oracle/sysman/emdrep/sql/core/latest/admin/admin_grants_schema_users.sql

Rem EMRU_FILE_POSTINSTALL:<!!! enter the view based location of the executable file. If there is NONE leave as-is !!!>
Rem EMRU_GENERIC_FLAG:NONE
Rem END EMRU_FILE_METADATA

Rem
Rem    NAME
Rem      admin_grants_schema_users.sql - grant to core users
Rem
Rem    DESCRIPTION
Rem      Script to grant to core EM Users
Rem
Rem    NOTES
Rem      <other useful comments, qualifications, etc.>
Rem
Rem    MODIFIED   (MM/DD/YY)
Rem    spramani    01/30/25 - add compile post synonmyms to sysman_types
Rem    vbierlin    11/12/14 - Grants for EUS user
Rem    rahgupta    11/22/13 - pass schema owner
Rem    spramani    07/14/11 - grants to all SYSMAN_* users
Rem    spramani    07/14/11 - Created
Rem

DEFINE EM_ORACLE_HOME = "&1"
DEFINE EM_REPOS_USER  = "&2"
DEFINE MGMT_USER_ROLE = "&3"
DEFINE EM_VIEW_USER   = "&4"
DEFINE EM_RO_USER     = "&5"
DEFINE CLOUD_ENGINE_USER   = "&6"
DEFINE CLOUD_SWLIB_USER   = "&7"
DEFINE EUS_ENGINE_USER       = "&8"

DEFINE EM_SQL_ROOT       = "&EM_ORACLE_HOME/sysman/admin/emdrep/sql"


Rem Grants to MGMT_USER role
@@&&EM_SQL_ROOT/core/latest/admin/admin_grants_user_role.sql &EM_REPOS_USER &MGMT_USER_ROLE

Rem Grants to MGMT_VIEW user
@@&&EM_SQL_ROOT/core/latest/admin/em_view_user_grants.sql &EM_REPOS_USER &EM_VIEW_USER

Rem Grants to SYSMAN_RO user
@@&&EM_SQL_ROOT/core/latest/admin/admin_reposuser_grants_to_ro_user.sql &EM_REPOS_USER &EM_RO_USER ON
Rem compile after synonyms are recreated  
@@&&EM_SQL_ROOT/core/latest/admin/admin_recompile_invalid.sql &EM_REPOS_USER
@@&&EM_SQL_ROOT/core/latest/admin/admin_recompile_invalid.sql &EM_RO_USER
@@&&EM_SQL_ROOT/core/latest/admin/admin_recompile_invalid.sql &EM_VIEW_USER



Rem Grants to Cloud users
@@&&EM_SQL_ROOT/core/latest/admin/admin_grants_cloud_users.sql &EM_REPOS_USER &CLOUD_ENGINE_USER  &CLOUD_SWLIB_USER

Rem Grants to EUS users
@@&&EM_SQL_ROOT/core/latest/admin/admin_grants_eus_engine_user.sql &EM_REPOS_USER &EUS_ENGINE_USER


