--------------------------------------------------------
--  DDL for Materialized View ACS_MONITORING_MVW
--------------------------------------------------------

  CREATE MATERIALIZED VIEW "OTHQ_OWN"."ACS_MONITORING_MVW" ("TABLE_NAME", "COMPID", "TIMESTAMP", "COUNT_RECORDS")
  DEFAULT COLLATION "USING_NLS_COMP"  SEGMENT CREATION IMMEDIATE
  ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 10 MAXTRANS 255 
 COLUMN STORE COMPRESS FOR QUERY HIGH ROW LEVEL LOCKING LOGGING
  STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "DATA" 
  BUILD IMMEDIATE
  USING INDEX 
  REFRESH FORCE ON DEMAND
  USING DEFAULT LOCAL ROLLBACK SEGMENT
  USING ENFORCED CONSTRAINTS DISABLE ON QUERY COMPUTATION DISABLE QUERY REWRITE
  AS SELECT TABLE_NAME,
       COMPID,
       "TIMESTAMP",
       COUNT_RECORDS
FROM (
  SELECT 'SRC_ACS_EC_WORKFLOWS_V2_TB' AS TABLE_NAME,
         METADATA_COMPID               AS COMPID,
         TRUNC(METADATA_TIMESTAMP)     AS "TIMESTAMP",
         COUNT(*)                      AS COUNT_RECORDS
  FROM SRC_ACS_EC_WORKFLOWS_V2_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_ENVIRONMENT_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_ENVIRONMENT_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_FIELD_SEARCHES_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_FIELD_SEARCHES_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_FORM_FIELDS_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_FORM_FIELDS_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_INTEGRATION_CONCURRENCY_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_INTEGRATION_CONCURRENCY_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_INTEGRATION_DETAILS_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_INTEGRATION_DETAILS_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_LOGO_SIZE_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_LOGO_SIZE_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_MRSSWAIT_TIME_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_MRSSWAIT_TIME_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_RECORD_NAMES_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_RECORD_NAMES_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_SCPROCESSOR_PREFERENCES_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_SCPROCESSOR_PREFERENCES_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_SCPROCESSOR_UTILIZATION_APM_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_SCPROCESSOR_UTILIZATION_APM_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_SCPROCESSOR_UTILIZATION_HOURLY_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_SCPROCESSOR_UTILIZATION_HOURLY_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_SCPROCESSOR_WAIT_TIME_HOURLY_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_SCPROCESSOR_WAIT_TIME_HOURLY_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_SCRIPT_FAILURE_DETAILS_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_SCRIPT_FAILURE_DETAILS_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_SCRIPT_FAILURES_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_SCRIPT_FAILURES_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_SUITEAPP_BUNDLE_OBJECTS_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_SUITEAPP_BUNDLE_OBJECTS_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TH_SCRIPT_CONTEXT_USAGE_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TH_SCRIPT_CONTEXT_USAGE_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TH_UI_E2E_DETAILS_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TH_UI_E2E_DETAILS_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TH_UI_SCRIPT_DETAILS_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TH_UI_SCRIPT_DETAILS_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TH_UI_SCRIPT_ERRORS_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TH_UI_SCRIPT_ERRORS_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TH_UI_WF_DETAILS_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TH_UI_WF_DETAILS_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TH_WS_CONCURRENCY_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TH_WS_CONCURRENCY_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TH_WS_REST_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TH_WS_REST_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TH_WS_RESTLET_FAILURES_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TH_WS_RESTLET_FAILURES_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TH_WS_RESTLETS_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TH_WS_RESTLETS_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TH_WS_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TH_WS_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TH_WS_USERID_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TH_WS_USERID_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)

  UNION ALL
  SELECT 'SRC_ACS_TRANSACTION_COUNTS_TB', METADATA_COMPID, TRUNC(METADATA_TIMESTAMP), COUNT(*)
  FROM SRC_ACS_TRANSACTION_COUNTS_TB
  GROUP BY METADATA_COMPID, TRUNC(METADATA_TIMESTAMP)
)
;
