无法并行化Materiazed视图的创建

时间:2019-06-14 10:42:55

标签: oracle view parallel-processing dblink materialized

我正在尝试创建一个实例化视图,该视图引用具有超过800万条记录的远程表。 我在DDL MVIEW语句中添加了clausole“ PARALLEL 8”,并在MVIEW QUERY中添加了提示“ / * + PARALLEL(8)* /。

创建时,没有为该进程激活任何并行从属进程。

怎么了?

感谢您的咨询。

这些是目标服务器的DOP参数:

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------------
fast_start_parallel_rollback         string      LOW
parallel_adaptive_multi_user         boolean     TRUE
parallel_automatic_tuning            boolean     FALSE
parallel_degree_level                integer     100
parallel_degree_limit                string      CPU
parallel_degree_policy               string      MANUAL
parallel_execution_message_size      integer     16384
parallel_force_local                 boolean     FALSE
parallel_instance_group              string
parallel_io_cap_enabled              boolean     FALSE
parallel_max_servers                 integer     80
parallel_min_percent                 integer     0
parallel_min_servers                 integer     8
parallel_min_time_threshold          string      AUTO
parallel_server                      boolean     FALSE
parallel_server_instances            integer     1
parallel_servers_target              integer     32
parallel_threads_per_cpu             integer     2
recovery_parallelism                 integer     0

我尝试将参数“ parallel_degree_policy”从MANUAL设置为AUTO,并使用以下命令更改会话(在启动MVIEW创建语句之前):

ALTER SESSION FORCE PARALLEL DML PARALLEL 8;
ALTER SESSION FORCE PARALLEL QUERY PARALLEL 8;

...但是结果相同。

这是MVIEW DDL:

CREATE MATERIALIZED VIEW NEMESI_REPLICA.SCGC_CONSENSI (ID_CODICE_CONSENSO,ID_CLIENTE,OPERATORE,TIMESTAMP_SCGC,TIMESTAMP_CONSENSO,ARCHIVIAZIONE,VALORE_CONSENSO,ID_SISTEMA,ID_SOCIETA,ID_CANALE_ACQUISIZIONE,INTEGRITA,NOTA,ID_IDENTIFICAZIONE_CLIENTE,CANALE_SCGC,STATO_CLIENTE,ID_FRONTEND)
TABLESPACE TBS_NEMESI_REPLICA
PCTUSED    0
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
               INITIAL          1M
               NEXT             30M
       MINEXTENTS       1
       MAXEXTENTS       UNLIMITED
       PCTINCREASE      0
       BUFFER_POOL      DEFAULT
       )
NOCACHE
NOLOGGING
NOCOMPRESS
PARALLEL 8
BUILD IMMEDIATE
USING INDEX
      TABLESPACE TBS_NEMESI_REPLICA
      PCTFREE    10
      INITRANS   2
      MAXTRANS   255
      STORAGE    (
          INITIAL          1M
          NEXT             50M
              MINEXTENTS       1
          MAXEXTENTS       UNLIMITED
          PCTINCREASE      0
          BUFFER_POOL      DEFAULT
          FLASH_CACHE      DEFAULT
          CELL_FLASH_CACHE DEFAULT
      )
REFRESH FAST ON DEMAND
WITH PRIMARY KEY
AS 
SELECT
       /*+ PARALLEL(8) */
       "SCGC_CONSENSI"."ID_CODICE_CONSENSO" "ID_CODICE_CONSENSO",
       "SCGC_CONSENSI"."ID_CLIENTE" "ID_CLIENTE",
       "SCGC_CONSENSI"."OPERATORE" "OPERATORE",
       "SCGC_CONSENSI"."TIMESTAMP_SCGC" "TIMESTAMP_SCGC",
       "SCGC_CONSENSI"."TIMESTAMP_CONSENSO" "TIMESTAMP_CONSENSO",
       "SCGC_CONSENSI"."ARCHIVIAZIONE" "ARCHIVIAZIONE",
       "SCGC_CONSENSI"."VALORE_CONSENSO" "VALORE_CONSENSO",
       "SCGC_CONSENSI"."ID_SISTEMA" "ID_SISTEMA",
       "SCGC_CONSENSI"."ID_SOCIETA" "ID_SOCIETA",
       "SCGC_CONSENSI"."ID_CANALE_ACQUISIZIONE" "ID_CANALE_ACQUISIZIONE",
       "SCGC_CONSENSI"."INTEGRITA" "INTEGRITA",
       "SCGC_CONSENSI"."NOTA" "NOTA",
       "SCGC_CONSENSI"."ID_IDENTIFICAZIONE_CLIENTE"
          "ID_IDENTIFICAZIONE_CLIENTE",
       "SCGC_CONSENSI"."CANALE_SCGC" "CANALE_SCGC",
       "SCGC_CONSENSI"."STATO_CLIENTE" "STATO_CLIENTE",
       "SCGC_CONSENSI"."ID_FRONTEND" "ID_FRONTEND"
FROM
       "SCGC_ONLINE"."SCGC_CONSENSI"@"NEMESI_LINK" "SCGC_CONSENSI";

1 个答案:

答案 0 :(得分:1)

您在mview DDL和mview查询上使用了并行处理,也许您遇到了一些错误

并行DML不用于Mview刷新(文档ID 2529168.1)

检查MOS注释,并执行一些解决方案。

其他方法是将主表更改为> 1,然后并行进行刷新。

“当实例化视图的主表的PARALLEL属性​​设置为> 1时, 创建和刷新过程将并行化。是否指定 REFRESH子句中的PARALLELISM参数无关紧要。”

如何并行刷新实体化视图(文档ID 577870.1)

我首先尝试第二种方法,然后更改主表的程度进行测试。如果无法解决问题,请查看MOS说明