真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

parallel并行度的相關(guān)操作、概念、參數(shù)解釋

哪些場景可以使用并行度
table scan、fast full index scans、partition index range scans(僅限local索引)
create table as、create index、rebuild index、move、split、DML(insert\update\delete)

當使用了并行執(zhí)行,SQL的執(zhí)行計劃中就會多出一列:in-out。相關(guān)視圖為:v$pq_sysstat、v$pq_tqstat


alter session force parallel query parallel N  --強制使用N個并行度,force parallel會覆蓋默認的parallel設(shè)置
alter session enable parallel query  --使用默認的并行度數(shù)量

表打開并行的方法
alter table sales parallel;
alter table sales parallel 8;

hint開啟表查詢的并行度
select /*+ parallel(tablename,8) */ * from tablename
select /*+ parallel(sales,8) */ * from sales

DML使用hint開啟并行時,表必須打開并行,因為update時,是要先查出表的數(shù)據(jù)即先執(zhí)行select,所以update開啟了并行度,select也要開啟并行度,否則只有update是并行,但select卻不是。


并行度GRANULES
1.并行工作的一個基本單元被稱為GRANULES
2,一個GRANULES只能有一個并行執(zhí)行的server進行讀的操作
3,并行的一個server可以從一個GRANULES到另外一個GRANULES的執(zhí)行任務(wù),即當一個任務(wù)完成了就去接著執(zhí)行下一個任務(wù)。

并行度GRANULES分兩種
1.block range granules(自動根據(jù)塊的數(shù)目范圍為分)
Block range granules: Server進程在執(zhí)行的時候就動態(tài)的產(chǎn)生。
2.partition granules(用于分區(qū)表,比如有8個分區(qū),它可能會分四個并行度,這樣四個并行度可能在四個不同分區(qū)上)
Partition granules : 有分區(qū)的數(shù)量靜態(tài)的決定。



三個著名參數(shù)的應(yīng)用場景
PARALLEL_DEGREE_POLICY
PARALLEL_MIN_PERCENT
PARALLEL_SERVERS_TARGET

比如80個CPU、現(xiàn)在已經(jīng)使用了60個,剩下20個(PARALLEL_SERVERS_TARGET),現(xiàn)在來了一個60個并行度的查詢,怎么辦?
如果PARALLEL_MIN_PERCENT=10,就是10%可以用,就是最少使用60*10%=6個并行度,6<20,可以使用
如果PARALLEL_MIN_PERCENT=50,就是使用60*50%=30,30>20,如果PARALLEL_DEGREE_POLICY=MANUAL,則不夠,直接報錯,如果PARALLEL_DEGREE_POLICY=AUTO,則進入隊列。


PARALLEL_FORCE_LOCALcontrols parallel execution in an Oracle RAC environment. By default, the parallel server processes selected to execute a SQL statement can operate on any or all Oracle RAC nodes in the cluster. By setting PARALLEL_FORCE_LOCAL to true, the parallel server processes are restricted so that they can only operate on the same Oracle RAC node where the query coordinator resides (the node on which the SQL statement was executed on).
控制Oracle RAC環(huán)境中的并行執(zhí)行。默認情況下,選擇執(zhí)行SQL語句的并行服務(wù)器進程可以在群集中的任何或所有Oracle RAC節(jié)點上運行。通過將PARALLEL_FORCE_LOCAL設(shè)置為true,并行服務(wù)器進程受到限制,因此它們只能在查詢協(xié)調(diào)程序所在的同一個Oracle RAC節(jié)點(執(zhí)行SQL語句的節(jié)點)上運行
默認FORCE,就是可以使用其他節(jié)點的CPU,并不是說在其他節(jié)點執(zhí)行SQL,執(zhí)行SQL還是本節(jié)點(即PX在本節(jié)點),但是可以使用其他節(jié)點的資源做coordinator process即QC(就是管理下面這些并行度的一個進程,一個個的并行程序叫parallel execution servers即PX),此參數(shù)最好設(shè)置為TRUE

PARALLEL_MAX_SERVERSspecifies the maximum number of parallel execution processes and parallel recovery processes for an instance. As demand increases, Oracle Database increases the number of processes from the number created at instance startup up to this value
PARALLEL_MAX_SERVERS指定實例的并行執(zhí)行進程和并行恢復進程的最大數(shù)量。隨著需求的增加,Oracle數(shù)據(jù)庫將實例啟動時創(chuàng)建的進程數(shù)量增加到此值

PARALLEL_MIN_SERVERSspecifies the minimum number of parallel execution processes for the instance. This value is the number of parallel execution processes Oracle creates when the instance is started
PARALLEL_MIN_SERVERS指定實例的最小并行執(zhí)行進程數(shù)。 該值是在實例啟動時由Oracle創(chuàng)建的并行執(zhí)行進程的數(shù)量
PARALLEL_MIN_SERVERS默認是0,如果修改為5,說明就算是空閑不用,也開啟5個進程,相關(guān)視圖v$px_process
比如一開機就有ora_p001_sid、ora_p002_sid、ora_p003_sid、ora_p004_sid、ora_p004_sid這樣5個進程,這就是partition slave process they do parallel dml ddl and query jobs..

PARALLEL_DEGREE_POLICYspecifies whether or not automatic degree of Parallelism,statement queuing, and in-memory parallel execution will be enabled
PARALLEL_DEGREE_POLICY指定是否啟用并行度,語句排隊和內(nèi)存中并行執(zhí)行的自動程度

PARALLEL_MIN_PERCENTlets you specify the minimum percentage of the requested number of parallel execution processes required for parallel execution. This parameter controls the behavior for parallel operations when parallel statement queuing is not enabled (when PARALLEL_DEGREE_POLICY is set to manual or limited). It ensures that an operation always gets a minimum percentage of parallel execution servers or errors out. Setting this parameter ensures that parallel operations will not execute unless adequate resources are available. The default value of 0 means that no minimum percentage of processes has been set.
If 8 of the 10 parallel execution processes are busy, only 2 processes are available. If you then request a query with a degree of parallelism of 8, the minimum 50% will not be met.
PARALLEL_MIN_PERCENT可以指定并行執(zhí)行所需的并行執(zhí)行進程的最小數(shù)量百分比。 并行語句隊列未啟用時(PARALLEL_DEGREE_POLICY設(shè)置為manual or limited),此參數(shù)控制并行操作的行為。它確保操作始終獲得并行執(zhí)行服務(wù)器的最小百分比或出錯。設(shè)置此參數(shù)可確保并行操作不會執(zhí)行,除非提供足夠的資源。默認值0意味著沒有設(shè)置最小進程百分比。

PARALLEL_SERVERS_TARGETspecifies the number of parallel server processes allowed to run parallel statements before statement queuing will be used. When the parameter PARALLEL_DEGREE_POLICY is set to AUTO, Oracle will queue SQL statements that require parallel execution, if the necessary parallel server processes are not available.
PARALLEL_SERVERS_TARGE指定在使用語句排隊之前允許運行并行語句的并行服務(wù)器進程的數(shù)量。當參數(shù)PARALLEL_DEGREE_POLICY設(shè)置為AUTO時,如果必需的并行服務(wù)器進程不可用,Oracle將對需要并行執(zhí)行的SQL語句進行排隊。

PARALLEL_MIN_TIME_THRESHOLDspecifies the minimum execution time a statement should have before the statement is considered for automatic degree of parallelism. By default, this is set to 10 seconds. Automatic degree of parallelism is only enabled if PARALLEL_DEGREE_POLICY is set to AUTO or LIMITED.
PARALLEL_MIN_TIME_THRESHOLD指定語句在考慮自動并行度之前語句應(yīng)該具有的最短執(zhí)行時間。默認情況下,它被設(shè)置為10秒。自動并行度僅在PARALLEL_DEGREE_POLICY設(shè)置為AUTO或LIMITED時才能使用。

PARALLEL_ADAPTIVE_MULTI_USER, when set to true, enables an adaptive algorithm designed to improve performance in multiuser environments that use parallel execution. The algorithm automatically reduces the requested degree of parallelism based on the system load at query startup time. The effective degree of parallelism is based on the default degree of parallelism, or the degree from the table or hints, divided by a reduction facto
PARALLEL_ADAPTIVE_MULTI_USER,當設(shè)置為true時,啟用一個自適應(yīng)算法,旨在提高使用并行執(zhí)行的多用戶環(huán)境的性能。該算法根據(jù)查詢啟動時的系統(tǒng)負載自動降低請求的并行度。并行度的有效程度是基于默認的并行度,或者從表或者提示的程度除以還原因子

當前文章:parallel并行度的相關(guān)操作、概念、參數(shù)解釋
文章分享:http://weahome.cn/article/iiooog.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部