Rem
Rem $Header: emcore/source/oracle/sysman/emdrep/sql/core/11.2.0.1/gccompliance/gccompliance_types.sql rbali_oneoff_updated/1 2025/03/14 06:41:12 rbali Exp $
Rem
Rem gccompliance_types.sql
Rem
Rem Copyright (c) 2010, 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/11.2.0.1/gccompliance/gccompliance_types.sql
Rem EMRU_UNIX_DELIVERABLES:
Rem emcore/source/oracle/sysman/emdrep/sql/core/11.2.0.1/gccompliance/gccompliance_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      gccompliance_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      01/07/25 - make synonyms noneditionable
Rem    rnadidar    02/11/15 - cut over to EBR
Rem    bozhou      12/21/10 - Extend the EM_POST_UPDATE_LIST type
Rem    suvmalho    04/02/10 - Created
Rem

ALTER SESSION SET CURRENT_SCHEMA=SYSMAN_TYPES;

CREATE OR REPLACE TYPE EM_CS_NODE_INFO AS OBJECT
(
        ROOT_CS_GUID RAW(16),
        RQS_GUID RAW (16),
        NODE_GUID RAW (16),
        NODE_TYPE NUMBER (1,0) -- 1 - ICS/CS, 2- RF, 3- RULE
);
/


grant execute on EM_CS_NODE_INFO to sysman;

create or replace noneditionable synonym SYSMAN.EM_CS_NODE_INFO for EM_CS_NODE_INFO;



CREATE OR REPLACE TYPE EM_CS_NODE_ARRAY IS TABLE OF EM_CS_NODE_INFO;
/

grant execute on EM_CS_NODE_ARRAY to sysman;

create or replace noneditionable synonym SYSMAN.EM_CS_NODE_ARRAY for EM_CS_NODE_ARRAY;


CREATE OR REPLACE TYPE EM_CSG_NODE_INFO AS OBJECT
(
        NODE_GUID RAW (16),
        NODE_TYPE NUMBER (1,0) --  1 - CSG, 2- SUBGROUP, 3-CS
);
/

grant execute on EM_CSG_NODE_INFO to sysman;

create or replace noneditionable synonym SYSMAN.EM_CSG_NODE_INFO for EM_CSG_NODE_INFO;



CREATE OR REPLACE TYPE EM_CSG_NODE_ARRAY IS TABLE OF EM_CSG_NODE_INFO;
/

grant execute on EM_CSG_NODE_ARRAY to sysman;

create or replace noneditionable synonym SYSMAN.EM_CSG_NODE_ARRAY for EM_CSG_NODE_ARRAY;


ALTER SESSION SET CURRENT_SCHEMA=SYSMAN;


CREATE OR REPLACE  TYPE EM_POST_UPDATE_LIST IS TABLE OF NUMBER(2);
/


CREATE OR REPLACE TYPE EM_CS_ASSOC_EDIT_VERSION AS OBJECT
(
        RQS_GUID RAW (16),
        NODE_GUID RAW (16),
        NODE_TYPE NUMBER (1,0), -- 1 - ICS/CS, 2- RF, 3- RULE
        EDIT_VERSION NUMBER,
        CRITICAL_EDIT_VERSION NUMBER,
        TARGET_GUID RAW(16)
);
/

CREATE OR REPLACE TYPE EM_CS_ASSOC_EDIT_VERSION_ARR IS TABLE OF EM_CS_ASSOC_EDIT_VERSION;
/


CREATE OR REPLACE TYPE EM_RULE_VERSION AS OBJECT
(
        RULE_GUID RAW (16),
        EDIT_VERSION NUMBER,
        CRITICAL_EDIT_VERSION NUMBER
);
/

CREATE OR REPLACE TYPE EM_RULE_VERSION_ARRAY IS TABLE OF EM_RULE_VERSION;
/


CREATE OR REPLACE TYPE EM_CS_HIERARCHY_OP AS OBJECT
(
        NODE_GUID RAW (16),
        NODE_TYPE NUMBER (1,0) -- 1 - ICS/CS, 2- RF, 3- RULE
)NOT FINAL;
/

CREATE OR REPLACE TYPE EM_CS_HIER_ADD_NODE UNDER EM_CS_HIERARCHY_OP
(
        POSITION      NUMBER,
        PARENT_GUID   RAW(16),
        PARENT_TYPE   NUMBER
);
/

CREATE OR REPLACE TYPE EM_CS_HIER_MOVE_NODE UNDER EM_CS_HIERARCHY_OP
(
        OLD_POSITION      NUMBER,
        OLD_PARENT_GUID   RAW(16),
        NEW_POSITION      NUMBER,
        NEW_PARENT_GUID   RAW(16)
);
/

CREATE OR REPLACE TYPE EM_CS_HIER_REM_NODE UNDER EM_CS_HIERARCHY_OP
(
        POSITION      NUMBER,
        PARENT_GUID   RAW(16)
);
/

CREATE OR REPLACE TYPE EM_CS_HIERARCHY_OP_ARR IS TABLE OF EM_CS_HIERARCHY_OP;
/


CREATE OR REPLACE TYPE EM_COMPLIANCE_ASSOC_OP AS OBJECT
(
        ROOT_CS_GUID      RAW(16),
        ROOT_TARGET_GUID  RAW(16)
)NOT FINAL;
/

CREATE OR REPLACE TYPE EM_COMPLIANCE_ADD_ASSOC UNDER EM_COMPLIANCE_ASSOC_OP
(
);
/

CREATE OR REPLACE TYPE EM_COMPLIANCE_REM_ASSOC UNDER EM_COMPLIANCE_ASSOC_OP
(
);
/

CREATE OR REPLACE TYPE EM_COMPLIANCE_EDIT_ASSOC UNDER EM_COMPLIANCE_ASSOC_OP
(
        RULE_GUID     RAW(16),
        RQS_GUID      RAW(16),
        RULE_TYPE     NUMBER(1),
        TARGET_GUID   RAW(16),
        STATUS        NUMBER(1)
);
/

CREATE OR REPLACE TYPE EM_COMPLIANCE_ASSOC_OP_ARR IS TABLE OF EM_COMPLIANCE_ASSOC_OP;
/


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


CREATE OR REPLACE TYPE EM_CS_NUMBER_ARRAY AS TABLE OF NUMBER;
/


CREATE OR REPLACE TYPE EM_CSG_EVAL_SUMM_ROW AS OBJECT
(
        CSG_GUID RAW(16),
        CSG_INAME VARCHAR2(128),
        CSG_DNAME VARCHAR2(128),
        AUTHOR  VARCHAR2(256),
        VERSION NUMBER,
        LIFECYCLE_STATUS NUMBER,
        CRIT_VIOLATIONS NUMBER,
        WARN_VIOLATIONS NUMBER,
        MWARN_VIOLATIONS NUMBER,
        CRIT_EVALS  NUMBER,
        WARN_EVALS  NUMBER,
        COMPLIANT_EVALS  NUMBER,
        COMPLIANCE_SCORE NUMBER(3)
);
/


CREATE OR REPLACE TYPE EM_CSG_EVAL_SUMM AS TABLE OF EM_CSG_EVAL_SUMM_ROW;
/


CREATE OR REPLACE TYPE EM_CSG_SG_EVAL AS OBJECT
(
        COMPLIANCE_SCORE NUMBER,
        CRIT_VIOLATIONS NUMBER,
        WARN_VIOLATIONS NUMBER,
        MWARN_VIOLATIONS NUMBER,
        CRIT_EVALS  NUMBER,
        WARN_EVALS  NUMBER,
        COMPLIANT_EVALS  NUMBER,
        NUMERATOR NUMBER(8),
        DENOMINATOR NUMBER(4)
);
/


CREATE OR REPLACE TYPE EM_CSG_EVAL_BY_TARGET_ROW AS OBJECT
(
        ROOT_TARGET_GUID RAW(16),
        TARGET_GUID RAW(16),
        ROOT_TARGET_NAME VARCHAR2(256),
        ROOT_TARGET_TYPE VARCHAR2(128),
        TARGET_NAME VARCHAR2(256),
        TARGET_TYPE VARCHAR2(128),
        CRIT_VIOLATIONS NUMBER,
        WARN_VIOLATIONS NUMBER,
        MWARN_VIOLATIONS NUMBER,
        COMPLIANCE_SCORE NUMBER(3),
        NUMERATOR NUMBER(8),
        DENOMINATOR NUMBER(4)
);
/

CREATE OR REPLACE TYPE EM_CSG_EVAL_BY_TARGET AS TABLE OF EM_CSG_EVAL_BY_TARGET_ROW;
/


CREATE OR REPLACE TYPE cs_eval_summ_row AS OBJECT 
(
        cs_guid                  RAW(16),
        cs_dname                 VARCHAR2(128),
        cs_iname                 VARCHAR2(128),
        version                  NUMBER,
        author 			 VARCHAR2(256),
        lifecycle_status         NUMBER,
        type_display_name        VARCHAR2(128),
        crit_violations          NUMBER,
        warn_violations          NUMBER,
        mwarn_violations         NUMBER,
        compliant_targets        NUMBER,
        critical_targets         NUMBER,
        warning_targets          NUMBER,
        compliance_score         NUMBER,
        target_name              VARCHAR2(256),
        target_type              VARCHAR2(64)
);
/

CREATE OR REPLACE TYPE cs_eval_summ AS TABLE OF cs_eval_summ_row;
/


CREATE OR REPLACE TYPE EM_CSG_EVAL_SUMM_TREND_ROW AS OBJECT
(
        CSG_GUID RAW(16),
        CSG_INAME VARCHAR2(128),
        CSG_DNAME VARCHAR2(128),
        AUTHOR  VARCHAR2(256),
        VERSION NUMBER,
        LIFECYCLE_STATUS NUMBER,
        AVG_VIOLATIONS NUMBER,
        TOTAL_EVALS NUMBER,
        COMPLIANCE_SCORE NUMBER(3),
        NUM_EVALS_0_20 NUMBER,
        NUM_EVALS_20_40 NUMBER,
        NUM_EVALS_40_60 NUMBER,
        NUM_EVALS_60_80 NUMBER,
        NUM_EVALS_80_100 NUMBER,
        SNAPSHOT_TS DATE
);
/


CREATE OR REPLACE TYPE EM_CSG_EVAL_SUMM_TREND AS TABLE OF EM_CSG_EVAL_SUMM_TREND_ROW;
/


CREATE OR REPLACE TYPE EM_ASSOCIABLE_CS_ROW AS OBJECT
(
        CS_GUID RAW(16),
        CS_INAME VARCHAR2(128),
        CS_DNAME VARCHAR2(128),
        AUTHOR  VARCHAR2(256),
        VERSION NUMBER,
        LIFECYCLE_STATUS NUMBER,
        SYSTEM_TYPE NUMBER,
        TARGET_GUID RAW(16)
);
/


CREATE OR REPLACE TYPE EM_ASSOCIABLE_CS AS TABLE OF EM_ASSOCIABLE_CS_ROW;
/

CREATE OR REPLACE TYPE EM_RULETEST_PARAMS AS OBJECT
(
    PARAM_NAME         VARCHAR2(64),
    PARAM_TYPE         NUMBER(1),
    PARAM_VALUE        VARCHAR2(64)
);
/

CREATE OR REPLACE TYPE EM_RULETEST_PARAMS_ARR IS TABLE OF EM_RULETEST_PARAMS; 
/

ALTER SESSION SET CURRENT_SCHEMA=SYSMAN_TYPES;


CREATE OR REPLACE TYPE EM_CS_NODE IS OBJECT (
    NODE_GUID       RAW (16),
    NODE_TYPE       NUMBER (1,0), -- 1 - ICS/CS, 2- RF, 3- RULE
    OP_TYPE         NUMBER (2,0),
    ROOT_CS_GUID    RAW(16),
    RQS_GUID        RAW(16),
    RULE_TYPE       NUMBER(1,0),
    
    STATIC FUNCTION NEW(
        P_NODE_GUID       IN RAW,
        P_NODE_TYPE       IN NUMBER,
        P_OP_TYPE         IN NUMBER DEFAULT 0,
        P_ROOT_CS_GUID    IN RAW,
        P_RQS_GUID        IN RAW,
        P_RULE_TYPE       IN NUMBER DEFAULT 0
    )RETURN EM_CS_NODE
);
/

grant execute on EM_CS_NODE to sysman;

create or replace noneditionable synonym SYSMAN.EM_CS_NODE for EM_CS_NODE;


CREATE OR REPLACE TYPE EM_CS_NODE_TABLE IS VARRAY(5000) OF EM_CS_NODE;
/

grant execute on EM_CS_NODE_TABLE to sysman;

create or replace noneditionable synonym SYSMAN.EM_CS_NODE_TABLE for EM_CS_NODE_TABLE;



CREATE OR REPLACE TYPE EM_CS_ASSOC_NODE IS OBJECT (
    ROOT_CS_GUID       RAW (16),
    ROOT_TARGET_GUID   RAW(16),
    OP_TYPE            NUMBER (2,0),
    TARGET_GUID        RAW(16),
    RULE_GUID          RAW(16),
    RQS_GUID           RAW(16),
    RULE_TYPE          NUMBER(1,0),
    
    STATIC FUNCTION NEW(
        P_ROOT_CS_GUID       IN RAW,
        P_ROOT_TARGET_GUID   IN RAW,
        P_OP_TYPE            IN NUMBER,
        P_TARGET_GUID        IN RAW DEFAULT NULL,
        P_RULE_GUID          IN RAW DEFAULT NULL,
        P_RQS_GUID           IN RAW DEFAULT NULL,
        P_RULE_TYPE          IN NUMBER DEFAULT 0
    )  RETURN EM_CS_ASSOC_NODE
);
/

grant execute on EM_CS_ASSOC_NODE to sysman;

create or replace noneditionable synonym SYSMAN.EM_CS_ASSOC_NODE for EM_CS_ASSOC_NODE;



CREATE OR REPLACE TYPE EM_CS_ASSOC_NODE_TABLE IS TABLE OF EM_CS_ASSOC_NODE;
/

grant execute on EM_CS_ASSOC_NODE_TABLE to sysman;

create or replace noneditionable synonym SYSMAN.EM_CS_ASSOC_NODE_TABLE for EM_CS_ASSOC_NODE_TABLE;


ALTER SESSION SET CURRENT_SCHEMA=SYSMAN;

CREATE OR REPLACE TYPE cs_eval_popup_summ_row AS OBJECT
(
    root_cs_guid             RAW(16),
    target_name              VARCHAR2(256),
    compliance_score         NUMBER,
    last_evaluation_date     DATE,
    compliance_score_level   NUMBER,
    crit_violations          NUMBER,
    root_target_guid         RAW(16),        
    warn_violations          NUMBER,
    mwarn_violations         NUMBER
        
);
/


CREATE OR REPLACE TYPE cs_eval_popup_summ AS TABLE OF cs_eval_popup_summ_row;
/

CREATE OR REPLACE TYPE grp_region_member_summ_row AS OBJECT
(
    crit_violations          NUMBER,            
    warn_violations          NUMBER,
    mwarn_violations         NUMBER,
    compliance_score         NUMBER,
    member_target_guid       RAW(16),
    member_target_name       VARCHAR2(256),
    member_type_display_name VARCHAR2(256),
    member_target_type   VARCHAR2(256)
        
);
/

CREATE OR REPLACE TYPE grp_region_member_summ AS TABLE OF grp_region_member_summ_row;
/

CREATE OR REPLACE TYPE grp_rgn_tgt_ovw_summ_row AS OBJECT
(
    cs_guid                  RAW(16),
    cs_dname                 VARCHAR2(256),
    cs_iname                 VARCHAR2(256),
    author                   VARCHAR2(256),
    version                  NUMBER,
    crit_violations          NUMBER,            
    warn_violations          NUMBER,
    mwarn_violations         NUMBER,
    compliance_score         NUMBER,
    target_guid              RAW(16),
    target_type              VARCHAR2(256),
    target_name          VARCHAR2(256)
        
);
/

CREATE OR REPLACE TYPE grp_rgn_tgt_ovw_summ AS TABLE OF grp_rgn_tgt_ovw_summ_row;
/

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

CREATE OR REPLACE TYPE EM_CS_ASSOC_PU AS OBJECT
(
    CS_GUID            RAW (16),
    RULE_GUID          RAW (16) 
);
/

CREATE OR REPLACE TYPE EM_CS_ASSOC_PU_ARR IS TABLE OF EM_CS_ASSOC_PU;
/

CREATE OR REPLACE TYPE EM_CS_TGT_ASSOC_ARR_OBJ AS OBJECT
(
    ROOT_CS_GUID RAW(16),
    CS_GUID RAW(16),
    RQS_GUID RAW(16),
    ROOT_TARGET_GUID RAW(16),
    TARGET_GUID RAW(16)
);
/

CREATE OR REPLACE TYPE EM_CS_TGT_ASSOC_ARR AS TABLE OF EM_CS_TGT_ASSOC_ARR_OBJ;
/

CREATE OR REPLACE TYPE EM_CS_ASSOC_EDIT AS OBJECT
(
    ROOT_CS_GUID             RAW(16),
    ROOT_TARGET_GUID         RAW(16),
    EDIT_VERSION             NUMBER,
    CRITICAL_EDIT_VERSION    NUMBER
);
/

CREATE OR REPLACE TYPE EM_CS_ASSOC_EDIT_ARR AS TABLE OF EM_CS_ASSOC_EDIT;
/

CREATE OR REPLACE TYPE included_standard_row AS OBJECT
(
    CS_GUID                   RAW(16) ,
    CS_INAME                  VARCHAR2(128) ,
    CS_DNAME                  VARCHAR2(128) ,
    TARGET_TYPE               VARCHAR2(128) ,
    AUTHOR                    VARCHAR2(256),
    OWNER                     VARCHAR2(256),
    VERSION                   NUMBER(3,0) ,
    LIFECYCLE_STATUS          NUMBER(1,0) ,
    DESCRIPTION               VARCHAR2(256) ,
    CS_TYPE                   NUMBER(1,0),
    DESCRIPTION_NLSID         VARCHAR2(64)  ,
    CS_DNAME_NLSID            VARCHAR2(64) 
);
/

CREATE OR REPLACE TYPE included_standard_summ AS TABLE OF included_standard_row;
/

show errors;



