夢幻之旅

          DEBUG - 天道酬勤

             :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            671 隨筆 :: 6 文章 :: 256 評論 :: 0 Trackbacks
          <2011年7月>
          262728293012
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          公告

          本博客中未注原創的文章均為轉載,對轉載內容可能做了些修改和增加圖片注釋,如果侵犯了您的版權,或沒有注明原作者,請諒解

          常用鏈接

          留言簿(21)

          隨筆分類(644)

          隨筆檔案(669)

          文章檔案(6)

          最新隨筆

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          Oracle Parallel QueryOPQ)可以將一個SQL statement分成多個片(chunks),然后在獨自的CPU上通過多個process進行并行運行。典型的應用是:full table scans, creating or rebuilding an index ,one or more partitions of an indexPartition operations such as moving or splitting partitionsCREATE TABLE AS SELECT   operations  if the SELECT involves a full table or partition scan 。INSERT INTO . . . SELECT operations, if the SELECT involves a full table or partition scan ,Update and delete operations on partitioned tables,sorts, sub_queries, data loading.
                而另一個PARALLEL的概念是Parallel Server ClustersRAC),是利用Clustered 環境的multi-node來達到性能上的總體提高。通常用在一個非常大的數據庫應用中。不在本次討論之列。
          一:INIT.ORA相關參數
          PARALLEL_MIN_SERVERS
          PARALLEL_MAX_SERVERS
          PARALLEL_AUTOMATIC_TUNING=TRUE    ORACLE會盡量使用PARALLEL
          二:OBJECT級啟用OPQ
          ALTER  TABLE /INDEX XXX PARALLEL DEGREE 8
          OR
          STATEMENT
          SELECT   --+ PARALLEL table_alias, degree, nodes from table …..
          /*+ FULL(emp) PARALLEL(table_alias, 35) */
          三:表級停止OPQ
          ALTER   TABLE/INDEX  XXX  PARALLEL DEGREE 1  INSTANCES 1
          OR
          ALTER  TABLE/INDEX  XXX   NOPARALLEL
          四:INSTANCE
          Alter table customer parallel degree 35;
          五:局限
          Paralle Query并不一定是最好的,尤其是武斷的把所有TABLE都設置成Paralle Query更是危險的,因為CBO會改變評估標準而盡量使用parallel full-table scans而不是index scans。因為CBO認為parallel full-table scancostfull-table scan低,所以如果非要這么做,那么需要調整optimizer_index_cost_adj。此值默認是1000,如果調整為10則基本都會用INDEX,那么可以調整為小于1000的某個值,然后及時監控性能并再作調整。
          相關數據字典
          select * from v_$pq_sysstat;
          select * from v_$px_process;
          select * from v_$px_sesstat;
          select * from v_$px_process_sysstat;
          七:其他OPQ用法
          SQLLDR   SQLLOAD scott/tiger CONTROL=con1.ctl DIRECT=TRUE PARALLEL=TRUE
          Parallel Recovery 1, RECOVERY_PARALLELISM
                       2,RECOVER TABLESPACE tab PARALLEL (DEGREE 4);
                          RECOVER DATABASE PARALLEL (DEGREE DEFAULT);
          八:名詞解釋
          InstanceSpecifies the number of instances to use(除非在OPS環境,否則只需要設置為1,其他的都是無意義的)
          DEGREE: Specifies the number of slave processes to use on each instance
          posted on 2011-07-09 14:06 HUIKK 閱讀(258) 評論(0)  編輯  收藏 所屬分類: DataBase
          主站蜘蛛池模板: 清水县| 津市市| 阿图什市| 珲春市| 云林县| 汉寿县| 柞水县| 罗田县| 临桂县| 彭水| 奎屯市| 寻乌县| 抚州市| 舒城县| 蛟河市| 广宗县| 宣武区| 体育| 安西县| 阳东县| 许昌县| 乐清市| 神池县| 广丰县| 泰顺县| 陇川县| 屯昌县| 长治市| 慈利县| 巴马| 奉化市| 东兴市| 商南县| 武强县| 荥阳市| 县级市| 桐梓县| 新和县| 湾仔区| 平陆县| 育儿|