Insert query is using parallel mode

Hi All,
Insert query is running against below tables. It is using Parallelism as the below explain shows.
Execution Plan
Id  Operation  Name  Rows  Bytes  Cost (%CPU) Time  TQ  IN-OUT PQ Distrib 
0  INSERT STATEMENT        779K(100)        
1     LOAD TABLE CONVENTIONAL                 
2       PX COORDINATOR                 
3         PX SEND QC (RANDOM)  :TQ10002  4116K 443M 779K (0) 999:59:59  Q1,02  P->S  QC (RAND) 
4           HASH JOIN ANTI BUFFERED   4116K 443M 779K (0) 999:59:59  Q1,02  PCWP   
5             BUFFER SORT            Q1,02  PCWC   
6               PX RECEIVE    4116K 235M 36221 (0) 758:17:06  Q1,02  PCWP   
7                 PX SEND HASH  :TQ10000  4116K 235M 36221 (0) 758:17:06    S->P  HASH 
8                   TABLE ACCESS FULL  GL_POSTING_INTERIM_50123  4116K 235M 36221 (0) 758:17:06       
9             PX RECEIVE    471M 23G 742K (0) 999:59:59  Q1,02  PCWP   
10               PX SEND HASH  :TQ10001  471M 23G 742K (0) 999:59:59  Q1,01  P->P  HASH 
11                 PX BLOCK ITERATOR    471M 23G 742K (0) 999:59:59  Q1,01  PCWC   
12                   TABLE ACCESS FULL  GL_BALANCES  471M 23G 742K (0) 999:59:59  Q1,01  PCWP    WE are not using any parallel hint again all the tables in the insert query.
Environment details.
DB version - 11.2.0.1
OS version - IBM AIX 6.1
Please let me know why query is going for parallelism automatically as i am not using any parallel hint or any auto parallel.
NAME                                 TYPE        VALUE
fast_start_parallel_rollback         string      FALSE
parallel_adaptive_multi_user         boolean     TRUE
parallel_automatic_tuning            boolean     FALSE
parallel_degree_limit                string      CPU
parallel_degree_policy               string      MANUAL
parallel_execution_message_size      integer     16384
parallel_force_local                 boolean     FALSE
parallel_instance_group              string
parallel_io_cap_enabled              boolean     FALSE
parallel_max_servers                 integer     8
parallel_min_percent                 integer     0
NAME                                 TYPE        VALUE
parallel_min_servers                 integer     0
parallel_min_time_threshold          string      AUTO
parallel_server                      boolean     FALSE
parallel_server_instances            integer     1
parallel_servers_target              integer     64
parallel_threads_per_cpu             integer     2
recovery_parallelism                 integer     0Please suggest.
Thanks

That will depend on the query and whether it decides to use parallel or not. Having PARALLEL_AUTOMATIC_TUNING set to FALSE does not disable parallel query in your database. Unless you are talking about some other parameter when you say "parallel auto is manual"?
Here is a worked example. Note my parallel settings at the end:
create table rj_test (id number(10), name varchar2(20));
exec dbms_stats.set_table_stats(ownname=>'SYS',tabname=>'RJ_TEST',numrows=>'1000000',numblks=>'10000');
SQL> explain plan for
  2  select id, count(*)
  3  from rj_test
  4  group by id;
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 3757798270
| Id  | Operation          | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT   |         |  1000K|    12M|  1058  (12)| 00:00:06 |
|   1 |  HASH GROUP BY     |         |  1000K|    12M|  1058  (12)| 00:00:06 |
|   2 |   TABLE ACCESS FULL| RJ_TEST |  1000K|    12M|   962   (3)| 00:00:05 |
9 rows selected.
SQL> select degree from user_tables where table_name = 'RJ_TEST';
DEGREE
         1
SQL> alter table rj_test parallel (degree 8);
Table altered.
SQL> explain plan for
  2  select id, count(*)
  3  from rj_test
  4  group by id;
Explained.
SQL> select * from table(dbms_xplan.display);
SQL> set lines 120
SQL> set pages 1000
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 2739002282
| Id  | Operation                | Name     | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
|   0 | SELECT STATEMENT         |          |  1000K|    12M|   145  (11)| 00:00:01 |        |      |            |
|   1 |  PX COORDINATOR          |          |       |       |            |          |        |      |            |
|   2 |   PX SEND QC (RANDOM)    | :TQ10001 |  1000K|    12M|   145  (11)| 00:00:01 |  Q1,01 | P->S | QC (RAND)  |
|   3 |    HASH GROUP BY         |          |  1000K|    12M|   145  (11)| 00:00:01 |  Q1,01 | PCWP |            |
|   4 |     PX RECEIVE           |          |  1000K|    12M|   145  (11)| 00:00:01 |  Q1,01 | PCWP |            |
|   5 |      PX SEND HASH        | :TQ10000 |  1000K|    12M|   145  (11)| 00:00:01 |  Q1,00 | P->P | HASH       |
|   6 |       HASH GROUP BY      |          |  1000K|    12M|   145  (11)| 00:00:01 |  Q1,00 | PCWP |            |
|   7 |        PX BLOCK ITERATOR |          |  1000K|    12M|   133   (3)| 00:00:01 |  Q1,00 | PCWC |            |
|   8 |         TABLE ACCESS FULL| RJ_TEST  |  1000K|    12M|   133   (3)| 00:00:01 |  Q1,00 | PCWP |            |
15 rows selected.
SQL> show parameter parallel
NAME                                 TYPE        VALUE
fast_start_parallel_rollback         string      LOW
parallel_adaptive_multi_user         boolean     TRUE
parallel_automatic_tuning            boolean     FALSE
parallel_degree_limit                string      CPU
parallel_degree_policy               string      MANUAL
parallel_execution_message_size      integer     16384
parallel_force_local                 boolean     FALSE
parallel_instance_group              string
parallel_io_cap_enabled              boolean     FALSE
parallel_max_servers                 integer     16
parallel_min_percent                 integer     0
parallel_min_servers                 integer     1
parallel_min_time_threshold          string      AUTO
parallel_server                      boolean     FALSE
parallel_server_instances            integer     1
parallel_servers_target              integer     16
parallel_threads_per_cpu             integer     2
recovery_parallelism                 integer     0
SQL>

Similar Messages

  • Sql query not using parallel option

    I am working in oracle 11.2.0.2.0 .
    I am trying to execute one query using parallel options but in explain plan it is not using that PX option ...
    UPDATE /*+PARALLEL (emp,4) */
    cust_sku_allocation_data emp
    set emp.mean=
    (select sum(dep.stock_to_sales)/count(distinct dep.destination_facility)
    FROM cust_sku_allocation dep
    WHERE dep.stock_to_sales_ratio NOT IN (0,9999)
    AND dep.sku_id = emp.sku_id);
    Any idea where to check..

    Sorry I meant:
    You cannot parallelize UPDATE or DELETE operations on a nonpartitioned table, or when the update only affects 1 partition in a partitioned one.

  • How can I enter the data from the recordset into your insert query

    Hi
    i would like to know how I can enter the data from the recordset into your insert query without using a  hidden field.
    thanks
    ------------------------------------------------------------------------------------Below is the code------------------------------------------------------------------------------------- -----
    <?php require_once('../../Connections/ezzyConn.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
       $theValue = function_exists("mysql_real_escape_string") ?  mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frmpostComment")) {
       $insertSQL = sprintf("INSERT INTO comments (com_topic, com_user, title,  com_content, com_date, online_id) VALUES (%s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['com_topic'], "int"),
                           GetSQLValueString($_POST['commentby'], "int"),
                           GetSQLValueString($_POST['title'], "text"),
                           GetSQLValueString($_POST['com_content'], "text"),
                           GetSQLValueString($_POST['com_date'], "text"),
                           GetSQLValueString($_POST['online_id'], "int"));
      mysql_select_db($database_ezzyConn, $ezzyConn);
      $Result1 = mysql_query($insertSQL, $ezzyConn) or die(mysql_error());
      $insertGoTo = "index.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    $colname_rsCommentby = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_rsCommentby = $_SESSION['MM_Username'];
    mysql_select_db($database_ezzyConn, $ezzyConn);
    $query_rsTopics = "SELECT topic_id, topic FROM topics ORDER BY topic_date DESC";
    $rsTopics = mysql_query($query_rsTopics, $ezzyConn) or die(mysql_error());
    $row_rsTopics = mysql_fetch_assoc($rsTopics);
    $totalRows_rsTopics = mysql_num_rows($rsTopics);
    mysql_select_db($database_ezzyConn, $ezzyConn);
    $query_rsOnline = "SELECT online_id, `online` FROM `online` ORDER BY online_id DESC";
    $rsOnline = mysql_query($query_rsOnline, $ezzyConn) or die(mysql_error());
    $row_rsOnline = mysql_fetch_assoc($rsOnline);
    $totalRows_rsOnline = mysql_num_rows($rsOnline);
    $colname_rsCommentby = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_rsCommentby = $_SESSION['MM_Username'];
    mysql_select_db($database_ezzyConn, $ezzyConn);
    $query_rsCommentby  = sprintf("SELECT user_id, username FROM users WHERE username = %s",  GetSQLValueString($colname_rsCommentby, "text"));
    $rsCommentby = mysql_query($query_rsCommentby, $ezzyConn) or die(mysql_error());
    $row_rsCommentby = mysql_fetch_assoc($rsCommentby);
    $totalRows_rsCommentby = mysql_num_rows($rsCommentby);
    ?>
    <?php include("../includes/access.php"); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>ezzybay - easy click, ezzy shopping</title>
    <link href="../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../css/navigation.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <?php include("../includes/top.php"); ?>
      <div id="content">
      <div id="pageTitle">
        <h2>CMS Section:</h2>
        <p>Comment Topics Page</p>
      </div>
      <?php include("../includes/leftnav.php"); ?>
        <div id="mainContent">
          <form action="<?php echo $editFormAction; ?>" method="post" name="frmpostComment" id="frmpostComment">
            <table align="center">
            <caption>Post Comment</caption>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Topic:</td>
                <td><select name="com_topic" class="listbox" id="com_topic">
                  <?php
    do { 
    ?>
                   <option value="<?php echo  $row_rsTopics['topic_id']?>"><?php echo  $row_rsTopics['topic']?></option>
                  <?php
    } while ($row_rsTopics = mysql_fetch_assoc($rsTopics));
      $rows = mysql_num_rows($rsTopics);
      if($rows > 0) {
          mysql_data_seek($rsTopics, 0);
          $row_rsTopics = mysql_fetch_assoc($rsTopics);
    ?>
                </select></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Title:</td>
                <td><input name="title" type="text" class="textfield" value="" size="32" /></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right" valign="top">Comment:</td>
                <td><textarea name="com_content" cols="50" rows="5" class="textarea"></textarea></td>
              </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right">Status:</td>
                <td><select name="online_id" class="smalllistbox">
                  <?php
    do { 
    ?>
                   <option value="<?php echo $row_rsOnline['online_id']?>"  <?php if (!(strcmp($row_rsOnline['online_id'], 2))) {echo  "SELECTED";} ?>><?php echo  $row_rsOnline['online']?></option>
                  <?php
    } while ($row_rsOnline = mysql_fetch_assoc($rsOnline));
    ?>
                </select></td>
              </tr>
              <tr> </tr>
              <tr valign="baseline">
                <td nowrap="nowrap" align="right"> </td>
                <td><input type="submit" class="button" value="Insert record" /></td>
              </tr>
            </table>
            <input name="commentby" type="hidden" id="commentby" value="<?php echo $row_rsCommentby['user_id']; ?>" />
            <input type="hidden" name="com_date" value="<?php echo date("d/m/y : H:i:s", time()) ?>" />
            <input type="hidden" name="MM_insert" value="frmpostComment" />
          </form>
        </div>
      </div>
    <?php include("../includes/footer.php"); ?>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($rsTopics);
    mysql_free_result($rsOnline);
    mysql_free_result($rsCommentby);
    ?>

    I'll keep it simple and only use the date as an example. Hopefully you get the concept from the example. Basically you create a recordset and insert the recordset value instead of the POST value into your insert query. In the example below I declared a variable for $the_date and entered the variable into the INSERT query instead of the hidden POST field.
    <?php require_once('../../Connections/ezzyConn.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
       $theValue = function_exists("mysql_real_escape_string") ?  mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $the_date = date("d/m/y : H:i:s", time());
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frmpostComment")) {
       $insertSQL = sprintf("INSERT INTO comments (com_topic, com_user, title,  com_content, com_date, online_id) VALUES (%s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['com_topic'], "int"),
                           GetSQLValueString($_POST['commentby'], "int"),
                           GetSQLValueString($_POST['title'], "text"),
                           GetSQLValueString($_POST['com_content'], "text"),
                           GetSQLValueString($the_date, "text"),
                           GetSQLValueString($_POST['online_id'], "int"));
      mysql_select_db($database_ezzyConn, $ezzyConn);
      $Result1 = mysql_query($insertSQL, $ezzyConn) or die(mysql_error());
      $insertGoTo = "index.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    ?>

  • Performance issue with insert query !

    Hi ,
    I am using dbxml-2.4.16, my node-storage container is loaded with a large document ( 54MB xml ).
    My document basically contains around 65k records in the same table ( 65k child nodes for one parent node ). I need to insert more records in to my DB, my insert XQuery is consuming a lot of time ( ~23 sec ) to insert one entry through command-line and around 50sec through code.
    My container is indexed with "node-attribute-equality-string". The insert query I used:
    insert nodes <NS:sampleEntry mySSIAddress='70011' modifier = 'create'><NS:sampleIPZone1Address>AABBCCDD</NS:sampleIPZone1Address><NS:myICMPFlag>1</NS:myICMPFlag><NS:myIngressFilter>1</NS:myIngressFilter><NS:myReadyTimer>4</NS:myReadyTimer><NS:myAPNNetworkID>ggsntest</NS:myAPNNetworkID><NS:myVPLMNFlag>2</NS:myVPLMNFlag><NS:myDAC>100</NS:myDAC><NS:myBcastLLIFlag>2</NS:myBcastLLIFlag><NS:sampleIPZone2Address>00000000</NS:sampleIPZone2Address><NS:sampleIPZone3Address>00000000</NS:sampleIPZone3Address><NS:sampleIPZone4Address>00000000</NS:sampleIPZone4Address><NS:sampleIPZone5Address>00000000</NS:sampleIPZone5Address><NS:sampleIPZone6Address>00000000</NS:sampleIPZone6Address><NS:sampleIPZone7Address>00000000</NS:sampleIPZone7Address></NS:sampleEntry> into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable)
    If I modify my query with
    into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:sampleTable/NS:sampleEntry[@mySSIAddress='1']
    insted of
    into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable)
    Time taken reduces only by 8 secs.
    I have also tried to use insert "after", "before", "as first", "as last" , but there is no difference in performance.
    Is anything wrong with my query, what should be the expected time to insert one record in a DB of 65k records.
    Has anybody got any idea regarding this performance issue.
    Kindly help me out.
    Thanks,
    Kapil.

    Hi George,
    Thanks for your reply.
    Here is the info you requested,
    dbxml> listIndexes
    Index: unique-node-metadata-equality-string for node {http://www.sleepycat.com/2002/dbxml}:name
    Index: node-attribute-equality-string for node {}:mySSIAddress
    2 indexes found.
    dbxml> info
    Version: Oracle: Berkeley DB XML 2.4.16: (October 21, 2008)
    Berkeley DB 4.6.21: (September 27, 2007)
    Default container name: n_b_i_f_c_a_z.dbxml
    Type of default container: NodeContainer
    Index Nodes: on
    Shell and XmlManager state:
    Not transactional
    Verbose: on
    Query context state: LiveValues,Eager
    The insery query with update takes ~32 sec ( shown below )
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS';insert nodes <NS:sampleEntry mySSIAddress='70000' modifier = 'create' ><NS:sampleIPZone1Address>AABBCCDD</NS:sampleIPZone1Address><NS:myICMPFlag>1</NS:myICMPFlag><NS:myIngressFilter>1</NS:myIngressFilter><NS:myReadyTimer>4</NS:myReadyTimer><NS:myAPNNetworkID>ggsntest</NS:myAPNNetworkID><NS:myVPLMNFlag>2</NS:myVPLMNFlag><NS:myDAC>100</NS:myDAC><NS:myBcastLLIFlag>2</NS:myBcastLLIFlag><NS:sampleIPZone2Address>00000000</NS:sampleIPZone2Address><NS:sampleIPZone3Address>00000000</NS:sampleIPZone3Address><NS:sampleIPZone4Address>00000000</NS:sampleIPZone4Address><NS:sampleIPZone5Address>00000000</NS:sampleIPZone5Address><NS:sampleIPZone6Address>00000000</NS:sampleIPZone6Address><NS:sampleIPZone7Address>00000000</NS:sampleIPZone7Address></NS:sampleEntry> into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable"
    Time in seconds for command 'query': 32.5002
    and the query without the updation part takes ~14 sec ( shown below )
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS'; doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable"
    Time in seconds for command 'query': 13.7289
    The query :
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS'; doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//PMB:sampleTable/PMB:sampleEntry[@mySSIAddress='1000']"
    Time in seconds for command 'query': 0.005375
    is very fast.
    The Updation of the document seems to consume much of the time.
    Regards,
    Kapil.

  • Insert using parallel

    what does this last statement mean?  it is as though the query runs just like without any hints.
    oracle doc:
    Using Parallel Execution
    Examples of Distributed Transaction Parallelization
    This section contains several examples of distributed transaction processing.
    Example 1 Distributed Transaction Parallelization
    In this example, the DML statement queries a remote object:
    INSERT /* APPEND PARALLEL (t3,2) */ INTO t3 SELECT * FROM t4@dblink;
    The query operation is executed serially without notification because it references a remote object.

    Randolf,
    As far as I have a real db link why not test it myself  (see my questions at the end of this thread)
    SQL> insert /*+ append parallel(lcl) */ into local_tab lcl select /*+ parralel(dst) */ dst.* from distant_tab dst;
    51 rows created.
    SQL> select * from table(dbms_xplan.display_cursor);
    PLAN_TABLE_OUTPUT
    SQL_ID  1nhmuzb4ayq7x, child number 0
    insert /*+ append parallel(lcl) */ into local_tab lcl select /*+
    parralel(dst) */ dst.* from distant_tab dst
    Plan hash value: 2098243032
    | Id  | Operation        | Name          | Rows  | Bytes | Cost (%CPU)| Time     | Inst   |IN-OUT|
    |   0 | INSERT STATEMENT |               |       |       |    57 (100)|          |        |      |
    |   1 |  LOAD AS SELECT  |               |       |       |            |          |        |      |
    |   2 |   REMOTE         | distant_tab   |    51 |  3009 |    57   (0)| 00:00:01 | XLCL~  | R->S |
    Remote SQL Information (identified by operation id):
       2 - SELECT /*+ OPAQUE_TRANSFORM */ "DST_ID","NAME_FR","NAME_NL","DST_UIC_CODE","DST_VOI
           C_CODE","BUR_UIC_CODE","BUR_VOIC_CODE","INFO_NEEDED","TRANSFERRED","VALID_FROM_DATE",
        "VALID_TO_DATE","SORTING","SO_NEEDED" FROM "distant_tab" "DST" (accessing'XLCL_XDST.WORLD' )
    Let enable parallel DML and repeat the same insert
    SQL> alter session enable parallel dml;
    Session altered.
    SQL> insert /*+ append parallel(lcl) */ into local_tab lcl select /*+ parralel(dst) */ dst.* from distant_tab dst;
    51 rows created.
    SQL> select * from table(dbms_xplan.display_cursor);
    PLAN_TABLE_OUTPUT
    SQL_ID  1nhmuzb4ayq7x, child number 1
    insert /*+ append parallel(lcl) */ into local_tab lcl select /*+ parralel(dst) */ dst.* from distant_tab dst
    Plan hash value: 2511483212
    | Id  | Operation               | Name          | Rows  | Bytes | Cost (%CPU)| Time     | TQ/Ins |IN-OUT| PQ Distrib |
    |   0 | INSERT STATEMENT        |               |       |       |    57 (100)|          |        |      |            |
    |   1 |  PX COORDINATOR         |               |       |       |            |          |        |      |            |
    |   2 |   PX SEND QC (RANDOM)   | :TQ10001      |    51 |  3009 |    57   (0)| 00:00:01 |  Q1,01 | P->S | QC (RAND)  |
    |   3 |    LOAD AS SELECT       |               |       |       |            |          |  Q1,01 | PCWP |            |
    |   4 |     PX RECEIVE          |               |    51 |  3009 |    57   (0)| 00:00:01 |  Q1,01 | PCWP |            |
    |   5 |      PX SEND ROUND-ROBIN| :TQ10000      |    51 |  3009 |    57   (0)| 00:00:01 |        | S->P | RND-ROBIN  |
    |   6 |       REMOTE            | distant_tab   |    51 |  3009 |    57   (0)| 00:00:01 | XLCL~  | R->S |            |
    Remote SQL Information (identified by operation id):
       6 - SELECT /*+ OPAQUE_TRANSFORM */ "DST_ID","NAME_FR","NAME_NL","DST_UIC_CODE","DST_VOIC_CODE","BUR_UIC_COD
           E","BUR_VOIC_CODE","INFO_NEEDED","TRANSFERRED","VALID_FROM_DATE","VALID_TO_DATE","SORTING","SO_NEEDED"
           FROM "distant_tab" "DST" (accessing 'XLCL_XDST.WORLD' )
    SQL> select * from local_tab;
    select * from local_tab
    ERROR at line 1:
    ORA-12838: cannot read/modify an object after modifying it in parallel
    SQL> select
      2      dfo_number,
      3      tq_id,
      4      server_type,
      5      process,
      6      num_rows,
      7      bytes,
      8      waits,
      9      timeouts,
    10      avg_latency,
    11      instance
    12  from
    13      v$pq_tqstat
    14  order by
    15      dfo_number,
    16      tq_id,
    17      server_type desc,
    18      process
    19  ;
    DFO_NUMBER      TQ_ID SERVER_TYP PROCES   NUM_ROWS      BYTES      WAITS   TIMEOUTS AVG_LATENCY   INSTANCE
             1          0 Producer   QC             51       4451          0          0           0          1
             1          1 Consumer   QC              1        683         14          6           0          1
    This time parallel DML has been used
    What If I create a trigger on the local_tab table and repeat the insert?
    SQL> create or replace trigger local_tab_trg
      2  before insert on local_tab
      3  for each row
      4  begin
      5   null;
      6  end;
      7  /
    Trigger created.
    SQL> insert /*+ append parallel(lcl) */ into local_tab lcl select /*+ parralel(dst) */ dst.* from distant_tab dst;
    51 rows created.
    SQL> select * from table(dbms_xplan.display_cursor);
    PLAN_TABLE_OUTPUT
    SQL_ID  1nhmuzb4ayq7x, child number 1
    insert /*+ append parallel(lcl) */ into local_tab lcl select /*+
    parralel(dst) */ dst.* from distant_tab dst
    Plan hash value: 1788691278
    | Id  | Operation                | Name          | Rows  | Bytes | Cost (%CPU)| Time     | Inst   |IN-OUT|
    |   0 | INSERT STATEMENT         |               |       |       |    57 (100)|          |        |      |
    |   1 |  LOAD TABLE CONVENTIONAL |               |       |       |            |          |        |      |
    |   2 |   REMOTE                 | distant_tab |    51 |  3009 |    57   (0)| 00:00:01 | XLCL~ | R->S |
    Remote SQL Information (identified by operation id):
       2 - SELECT /*+ OPAQUE_TRANSFORM */ "DST_ID","NAME_FR","NAME_NL","DST_UIC_CODE","DST_VOIC_CODE",
           "BUR_UIC_CODE","BUR_VOIC_CODE","INFO_NEEDED","TRANSFERRED","VALID_FROM_DATE","VALID_TO_DATE","S
           ORTING","SO_NEEDED" FROM "distant_tab" "DST" (accessing 'XLCL_XDST.WORLD' )
    Parallel run has been disabled by the existence of this trigger in both distant and local database
    SQL> drop trigger local_tab_trg;
    Trigger dropped.
    Now I want to test an insert using only the append hint as shown below
    SQL> insert /*+ append */ into local_tab lcl select /*+ parralel(dst) */ dst.* from distant_tab dst;
    51 rows created.
    SQL> select * from table(dbms_xplan.display_cursor);
    PLAN_TABLE_OUTPUT
    SQL_ID  4pkxbmy8410s9, child number 0
    insert /*+ append */ into local_tab lcl select /*+ parralel(dst) */
    dst.* from distant_tab dst
    Plan hash value: 2098243032
    | Id  | Operation        | Name          | Rows  | Bytes | Cost (%CPU)| Time     | Inst   |IN-OUT|
    |   0 | INSERT STATEMENT |               |       |       |    57 (100)|          |        |      |
    |   1 |  LOAD AS SELECT  |               |       |       |            |          |        |      |
    |   2 |   REMOTE         | distant_tab |    51 |  3009 |    57   (0)| 00:00:01 | XLCL~    | R->S |
    Remote SQL Information (identified by operation id):
       2 - SELECT /*+ OPAQUE_TRANSFORM */ "DST_ID","NAME_FR","NAME_NL","DST_UIC_CODE","DST_VOI
           C_CODE","BUR_UIC_CODE","BUR_VOIC_CODE","INFO_NEEDED","TRANSFERRED","VALID_FROM_DATE","V
           ALID_TO_DATE","SORTING","SO_NEEDED" FROM "distant_tab" "DST" (accessing
           'XLCL_XDST.WORLD' )
    SQL> select * from local_tab;
    select * from local_tab
    ERROR at line 1:
    ORA-12838: cannot read/modify an object after modifying it in parallel
    Question 1 : What does this last ORA-128838 means if the execution plan is not showing a parallel DML insert?
    Particularly when I repeat the same insert using a parallel hint without the append hint
    SQL> insert /*+ parallel(lcl) */ into local_tab lcl select /*+ parralel(dst) */ dst.* from distant_tab dst;
    51 rows created.
    SQL> select * from table(dbms_xplan.display_cursor);
    PLAN_TABLE_OUTPUT
    SQL_ID  40uqkc82n1mqn, child number 0
    insert /*+ parallel(lcl) */ into local_tab lcl select /*+ parralel(dst)
    */ dst.* from distant_tab dst
    Plan hash value: 2511483212
    | Id  | Operation               | Name          | Rows  | Bytes | Cost (%CPU)| Time     | TQ/Ins |IN-OUT| PQ Distrib |
    |   0 | INSERT STATEMENT        |               |       |       |    57 (100)|          |        |      |            |
    |   1 |  PX COORDINATOR         |               |       |       |            |          |        |      |            |
    |   2 |   PX SEND QC (RANDOM)   | :TQ10001      |    51 |  3009 |    57   (0)| 00:00:01 |  Q1,01 | P->S | QC (RAND)  |
    |   3 |    LOAD AS SELECT       |               |       |       |            |          |  Q1,01 | PCWP |            |
    |   4 |     PX RECEIVE          |               |    51 |  3009 |    57   (0)| 00:00:01 |  Q1,01 | PCWP |            |
    |   5 |      PX SEND ROUND-ROBIN| :TQ10000      |    51 |  3009 |    57   (0)| 00:00:01 |        | S->P | RND-ROBIN  |
    |   6 |       REMOTE            | distant_tab   |    51 |  3009 |    57   (0)| 00:00:01 | A1124~ | R->S |            |
    Remote SQL Information (identified by operation id):
       6 - SELECT /*+ OPAQUE_TRANSFORM */ "DST_ID","NAME_FR","NAME_NL","DST_UIC_CODE","DST_VOI
           C_CODE","BUR_UIC_CODE","BUR_VOIC_CODE","INFO_NEEDED","TRANSFERRED","VALID_FROM_DATE","V
           ALID_TO_DATE","SORTING","SO_NEEDED" FROM "distant_tab" "DST" (accessing'XLCL_XDST.WORLD' )
    SQL> select * from local_tab;
    select * from local_tab
    ERROR at line 1:
    ORA-12838: cannot read/modify an object after modifying it in parallel
    "in that particular case the REMOTE data was joined to some local data and there was an additional BUFFER SORT operation in the execution plan, which (in most cases) shows up when a serial to parallel distribution (S->P) is involved in an operation with further re-distribution of data, and the BUFFER SORT had to buffer all the data from remote before the local operation could continue - defeating any advantage of speeding up the local write operation by parallel DML. A serial direct path insert was actually faster in that particular case."
    Question 2 : Isn’t this a normal behavior of distributed DML where the driving site is always the site where the DML operation is done? And this is why the BUFFER SORT had to buffer all the data from remote to the driving site (local site here)?
    http://jonathanlewis.wordpress.com/2008/12/05/distributed-dml/
    Best regards
    Mohamed Houri

  • Can I use parallel and multiplexed mode?

    Hi,
    I have
    a NI USB-6259 DAQ Module (Two Connectors with to Cables to two SCXI-1349, which connects the DAQ to the Chassis)
    a SCXI-1001 Chassis
    3 SCXI-1143 8 Channel Low Pass Filter Modules
    and
    a SCXI-1180 Front End Plate
    As the DAQ has 16 diff. AI Channels, I would like to drive two SCXI 1143 in multiplexed mode(connected to Connector 0 at USB-DAQ via SCXI 1349) and one in parallel mode assigned to AI 8-15 (Connected to Connector 1 at USB-DAQ via SCXI 1349) .
    The configuration is approved by MAX
    But when I run it with the software I get an error saying that a simultaneous scan is possible Error -223835. And that the selected channel is not in the task Error: -200486.
    Can one DAQ device(like NI USB-6259) be assigned with Channels 0-7 in multiplexed mode (multiplexing two SCXI 1143 8 Channel) and the rest of the channels in parallel mode for on SCXI card? NI-USB 6259 has to separate connectors but is it still seen as one DAQ card?
    What does the error say? I thought I configured for a simultaneous scan.
    Attached to this post is a picture:
    Top Left: Back view of my NI USB-6259
    Top Right: Front view of my chassis with three SCXI 1143
    Bottom: Back view of my chassis. Two SCXI 1249 are connected to two Cards. One card should be run in parallel mode, two in multiplexed mode.
    Cheers,
    Alex
    Solved!
    Go to Solution.

    @ Lorenz-Mie
    you are right that I need a new DAQ device, but as stated in the M-Series manual on page A-108:
    "Use Connector 0 of  your M Series device to control SCXI. NI-DAQ 7.4
    and later supports SCXI in parallel mode on Connector 1."
    Thats what I've done. I'll keep on trying.
    Alex

  • Insert query using fn-bea:execute-sql() function

    Hi ,
    How to use sql insert query in Xquery function fn-bea:execute-sql().
    Could you please anyone help me on this.
    Regards
    Rajesh.

    Hi
    Can i use stored procedure in that function to include insert query?
    could you please suggest me on this.
    Please provide some links or tutorial on that.
    Regards
    Rajesh

  • How to retrieve multiple columns using "returning" in the Insert query.

    hi,
    wanted to know how to retrieve multiple columns using "returning" in the Insert Query.
    For retrieving one column we write the query as follows:
    Insert into TABLE values(1,2,3,4) returning COLUMN1 into PARAMETER
    But can we retrive multiple columns in the same query?
    am using oracle 10g and coding in .NET

    Hi,
    You can definetely get multiple values from a single query using the 'returning' clause.
    Eg : insert into emp (empno, ename, job, deptno) values (7324,'ADAM','MARKETING',30) returning ename, deptno into var1, var2; PN : var1 & var2 to be declared as varchar2 & number respectively.
    More insight into the 'RETURNING' clause in this link.
    http://www.samoratech.com/PLSQL/swArtPLSQLReturn.htm
    Regards,
    Bhanu.

  • Using SCXI-1520 in Parallel Mode.

    Hi all,
    I am using SCXI-1000 chassis and PCI-1024E DAQ card.
    I want to use my SCXI-1520 in Parallel mode.
    Is there any other way to configure my 1520 in parallel mode other than directly connecting to DAQ board using SCXI-1180 feed through panel and SCXi-1302?
    Some of my friends are telling that there are some Patch files, through which we can use the scxi-1520 in parallel mode. Is it true? If it is true please give me how use the Patch files( or alternative solutions).
    Thanq
    Regards
    Preetam

    Preetam,
    As explained in the SCXI-1520 user manual, Traditional NI-DAQ does not support true parallel mode operation of the SCXI-1520. However, NI-DAQmx does. I would recommend installing NI-DAQ 7.2, which includes the latest version of both Traditional NI-DAQ and NI-DAQmx. Then you can use the NI-DAQmx driver to control your SCXI-1520 in parallel mode. To configure the SCXI-1520 in parallel mode with NI-DAQmx, simply select the Parallel Mode check box when setting up your chassis and modules in MAX. I hope this information helps.
    SCXI-1520 User Manual
    NI-DAQ 7.2 Download

  • Use DAQ in Parallel Mode

    Is there any issues using a DAC card (M-Series) in TestStand in Parallel Mode?  I would like to have 4 instances running in parallel all using ine DAC card.  Of course, each instance would be using separate channels.  How would you create the reference to the DAC card?  I assumed that one insides could open the DACCA card but could be a race conditon.
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison

    The M series cards (if I remember correctly) only have one clock for input and one for output.  This means that you can only do one operation at a time on the device, even if it has multiple channels.  If you are doing a true parallel test (rather than a batch test), I would recommend using a Lock in TestStand on the card so that only one UUT tries to access the device at a time.  If you are using Batch, you can use the same setup, or have a "worker" thread that does the DAQ operations and then sends the data to each thread using a Notifier.  Depending on how long you are using the card, this may be more trouble than just doing it independently and using locks.
    Allen P.
    NI

  • Can i insert doc/pdf/excel file to table using the INSERT query ?

    Hi,
    can i insert doc or pdf file to table by using INSERT query like we can insert char/numeric values by using INSERT query. But how how can i pass my word file that is placed at some location of my file system ?Is this possible ?

    EdStevens wrote:
    user12222356 wrote:
    Hi,
    can i insert doc or pdf file to table by using INSERT query like we can insert char/numeric values by using INSERT query. But how how can i pass my word file that is placed at some location of my file system ?Is this possible ?I've never worked with blobs, so don't know if this is the best way or not, but at least it is a starting point.
    (Hint: It was the first hit that came up when I googled "how to insert blob into oracle table")
    http://arjudba.blogspot.com/2008/06/how-to-insert-blob-dataimage-video-into.html
    Did not understood this very first statement:
    1)Create Directory Where BLOB resides.
    create or replace directory temp as '/oradata2';what is its purpose?

  • Need Sample Code in C#  to Insert,Update,Query data using W 2.0 wsdl

    Hi,
    Can anyone please share sample code in C# to Insert,Update,Query data using W 2.0 wsdl.
    Thanks in advance

    I have found solution.
    Need add following line for non string data type.
    objOutreachUpdateList.Opportunity[0].IndexedNumber0Specified = true;

  • Tools | Insert Query no longer supported with SAPBEX 7.0 ?

    Hi
    With SAPBEX for BW 3.5 we could use Tools | Insert Query ... in individual worksheets and then save this as a workbook. 
    Now for BW 7.0, the SAPBEX does not seem to be able to do this and the end-user must "paint" the query by inserting a navigation area, filter block and results area into the sheet and then bind these objects to an infoprovider.
    My users will struggle with this new method - has the Insert function been removed or is it hiding somewhere ?
    regards
    Ian MacLaren

    Hi,
    it's very borring to re-design a query for each sheet...
    So there is an helpful option :
    1) Open Bex Analyser
    2) Open your query
    3) DIsplay the Navigation pane (thanks to the button filter)
    4) In the navigation pane, right click on a caracteristic that is not display in your analysis grid yet
    5) choose the last option "Drill <name of the caracteristic> Across Sheets"
    6) It will duplicate the query for each value of the caracteristic, in a individual sheet for each value.
    (so... choose a caracteristic with less than 10 values)
    7) now you've got several sheets but no data.
    8) Refresh the workbook
    Now, you've got a workbook with several sheet with the same design.
    You just have to go in conception mode and change the dataprovider of the different object into each sheet.
    N.B : The button chart, filter, information doesn't work for news sheet...
    you will have to develop VBA macro or just use Excel function : Data > Group and Outline > Group... in order to hide and unhide lines and column quickly.
    Hope it's help
    Don't forget point.

  • Jdbc insert query hangs

    We have 2 instances of the same program running in parallel. The application inserts data to a database table. one of the instance just hangs when it is trying to insert a query to database i.e. when executing statement.executeUpdate(). We are using a prepared statement to bind all parameter values. Instance 1 keeps running but instance 2 hangs and goes in a waiting state.
    Is there any suggestions on how can this issue be investigated. I know a possible reason for hanging could be database lock, but I cannot understand, how it can have a database lock for insert query.
    oracle : 9.2.0.7
    java : jre 1.4

    user551224,
    Are you running two separate Threads that both use the same database connection?
    This issue has been discussed previously in this forum.
    Search the forum archives for more details.
    It could also be because of a database lock.
    Are you trying to insert rows into the same table?
    You could try using the FOR UPDATE NOWAIT clause to verify.
    Good Luck,
    Avi.

  • Can I use Parallel execution for Global Temporary table within SP and How

    Dear Gurus,
    I have Global temporary table as below
    Create global temporary table Temp_Emp
    empno number,
    ename varchar2(20),
    deptno number
    ) on commit preserve rows;
    During processing I insert the data into this table and then fire query on Temp_Emp, get the data and pass it to front end.
    The SP as shown below
    Create or replace procedure get_emp_data
    empid in number,
    emp_detail out RefCsr -- Ref cursor
    as
    begin
    -- some code here
    open emp_detail for
    select *
    from Temp_Emp
    where empno = empid;
    end get_emp_data;
    Can use Parallel Query execution on Temp_Emp table and how ?
    i.e. do need to explicitly use parallel construct in query or is it default.
    Because I have many SQL like above (on global temporary tables) within Stored Procedures.
    Can anybody give me any suggestion.
    Thanking in Advance
    Sanjeev

    How come you are populating a temporary table and then opening a cursor on this temporary table for the front end to use?
    Couldn't you presumably just form a query out of the code you use to populate the temporary table? This is the recommended approach in Oracle.

Maybe you are looking for

  • Apple tv connection to computer

    can I use any USB-mini cable on my Apple TV or does it have to be an Apple cable?

  • Logitech mouse thumb button doesn't work with Firefox upgrade

    After upgrading to the latest version of Firefox, my Logitech mouse works, but NOT the thumb button, (which I have configured to be a double click).

  • Completing an album

    I recently bought the newly released single for a new album that was coming out.  I just bought the album but the song that I bought ahead of time still shows as a single; apart from the rest of the album in my music library.  How do I get it to appe

  • System Preferences Do Not Stick

    System Preferences for adding menu icons do not stick. Date & Time/Clock: Show the date and time Displays: Show Displays in menu bar International/Input menu: Show input menu in menu bar (even when there, it didn't actually work) Sound: Show volume i

  • How can I open a .rfc822 file

    When I receive an e-mail with a .rfc822 file as an attachment I can not open it with Firefox. How can I open this type of file?