Rem
Rem $Header: emcore/source/oracle/sysman/emdrep/sql/core/13.1.0.0/loaderjob/loaderjob_types.sql rbali_oneoff_updated/1 2025/03/14 06:41:13 rbali Exp $
Rem
Rem loaderjob_types.sql
Rem
Rem Copyright (c) 2014, 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/13.1.0.0/loaderjob/loaderjob_types.sql
Rem EMRU_UNIX_DELIVERABLES:
Rem emcore/source/oracle/sysman/emdrep/sql/core/13.1.0.0/loaderjob/loaderjob_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      loaderjob_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    BEGIN SQL_FILE_METADATA 
Rem    SQL_SOURCE_FILE: emcore/source/oracle/sysman/emdrep/sql/core/latest/loaderjob/loaderjob_types.sql 
Rem    SQL_SHIPPED_FILE: 
Rem    SQL_PHASE: 
Rem    SQL_STARTUP_MODE: NORMAL 
Rem    SQL_IGNORABLE_ERRORS: NONE 
Rem    SQL_CALLING_FILE: 
Rem    END SQL_FILE_METADATA
Rem
Rem    MODIFIED   (MM/DD/YY)
Rem    gbafna      01/07/25 - make synonyms noneditionable
Rem    rnadidar    02/11/15 - cut over to EBR
Rem    kalchand    11/17/14 - Offending Types mode to SYSMAN_TYPES Schema
Rem    pinshah     10/24/14 - support for incremental (row level diffs) config metrics
Rem    soumegho    07/24/14 - Created
Rem


CREATE SEQUENCE loaderjob_payload_sequence
  MINVALUE 1
  MAXVALUE 999999999999999999999999999
  START WITH 1
  INCREMENT BY 1
  CACHE 1000
  CYCLE
  ;

CREATE SEQUENCE loaderjob_log_sequeunce
  MINVALUE 1
  MAXVALUE 999999999999999999999999999
  START WITH 1
  INCREMENT BY 1
  CACHE 1000
  CYCLE
  ;

ALTER SESSION SET CURRENT_SCHEMA = SYSMAN_TYPES;

CREATE OR REPLACE TYPE LOADERJOB_PAYLOAD_TYPE as OBJECT(
        payload_id NUMBER,
        command_type VARCHAR2(128),
        is_empty VARCHAR2(2),
        target_guid VARCHAR2(64),
        target_type VARCHAR2(256),
        target_name VARCHAR2(256),
        collection_name VARCHAR2(512),
        collection_timestamp VARCHAR2(64),
        emd_url_string VARCHAR2(1024),
        conf_vers VARCHAR2(128),
        ver_string VARCHAR2(128),
        load_snapshot_id VARCHAR2(1024),
        mtc_guids_list LOADER_STR_ARRAY,
        metric_tables_list LOADER_STR_ARRAY,
        prev_info_array LOADER_STR_ARRAY,
        is_incremental_array LOADER_STR_ARRAY,
        sup_data_keys LOADER_STR_ARRAY,
        sup_data_values LOADER_STR_ARRAY,
        preload_keys LOADER_STR_ARRAY,
        prelaod_values LOADER_STR_ARRAY
);
/

GRANT EXECUTE ON LOADERJOB_PAYLOAD_TYPE TO SYSMAN WITH GRANT OPTION;
CREATE OR REPLACE NONEDITIONABLE SYNONYM SYSMAN.LOADERJOB_PAYLOAD_TYPE FOR LOADERJOB_PAYLOAD_TYPE;

CREATE OR REPLACE TYPE EM_LOADERJOB_MSG AS OBJECT
(
  payload_id number,
  command_type VARCHAR2(128),
  target_guid VARCHAR2(64),
  target_type VARCHAR2(256),
  current_seq_number NUMBER,
  target_name VARCHAR2(256)
);
/

GRANT EXECUTE ON EM_LOADERJOB_MSG TO SYSMAN WITH GRANT OPTION;
CREATE OR REPLACE NONEDITIONABLE SYNONYM SYSMAN.EM_LOADERJOB_MSG FOR EM_LOADERJOB_MSG;

ALTER SESSION SET CURRENT_SCHEMA = SYSMAN;

BEGIN
  DBMS_AQADM.CREATE_QUEUE_TABLE (queue_table => '&&EM_REPOS_USER'||'.EM_LOADERJOB_Q_TBL',
                               queue_payload_type => 'SYSMAN_TYPES'||'.EM_LOADERJOB_MSG',
                               multiple_consumers => TRUE);

  DBMS_AQADM.CREATE_QUEUE (queue_name => '&&EM_REPOS_USER'||'.EM_LOADERJOB_QUEUE',
                           queue_table => '&&EM_REPOS_USER'||'.EM_LOADERJOB_Q_TBL');

  DBMS_AQADM.START_QUEUE (queue_name => '&&EM_REPOS_USER'||'.EM_LOADERJOB_QUEUE');
END;
/

show errors;



