Rem
Rem $Header: emcore/source/oracle/sysman/emdrep/sql/emregistry/latest/emupgrade_postops.sql rbali_oneoff_updated/1 2025/03/14 06:41:14 rbali Exp $
Rem
Rem emupgrade_postops.sql
Rem
Rem Copyright (c) 2013, 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/emregistry/latest/emupgrade_postops.sql
Rem EMRU_UNIX_DELIVERABLES:
Rem emcore/source/oracle/sysman/emdrep/sql/emregistry/latest/emupgrade_postops.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      emupgrade_postops.sql - <one-line expansion of the name>
Rem
Rem    DESCRIPTION
Rem      <short description of component this file declares/defines>
Rem
Rem    NOTES
Rem      <other useful comments, qualifications, etc.>
Rem
Rem    MODIFIED   (MM/DD/YY)
Rem    mvenkata    12/13/19 - To add revoke for sys.user$ for upgrade use case
Rem    spramani    04/12/13 - emupgrade postops
Rem    spramani    04/12/13 - Created
Rem

DEFINE MY_REPOS_USER = "&1"
ALTER SESSION SET CURRENT_SCHEMA = &MY_REPOS_USER;

-- Update ECM metadata
BEGIN ECM_METADATA_UTIL.UPDATE_ECM_POST_CRE_UPGR; END;
/
--
-- This revoke is to ensure the repos user does not have
-- access to SYS.USER$ this is mainly for Upgrade use case. 
-- 
BEGIN
    EXECUTE IMMEDIATE 'REVOKE ALL on SYS.USER$ from &MY_REPOS_USER';
EXCEPTION
  WHEN OTHERS THEN
    IF (SQLCODE != -1952) THEN
      RAISE;
    END IF;
END;
/


