Re: Parallel DML

From: Oracle List <"Oracle>
Date: Thu, 23 Jun 2016 17:05:49 -0500
Message-Id: <293A2148-1752-4027-B569-7C7E322596DA_at_yahoo.com>



Try alter session to enable parallel query as well. That's related to the select portion of the SQL.

> On Jun 23, 2016, at 2:24 PM, Ram Cheruvattath <ram.cheruvattath_at_gmail.com> wrote:
>
> To clarify my statement below:
>
> "However, any increase in parallel thereafter does not result in an increase in slaves."
>
> What I meant is "However, any increase in parallel thereafter does not result in doubling of slaves."
>
> In other words, increasing the parallelism for INSERT and SELECT to 8 does not result in 16 slaves. It results in 8 slaves.
>
> Ram
>
> From: Ram Cheruvattath
> Sent: Thursday, June 23, 2016 2:19 PM
> To: oracle-l-freelists
> Subject: Parallel DML
>
> Hi
>
> We have a situation wherein we need to copy the data from one table to another. Both source and target tables are partitioned. There are no constraints other than NULL constraints on the target table. There are no indexes, triggers etc. The target table is no logging mode.
>
> We are using parallel DML with direct path load. The issue is that we are not able to scale beyond 4 slaves even of the PARALLEL clause used is more than 2. The sample script below uses 2 for both INSERT and SELECT portion of the statement. We see 4 slaves being used. However, any increase in parallel thereafter does not result in an increase in slaves.
>
> Interestingly enough, there is another SQL that I have (posting it below this example) which works as expected.
>
> Please let me know your thoughts.
>
> Ram
>
>
> Sample PARALLEL LOAD AS SELECT script
>
> EXAMPLE 1
>
> alter session set current_schema=MY_APP;
>
> alter session enable parallel dml;
>
> set echo on timing on
>
> insert /*+ APPEND PARALLEL(2) */ into piece_cache_temp partition (PCECCHE_105) SELECT /*+ PARALLEL(2) */ * from piece_cache partition (PCECCHE_105);
>
> ROLLBACK;
>
>
>
> CREATE TABLE MY_APP.PIECE_CACHE_TEMP
>
> (
>
> ZZZZZZ_PARTITION_KEY NUMBER(4) NOT NULL,
>
> DATE_PARTITION_KEY NUMBER(3) NOT NULL,
>
> ZZZZG_DATE DATE NOT NULL,
>
> IMB_MID_SEQ_ID NUMBER(6) NOT NULL,
>
> JOB_SEQ_ID NUMBER(10) NOT NULL,
>
> ML_CL_CODE NUMBER(2) NOT NULL,
>
> IMB_SERIAL_NBR VARCHAR2(9 BYTE) NOT NULL,
>
> IMB_CODE_PARTIAL VARCHAR2(16 BYTE),
>
> PIECE_RANGE_SEQ_ID NUMBER(15),
>
> PHYS_PIECE_SEQ_ID NUMBER(16),
>
> YYY_GRP_SEQ_ID NUMBER(13) NOT NULL,
>
> YYY_SCAN_PARTITION_KEY NUMBER(4) NOT NULL,
>
> ACTIVE_IND VARCHAR2(1 BYTE) NOT NULL,
>
> UNIQUE_IND VARCHAR2(1 BYTE) NOT NULL
>
> )
>
> TABLESPACE DATA08_TS
>
> INITRANS 10
>
> STORAGE (INITIAL 1M)
>
> NOLOGGING
>
> PARTITION BY RANGE (ZZZZZZ_PARTITION_KEY)
>
> SUBPARTITION BY LIST (DATE_PARTITION_KEY)
>
> (
>
> PARTITION PCECCHE_105 VALUES LESS THAN (106)
>
> NOLOGGING
>
> TABLESPACE DATA08_TS
>
> ( SUBPARTITION PCECCHE_105_PCECCHE_1 VALUES (1) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_2 VALUES (2) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_3 VALUES (3) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_4 VALUES (4) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_5 VALUES (5) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_6 VALUES (6) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_7 VALUES (7) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_8 VALUES (8) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_9 VALUES (9) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_10 VALUES (10) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_11 VALUES (11) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_12 VALUES (12) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_13 VALUES (13) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_14 VALUES (14) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_15 VALUES (15) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_16 VALUES (16) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_17 VALUES (17) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_18 VALUES (18) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_19 VALUES (19) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_20 VALUES (20) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_21 VALUES (21) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_22 VALUES (22) ,
>
> SUBPARTITION PCECCHE_105_PCECCHE_23 VALUES (23)
>
> )
>
> )
>
> /
>
>
>
> EXAMPLE 2 - This works and uses more parallel slaves as the parallel hint is adjusted
>
> create table my_app.my_tab_statistics_source
>
> (
>
> owner varchar2(128) not null,
>
> table_name varchar2(128) not null,
>
> last_analyzed date
>
> )
>
> tablespace MY_APP_DATA02_TS
>
> nologging
>
> partition by range (LAST_ANALYZED)
>
> (
>
> partition p2014 values less than (TO_DATE('01-01-2015','mm-dd-yyyy')),
>
> partition p2015 values less than (TO_DATE('01-01-2016','mm-dd-yyyy')),
>
> partition p2016 values less than (TO_DATE('01-01-2017','mm-dd-yyyy'))
>
> )
>
>
>
> spool insert1.txt
>
> alter session enable parallel dml;
>
> set echo on timing on
>
> insert /*+ APPEND PARALLEL(4) */ into MY_APP.my_tab_statistics_source partition (p2016) SELECT /*+ PARALLEL(4) */ OWNER, TABLE_NAME, SYSDATE FROM DBA_TAB_STATISTICS;
>
> COMMIT;
>
> spool off
>
> exit
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jun 24 2016 - 00:05:49 CEST

Original text of this message