Rem
Rem $Header: emcore/source/oracle/sysman/emdrep/sql/core/latest/admin/admin_postprep_pdb_admin_cre.sql /main/1 2023/03/28 09:25:16 spramani Exp $
Rem
Rem admin_postprep_pdb_admin_cre.sql
Rem
Rem Copyright (c) 2023, Oracle and/or its affiliates.
Rem
Rem    NAME
Rem      admin_postprep_pdb_admin_cre.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    BEGIN SQL_FILE_METADATA
Rem    SQL_SOURCE_FILE: emcore/source/oracle/sysman/emdrep/sql/core/latest/admin/admin_postprep_pdb_admin_cre.sql
Rem    SQL_SHIPPED_FILE:
Rem    SQL_PHASE:
Rem    SQL_STARTUP_MODE: NORMAL
Rem    SQL_IGNORABLE_ERRORS: NONE
Rem    END SQL_FILE_METADATA
Rem
Rem    MODIFIED   (MM/DD/YY)
Rem    spramani    03/02/23 - lcm admin creation
Rem    spramani    03/02/23 - Created
Rem

define PDB_ADMIN_USER            = "&1"
BEGIN 
EM_PDBLCM_UTL.lcmprep('&PDB_ADMIN_USER');
END;
/

DECLARE
    l_error_code VARCHAR2(4000):='';
BEGIN 


    execute immediate 'drop package body EM_PDBLCM_UTL';
    execute immediate 'drop package EM_PDBLCM_UTL';
EXCEPTION
        WHEN OTHERS THEN
        IF SQLCODE = -4043 THEN
                NULL;
            ELSE
                l_error_code := l_error_code || 'DROP PACKAGE PDB LCM UTIL has error: ' || SQLCODE || ' ';
                IF LENGTH(l_error_code) > 0 THEN
                    raise_application_error(-20109, l_error_code);
                END IF;
        END IF;
END;
/
 
