Parallel Execution in Oracle

Hi,
I have source data which keeps on populating.I want to process the records parallely using Oracle Stored Procedure.I should not reprocess the records that are already processed.Please suggest an logic.
Right now i have only option of calling the procedure multiple times in unix environment.
Regards,
Venkat

An example of how to create a worloads table that enables target table (to process) to be chunked, and processed.
SQL> --// we have a table with a PK that is not a gap-free
SQL> --// sequential number
SQL> create table sample_data(
  2          id              primary key,
  3          last_update,
  4          name
  5  ) organization index
  6  nologging as
  7  select
  8          object_id,
  9          sysdate,
10          object_name
11  from       all_objects
12  /
Table created.
SQL>
SQL> --// first couple of rows - as can be seen, we cannot
SQL> --// use id column ranges as the 1-1000 range could be
SQL> --// 10 rows, the 1001-2000 range 1 row, and the 2001-3000
SQL> --// range 900 rows.
SQL> select * from(
  2          select * from sample_data order by 1
  3  ) where rownum < 11;
        ID LAST_UPDATE         NAME
       100 2013/07/08 09:10:01 ORA$BASE
       116 2013/07/08 09:10:01 DUAL
       117 2013/07/08 09:10:01 DUAL
       280 2013/07/08 09:10:01 MAP_OBJECT
       365 2013/07/08 09:10:01 SYSTEM_PRIVILEGE_MAP
       367 2013/07/08 09:10:01 SYSTEM_PRIVILEGE_MAP
       368 2013/07/08 09:10:01 TABLE_PRIVILEGE_MAP
       370 2013/07/08 09:10:01 TABLE_PRIVILEGE_MAP
       371 2013/07/08 09:10:01 STMT_AUDIT_OPTION_MAP
       373 2013/07/08 09:10:01 STMT_AUDIT_OPTION_MAP
10 rows selected.
SQL>
SQL> --// we create a workloads table - we'll use this to
SQL> --// hand out work to a parallel process
SQL> create table workloads(
  2          workload_name   varchar2(30),
  3          workload_id     number,
  4          workload_data   number,
  5          constraint pk_workloads primary key
  6          ( workload_name, workload_id )
  7  ) organization index
  8  /
Table created.
SQL>
SQL> --// we create the workloads (1 workload per rows in
SQL> --// this example) for processing the sample_data table
SQL> insert into workloads
  2  select
  3          'SampleData1',
  4          rownum,
  5          id
  6  from       sample_data;
57365 rows created.
SQL> commit;
Commit complete.
SQL>
SQL> --// we can now chunk the SampleData1 workload using the
SQL> --// workload_id as it is a sequential gap free number to
SQL> --// use for even distribution of work
SQL> col VALUE format 999,999,999
SQL> select 'Start at ' as "LABEL", min(workload_id) as  "VALUE" from workloads where workload_name = 'SampleData1'
  2  union all
  3  select 'End at ', max(workload_id) from workloads where workload_name = 'SampleData1'
  4  union all
  5  select 'For rowcount ', count(*) from workloads where workload_name = 'SampleData1'
  6  /
LABEL                VALUE
Start at                 1
End at              57,365
For rowcount        57,365
SQL>
SQL> --// for example, we want to create 10 workload buckets and
SQL> --// fill each with a range of workload identifiers
SQL> with workload_totals( start_id, end_id ) as(
  2          select min(workload_id), max(workload_id) from workloads where workload_name = 'SampleData1'
  3  ),
  4  buckets_needed( b ) as(
  5          select ceil(end_id/10) from workload_totals
  6  ),
  7  buckets( workload_id, bucket) as (
  8          select workload_id, ceil(workload_id/b) from workloads, buckets_needed where workload_name = 'SampleData1'
  9          order by 1
10  )
11  select
12          row_number() over(order by min(workload_id))    as BUCKET,
13          min(workload_id)                                as START_WORLOAD_ID,
14          max(workload_id)                                as END_WORKLOAD_ID
15  from       buckets
16  group by bucket
17  order by 1
18  /
    BUCKET START_WORLOAD_ID END_WORKLOAD_ID
         1                1            5737
         2             5738           11474
         3            11475           17211
         4            17212           22948
         5            22949           28685
         6            28686           34422
         7            34423           40159
         8            40160           45896
         9            45897           51633
        10            51634           57365
10 rows selected.
SQL>
SQL> --// we need now a procedure that will work as a thread and be called, in
SQL> --// parallel, to process a workload bucket
SQL> create or replace procedure ProcessWorkload(
  2          workloadName    varchar2,
  3          startID         number,
  4          endID           number
  5  ) is
  6  begin
  7          --// we make this simple - we read the workload data from
  8          --// workloads table and do an update of sample data
  9          update(
10                  select
11                          s.*
12                  from    sample_data s
13                  where   s.id in(
14                          select
15                                  w.workload_data
16                          from    workloads w
17                          where   w.workload_name = 'SampleData1'
18                          and     w.workload_id between startID and endID
19                  )
20          )
21          set     name = lower(name),
22                  last_update = sysdate;
23  end;
24  /
Procedure created.
SQL>
SQL> --// process sample_data in parallel via 10 workload buckets, using 2
SQL> --// parallel processes
SQL> var c refcursor
SQL> declare
  2          taskName        varchar2(30);
  3  begin
  4          taskName := 'Parallel-PQ-Process1';
  5          DBMS_PARALLEL_EXECUTE.create_task( taskName );
  6
  7          --// we use our SQL above to create 10 buckets, with each bucket
  8          --// (or chunk) specifying the start and end workload id's to
  9          --// process
10          DBMS_PARALLEL_EXECUTE.create_chunks_by_sql(
11                  task_name => taskName,
12                  sql_stmt =>
13                          'with workload_totals( start_id, end_id ) as(
14                                  select min(workload_id), max(workload_id) from workloads where workload_name = ''SampleData1''
15                          ),
16                          buckets_needed( b ) as(
17                                  select ceil(end_id/10) from workload_totals
18                          ),
19                          buckets( workload_id, bucket) as (
20                                  select workload_id, ceil(workload_id/b) from workloads, buckets_needed where workload_name = ''SampleData1''
21                                  order by 1
22                          )
23                          select
24                                  min(workload_id),
25                                  max(workload_id)
26                          from    buckets
27                          group by bucket ',
28                  by_rowid => false
29          );
30
31          --// next we process the 10 buckets/chunks, two at a time
32          DBMS_PARALLEL_EXECUTE.Run_Task(
33                  task_name => taskName,
34                  sql_stmt => 'begin ProcessWorkload(''SampleData1'',:start_id,:end_id); end;',
35                  language_flag => DBMS_SQL.NATIVE,
36                  parallel_level => 2
37          );
38
39          --// wait for it to complete
40          while DBMS_PARALLEL_EXECUTE.task_status( taskName ) != DBMS_PARALLEL_EXECUTE.Finished loop
41                  DBMS_LOCK.Sleep(10);
42          end loop;
43
44          --// stats cursor
45          open :c for
46          select
47                  task_name,
48                  job_name,
49                  chunk_id,
50                  status,
51                  start_id,
52                  end_id,
53                  end_id-start_id                         as UPDATES_DONE,
54                  to_char(start_ts,'hh24:mi:ss.ff')       as START_TS,
55                  to_char(end_ts,'hh24:mi:ss.ff')         as END_TS,
56                  end_ts-start_ts                         as DURATION
57          from    user_parallel_execute_chunks
58          where   task_name = taskName
59          order by 1,2;
60
61          --// remove task
62          DBMS_PARALLEL_EXECUTE.drop_task( taskName );
63  end;
64  /
PL/SQL procedure successfully completed.
SQL>
SQL> col TASK_NAME format a20
SQL> col JOB_NAME format a20
SQL> col START_TS format a15
SQL> col END_TS format a15
SQL> col DURATION format a28
SQL> print c
TASK_NAME            JOB_NAME               CHUNK_ID STATUS       START_ID     END_ID UPDATES_DONE START_TS        END_TS          DURATION
Parallel-PQ-Process1 TASK$_15266_1              5821 PROCESSED           1       5737         5736 09:10:19.066131 09:10:19.313965 +000000000 00:00:00.247834
Parallel-PQ-Process1 TASK$_15266_1              5822 PROCESSED       28686      34422         5736 09:10:19.315984 09:10:19.682781 +000000000 00:00:00.366797
Parallel-PQ-Process1 TASK$_15266_1              5823 PROCESSED        5738      11474         5736 09:10:19.684925 09:10:19.818145 +000000000 00:00:00.133220
Parallel-PQ-Process1 TASK$_15266_1              5824 PROCESSED       17212      22948         5736 09:10:19.818694 09:10:19.950409 +000000000 00:00:00.131715
Parallel-PQ-Process1 TASK$_15266_1              5830 PROCESSED       51634      57365         5731 09:10:20.605421 09:10:20.721599 +000000000 00:00:00.116178
Parallel-PQ-Process1 TASK$_15266_1              5826 PROCESSED       40160      45896         5736 09:10:20.080270 09:10:20.214443 +000000000 00:00:00.134173
Parallel-PQ-Process1 TASK$_15266_1              5827 PROCESSED       11475      17211         5736 09:10:20.217662 09:10:20.339758 +000000000 00:00:00.122096
Parallel-PQ-Process1 TASK$_15266_1              5828 PROCESSED       34423      40159         5736 09:10:20.342242 09:10:20.453802 +000000000 00:00:00.111560
Parallel-PQ-Process1 TASK$_15266_1              5829 PROCESSED       45897      51633         5736 09:10:20.454376 09:10:20.603116 +000000000 00:00:00.148740
Parallel-PQ-Process1 TASK$_15266_1              5825 PROCESSED       22949      28685         5736 09:10:19.950975 09:10:20.079311 +000000000 00:00:00.128336
10 rows selected.
SQL>
SQL> --// updated sample data
SQL> select * from(
  2          select * from sample_data order by 1
  3  ) where rownum < 11;
        ID LAST_UPDATE         NAME
       100 2013/07/08 09:10:19 ora$base
       116 2013/07/08 09:10:19 dual
       117 2013/07/08 09:10:19 dual
       280 2013/07/08 09:10:19 map_object
       365 2013/07/08 09:10:19 system_privilege_map
       367 2013/07/08 09:10:19 system_privilege_map
       368 2013/07/08 09:10:19 table_privilege_map
       370 2013/07/08 09:10:19 table_privilege_map
       371 2013/07/08 09:10:19 stmt_audit_option_map
       373 2013/07/08 09:10:19 stmt_audit_option_map
10 rows selected.
SQL>
To eliminate the workload table approach, you need to find an alternative method for chunking the target table. Whether such a method is available depends entirely on the structure and nature of your target table  (and is the preferred approach over using a secondary worktable to drive parallel processing).

Similar Messages

  • 11g Parallel Execution on AIX 6 - SMT Enabled or Disabled?

    Greetings,
    I've had no luck searching for an answer to this question and I'm hoping someone can answer it:
    Can Oracle 11g Parallel Execution spread the "granules" of paralllism across the threads (logical cpus) in an AIX SMT enabled environment, or should SMT be disabled and the "granules" be spread scross the processors (virtual cpus)? The application is a data warehouse in a non-RAC configuration using a p570 server. From what I've read, the server must be SMP for Oracle parallel execution capabilities to be maximized, but I think all AIX servers are SMP (not sure if the server needs to be ordered as an SMP server). I'm mostly concerned with the data load processing at this point, and not so concerned for the query right now. I believe AIX 6.1 can enable/disable SMT dynamically. So would it make sense to disable during data loads, and enable for DSS query?
    Hope the question makes sense. Thanks for any help in advance!

    SMT will determine Oracle's cpu_count parameter.
    However this is a static parameter.
    So it won't work, and it might be even dangerous to change it on the fly.
    Sybrand Bakker
    Senior Oracle DBA
    Experts: those who did read documentation.

  • Parallel Processing in Oracle 10g

    Dear Oracle Experts,
    I would like to use the Parallel Processing feature on My production database running on Unix Box.
    No: of CPU in each node is 8 and its RAC database
    Before going for this option i would like to certain things regarding Parallel Processing.
    1. According to my server specification how much DOP i can specify.
    2. Which option for Setting Parallel is good
    a. Using the 'alter table A parallel 4' or passing the parallel hints in the sql statements
    3. We have a batch processing jobs which are loading data into the tables from flat files (24*7) using sql loader. is it possible to parallel this operation and any negative effect if enabled parallel.
    4. Query or DML - which one will be perform best with parallel option.
    5. What are the negative issue if parallel option is enabled.
    6. what are the things to be taken care while enabling the parallel option.
    Thanks in Advance
    Edited by: user585870 on Jun 7, 2009 12:04 PM

    Hi,
    first of all, you should read [Using Parallel Execution|http://download.oracle.com/docs/cd/B19306_01/server.102/b14223/usingpe.htm#DWHSG024] in documentation for your version - almost all of these topics are covered there.
    1. According to my server specification how much DOP i can specify.It depends not only on number of CPU. More important factors are settings of PARALLEL_MAX_SERVERS and PARALLEL_ADAPTIVE_MULTI_USER.
    2. Which option for Setting Parallel is good - Using the 'alter table A parallel 4' or passing the parallel hints in the sql statementsIt depends on your application. When setting PARALLEL on a table, all SQL dealing with that table would be considered for parallel execution. So if it is normal for your app to use parallel access to that table, it's OK. If you want to use PX on a limited set of SQL, then hints or session settings are more appropriate.
    3. We have a batch processing jobs which are loading data into the tables from flat files (24*7) using sql loader. is it possible to parallel this operation and any negative effect if enabled parallel.Yes, refer to documentation.
    4. Query or DML - which one will be perform best with parallel option.Both may take advantages of using PX (with some restrictions to Parallel DML) and both may run slower than non-PX versions.
    5. What are the negative issue if parallel option is enabled.1) Object checkpoint happens before starting parallel FTS (true for >=10gR2, before that version tablespace checkpoint was used)
    2) More CPU and memory resources are used with PX - it may be both benefit and an issue, especially with concurrent PX.
    6. what are the things to be taken care while enabling the parallel option.Read the documentation - it contains almost all you need to know. Since you are using RAC, you sould not forget about method of PX slaves load balancing between nodes. If you are on 10g, refer to INSTANSE_GROUPS/PARALLEL_INSTANCE_GROUPS parameters, if you are using 11g then properly configure services.

  • Parallel execution of multiple scripts

    Hi All,
    I understand that by using parallel hint we can achieve parallel execution of the queries(insert/update/delete).
    For my today's question I would like know if Parallelism can be achieved for the following scenario.
    I have a script with an insert-select statement and multiple merge statements and few update statements all on the same table.
    I have to run this script 12 times on the same table, once for each month of the year.
    Currently we run for Jan (where record_date = '201001') commit it, and then run for Feb, and so on.
    Can all the 12 month be run in parallel. One way I can think of is create 12 different scripts and kick them of by opening 12 different SQL Plus sessions (all on the same table).
    Is there a better way of doing this ?
    Note: each month data will not effect the other other month data.
    Regards,
    Aj

    Creating 12 different scripts would be a sub-optimal solution, and a maintenance nightmare. Creating 1 parametrized script and call that 12 times with different parameters would be slightly better.
    Creating 1 stored procedure with parameters, and run that procedure in the scheduler 12 times would still be better, as everything runs at the server side only.
    Your description is deliberately vague, so the possibility of deadlock can not be excluded.
    Sybrand Bakker
    Senior Oracle DBA

  • Parallel Execution questions

    Hi everyone, i have few questions about Parallel Execution.
    1- Query Coordinator to scan the table, split up the table to the processes. But, each process take different number of rows. For example, in oracle 10g database architecture, thomas kyte gave an example:
    "SELECT COUNT(*) FROM BIG_TABLE"
    It is distributed to 4 processes. One process take 1000 rows, another process 1200 etc. Why this is not equal? How the number of rows is determined by the QC?
    2- If we do not determine the degree of parallelism ( /*+ PARALLEL(B) */ instead of /*+ PARALLEL(B,16) */ ) how the cbo determine the degree of parallelism?
    3- in the explain plan i see lots of thing i do not know. For example :
    :TQ10000
    what is that?
    -> TQ, IN-OUT, PQ_Disturb columns?
    thanks for responses.

    Hi
    Why this is not equal? How the number of rows is determined by the QC?The number of rows is not used to split the table. Data is split in granules and distributed to the slave processed based on two methods:
    - partition granules: a whole partition is given to a specific slave process
    - block range granules: range of blocks are given to each slave process
    So, depending on the size of the granules, one slave process might process much more data than another.
    If we do not determine the degree of parallelism how the cbo determine
    the degree of parallelism?It depends on the configuration. In fact, there is a default at session level, at system level and at table level. Depending which ones are set, a DOP is chosen. In addition, the DOP might be decreased at runtime (before the execution starts, not dynamically during it).
    For example : :TQ10000 what is that?Producers send data to consumers through so called "table queues" (TQ). The number, in your case 10000, is just a identifier generated by the database engine.
    TQTable queue, e.g.: TQ10000 -> Q1,00
    IN-OUTThis is the relationship between parallel operations. E.g. P->P means that a parallel operation sends data to another parallel operation.
    PQ_Disturb columns?This is the method used to distribute rows. E.g. RANGE means that the producers send specific ranges of rows to different consumers.
    For a more detailed discussion about these topics have a look to the documentation:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14223/usingpe.htm#i1009828
    HTH
    Chris Antognini
    Author of Troubleshooting Oracle Performance, Apress 2008 (http://top.antognini.ch)

  • Parallel Execution  against Normal Execution

    Hi,
    Can someone explain why in this case Serial Execution is faster although enabling parallel dml at session level , What are the possibilities to improve speed of executoin for parallel execution as i need to populate for 139 stores data having around half a million rows for each store , i will have to run a cursor on the distinct value of store to achieve this , just to test i got the following Results , can anyoe guide where i am going Wrong?
    This is the Script
    set timing on
    insert into r8_win_store
    select * from win_store@rms8 where store=99;
    commit;
    alter session enable parallel dml;
    insert /*+ Parallel(t,8) */ into r8_win_store t
    select /*+ parallel(e,8)*/ * from win_store@rms8 e where e.store=99;
    commit;
    alter session disable parallel dml;
    OUtput
    SQL> @test1.sql
    299666 rows created.
    Elapsed: 00:03:48.12
    Commit complete.
    Elapsed: 00:00:00.01
    Session altered.
    Elapsed: 00:00:00.00
    299666 rows created.
    Elapsed: 00:08:02.81
    Commit complete.
    Elapsed: 00:00:01.31
    Session altered.
    Elapsed: 00:00:00.00

    Parallel processing in Oracle is intended to reduce I/O latency. When you tell the kernel to do an I/O, you need to wait for that call to complete - disk platters to spin, disk controller heads to move, etc.
    If you need to make a bunch of I/O calls after one another, you will spend up to 90% of the elapsed time waiting for that I/O to actually put the data into your buffer to process.
    Now imagine doing a million I/Os.. and 90% of the time spend waiting for I/O to complete. A big performance knock and a frustrating one - as you cannot make that actual I/O any faster. It is simply slow. The slowest operation you can do on the computer and you're doing a million of them.
    Parallel processing in Oracle addresses this problem. There can be sufficient I/O bandwidth to make a 100 I/O calls per second. But your process that does an I/O call, wait, process, and does an I/O call, wait, process, can only reach a speed of 10 I/O calls per second.
    Which means 90% of the I/O pipe is free to do I/O in parallel. So instead of a single process doing that million I/Os (using 10% I/O bandwidth/thruput), Oracle spawns 10 process each doing a 100K I/Os each - thus making better use of the I/O thruput.
    So Oracle PQ is useless if you scan small volumes of data - it is intended for large volumes of data. There are overheads in PQ as the parallel processes have to be coordinated in order to work together. When each only needs to do 10 I/Os, the time spend on coordination alone can be more than what the time would have been to simply do a 100 I/Os using a single process.
    It is also a fallacy that number of CPUs determine the just how many parallel processes you can start. The real determining factor is the load you can put on your I/O subsystem.
    Bottom line is that PQ is nothing "special" or "magic". It is simply a method to reduce I/O latency by performing parallel I/O. And it is only sensible to use when the amount of I/O to be done warrants parallel processing.
    Oh yeah - and the CBO is very capable in deciding when to use PQ and not. So rather than force PQ down the CBO's throat using the PARALLEL clause and hardcoding the degrees and instances, it should rather make those decisions (as informed decisions) itself. Which means using the PARALLEL clause on tables and not as SQL hints. The DBA can easily tune that by altering the PARALLEL clause if a table.. The DBA cannot by any means do the same thing when dealing with SQLs that insists on a specific number of PQ processes on a specific number of instances.

  • Parallel execution for Expression Filters

    I'm looking for any information on whether expression filters are amenable to parallel execution or not.
    I had a look through the documentation without success, and saw that in the type declarations for supporting objects there is no mention of DETERMINISTIC or PARALLEL_ENABLE. However, the static functions and procedures do not look like they have any constructs that the database would see as an impediment for parallel execution.
    Can anyone advise on this?

    Thanks for that.
    Maybe in a parallel query environment the index will not be used. But I was really wondering whether the execution of the Evaluate function itself would be parallelised, as it invokes functions that are not explicitly marked as deterministic or as safe for parallel execution.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_packages.htm#BABIGDGE
    Well, I'll see if I can investigate (maybe I'll have to suspend those system triggers that prevent modification of the Type ... just for experimental reasons, you understand).

  • Parallel Execution and disk affinity on MPP

    Hello,
    In Chapter 25 Using Parallel Execution
    Oracle® Database Data Warehousing Guide
    10g Release 2 (10.2)
    Part Number B14223-02
    There is a very short quote "Additionally, Oracle Database considers the disk affinity of the granules on MPP systems to take advantage of the physical proximity between parallel execution servers and disks."
    I understand the benefits but :
    - I'm wondering what it really means ?
    - How it can work ?
    - How to demonstrate, show this phenomenon ?
    Best Regards,
    Gregory

    Hi Vency,
    Try posting this in the following forum:
    General Database Discussions
    Thanks, Mark

  • ORA-12842: Cursor invalidated during parallel execution Database driver err

    Hi gurus,
    I have got an PL/SQL package in DWH environment and sometimes it generates the follwoing error message:
    ORA-12842: Cursor invalidated during parallel execution Database driver error...
    When I restart the process, it runs successfully.
    Any ideas about this behaviour?
    Regards
    Bernd

    More info needed.
    Which Oracle version?
    Are you running up against a known bug? Check metalink.
    Cheers,
    Colin

  • Parallel executions on AIX

    Hi,
    9.2 AIX5.3
    Since I enabled parallel executions, and table monitoring there are performance issues while database (warehouse) is loaded (sqlldr) .
    The LRUD root process gets active and maxes up the CPU to extend that performance is trashed.
    The process is active even after all db activities are gone.
    Is there something that could be done from db side to tune-accommodate the AIX behavior?
    The only solution so far is to disable the parallel executions that I'm reluctant to do.
    Thx,

    Greg Rahn wrote:
    If LRUD is consuming lots of CPU and there is also a high paging rate, it would seem to point to an issue with the VMM file cache. Are you using direct I/O? Not doing so, while using PQ would cause the VMM file cache to be flooded with I/O requests from all the PQ slaves thus resulting in a high CPU usage for LRUD. Direct I/O allows I/O to bypass the VMM and eliminates LRUD from having to do any work at all - it bypasses this code path. This is a necessity while using PQ (as well as a recommendation in the Oracle docs).
    Greg,
    I was going to say "concurrent I/O" rather than "direct I/O" - but either way it looks like there's a load of memory being used for the filesystem cache when bypassing the cache and letting Oracle use the memory seems to be the obvious bet.
    Nemohm
    Could you supply a little more precise about your comments:
    The LRUD root process gets active and maxes up the CPU to extend that performance is trashed.
    The process is active even after all db activities are gone.When you say "after all db activities are gone" - do you mean just the heavy duty loader activity is complete, or has all activity from all other users stopped as well; and is this only during and directly after a loader session, or does it happen at other times when parallel queries are going on; and how long does it take before the LRU daemon calms down ? How many CPUs do you have, by the way ?
    As Greg points out - parallel execution can result in a very heavy demand for I/O requests that bypass Oracle's own cache - this means that data that could have been thrashed through Oracle's cache when you run serially is suddenly thrashed through the filesystem cache (if hasn't been bypassed). Moreover, parallel execution often does things that put a heaavy load on the PGA memory - which could cause lots of (OS) memory pages to be reclaimed from the filesystem cache so that they can be used by Oracle processes in their PGA heaps.
    In general: if you've got memory set it up so that Oracle can use it effectively - leaving it for the filesystem cache can help in some cases, but avoiding the filesystem cache is often the better bet.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    "Science is more than a body of knowledge; it is a way of thinking" Carl Sagan

  • ODISqlUnload - Parallel Execution

    Hello, I have developed a KM that uses ODISqlUnload to extract data from an Oracle source. I have noticed that when I attempt to run 2 jobs using the same KM, the first job fails when the second job is executed. For example:
    Session 1 : Executed at 12:20
    Session 2 : Executed at 12:30
    When Session 2 executes the ODISqlUnload command, Session 1 will fail but Session 2 will continue.
    My question is, is there a parameter to instruct ODISqlUnload to enable parallel execution? Or is it a limitation of the tool?
    Thanks in advance!

    smercurio_fc wrote:
    Well, there you go then. You can only have 1 "read" task for one device active at a time. Your "78652-manual_EDIT" is set up in parallel, but each task can only execute once the currently active "read" is done. Since the "7862SUBVI_manualmode" VI is dependent on data from the "78652-manual_EDIT" VI, it can only execute once the data has been read. You can mitigate this somewhat so that instead of 6 separate reads you perform 1 read to get a 2D array of booleans and then index out each one to your 6 instances of "7862SUBVI_manualmode". The "7862SUBVI_manualmode" VI, however, contains additional DAQ tasks so you may get some blocking in there as well.
    What I am trying to say is, you said I should create an array and perform the reads. I had done that initally. But the subvi contains DAQ tasks and using the value after indexing arrays is leading to errors.
    Also the P3/0-3.5 ets are port nos and lines. So i don't have lines of a function in a straight order together. The indexing also makes DAQ writes difficult to implement.

  • 11gR2 query parallel execution

    I need to retrieve info from a very big table many times with different where conditions and compared execution plan for the queries using composite index on (group_id, start,end).
    SELECT /*+ index(a idx_loc) */ a.id , a.group_id
    from location a
    where a.group_id=10
    and a.start>=30000
    and a.end<=60000;
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 578 | 25432 | 191K (1)| 00:38:14 | | |
    | 1 | PARTITION LIST SINGLE | | 578 | 25432 | 191K (1)| 00:38:14 | KEY | KEY |
    | 2 | PARTITION LIST SINGLE | | 578 | 25432 | 191K (1)| 00:38:14 | 6 | 6 |
    | 3 | TABLE ACCESS BY LOCAL INDEX ROWID| LOCATION | 578 | 25432 | 191K (1)| 00:38:14 | 6 | 6 |
    |* 4 | INDEX SKIP SCAN | IDX_LOC | 592 | | 190K (1)| 00:38:07 | 6 | 6 |
    SELECT /*+ parallel */ a.id , a.group_id
    from location a
    where a.group_id=10
    and a.start>=30000
    and a.end<=60000;
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop | TQ |IN-OUT| PQ Distrib |
    | 0 | SELECT STATEMENT | | 578 | 25432 | 16333 (1)| 00:00:33 | | | | | |
    | 1 | PX COORDINATOR | | | | | | | | | | |
    | 2 | PX SEND QC (RANDOM)| :TQ10000 | 578 | 25432 | 16333 (1)| 00:00:33 | | | Q1,00 | P->S | QC (RAND) |
    | 3 | PX BLOCK ITERATOR | | 578 | 25432 | 16333 (1)| 00:00:33 | 6 | 6 | Q1,00 | PCWC | |
    |* 4 | TABLE ACCESS FULL| LOCATION | 578 | 25432 | 16333 (1)| 00:00:33 | 6 | 6 | Q1,00 | PCWP | |
    My questions are:
    1) The execution plan shows the query using parallel hint has much less cpu cost and time compared with the one with index hint. So it seems it is better to use the parallel execution. is there any downside to use parallel hint that I should consider?
    2) I can also modify the application to submit multiple queries (using index hint) in parallel (which opens multiple sessions). Is the parallel hint in the query superior to parallel queries in application?

    user7435395 wrote:
    I need to retrieve info from a very big table many times with different where conditions and compared execution plan for the queries using composite index on (group_id, start,end). BIG is a very qualitative term. So you need to be more specific. And when ever you ask for a SQL Tuning request please provide the following details mentioned in {thread:id=863295}
    SELECT /*+ index(a idx_loc) */ a.id , a.group_id
    from  location a
    where  a.group_id=10
    and a.start>;=30000
    and a.end;=60000;
    | Id  | Operation                           | Name                      | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT                    |                           |   578 | 25432 |   191K  (1)| 00:38:14 |       |       |
    |   1 |  PARTITION LIST SINGLE              |                           |   578 | 25432 |   191K  (1)| 00:38:14 |   KEY |   KEY |
    |   2 |   PARTITION LIST SINGLE             |                           |   578 | 25432 |   191K  (1)| 00:38:14 |     6 |     6 |
    |   3 |    TABLE ACCESS BY LOCAL INDEX ROWID| LOCATION |   578 | 25432 |   191K  (1)| 00:38:14 |     6 |     6 |
    |*  4 |     INDEX SKIP SCAN                 | IDX_LOC           |   592 |       |   190K  (1)| 00:38:07 |     6 |     6 |
    --------------------------------------------------------------------------------------------------------------------------------- As you have forced oracle to use IDX_LOC. it is going for a [url http://docs.oracle.com/cd/B19306_01/server.102/b14211/optimops.htm#PFGRF10105]INDEX SKIP SCAN. And if the cardinality of the subindex column is low then oracle may be doing more work here. I think that is what exactly happening in your case. A simple full table scan could be more efficient.
    SELECT /*+ parallel */ a.id , a.group_id
    from  location a
    where  a.group_id=10
    and a.start>;=30000
    and a.end;=60000;
    | Id  | Operation            | Name                      | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |    TQ  |IN-OUT| PQ Distrib |
    |   0 | SELECT STATEMENT     |                           |   578 | 25432 | 16333   (1)| 00:00:33 |       |       |        |      |            |
    |   1 |  PX COORDINATOR      |                           |       |       |            |          |       |       |        |      |            |
    |   2 |   PX SEND QC (RANDOM)| :TQ10000                  |   578 | 25432 | 16333   (1)| 00:00:33 |       |       |  Q1,00 | P->S | QC (RAND)  |
    |   3 |    PX BLOCK ITERATOR |                           |   578 | 25432 | 16333   (1)| 00:00:33 |     6 |     6 |  Q1,00 | PCWC |            |
    |*  4 |     TABLE ACCESS FULL| LOCATION |   578 | 25432 | 16333   (1)| 00:00:33 |     6 |     6 |  Q1,00 | PCWP |            |
    ----------------------------------------------------------------------------------------------------------------------------------------------- Again PARALLEL query has its own down side. There is no free lunch. You need to spend more resource. And most of the time in a OLTP system with multi user access its not worthwhile.
    So the first thing i would suggest you is to remove all your hint and get an execution plan and post it. And read the above link provided an post all the necessary details.
    You need to be first clear about your problem.

  • Parallel execution of query

    Hi Everyone,
    I am using following version oracle version
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    "CORE 10.2.0.4.0 Production"
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    Parameter for parallel execution.
    Name        Type Value
    parallel_server      1 FALSE
    parallel_server_instances   3 1
    recovery_parallelism    3 0
    fast_start_parallel_rollback  2 LOW
    parallel_min_percent    3 0
    parallel_min_servers     3 4
    parallel_max_servers    3 10
    parallel_instance_group    2
    parallel_execution_message_size 3 2152
    parallel_adaptive_multi_user  1 TRUE
    parallel_threads_per_cpu   3 2
    parallel_automatic_tuning   1 FALSE
    If i execute two or more SQL with parallel hint, i realised that the SQL which is first executed is using the parallelism functionality and rest are sequentially.
    select /*+ parallel(a) */  max(sal)  from emp a;
    SELECT /*+ parallel(a) parallel(b) */ a.empno, b.deptno FROM emp a,  dept b
    WHERE a.deptno = b.deptno
    I have following queries.
    1. How can i find out how many Degree of parallalism is being used by SQL
    2. What needs to be done so that both SQL can be executed using parallel execution.
    3. How to find out how many 'Query server' are being used by SQL and how many left for another SQL
       to use 'Query server'
    Regards,
    Sandeep

    Did you already consult the documentation? "Rules for Parallelizing Queries":  Types of Parallelism
    And you can find several threads on AskTom, for example: Ask Tom &amp;quot;Number of CPUs and Degree of Parallelism&amp;quot;

  • How to run multiple CodedUI Ordered Tests over multiple Test Agents for parallel execution using Test Controller

    we are using VS 2013, I need to run multiple Coded UI Ordered Tests in parallel on different agents.
    My requirement :
    Example:   I have 40 Coded UI Test scripts in single solution/project. i want to run in different OS environments(example 5 OS ).  I have created 5 Ordered tests with the same 40 test cases. 
    I have one Controller machine and 5 test agent machines. Now I want my tests to be distributed in a way that every agent gets 1 Ordered test to execute. 
    Machine_C = Controller (Controls Machine_1,2,3,4,5)
    Machine_1 = Test Agent 1 (Should execute Ordered Test 1 (ex: OS - WIN 7) )
    Machine_2 = Test Agent 2 (Should execute Ordered Test 2 (ex:
    OS - WIN 8) )
    Machine_3 = Test Agent 3 (Should execute Ordered Test 3
    (ex: OS - WIN 2008 server)  )
    Machine_4 = Test Agent 4 (Should execute Ordered Test 4 (ex:
    OS - WIN 2012 server) )
    Machine_5 = Test Agent 5 (Should execute Ordered Test 5 (ex:
    OS - WIN 2003 server) )
    I have changed the  “MinimumTestsPerAgent” app setting value
    as '1' in controller’s configuration file (QTController.exe.config).
    When I run the Ordered tests from the test explorer all Test agent running with each Ordered test and showing the status as running. but with in the 5 Test Agents only 2 Agents executing the test cases remaining all 3 agents not executing the test cases but
    status showing as 'running' still for long time (exp: More then 3 hr) after that all so  its not responding. 
    I need to know how I can configure my controller or how I can tell it to execute these tests in parallel on different test agents. This will help me reducing the script execution time. 
     I am not sure what steps I am missing. 
    It will be of great help if someone can guide me how this can be achieved.
    -- > One more thing Can I Run one Coded UI Ordered Test on One Specific Test Agent?
    ex: Need to run ordered Test 1 in Win 7 OS (Test Agent 1) only.
    Thanks in Advance.

    Hi Divakar,
    Thank you for posting in MSDN forum.
    As far as I know, we cannot specify coded UI ordered test run on specific test agent. And it is mainly that test controller determine which coded UI ordered test assign to which test agent.
    Generally, I know that if we want to run multiple CodedUI Ordered Tests over multiple Test Agents for parallel execution using Test Controller.
    We will need to change the MinimumTestsPerAgent property to 1 in the test controller configuration file (QTControllerConfig.exe.config) as you said.
    And then we will need to change the bucketSize number of tests/number of machines in the test settings.
    For more information about how to set this bucketSize value, please refer the following blog.
    http://blogs.msdn.com/b/aseemb/archive/2010/08/11/how-to-run-automated-tests-on-different-machines-in-parallel.aspx
    You can refer this Jack's suggestion to run your coded UI ordered test in lab Environment or load test.
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/661e73da-5a08-4c9b-8e5a-fc08c5962783/run-different-codedui-tests-simultaneously-on-different-test-agents-from-a-single-test-controller?forum=vstest
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Parallel execution in a web template

    We have a web template with several queries. It is possible execute our queries with parallel execution?
    Thanks !!

    Hi Dani,
    currently all DP's are executed sequentially, because in general it would be possible that the dataproviders have influence on each other.
    i heard that sap is building a prototyp to allow parallelization in BEX web 7.0. But currently there is no release date known, May this will come with some enhancement package.
    You should consider the Functional enhancement schedule on http://service.sap.com/bi. If this feature will be released sometime, it will be listed there.
    best regards,
    Kai

Maybe you are looking for

  • How do i prevent Dreamweaver from changing all of my pages?

    Hello, thank you in advance for your help! I am using Dreamweaver CS5.5 and have downloaded a free CSS template (www.freecsstemplates.org). I created my home page and moved onto the second page - as i wanted the same theme i simply copied and pasted

  • Urgent help in IDOC .

    helo , Please help me in this : How can i get data from the " Characteristics" for my IDOC segment fields ( the characteristics have been created with tcode CT04).. thanks,

  • How to open xls files in Mountain Lion

    I upgraded to Mountain Lion and now cannot open xls files.  xlsx files open fine. Is there a way to convert the xls files?

  • Asynchronous socket programming in Java?

    I am a C++ programmer, I just wonder how do I do asynchronous programming in Java? In VC++, you can hook an event handler to the socket and the system will fire an event whenever there is data coming in to the socket. The event handler can then spawn

  • PI Mapping Problem

    Hi, Plzzz help me on this. IN EDI data DTM Segment has 2 fields Date Qualifier, and Date two fields. DTM1020100202 DTM2020100102 i need date in output when Qualifier is 10. If qualifier is 20 ignore that date in output. i need to check this thing and