zoukankan      html  css  js  c++  java
  • alter noparallel

    注释:
       今天出现一个SQL中不包含parallel关键字而执行计划中去出现并行;
     
    1、检查表的degree并行度是否等于1
    SQL> SELECT table_name,degree FROM DBA_TABLES WHERE TABLE_NAME ='T1';
    TABLE_NAME                DEGREE
    ------------------------------ ------------ 
     T1                       1
    SQL> 
     
    2、再检查该表T1的索引的degree是否等于1
    SQL> SELECT table_name,index_name,degree FROM user_indexes where table_name='T1'  and index_name='M1' ;
    TABLE_NAME               INDEX_NAME     DEGREE
    ------------------------------ --------------- --------- 
    T1                       M1         4
    SQL> 
     
    ***出现索引M1 degree=4 是因为在创建/重建索引时指定并行=4,CREATE INDEX M1 ON  BILL_OM_DIVIDE_DTL ITEM_NO online parallel 4;而导致sql中只要用到M1的索引就开4个并行去查询...
     
    3、取消并行 noparallel:   ---解决方案

    SQL> alter index M1 noparallel;

    Index altered.

    SQL> SELECT table_name,index_name,degree FROM user_indexes where table_name='T1'  and index_name='M1';
    TABLE_NAME               INDEX_NAME     DEGREE
    ------------------------------ -------------- ---------- 
    T1                       M1          1
    SQL> 
     
    提醒:
      create/rebuild index并行处理完后 要记得alter index M1 noparallel 避免影响到其他业务;

    Tables and Indexes with DOP mismatch

    Oracle create/rebuild index开并行时要记得noparallel

  • 相关阅读:
    页面实现的平滑效果
    CSS :hover 选择器
    AngularJS 路由
    [Leetcode] Container With Most Water
    [Leetcode] Minimum Path Sum
    [Leetcode] Unique Paths II
    [Leetcode] Unique Paths
    [Leetcode] Maximum Subarray
    [Leetcode] Binary Tree Postorder Traversal
    [Leetcode] Binary Tree Preorder Traversal
  • 原文地址:https://www.cnblogs.com/kakaisgood/p/13175866.html
Copyright © 2011-2022 走看看