Rem drv: <create type="types" pos="-"/>
Rem
Rem $Header: emcore/source/oracle/sysman/emdrep/sql/core/latest/sdk/sdk_types.sql rbali_oneoff_updated/1 2025/03/14 06:41:14 rbali Exp $
Rem
Rem sdk_types.sql
Rem
Rem Copyright (c) 2002, 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/sdk/sdk_types.sql
Rem EMRU_UNIX_DELIVERABLES:
Rem emcore/source/oracle/sysman/emdrep/sql/core/latest/sdk/sdk_types.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      sdk_types.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    gbafna      02/03/25 - 
Rem    gbafna      01/07/25 - make synonyms noneditionable
Rem    rstobbe     06/18/20 - extend mgmt_metric_details
Rem    shrikris    06/14/19 - create new type to support larger int arrays
Rem    lcuriel     08/31/17 - Bug 26726315 - Increase property_value column
Rem                           size of mgmt_target_* related tables
Rem    aalatorr    03/03/16 - Bug 22821675 - Requirement to increase
Rem                           property_value column size of
Rem                           mgmt_target_properties tab
Rem    vaibagar    02/25/15 - Adding user_name to assoc callback object
Rem    rnadidar    02/11/15 - cut over to EBR
Rem    akschand    05/23/14 - Change version from 13.1.0.0 to 12.2.0.0 for security fwk
Rem    jsadras     03/17/11 - move guid_array to sdk
Rem    jsadras     05/12/10 - add smp_emd_nvpair
Rem    pinshah     05/06/10 - moved ecm_tprop_obj here
Rem    jsadras     05/05/10 - add mgmt_guid_obj
Rem    jsadras     04/28/10 - add namevalue array
Rem    skini       03/15/10 - Add MGMT_ASSOC_ME_GUID_LIST
Rem    jsadras     02/26/10 - add ng assoc types
Rem    jashukla    07/09/09 - Add MGMT_PRIV_ARRAY
Rem    rrawat      08/14/08 - 
Rem    chyu        06/30/08 - factored out the mgmt_user role creation process
Rem                           to admin/admin_create_mgmt_user_role.sql
Rem    rrawat      06/29/08 - ER:6906328
Rem    jsadras     08/17/05 - type_meta_ver_cbk_obj/array additions 
Rem    gsbhatia    06/26/05 - New repmgr header impl 
Rem    rpinnama    06/23/05 - Add mgmt_tzrgn_update_cbk_obj 
Rem    jsadras     05/30/05 - property change type 
Rem    jsadras     03/14/05 - target metaver callback object 
Rem    dcawley     03/03/05 - Create private application context 
Rem    gsbhatia    02/13/05 - updating repmgr header 
Rem    gsbhatia    02/09/05 - updating repmgr header 
Rem    gsbhatia    02/07/05 - updating repmgr header 
Rem    ktlaw       01/11/05 - add repmgr header 
Rem    jsadras     12/23/04 - target name length 
Rem    jsadras     12/17/04 - target_array
Rem    jsadras     12/08/04 - mgmt_date_table
Rem    jsadras     11/09/04 - mgmt_metric_name_array
Rem    rzazueta    11/01/04 - Add EM_REPOS_USER parameter 
Rem    jsadras     10/13/04 - mgmt_integer_table
Rem    jsadras     10/06/04 - short_string_table
Rem    kmanicka    09/18/04 - Added type MGMT_USER_OBJECTS
Rem    streddy     08/10/04 - Added new function to metric objects 
Rem    dcawley     07/28/04 - Remove unused types 
Rem    jsadras     07/23/04 - add mgmt_target_guid_array 
Rem    rpinnama    06/20/04 - Add generic types like mgmt_integer_array 
Rem    streddy     09/25/03 - Added type_meta_ver 
Rem    streddy     03/18/03 - Added types for specifying metric dependencies
Rem    dcawley     12/10/02 - Change target_guid to guid
Rem    rpinnama    09/18/02 - Make all type creation create or replace
Rem    skini       07/12/02 - target_name column change
Rem    rpinnama    05/15/02 - rpinnama_reorg_rep_scripts
Rem    rpinnama    05/15/02 - Created
Rem

-- Create the type for returning objects owned by the user
CREATE OR REPLACE TYPE MGMT_USER_OBJECT IS OBJECT
(
 object_type        VARCHAR2(20),
 object_name        VARCHAR2(256),
 object_sub_type    VARCHAR2(256),
 async_drop         INTEGER(1)
);
/

CREATE OR REPLACE TYPE MGMT_USER_OBJECTS IS TABLE OF MGMT_USER_OBJECT;
/

-- Create the type for returning privilege information
CREATE OR REPLACE TYPE MGMT_USER_PRIVILEGE IS OBJECT
(priv_name    VARCHAR2(30),
 priv_type    NUMBER,
 guid         RAW(16),
 target_name  VARCHAR2(256),
 target_type  VARCHAR2(1024),
 user_defined NUMBER
);
/
CREATE OR REPLACE TYPE MGMT_USER_PRIVILEGES IS TABLE OF MGMT_USER_PRIVILEGE;
/

CREATE OR REPLACE TYPE MGMT_USER_GUID_ARRAY IS TABLE OF RAW(16);
/

/** Object having the guid and name used for SDK functions
 */

CREATE OR REPLACE TYPE mgmt_guid_obj AS OBJECT (
    guid RAW(16),
    name VARCHAR2(256)
);
/

/** Object having an array of guid and name, used for SDK functions
 */

CREATE OR REPLACE TYPE mgmt_guid_array AS TABLE OF mgmt_guid_obj;
/


ALTER SESSION SET CURRENT_SCHEMA=SYSMAN_TYPES;

CREATE OR REPLACE TYPE MGMT_INTEGER_ARRAY AS VARRAY(5000) OF INTEGER;
/

grant execute on MGMT_INTEGER_ARRAY to sysman;

BEGIN
    SYSMAN.CUTOVER_SYNONYM('MGMT_INTEGER_ARRAY');
END;
/

CREATE OR REPLACE TYPE MGMT_SHORT_STRING_ARRAY AS VARRAY(5000) OF VARCHAR2(64);
/

grant execute on MGMT_SHORT_STRING_ARRAY to sysman;

BEGIN
    SYSMAN.CUTOVER_SYNONYM('MGMT_SHORT_STRING_ARRAY');
END;
/

CREATE OR REPLACE TYPE MGMT_MEDIUM_STRING_ARRAY AS VARRAY(5000) OF VARCHAR2(256);
/

grant execute on MGMT_MEDIUM_STRING_ARRAY to sysman;

BEGIN
    SYSMAN.CUTOVER_SYNONYM('MGMT_MEDIUM_STRING_ARRAY');
END;
/

CREATE OR REPLACE TYPE MGMT_LONG_STRING_ARRAY AS VARRAY(5000) OF VARCHAR2(1024);
/

grant execute on  MGMT_LONG_STRING_ARRAY to sysman;

BEGIN
    SYSMAN.CUTOVER_SYNONYM('MGMT_LONG_STRING_ARRAY');
END;
/

ALTER SESSION SET CURRENT_SCHEMA=SYSMAN;

CREATE OR REPLACE TYPE MGMT_MAX_STRING_ARRAY AS VARRAY(5000) OF VARCHAR2(4000);
/

ALTER SESSION SET CURRENT_SCHEMA=SYSMAN_TYPES;

CREATE OR REPLACE TYPE MGMT_SHORT_STRING_TABLE AS TABLE OF VARCHAR2(64);
/

grant execute on MGMT_SHORT_STRING_TABLE to sysman;

BEGIN
    SYSMAN.CUTOVER_SYNONYM('MGMT_SHORT_STRING_TABLE');
END;
/

ALTER SESSION SET CURRENT_SCHEMA=SYSMAN;

CREATE OR REPLACE TYPE MGMT_MEDIUM_STRING_TABLE AS TABLE OF VARCHAR2(256)
/

CREATE OR REPLACE TYPE MGMT_MAX_STRING_TABLE AS TABLE OF VARCHAR2(4000);
/

CREATE OR REPLACE TYPE MGMT_INTEGER_TABLE AS TABLE OF INTEGER
/

CREATE OR REPLACE TYPE MGMT_DATE_TABLE AS TABLE OF DATE
/
CREATE OR REPLACE TYPE MGMT_TARGET_OBJ AS OBJECT 
(
  target_name VARCHAR2(256),
  target_type VARCHAR2(64),
  STATIC FUNCTION new(p_target_name VARCHAR2,
                      p_target_type VARCHAR2
                      )
 RETURN mgmt_target_obj
)
/

CREATE OR REPLACE TYPE MGMT_TARGET_ARRAY AS TABLE OF MGMT_TARGET_OBJ
/ 

CREATE OR REPLACE TYPE MGMT_TARGET_PROPERTY AS OBJECT (
    property_name VARCHAR2(64),
    property_type VARCHAR2(64),
    property_value VARCHAR2(4000)
);
/

CREATE OR REPLACE TYPE MGMT_TARGET_PROPERTY_LIST AS TABLE OF MGMT_TARGET_PROPERTY;
/

CREATE OR REPLACE TYPE MGMT_TARGET_GUID_ARRAY AS TABLE OF RAW(16)
/
--
--Callback objects for type meta version change
--
CREATE OR REPLACE TYPE MGMT_TARGET_META_VER_CBK_OBJ AS OBJECT (
 target_guid        RAW(16),
 target_type        VARCHAR2(64),
 from_meta_ver      VARCHAR2(64),
 to_meta_ver        VARCHAR2(64),
 from_catprop_array mgmt_short_string_array,
 to_catprop_array   mgmt_short_string_array,
 STATIC FUNCTION NEW(p_target_guid        RAW,
                     p_target_type        VARCHAR2,
                     p_from_meta_ver      VARCHAR2,
                     p_to_meta_ver        VARCHAR2,
                     p_from_catprop_array mgmt_short_string_array,
                     p_to_catprop_array   mgmt_short_string_array
                     )
 RETURN MGMT_TARGET_META_VER_CBK_OBJ
);
/

CREATE OR REPLACE TYPE MGMT_TARGET_META_VER_CBK_ARRAY AS TABLE OF MGMT_TARGET_META_VER_CBK_OBJ
/

ALTER SESSION SET CURRENT_SCHEMA=SYSMAN_TYPES;

--
-- Callback object for target property change
--
CREATE OR REPLACE TYPE MGMT_TARGET_PROPERTY_CBK_OBJ AS OBJECT (
  target_guid        RAW(16),
  property_name      VARCHAR2(64),
  old_property_value VARCHAR2(1024),
  new_property_value VARCHAR2(1024),
  STATIC FUNCTION NEW(p_target_guid        IN RAW,
                      p_property_name      IN VARCHAR2,
                      p_old_property_value IN VARCHAR2,
                      p_new_property_value IN VARCHAR2
                      )
  RETURN MGMT_TARGET_PROPERTY_CBK_OBJ
) ;
/

grant execute on MGMT_TARGET_PROPERTY_CBK_OBJ to sysman;

BEGIN
    SYSMAN.CUTOVER_SYNONYM('MGMT_TARGET_PROPERTY_CBK_OBJ');
END;
/

ALTER SESSION SET CURRENT_SCHEMA=SYSMAN;

-- Object to describe a metric - used in mgmt_target APIs.
-- NOTE: Do not directly instantiate the object. Always
-- use the "NEW" function to instantiate the object to
-- avoid backwards compatibility problems.
CREATE OR REPLACE TYPE MGMT_METRIC_DESC as OBJECT (
    target_type        VARCHAR2(64),
    metric_name        VARCHAR2(64),
    metric_column      VARCHAR2(64),
    type_meta_ver      VARCHAR2(8),
    STATIC FUNCTION NEW(target_type    VARCHAR2,
                        metric_name    VARCHAR2,
                        metric_column  VARCHAR2,
                        type_meta_ver  VARCHAR2 DEFAULT '1.0')
   RETURN MGMT_METRIC_DESC
);
/

CREATE OR REPLACE TYPE MGMT_METRIC_DESC_ARRAY as TABLE of MGMT_METRIC_DESC;
/


-- Object to describe a metric instance - used in mgmt_target APIs.
-- NOTE: Use "NEW" function to instantiate the objects.
CREATE OR REPLACE TYPE MGMT_METRIC_INSTANCE as OBJECT (
    target_name        VARCHAR2(256),
    target_type        VARCHAR2(64),
    metric_name        VARCHAR2(64),
    metric_column      VARCHAR2(64),
    key_value          VARCHAR2(256),
    STATIC FUNCTION NEW(target_name    VARCHAR2,
	                target_type    VARCHAR2,
                        metric_name    VARCHAR2,
                        metric_column  VARCHAR2,
	                key_value      VARCHAR2)
     RETURN MGMT_METRIC_INSTANCE
);
/

CREATE OR REPLACE TYPE MGMT_METRIC_INSTANCE_ARRAY as TABLE of MGMT_METRIC_INSTANCE;
/

--
-- PURPOSE
--     Object to temporarily hold the state of a dependency metric
--     during severity calculations. 
--
--  MEMBERS
--     target_guid - guid of the dependency target
--     metric_guid - guid of the dependency metric
--     severity_code - severity code of the metric.
--     avail_status -  Availability state of the target 
CREATE OR REPLACE TYPE MGMT_METRIC_DETAILS as OBJECT (
   target_guid      RAW(16),
   metric_guid      RAW(16),
   key_value        VARCHAR2(256),
   severity_code    NUMBER,
   avail_status     NUMBER,
    STATIC FUNCTION NEW(target_guid    RAW,
	                metric_guid    RAW,
	                key_value      VARCHAR2,
                        severity_code  NUMBER,
	                avail_status   NUMBER)
     RETURN MGMT_METRIC_DETAILS 
);
/
CREATE OR REPLACE TYPE MGMT_METRIC_DETAILS_ARRAY 
    as TABLE of MGMT_METRIC_DETAILS;
/

-- Object to describe a metric used in system status computation
-- It is in principle an extension of mgmt_metric_details but
-- that is final and can not be changed
CREATE OR REPLACE TYPE MGMT_METRIC_DETAILS_EXT as OBJECT (
   target_guid      RAW(16),
   metric_guid      RAW(16),
   key_value        VARCHAR2(256),
   severity_code    NUMBER,
   avail_status     NUMBER,
   avail_substatus  NUMBER,
    STATIC FUNCTION NEW(target_guid     RAW,
	                metric_guid     RAW,
	                key_value       VARCHAR2,
                        severity_code   NUMBER,
	                avail_status    NUMBER,
                        avail_substatus NUMBER)
     RETURN MGMT_METRIC_DETAILS_EXT 
);
/
CREATE OR REPLACE TYPE MGMT_METRIC_DETAILS_EXT_ARRAY 
    as TABLE of MGMT_METRIC_DETAILS_EXT;
/

CREATE OR REPLACE TYPE mgmt_metric_name_obj AS OBJECT
( metric_name   VARCHAR2(64),
  metric_column VARCHAR2(64),
  STATIC FUNCTION NEW(p_metric_name   IN VARCHAR2,
                      p_metric_column IN VARCHAR2 DEFAULT ' ')
  RETURN mgmt_metric_name_obj
)
/

CREATE OR REPLACE TYPE mgmt_metric_name_array AS TABLE of
mgmt_metric_name_obj
/

--
-- Callback objects for tzrgn update callback
--
CREATE OR REPLACE TYPE MGMT_TZRGN_UPDATE_CBK_OBJ AS OBJECT 
(
  target_guid   RAW(16),
  target_type   VARCHAR2(64),
  from_tzrgn    VARCHAR2(64),
  to_tzrgn      VARCHAR2(64),
  STATIC FUNCTION NEW(p_target_guid    RAW,
                      p_target_type    VARCHAR2,
                      p_from_tzrgn     VARCHAR2,
                      p_to_tzrgn       VARCHAR2
                     )
 RETURN MGMT_TZRGN_UPDATE_CBK_OBJ
);
/

CREATE OR REPLACE TYPE MGMT_TARGET_PROPERTY_OBJ AS OBJECT
(
  target_name VARCHAR2(256),
  target_type VARCHAR2(64),
  property_name VARCHAR2(64),
  property_type VARCHAR2(64),
  property_value VARCHAR2(4000)
);
/

CREATE OR REPLACE TYPE MGMT_TARGET_PROPERTY_OBJ_ARRAY AS TABLE OF MGMT_TARGET_PROPERTY_OBJ;
/

CREATE OR REPLACE TYPE ECM_TPROP_OBJ AS OBJECT
(
  snap_id RAW(16),
  prop MGMT_TARGET_PROPERTY_OBJ
);
/

CREATE OR REPLACE TYPE ECM_TPROP_OBJ_ARRAY AS TABLE OF ECM_TPROP_OBJ;
/

CREATE OR REPLACE TYPE MGMT_TARGET_COMP_TYPE_OBJ AS OBJECT
(
  parent_target_type VARCHAR2(64),
  parent_type_meta_ver VARCHAR(8),
  component_type VARCHAR2(64),
  component_type_meta_ver VARCHAR(8)
);
/

CREATE OR REPLACE TYPE MGMT_TARGET_COMP_TYPE_OBJ_ARR AS TABLE OF MGMT_TARGET_COMP_TYPE_OBJ;
/

CREATE OR REPLACE TYPE MGMT_TARGET_COMP_TYPE_CONF_OBJ AS OBJECT
( snapshot_type VARCHAR2(64),
  table_name VARCHAR2(30),
  metric_name VARCHAR2(64)
);
/

--
-- ng assoc types
--
CREATE OR REPLACE TYPE MGMT_ASSOC_INST_PROP_OBJ IS OBJECT
(
   property_name VARCHAR2(256),
   property_value VARCHAR2(256)
);
/


CREATE OR REPLACE TYPE MGMT_ASSOC_INST_PROP_LIST IS 
    TABLE OF MGMT_ASSOC_INST_PROP_OBJ;
/

CREATE OR REPLACE TYPE MGMT_ASSOC_ME_OBJ IS OBJECT
(
  target_name VARCHAR2(256),
  target_type VARCHAR2(256),
  target_comp_name VARCHAR2(256),
  target_comp_type VARCHAR2(256)
);
/

CREATE OR REPLACE TYPE MGMT_ASSOC_ME_LIST IS 
   TABLE OF MGMT_ASSOC_ME_OBJ;
/

CREATE OR REPLACE TYPE MGMT_ASSOC_ME_GUID_OBJ IS OBJECT
(
  target_guid RAW(16),
  target_comp_guid RAW(16)
);
/

CREATE OR REPLACE TYPE MGMT_ASSOC_ME_GUID_LIST IS 
   TABLE OF MGMT_ASSOC_ME_GUID_OBJ;
/

CREATE OR REPLACE TYPE MGMT_ASSOC_INST_OBJ IS OBJECT
(
  assoc_type VARCHAR2(256),
  source_target_name VARCHAR2(256),
  source_target_type VARCHAR2(256),
  source_tc_name VARCHAR2(256),
  source_tc_type VARCHAR2(256),
  dest_target_name VARCHAR2(256),
  dest_target_type VARCHAR2(256),
  dest_tc_name VARCHAR2(256),
  dest_tc_type VARCHAR2(256),
  properties MGMT_ASSOC_INST_PROP_LIST
);
/

CREATE OR REPLACE TYPE MGMT_ASSOC_INST_LIST IS 
   TABLE OF MGMT_ASSOC_INST_OBJ;
/

REM Both source_me and dest_me can be a target or target component
CREATE OR REPLACE TYPE MGMT_ASSOC_INST_GUID_OBJ IS OBJECT
(
  assoc_type VARCHAR2(256),
  source_me_guid RAW(16),
  dest_me_guid RAW(16),
  properties MGMT_ASSOC_INST_PROP_LIST
);
/

CREATE OR REPLACE TYPE MGMT_ASSOC_INST_GUID_LIST IS
  TABLE OF MGMT_ASSOC_INST_GUID_OBJ;
/


REM this is for returning association instance, the source_me/dest_me can be 
REM target or target component. If it is target component, the corresponding
REM source/dest_target means the parent target of the component 
CREATE OR REPLACE TYPE MGMT_ASSOC_INST_RET_OBJ IS OBJECT
(
  assoc_type VARCHAR2(256),
  source_me_name VARCHAR2(256),
  source_me_type VARCHAR2(256),
  source_me_guid RAW(16),
  source_target_name VARCHAR2(256),
  source_target_type VARCHAR2(256),
  source_target_guid RAW(16),
  dest_me_name VARCHAR2(256),
  dest_me_type VARCHAR2(256),
  dest_me_guid RAW(16),
  dest_target_name VARCHAR2(256),
  dest_target_type VARCHAR2(256),
  dest_target_guid RAW(16),
  properties MGMT_ASSOC_INST_PROP_LIST
);
/

CREATE OR REPLACE TYPE MGMT_ASSOC_INST_RET_LIST IS 
    TABLE OF MGMT_ASSOC_INST_RET_OBJ;
/

/**
  * Used to hold a name value array pair
  * @params name  : Name 
  * @param  value : Value 
  */

ALTER SESSION SET CURRENT_SCHEMA=SYSMAN_TYPES;

CREATE OR REPLACE TYPE smp_emd_nvpair AS OBJECT (
    name VARCHAR2(256),
    value  VARCHAR2(2000)
);
/

grant execute on smp_emd_nvpair to sysman;

BEGIN
    SYSMAN.CUTOVER_SYNONYM('smp_emd_nvpair');
END;
/

/**
  * Used to hold a name value array
  */

CREATE OR REPLACE TYPE smp_emd_nvpair_array AS TABLE OF smp_emd_nvpair;
/

grant execute on smp_emd_nvpair_array to sysman;

BEGIN
    SYSMAN.CUTOVER_SYNONYM('smp_emd_nvpair_array');
END;
/

ALTER SESSION SET CURRENT_SCHEMA=SYSMAN;

/**
  * Used to hold a name value pair for a metric
  * @params name  : Name of the key
  * @param  value : Value of the key
  */

CREATE OR REPLACE TYPE mgmt_namevalue_obj IS OBJECT
(
   name  VARCHAR2(64),
   value VARCHAR2(4000),
   STATIC FUNCTION NEW(p_name  IN VARCHAR2,
                       p_value IN VARCHAR2
                      )
  RETURN mgmt_namevalue_obj
)
/

/** Used to hold an array of name value pairs
  */

CREATE OR REPLACE TYPE mgmt_namevalue_array as TABLE of mgmt_namevalue_obj
/


ALTER SESSION SET CURRENT_SCHEMA=SYSMAN_TYPES;

/* Used to store guids
 * @deprecated does not follow naming convention, added for mos 
 *             for use in 12c release only
 */
CREATE OR REPLACE TYPE GUID_ARRAY AS TABLE OF RAW(16);
/

grant execute on GUID_ARRAY to sysman;

BEGIN
    SYSMAN.CUTOVER_SYNONYM('GUID_ARRAY');
END;
/

ALTER SESSION SET CURRENT_SCHEMA=SYSMAN;

@@&EM_SQL_ROOT/core/10.3.0.0/sdk/sdk_types.sql
@@&EM_SQL_ROOT/core/12.1.0.2/sdk/sdk_types_upgrade.sql
@@&EM_SQL_ROOT/core/12.1.0.3/sdk/sdk_types_upgrade.sql
@@&EM_SQL_ROOT/core/12.1.0.4/sdk/sdk_types_upgrade.sql
@@&EM_SQL_ROOT/core/12.1.0.5/sdk/sdk_types_upgrade.sql
@@&EM_SQL_ROOT/core/12.2.0.0/sdk/sdk_types_upgrade.sql
@@&EM_SQL_ROOT/core/13.1.0.0/sdk/sdk_types_upgrade.sql
@@&EM_SQL_ROOT/core/13.4.0.0/sdk/sdk_types_upgrade.sql


