Rem
Rem $Header: emcore/source/oracle/sysman/emdrep/sql/core/12.1.0.2/gccompliance/gccompliance_types.sql rbali_oneoff_updated/1 2025/03/14 06:41:13 rbali Exp $
Rem
Rem gccompliance_types.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/12.1.0.2/gccompliance/gccompliance_types.sql
Rem EMRU_UNIX_DELIVERABLES:
Rem emcore/source/oracle/sysman/emdrep/sql/core/12.1.0.2/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    pluthra     12/02/11 - Created
Rem


ALTER TYPE cs_eval_popup_summ_row
  ADD ATTRIBUTE target_type VARCHAR2(256)
  CASCADE;

ALTER TYPE cs_eval_summ_row
  ADD ATTRIBUTE cs_dname_nls NVARCHAR2(1000)
  CASCADE;

ALTER TYPE EM_CSG_EVAL_SUMM_ROW
  ADD ATTRIBUTE csg_dname_nls NVARCHAR2(1000)
  CASCADE;

ALTER TYPE cs_eval_summ_row
  ADD ATTRIBUTE cs_dname_nlsid VARCHAR2(256)
  CASCADE;

ALTER TYPE em_csg_eval_summ_row
  ADD ATTRIBUTE csg_dname_nlsid VARCHAR2(256)
  CASCADE;

ALTER TYPE grp_rgn_tgt_ovw_summ_row
  ADD ATTRIBUTE cs_dname_nlsid VARCHAR2(256)
  CASCADE;

CREATE OR REPLACE TYPE EM_ICS_TARGET_ROW AS OBJECT
(
    ROOT_CS_GUID                   RAW(16) ,
    CS_GUID                   RAW(16) ,
    RQS_GUID                   RAW(16) ,
    ROOT_TARGET_GUID                   RAW(16) ,
    TARGET_GUID                   RAW(16) ,
    CS_NAME                  VARCHAR2(128) ,
    TARGET_NAME			VARCHAR2(128) ,
    TARGET_TYPE			VARCHAR2(128) ,
    TOTAL_VIOLATIONS          NUMBER(4,0),
    SEVERITY         NUMBER(2,0)  ,
    cs_name_nlsid    VARCHAR2(256)
);
/


CREATE OR REPLACE TYPE EM_ICS_TARGET AS TABLE OF EM_ICS_TARGET_ROW;
/

 CREATE OR REPLACE TYPE CS_VIOLS_ROW AS OBJECT
(
    RULE_NAME VARCHAR2(256) ,
    TARGET_NAME                 VARCHAR2(256) ,
    SEVERITY         NUMBER(2,0),
    RECOMMENDATION VARCHAR2(800) ,
    TARGET_TYPE                 VARCHAR2(256) ,
    ROOT_CS_GUID                   RAW(16) ,
    EVENT_INSTANCE_ID	RAW(16) ,
    EVENT_SEQ_ID RAW(16) ,
    KEYWORDS  VARCHAR2(800) ,
    LIFECYCLE_STATUS  VARCHAR2(256)  ,
    TARGET_GUID                   RAW(16) ,
    rule_name_nlsid VARCHAR2(256),
    recommendation_nlsid VARCHAR2(256)

);
/

CREATE OR REPLACE TYPE CS_VIOLS AS TABLE OF CS_VIOLS_ROW;
/

 CREATE OR REPLACE TYPE CSG_VIOLS_ROW AS OBJECT
(
    RULE_NAME VARCHAR2(256) ,
    TARGET_NAME                 VARCHAR2(256) ,
    SEVERITY         NUMBER(2,0),
    RECOMMENDATION VARCHAR2(800) ,
    TARGET_TYPE                 VARCHAR2(256) ,
    ROOT_CSG_GUID                   RAW(16) ,
    EVENT_INSTANCE_ID	RAW(16) ,
    EVENT_SEQ_ID RAW(16) ,
    KEYWORDS  VARCHAR2(800) ,
    LIFECYCLE_STATUS  VARCHAR2(256)  ,
    TARGET_GUID                   RAW(16) ,
    rule_name_nlsid VARCHAR2(256),
    recommendation_nlsid VARCHAR2(256)
);
/

CREATE OR REPLACE TYPE CSG_VIOLS AS TABLE OF CSG_VIOLS_ROW;
/
 
show errors;


CREATE OR REPLACE TYPE EM_RULE_ROW AS OBJECT (
       AUTHOR					VARCHAR2(256), 
       CHECK_GUID				RAW(16), 
       CLEAR_MESSAGE			NVARCHAR2(1000), 
       CLEAR_MESSAGE_NLSID 	VARCHAR2(64),
       CRITICAL_EDIT_VERSION	NUMBER(8), 
       RULE_DNAME				NVARCHAR2(1000),
       RULE_DNAME_NLSID			VARCHAR2(64),  
       DESCRIPTION				NVARCHAR2(1000),
       DESCRIPTION_NLSID		VARCHAR2(64), 
       EDIT_VERSION				NUMBER(8), 
       EVAL_ALWAYS				NUMBER(1), 
       FIXTEXT					NVARCHAR2(1000),
       FIXTEXT_NLSID			VARCHAR2(64), 
       IS_DELETED				NUMBER(1), 
       IS_SYSTEM				NUMBER(1), 
       LAST_UPDATED_BY			VARCHAR2(256), 
       LAST_UPDATED_DATE		DATE, 
       LIFECYCLE_STATE			NUMBER(1), 
       MESSAGE					NVARCHAR2(1000),
       MESSAGE_NLSID			VARCHAR2(64), 
       OWNER					VARCHAR2(256), 
       RATIONALE				NVARCHAR2(1000), 
       RATIONALE_NLSID			VARCHAR2(64), 
       REFERENCE_URL			VARCHAR2(4000), 
       RULE_GUID				RAW(16), 
       RULE_INAME				VARCHAR2(256), 
       RULE_TYPE				NUMBER(1), 
       SEVERITY					NUMBER(2), 
       TABLE_NAMES				MGMT_SHORT_STRING_TABLE,
       TARGET_TYPE				VARCHAR2(256), 
       VERSION					NUMBER(3), 
       WARNING					NVARCHAR2(1000),
       WARNING_NLSID			VARCHAR2(64)
);
/

CREATE OR REPLACE TYPE EM_RULE_ROW_TABLE AS TABLE OF EM_RULE_ROW;
/



CREATE OR REPLACE TYPE MGMT_CS_LIB_ROW AS OBJECT (
       AUTHOR								VARCHAR2(256), 
       AUTO_ENABLE							NUMBER(1), 
       CREATED_DATE							DATE, 
       CRITICAL_EDIT_VERSION				NUMBER(8),
       CS_DNAME								NVARCHAR2(1000), 
       CS_DNAME_NLSID						VARCHAR2(64), 
       CS_GUID								RAW(16), 
       CS_INAME								VARCHAR2(128),				
       DESCRIPTION							NVARCHAR2(1000), 
       DESCRIPTION_NLSID					VARCHAR2(64), 
       EDIT_VERSION							NUMBER(8),
       FRONT_MATTER							NVARCHAR2(1000), 
       FRONT_MATTER_NLSID					VARCHAR2(64), 
       IS_DELETED							NUMBER(1), 
       IS_HIDDEN							NUMBER(1), 
       IS_LOCKED							NUMBER(1), 
       IS_ROLLUP_PLAN_VALID					NUMBER(1), 
       IS_SYSTEM							NUMBER(1),
       CS_TYPE								NUMBER(1),
       LAST_UPDATED_BY						VARCHAR2(256), 
       LAST_UPDATED_DATE					DATE, 
       LIFECYCLE_STATUS						NUMBER(1), 
       LOCKED_BY							VARCHAR2(256), 
       LOCKED_TIME							DATE,
       NOTICE								NVARCHAR2(1000), 
       NOTICE_NLSID							VARCHAR2(64), 
       OWNER								VARCHAR2(256),
       REAR_MATTER							NVARCHAR2(1000),
       REAR_MATTER_NLSID					VARCHAR2(64), 
       REFERENCE_URL						VARCHAR2(4000), 
       RQS_HIERARCHY_VALID					NUMBER(1), 
       TARGET_TYPE							VARCHAR2(128), 
       VERSION								NUMBER(3)
);
/

CREATE OR REPLACE TYPE MGMT_CS_LIB_ROW_TABLE AS TABLE OF MGMT_CS_LIB_ROW;
/



CREATE OR REPLACE TYPE EM_CMP_FRMWRK_ROW AS OBJECT (
       AUTHOR							VARCHAR2(256), 
       CREATED_DATE						DATE, 
       CRITICAL_EDIT_VERSION			NUMBER(16),
       CSG_DNAME						NVARCHAR2(1000),
       CSG_DNAME_NLSID					VARCHAR2(64), 
       CSG_GUID							RAW(16), 
       CSG_INAME						VARCHAR2(128),
       DESCRIPTION						NVARCHAR2(1000), 
       DESCRIPTION_NLSID				VARCHAR2(64), 
       EDIT_VERSION						NUMBER(16),
       FRONT_MATTER						NVARCHAR2(1000), 
       FRONT_MATTER_NLSID				VARCHAR2(64), 
       IS_DELETED						NUMBER(1), 
       IS_HIDDEN						NUMBER(1), 
       IS_LOCKED						NUMBER(1), 
       IS_ROLLUP_PLAN_VALID				NUMBER(1), 
       IS_SYSTEM						NUMBER(1), 
       LAST_UPDATED_BY					VARCHAR2(256), 
       LAST_UPDATED_DATE				DATE, 
       LIFECYCLE_STATUS					NUMBER(1), 
       LOCKED_BY						VARCHAR2(256), 
       LOCKED_TIME						DATE,
       NOTICE							NVARCHAR2(1000), 
       NOTICE_NLSID						VARCHAR2(64), 
       OWNER							VARCHAR2(256),
       REAR_MATTER						NVARCHAR2(1000), 
       REAR_MATTER_NLSID				VARCHAR2(64), 
       REFERENCE_URL					VARCHAR2(4000), 
       VERSION							NUMBER(4)
);
/

CREATE OR REPLACE TYPE EM_CMP_FRMWRK_ROW_TABLE AS TABLE OF EM_CMP_FRMWRK_ROW;
/



CREATE OR REPLACE TYPE EM_CMP_GROUP_ROW AS OBJECT (
		CSG_GUID			RAW(16),
		CSG_INAME			VARCHAR2(128),
		CSG_DNAME			NVARCHAR2(1000),
		AUTHOR				VARCHAR2(256),
		VERSION				NUMBER(4),
		LIFECYCLE_STATUS		NUMBER(1),
		csg_dname_nlsid VARCHAR2(256)
);
/

CREATE OR REPLACE TYPE EM_CMP_GROUP_ROW_TABLE AS TABLE OF EM_CMP_GROUP_ROW;
/

ALTER SESSION SET CURRENT_SCHEMA=SYSMAN_TYPES;

CREATE OR REPLACE TYPE EM_CS_ASSOC_INST_GUID_OBJ AS OBJECT (
    ASSOC_TYPE                                         VARCHAR2(256),
    SOURCE_ME_GUID                                     RAW(16),
    DEST_ME_GUID                                       RAW(16)
);
/


grant execute on EM_CS_ASSOC_INST_GUID_OBJ to sysman;

create or replace noneditionable synonym SYSMAN.EM_CS_ASSOC_INST_GUID_OBJ for EM_CS_ASSOC_INST_GUID_OBJ;


CREATE OR REPLACE TYPE EM_CS_ASSOC_INST_GUID_LIST AS TABLE OF EM_CS_ASSOC_INST_GUID_OBJ;
/

grant execute on EM_CS_ASSOC_INST_GUID_LIST to sysman;

create or replace noneditionable synonym SYSMAN.EM_CS_ASSOC_INST_GUID_LIST for EM_CS_ASSOC_INST_GUID_LIST;


ALTER SESSION SET CURRENT_SCHEMA=SYSMAN;


create or replace type EM_CS_RULE_DESC as object (
    iname                                         varchar2(256),
    target_type                                    varchar2(256),
    
    static function new(
        iname_i                    in varchar2,
        target_type_i              in varchar2
    ) return EM_CS_RULE_DESC
);
/


create or replace type EM_CS_RULE_DESC_LIST as table of EM_CS_RULE_DESC;
/


create or replace type EM_CS_STD_DESC as object (
    iname                                       varchar2(128),
    author                                      varchar2(256),
    version                                     number,
    
    static function new(
        iname_i           in varchar2,
        author_i          in varchar2,
        version_i         in number
    ) return EM_CS_STD_DESC
);
/

create or replace type EM_CS_STD_DESC_LIST as table of EM_CS_STD_DESC;
/

create or replace type EM_CS_CF_DESC as object (
    iname                                       varchar2(128),
    author                                      varchar2(256),
    version                                     number(4),
    
    static function new(
        iname_i           in varchar2,
        author_i          in varchar2,
        version_i         in number
    ) return EM_CS_CF_DESC
);
/

create or replace type EM_CS_CF_DESC_LIST as table of EM_CS_CF_DESC;
/

create or replace type EM_CS_FACET_DESC as object (
    iname                                        varchar2(128),
    etype_iname                                  varchar2(128),
    target_type                                  varchar2(64),
    
    static function new(
        iname_i                in varchar2,
        etype_iname_i          in varchar2,
        target_type_i          in varchar2
    ) return EM_CS_FACET_DESC
);
/

create or replace type EM_CS_FACET_DESC_LIST as table of EM_CS_FACET_DESC;
/
alter type EM_CSG_SG_EVAL
modify attribute (NUMERATOR NUMBER, DENOMINATOR NUMBER);

alter type EM_CSG_EVAL_BY_TARGET_ROW
modify attribute (NUMERATOR NUMBER, DENOMINATOR NUMBER) cascade;

ALTER TYPE EM_COMPLIANCE_EDIT_ASSOC 
  MODIFY ATTRIBUTE STATUS NUMBER(2) 
  CASCADE;

ALTER TYPE included_standard_row 
  MODIFY ATTRIBUTE DESCRIPTION VARCHAR2(800)
  CASCADE;

show errors;


