Parallel table

Hi
What Disadvantages and advantages enable Parallel option in Table ?
If I did it , do I must change My procedures ?
Is This to improve performance ?
Where can I to find examples about ?
Thank you

What Disadvantages and advantages enable Paralleloption in Table ?
The ONLY time I would recommend it is when the vast
majority of queries fo full-table scans against the
table.
Doing "alter table fred parallel 63;" influences the
optimizer to be unfriendly to index access.
When I find a legit large-table full-scan, I use the
PARALLEL hint, on a case-by-case basis . . . When
using parallel query, one should seldom turn on
parallelism at the table level, alter table customer
parallel 35, because the setting of parallelism for a
table influences the optimizer. This causes the
optimizer to see that the full-table scan is
inexpensive. Hence, most Oracle professionals specify
parallel query on a query-by-query basis, combining
the full hint with the parallel hint to ensure a fast
parallel full-table scan.
I have my notes here:
http://www.dba-oracle.com/real_application_clusters_ra
c_grid/parallel_query.htm
HTH . . .
Don Burleson
Oracle Press authorThank you,
But , is It work only with hint wintout enable parallel option alter in table ?
How can I ALTER SESSION FORCE PARALLEL DML inside procedure ?
Message was edited by:
muttleychess

Similar Messages

  • PARALLEL Table  and Parallel Server (RAC)

    I have the following in parameter for CPU in my oracle 10g server without RAC
    SQL> show parameter cpu
    NAME TYPE VALUE
    cpu_count integer 24
    parallel_threads_per_cpu integer 4
    SQL>
    Do I need to enable any other Oracle parameters for using parallel options in create table scripts?. This is to increase the DML performance in tables where more than 100+ processes is INSERTING /SELECTING Data.
    I have parallel server parameters as shown below ?
    parallel_automatic_tuning boolean FALSE
    parallel_execution_message_size integer 2152
    parallel_max_servers integer 480
    parallel_min_percent integer 0
    parallel_min_servers integer 0
    parallel_server boolean FALSE
    parallel_threads_per_cpu integer 2
    Thanks in advance

    prajithparan wrote:
    I have the following in parameter for CPU in my oracle 10g server without RAC
    SQL> show parameter cpu
    NAME TYPE VALUE
    cpu_count integer 24
    parallel_threads_per_cpu integer 4
    SQL> Using these settings you're going to get a default parallel degree of 4 * 24, which is 96. Since some SQL statements can have two streams of parallel execution (e.g. a group by operation) you might end up with up to 192 parallel slaves for a single SQL statement. Given the "parallel_max_servers" setting of 480 this means you can't execute more than 5 statements in best case, 2 statements in worst case simultaneously using parallel execution without a parallel degradation.
    That can be fine but it's something you should consider depending on your requirements. You might want to define a non-default explicit lower parallel degree for some of your "smaller" large tables.
    Do I need to enable any other Oracle parameters for using parallel options in create table scripts?. This is to increase the DML performance in tables where more than 100+ processes is INSERTING /SELECTING Data.Not sure what you want to say with this? Do you have more than 100 separate processes that are inserting/selecting data simultaneously? This has nothing to do with the "parallel" execution option which is about parallelizing the execution of a single SQL statement.
    I have parallel server parameters as shown below ?
    parallel_automatic_tuning boolean FALSE
    parallel_execution_message_size integer 2152
    parallel_max_servers integer 480
    parallel_min_percent integer 0
    parallel_min_servers integer 0
    parallel_server boolean FALSE
    parallel_threads_per_cpu integer 2 What do you mean by this? "Parallel Server" basically means "RAC", but you say you don't use RAC currently. The "parallel_threads_per_cpu" setting of "2" contradicts your above output of "4" shown, so I'm not sure what you intend to say with this.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Oracle Tunning in 10g on table parallelism

    Hi,
    I am working in 10g database(10.2.0.1). I have insert statement which uses table A(120 M rows), B(0.5M rows) and C (0.2M rows) to insert on table D.
    Following are the table definitions:
    Table A - Is partitioned, has unique indexe and is declared NOPARALLEL DEGREE.
    Table B - Has unique indexe and is declared NOPARALLEL DEGREE.
    Table C - Has unique indexe and is declared NOPARALLEL DEGREE.
    Table D - Has declared NOPARALLEL DEGREE.
    a) When using the insert on table D using tables A,B and C using HINT /*+ APPEND PARALLEL(table name 12) / and also given on Inset table with /+ APPEND PARALLEL(table name 12). For most of the time it shows 17 to 21 sessions.
    INSERT INTO /*+ APPEND PARALLEL(d 12)*/ D d
    (x,y,z)
    SELECT /*+ PARALLEL(A 12) PARALLEL(B 12) PARALLEL(C 12)*/
    bla. bla...bla...
    with few joins on the respective tables
    b) Same query without any changes at table level definition and no query changes. Some time it shows only one session. At that particular time we (user) has to intervene and alter table definition from NOPARALLEL to PARALLEL (DEGREE DEFAULT) on target table D.
    My questions are:
    i) What could be reason that it varies and displays no of sessions are running ?
    ii) How oracle takes and uses no of sessions while executing the query?
    iii) Is there any where we can see or monitor the session tracking ?
    iv) How many max sessions can a query like above insert can take/use for the user schema?
    v) Is it possible for the developers to reduce and increase the sessions while executing the query ?
    vi) On what basis the sessions get increase or decrease?
    If any of them can provide answers to above query it will be helpful...
    Regards,
    Prakash C

    The following link might help u a bit in understanding parallelism concept for queries -
    http://docs.oracle.com/cd/B19306_01/server.102/b14223/usingpe.htm

  • 10g: parallel pipelined table func. using table(cast(SQL collect.))?

    Hi,
    i try to distribute SQL data objects - stored in a SQL data type TABLE OF <object-Type> - to multiple (parallel) instances of a table function,
    by passing a CURSOR(...) to the table function, which selects from the SQL TABLE OF storage via "select * from TABLE(CAST(<storage> as <storage-type>)".
    But oracle always only uses a single table function instance :-(
    whatever hints i provide or setting i use for the parallel table function (parallel_enable ...)
    Could it be, that this is due to the fact, that my data are not
    globally available, but only in the main thread data?
    Can someone confirm, that it's not possible to start multiple parallel table functions
    for selecting on SQL data type TABLE OF <object>storages?
    Here's an example sqlplus program to show the issue:
    -------------------- snip ---------------------------------------------
    set serveroutput on;
    drop table test_table;
    drop type ton_t;
    drop type test_list;
    drop type test_obj;
    create table test_table
         a number(19,0),
         b timestamp with time zone,
         c varchar2(256)
    create or replace type test_obj as object(
         a number(19,0),
         b timestamp with time zone,
         c varchar2(256)
    create or replace type test_list as table of test_obj;
    create or replace type ton_t as table of number;
    create or replace package test_pkg
    as
         type test_rec is record (
              a number(19,0),
              b timestamp with time zone,
              c varchar2(256)
         type test_tab is table of test_rec;
         type test_cur is ref cursor return test_rec;
         function TF(mycur test_cur)
    return test_list pipelined
    parallel_enable(partition mycur by hash(a));
    end;
    create or replace package body test_pkg
    as
         function TF(mycur test_cur)
    return test_list pipelined
    parallel_enable(partition mycur by hash(a))
    is
              sid number;
              counter number(19,0) := 0;
              myrec test_rec;
              mytab test_tab;
              mytab2 test_list := test_list();
         begin
              select userenv('SID') into sid from dual;
              dbms_output.put_line('test_pkg.TF( sid => '''|| sid || ''' ): enter');
              loop
                   fetch mycur into myRec;
                   exit when mycur%NOTFOUND;
                   mytab2.extend;
                   mytab2(mytab2.last) := test_obj(myRec.a, myRec.b, myRec.c);
              end loop;
              for i in mytab2.first..mytab2.last loop
                   -- attention: saves own SID in test_obj.a for indication to caller
                   --     how many sids have been involved
                   pipe row(test_obj(sid, mytab2(i).b, mytab2(i).c));
                   counter := counter + 1;
              end loop;
              dbms_output.put_line('test_pkg.TF( sid => '''|| sid || ''' ): exit, piped #' || counter || ' records');
         end;
    end;
    declare
         myList test_list := test_list();
         myList2 test_list := test_list();
         sids ton_t := ton_t();
    begin
         for i in 1..10000 loop
              myList.extend; myList(myList.last) := test_obj(i, sysdate, to_char(i+2));
         end loop;
         -- save into the real table
         insert into test_table select * from table(cast (myList as test_list));
         dbms_output.put_line(chr(10) || 'copy ''mylist'' to ''mylist2'' by streaming via table function...');
         select test_obj(a, b, c) bulk collect into myList2
         from table(test_pkg.TF(CURSOR(select /*+ parallel(tab,10) */ * from table(cast (myList as test_list)) tab)));
         dbms_output.put_line('... saved #' || myList2.count || ' records');
         select distinct(tab.a) bulk collect into sids from table(cast (myList2 as test_list)) tab;
         dbms_output.put_line('worker thread''s sid list:');
         for i in sids.first..sids.last loop
              dbms_output.put_line('sid #' || sids(i));
         end loop;
         dbms_output.put_line(chr(10) || 'copy physical ''test_table'' to ''mylist2'' by streaming via table function:');
         select test_obj(a, b, c) bulk collect into myList2
         from table(test_pkg.TF(CURSOR(select /*+ parallel(tab,10) */ * from test_table tab)));
         dbms_output.put_line('... saved #' || myList2.count || ' records');
         select distinct(tab.a) bulk collect into sids from table(cast (myList2 as test_list)) tab;
         dbms_output.put_line('worker thread''s sid list:');
         for i in sids.first..sids.last loop
              dbms_output.put_line('sid #' || sids(i));
         end loop;
    end;
    -------------------- snap ---------------------------------------------
    Here's the output:
    -------------------- snip ---------------------------------------------
    copy 'mylist' to 'mylist2' by streaming via table function...
    test_pkg.TF( sid => '98' ): enter
    test_pkg.TF( sid => '98' ): exit, piped #10000 records
    ... saved #10000 records
    worker thread's sid list:
    sid #98 -- ONLY A SINGLE SID HERE!
    copy physical 'test_table' to 'mylist2' by streaming via table function:
    ... saved #10000 records
    worker thread's sid list:
    sid #128 -- A LIST OF SIDS HERE!
    sid #141
    sid #85
    sid #125
    sid #254
    sid #101
    sid #124
    sid #109
    sid #142
    sid #92
    PL/SQL procedure successfully completed.
    -------------------- snap ---------------------------------------------
    I posted it to newsgroup comp.databases.oracle.server.
    (summary: "10g: parallel pipelined table functions with cursor selecting from table(cast(SQL collection)) doesn't work ")
    But i didn't get a response.
    There i also wrote some background information about my application:
    -------------------- snip ---------------------------------------------
    My application has a #2 steps/stages data selection.
    A 1st select for minimal context base data
    - mainly to evaluate for due driving data records.
    And a 2nd select for all the "real" data to process a context
    (joining much more other tables here, which i don't want to do for non-due records).
    So it's doing stage #1 select first, then stage #2 select - based on stage #1 results - next.
    The first implementation of the application did the stage #1 select in the main session of the pl/sql code.
    And for the stage #2 select there was done a dispatch to multiple parallel table functions (in multiple worker sessions) for the "real work".
    That worked.
    However there was a flaw:
    Between records from stage #1 selection and records from stage #2 selection there is a 1:n relation (via key / foreign key relation).
    Means, for #1 resulting record from stage #1 selection, there are #x records from stage #2 selection.
    That forced me to use "cluster curStage2 by (theKey)".
    Because the worker sessions need to evaluate the all-over status for a context of #1 record from stage #1 and #x records from stage #2
    (so it needs to have #x records of stage #2 together).
    This then resulted in delay for starting up the worker sessions (i didn't find a way to get rid of this).
    So i wanted to shift the invocation of the worker sessions to the stage #1 selection.
    Then i don't need the "cluster curStage2 by (theKey)" anymore!
    But: i also need to do an update of the primary driving data!
    So the stage #1 select is a 'select ... for update ...'.
    But you can't use such in CURSOR for table functions (which i can understand, why it's not possible).
    So i have to do my stage #1 selection in two steps:
    1. 'select for update' by main session and collect result in SQL collection.
    2. pass collected data to parallel table functions
    And for 2. i recognized, that it doesn't start up multiple parallel table function instances.
    As a work-around
    - if it's just not possible to start multiple parallel pipelined table functions for dispatching from 'select * from TABLE(CAST(... as ...))' -
    i need to select again on the base tables - driven by the SQL collection data.
    But before i do so, i wanted to verify, if it's really not possible.
    Maybe i just miss a special oracle hint or whatever you can get "out of another box" :-)
    -------------------- snap ---------------------------------------------
    - many thanks!
    rgds,
    Frank

    Hi,
    i try to distribute SQL data objects - stored in a SQL data type TABLE OF <object-Type> - to multiple (parallel) instances of a table function,
    by passing a CURSOR(...) to the table function, which selects from the SQL TABLE OF storage via "select * from TABLE(CAST(<storage> as <storage-type>)".
    But oracle always only uses a single table function instance :-(
    whatever hints i provide or setting i use for the parallel table function (parallel_enable ...)
    Could it be, that this is due to the fact, that my data are not
    globally available, but only in the main thread data?
    Can someone confirm, that it's not possible to start multiple parallel table functions
    for selecting on SQL data type TABLE OF <object>storages?
    Here's an example sqlplus program to show the issue:
    -------------------- snip ---------------------------------------------
    set serveroutput on;
    drop table test_table;
    drop type ton_t;
    drop type test_list;
    drop type test_obj;
    create table test_table
         a number(19,0),
         b timestamp with time zone,
         c varchar2(256)
    create or replace type test_obj as object(
         a number(19,0),
         b timestamp with time zone,
         c varchar2(256)
    create or replace type test_list as table of test_obj;
    create or replace type ton_t as table of number;
    create or replace package test_pkg
    as
         type test_rec is record (
              a number(19,0),
              b timestamp with time zone,
              c varchar2(256)
         type test_tab is table of test_rec;
         type test_cur is ref cursor return test_rec;
         function TF(mycur test_cur)
    return test_list pipelined
    parallel_enable(partition mycur by hash(a));
    end;
    create or replace package body test_pkg
    as
         function TF(mycur test_cur)
    return test_list pipelined
    parallel_enable(partition mycur by hash(a))
    is
              sid number;
              counter number(19,0) := 0;
              myrec test_rec;
              mytab test_tab;
              mytab2 test_list := test_list();
         begin
              select userenv('SID') into sid from dual;
              dbms_output.put_line('test_pkg.TF( sid => '''|| sid || ''' ): enter');
              loop
                   fetch mycur into myRec;
                   exit when mycur%NOTFOUND;
                   mytab2.extend;
                   mytab2(mytab2.last) := test_obj(myRec.a, myRec.b, myRec.c);
              end loop;
              for i in mytab2.first..mytab2.last loop
                   -- attention: saves own SID in test_obj.a for indication to caller
                   --     how many sids have been involved
                   pipe row(test_obj(sid, mytab2(i).b, mytab2(i).c));
                   counter := counter + 1;
              end loop;
              dbms_output.put_line('test_pkg.TF( sid => '''|| sid || ''' ): exit, piped #' || counter || ' records');
         end;
    end;
    declare
         myList test_list := test_list();
         myList2 test_list := test_list();
         sids ton_t := ton_t();
    begin
         for i in 1..10000 loop
              myList.extend; myList(myList.last) := test_obj(i, sysdate, to_char(i+2));
         end loop;
         -- save into the real table
         insert into test_table select * from table(cast (myList as test_list));
         dbms_output.put_line(chr(10) || 'copy ''mylist'' to ''mylist2'' by streaming via table function...');
         select test_obj(a, b, c) bulk collect into myList2
         from table(test_pkg.TF(CURSOR(select /*+ parallel(tab,10) */ * from table(cast (myList as test_list)) tab)));
         dbms_output.put_line('... saved #' || myList2.count || ' records');
         select distinct(tab.a) bulk collect into sids from table(cast (myList2 as test_list)) tab;
         dbms_output.put_line('worker thread''s sid list:');
         for i in sids.first..sids.last loop
              dbms_output.put_line('sid #' || sids(i));
         end loop;
         dbms_output.put_line(chr(10) || 'copy physical ''test_table'' to ''mylist2'' by streaming via table function:');
         select test_obj(a, b, c) bulk collect into myList2
         from table(test_pkg.TF(CURSOR(select /*+ parallel(tab,10) */ * from test_table tab)));
         dbms_output.put_line('... saved #' || myList2.count || ' records');
         select distinct(tab.a) bulk collect into sids from table(cast (myList2 as test_list)) tab;
         dbms_output.put_line('worker thread''s sid list:');
         for i in sids.first..sids.last loop
              dbms_output.put_line('sid #' || sids(i));
         end loop;
    end;
    -------------------- snap ---------------------------------------------
    Here's the output:
    -------------------- snip ---------------------------------------------
    copy 'mylist' to 'mylist2' by streaming via table function...
    test_pkg.TF( sid => '98' ): enter
    test_pkg.TF( sid => '98' ): exit, piped #10000 records
    ... saved #10000 records
    worker thread's sid list:
    sid #98 -- ONLY A SINGLE SID HERE!
    copy physical 'test_table' to 'mylist2' by streaming via table function:
    ... saved #10000 records
    worker thread's sid list:
    sid #128 -- A LIST OF SIDS HERE!
    sid #141
    sid #85
    sid #125
    sid #254
    sid #101
    sid #124
    sid #109
    sid #142
    sid #92
    PL/SQL procedure successfully completed.
    -------------------- snap ---------------------------------------------
    I posted it to newsgroup comp.databases.oracle.server.
    (summary: "10g: parallel pipelined table functions with cursor selecting from table(cast(SQL collection)) doesn't work ")
    But i didn't get a response.
    There i also wrote some background information about my application:
    -------------------- snip ---------------------------------------------
    My application has a #2 steps/stages data selection.
    A 1st select for minimal context base data
    - mainly to evaluate for due driving data records.
    And a 2nd select for all the "real" data to process a context
    (joining much more other tables here, which i don't want to do for non-due records).
    So it's doing stage #1 select first, then stage #2 select - based on stage #1 results - next.
    The first implementation of the application did the stage #1 select in the main session of the pl/sql code.
    And for the stage #2 select there was done a dispatch to multiple parallel table functions (in multiple worker sessions) for the "real work".
    That worked.
    However there was a flaw:
    Between records from stage #1 selection and records from stage #2 selection there is a 1:n relation (via key / foreign key relation).
    Means, for #1 resulting record from stage #1 selection, there are #x records from stage #2 selection.
    That forced me to use "cluster curStage2 by (theKey)".
    Because the worker sessions need to evaluate the all-over status for a context of #1 record from stage #1 and #x records from stage #2
    (so it needs to have #x records of stage #2 together).
    This then resulted in delay for starting up the worker sessions (i didn't find a way to get rid of this).
    So i wanted to shift the invocation of the worker sessions to the stage #1 selection.
    Then i don't need the "cluster curStage2 by (theKey)" anymore!
    But: i also need to do an update of the primary driving data!
    So the stage #1 select is a 'select ... for update ...'.
    But you can't use such in CURSOR for table functions (which i can understand, why it's not possible).
    So i have to do my stage #1 selection in two steps:
    1. 'select for update' by main session and collect result in SQL collection.
    2. pass collected data to parallel table functions
    And for 2. i recognized, that it doesn't start up multiple parallel table function instances.
    As a work-around
    - if it's just not possible to start multiple parallel pipelined table functions for dispatching from 'select * from TABLE(CAST(... as ...))' -
    i need to select again on the base tables - driven by the SQL collection data.
    But before i do so, i wanted to verify, if it's really not possible.
    Maybe i just miss a special oracle hint or whatever you can get "out of another box" :-)
    -------------------- snap ---------------------------------------------
    - many thanks!
    rgds,
    Frank

  • How to select a new table in logical database after creating the Infoset

    I have created a abap query report ,i have used logical data base ADA in the infoset in SQ02.In the logical database i had selected only two tables then ANALV and ANLB.Now my client wants one more field to be added and thats is from table ANEK.Now i need to select this table in logical database ADA.
    Please assist on how to select another table available in the Logicaldata base now which i didnt select when i created the query

    Markus,
    I have now selected the additional field Posting date in Document ANEK -BUDAT .Earlier the report had the fields from ANLCV - Current acquisition value ,ordinary dep posted selected for  the output.
    When i run the query after adding this new field ANEK-BUDAT the below warning  is generated  by system :
    The query specifications cannot be used to generate a list,
    i.e. the query will probably not return the list you desire.
    If you still want to execute the query, please use the
    "Generate" function
    -> 'Generate'
    Fields from parallel tables within a line*
    Line: 01
    Field: Posting Date in the Document
    (ANEK-BUDAT, table ANEK)
    Field: Ordinary depreciation posted
    (ANLCV-NAFA GEB, table ANLCV)
    Fields from parallel tables within a line*
    Line: 01
    Field: Posting Date in the Document
    (ANEK-BUDAT, table ANEK)
    Field: Current asset acquisition value
    (ANLCV-LFD KANSW, table ANLCV)
    2 warnings for query QUERY ***
    Please advice .How get this new field added.

  • Optimizer chooses slow parallel plan in Oracle 9.2

    We have an application that we are migrating from Oracle8 (8.1.7) to Oracle9 (9.2.0). We've changed from DMTs to LMTs too. We've come across a performance issue when running a application benchmark that we've isolated down to a simple 1 row look up query in a rather small table, initially 8 rows growing to several thousand. The table is 2 columns, an int ID value and a VARCHAR2(254) column. There is a unique index on the name column. The prepared query is of the form:
    select id from table_name where name = <bind_variable>;
    In Oracle8 the CBO chooses a serial plan of unique index lookup followed by table access by rowid to get the result from the table row. Oracle9 chooses a parallel table scan of degree default (effective degree 4) for the same query even when the table only has 8 rows.
    Over thousands of executions the Oracle8 query average 2-3 msec each. However, the exactly the same data and same sequence of queries the Oracle9 query averages 150 msec each. Clearly the cost of setup and tear down of executing a parallel query here is too expensive.
    My question is why is the Oracle9 optimizer making such a different, and in my opinion poorer, choice of query plan than the Oracle8 optimizer?
    I should note the optimizer stats are the same and result from exactly the same DBMS_STATS.GATHER_TABLE_STATS calls and Oracle9 is behaving exactly the same with the OPTIMIZER_FEATURES_ENABLE set to 9.2.0 and 8.1.7.

    Gabriele,
    As indicated in the original post - the following work-around might work for you for bug 9743250. What this does is essentially force the optimizer to ALWAYS use the spatial index. That is usually good - unless the query is actually more efficient not using the index, such as when it is much cheaper to just to a FTS. Anyhow this is what you can do from 11.2.0.1 to 11.2.0.3 - fixed in 11.2.0.4 and 12.1.0.1:
    connect /as sysdba
    alter session set current_schema=MDSYS;
    DISASSOCIATE STATISTICS FROM INDEXTYPES spatial_index FORCE
    DISASSOCIATE STATISTICS FROM PACKAGES sdo_3gl FORCE;
    DISASSOCIATE STATISTICS FROM PACKAGES prvt_idx FORCE;
    Bryan

  • Can't create table - using JDeveloper 11g (11.1.1.3.0)

    I am running a DDL to create a table:
    CREATE TABLE HORSE
    HORSE_NAME VARCHAR2(30) NOT NULL
    , PLACE VARCHAR2(20)
    , RACE_NAME VARCHAR2(30)
    , RACE_DATE DATE
    , CONSTRAINT HORSE_PK PRIMARY KEY
    HORSE_NAME
    ENABLE
    The message I get is:
    Error at Command Line:48 Column:13
    Error report:
    SQL Error: ORA-02264: name already used by an existing constraint
    02264. 00000 - "name already used by an existing constraint"
    *Cause:    The specified constraint name has to be unique.
    *Action:   Specify a unique constraint name for the constraint.
    This suggests to me that I should change the name to something else, like HORSE_ID. Whilst I don't agree that HORSE_NAME is used in another constraint I have changed the name but it doesn't make a scrap of difference.
    There is another parallel table called HORSES (plural) but but other examples ( eg PUNTER/PUNTERS) have been happily created.
    I would be grateful for any suggestions.
    Thanks,
    Jim

    The message is not specifically about the HORSE_NAME - it is more likely about the table name.
    You probably already have another database object called Horse (maybe not a table but it could be a view or a procedure).
    Try a different name for the table.

  • DAC- Indexes in parallel

    How to make DAC run Indexes in parallel ?
    We are on OBI Apps - 7.9.5.

    Go to Setup Physical Data Sources - Parallel Index Creation -Set a value
    If you want parallel Indexes to be created on the same table select the checkbox parallel table Indexes.
    If the script has to be changed to Include paralell then it can be fine inside D:\OracleBI\DAC\CustomSQLs
    customsql.xml file ..changing the syntax for create indexes would include parallelism.
    HTH

  • Function not returning table object correctly

    Instead of returning a table, my function is returning this:
    SCHEMA_OWNER.TBL_SUMS([SCHEMA_OWNER.SUMS_OBJ])
    Does anyone see a syntax error in my function or the ddl of my table and object types?
    This is a stripped down, simplified version of my function:
    create or replace FUNCTION "F_TEST" (p_skey number, p_start_date date, p_end_date date)
    RETURN tbl_sums
    IS
    tmp_A NUMBER;
    tmp_B NUMBER;
    l_tbl tbl_sums := tbl_sums();
    BEGIN
    SELECT SUM(FieldA), SUM(FieldB)
    into tmpA, tmpB
    from myTable where SKEY = p_skey
    and DATE_VALUE >= p_start_date
    and DATE_VALUE < p_end_date;
    l_tbl.extend;
    l_tbl(l_tbl.count()) := sums_obj(p_start_date, p_end_date, p_skey, tmpA, tmpB);
    return l_tbl;
    END;
    My types are:
    create or replace type sums_obj is object (start_date DATE, end_date DATE, skey NUMBER, SumA NUMBER, SumB NUMBER);
    create or replace type tbl_sums is table of sums_obj;
    Thanks!

    >
    RETURN tbl_kpi
    >
    What is 'tbl_kpi'? That isn't defined anywhere. Your original post said this:
    >
    RETURN tbl_sums
    >
    We can't help you if you don't post what you are really using. Cut & Paste is ok but you have to paste the correct code.
    Your funtion is returning a TABLE but it is NOT PIPELINED. So if you query the function from DUAL you will get a DATASET as the result.
    If you query the function AS A TABLE you will get the 'contents' of the table.
    If you make your function a PIPELINED function then you use PIPE ROW to return each row but the function is still declared to return a TABLE. Maybe that is what is confusing you.
    Try the following sample code to see what the difference is.
    Here are two SQL types based on the EMP table in the scott schema.
    -- type to match emp record
    create or replace type emp_scalar_type as object
      (EMPNO NUMBER(4) ,
       ENAME VARCHAR2(10),
       JOB VARCHAR2(9),
       MGR NUMBER(4),
       HIREDATE DATE,
       SAL NUMBER(7, 2),
       COMM NUMBER(7, 2),
       DEPTNO NUMBER(2)
    -- table of emp records
    create or replace type emp_table_type as table of emp_scalar_type
    /Now - here is a function (similar to yours) that returns that EMP_TABLE_TYPE. NOTE: the function IS NOT PIPELINED
    CREATE OR REPLACE function SCOTT.get_emp1( p_deptno in number )
      return emp_table_type
      as
    tb emp_table_type;
    BEGIN
      select emp_scalar_type(empno, ename, job, mgr, hiredate, sal, comm, deptno)
        bulk collect into tb from emp where deptno = p_deptno;
      return tb;
    end;
    /If I just select the function itself from DUAL I get this:
    select get_emp1(20) from dual
    GET_EMP1(20)
    (DATASET)I can use TOAD or sql developer to examine that dataset and see the records.
    But I can actually query the records by using the TABLE function:
    select * from table(get_emp1(20))
    EMPNO     ENAME     JOB     MGR     HIREDATE     SAL     COMM     DEPTNO
    7369     SMITH     CLERK     7902     12/17/1980     800          20
    7566     JONES     MANAGER     7839     4/2/1981     2975          20
    7788     SCOTT     ANALYST     7566     4/19/1987     3000          20
    7876     ADAMS     CLERK     7788     5/23/1987     1100          20
    7902     FORD     ANALYST     7566     12/3/1981     3000          20This is a similar function. It returns the same EMP_TABLE_TYPE but it is a PIPELINED function.
    -- pipelined function
    create or replace function get_emp( p_deptno in number )
      return emp_table_type
      PIPELINED
      as
       TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
        emp_cv EmpCurTyp;
        l_rec  emp%rowtype;
      begin
        open emp_cv for select * from emp where deptno = p_deptno;
        loop
          fetch emp_cv into l_rec;
          exit when (emp_cv%notfound);
          pipe row( emp_scalar_type( l_rec.empno, LOWER(l_rec.ename),
              l_rec.job, l_rec.mgr, l_rec.hiredate, l_rec.sal, l_rec.comm, l_rec.deptno ) );
        end loop;
        return;
      end;
      /The ONLY way I can query this function is by using the TABLE function:
    select * from table(get_emp(20))
    EMPNO     ENAME     JOB     MGR     HIREDATE     SAL     COMM     DEPTNO
    7369     smith     CLERK     7902     12/17/1980     800          20
    7566     jones     MANAGER     7839     4/2/1981     2975          20
    7788     scott     ANALYST     7566     4/19/1987     3000          20
    7876     adams     CLERK     7788     5/23/1987     1100          20
    7902     ford     ANALYST     7566     12/3/1981     3000          20The query of the PIPELINED function is the same and the result set is the same.
    The difference is that the PIPELINED function returns ONE ROW at a time and does NOT need to accumulate a lot of data in a collection before returning it. That collection uses expensive PGA memory and the more data you have the more memory it uses.
    Your function (and my similar one) doesn't return ANY data until it has produced ALL of it. And it uses that expensive PGA memory. What is the point of creating your collection one row at a time and waiting until you have it all before you return it?
    You could easily modify your function and add PIPELINED to the declaration. Then use the PIPE ROW clause to return each row as it is produced. That will eliminate the need for the collection (and memory) within the function.
    You can also then chain the function calls together if you need to.
    See 'Using Pipelined and Parallel Table Functions' in the Data Cartridge Developer's Guide
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28425/pipe_paral_tbl.htm
    There is little use for your function that is not pipelined but returns a table type unless you were storing that table-type in an object column of a table.
    There are many uses for PIPELINED functions.

  • Pulling out two records at a time

    I have a TABLE with multiple records in it, of which i want to pull out two records at a time (as if they were one record), of those records that meet the WHERE criteria. Order is not important. Basically, i have a TABLE of things that wither need processing or have been processed already. I can process two at a time. (In a related search, that i am not up to yet, i can do 20 at a time.) How would i go about doing that?
    My first thought was a CTE with ROW_NUMBER() RN, using CONNECT BY RN = PRIOR RN + 2, and have a sub-query (or joined TABLE) pull out the second record:
    WITH Moo (SELECT ... ROW_NUMBER RN FROM Table WHERE ...)
    SELECT ..., (SELECT ... FROM FROM Moo Moo2 WHERE Moo2.Id = Moo.Id + 1)
    FROM Moo CONNECT BY Id = PRIOR Id + 2;
    Or a join. Is there a better way to approach it?

    Pretty much everything you just said is wrong.
    >
    I generally keep away from CURSORs, as i want the DB to handle the set processing for me, as opposed to a CURSOR which tells the DB how to do it's job.
    >
    If you do any DB queries then you are using cursors. You have the wrong idea about them. All result sets are obtained using a cursor. A cursor does NOT tell a DB how to do a job; that is what the query and execution plan do.
    >
    (And, Tom Kyt's mantra of "You should do it in a single SQL statement if at all possible") But that's just a rule of thumb.
    >
    No - that isn't a rule of thumb. That is exactly what you should do if possible which is what I said. But I also said
    >
    Well the general use is to use SQL instead of PL/SQL but since you already need to use a function you might as well make that function as efficient as possible.
    >
    If you are already using a function then you should get the most bang for the buck from it and make it as efficient as possible.
    >
    If the CURSOR is the most efficient, so be it. But as you point out, if i'm already going to use a CURSOR, i might as well do all the work in the CURSOR LOOP. Why bother switching contexts.
    >
    All queries are done using cursors. It isn't a question of whether they are more efficient; it is the only way possible. I think you are referring to a user creating an explicit cursor and performing explicit manipulation of that cursor. That isn't normally what you want to do.
    A cursor loop is the slowest way to process results especially if all you are doing is row-by-row processing to perform essentially SQL-related work. PL/SQL should be used for the transactional part of the processing. In your case that transactional use is consolidating two records together for specialized processing.
    As for context switches if you perform any PL/SQL you are going to have a context switch: functions, procedures, triggers. The function you already planned to use would have caused a context switch. What I am saying is that if you are going to perform a context switch then you want to maximize the amount of work (transactional work) done in the PL/SQL engine so that you minimize the context switching.
    You still haven't explained exactly why 2 records at a time is any more ideal than 1 or if you could also process 50, 100, or 10000 at a time. Is the limit what needs to be passed somewhere else? What is the reason for a max of two? What exactly are you doing with the data to prepare it before you have to pass it on?
    Bulk collect processing is more efficient, with fewer context switches, if you process 20, 50, or 100 records in the loop at a time.
    See Chap 13 Using Pipelined and parallel Table Functions in the Data Cartridge Dev Guide
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28425/pipe_paral_tbl.htm

  • (V7.3)RDBMS 7.3 Enterprise Edition NEW FEATURE에 대한 Q&A

    제품 : ORACLE SERVER
    작성날짜 : 2004-08-13
    (V7.3)RDBMS 7.3 Enterprise Edition NEW FEATURE에 대한 Q&A
    =========================================================
    1. Q) Oracle 7 Release 7.3의 new feature들을 간단하게 알고 싶습니다.
    A) 다음과 같이 요약하여 설명드리겠습니다.
    New features of 7.3.3 are :Direct load to cluster
    Can use backup from before RESETLOGS
    New features of 7.3 are :histograms
    hash joins
    star join enhancement
    standby databases
    parallel union-all
    dynamic init.ora configuration
    direct path export
    compiled triggers
    fast create index
    multiple LRU latches
    updatable join views
    LSQL cursor variable enhancement
    replication enhancement
    ops processor affinity
    Net 2 load balancing
    XA scaling/recovery
    thread safe pro*c/oci
    DB verify
    new pl/sql packages
    new pl/sql features
    bitmap indexes
    2. Q) Oracle 7 Release 7.2와 7.3의 새로운 Parallel feature에는 어떤 것이
    있습니까?
    A) Oracle 7 parallel query 에 의한 parallel operation에는 다음과 같은 내
    용이 있습니다.
    > Parallel Data Loading : conventional and direct-path, to the same
    table or multiple tables concurrently.
    > Parallel Query : table scans, sorts, joins, aggregates, duplicate
    elimination, UNION and UNION ALL(7.3)
    > Parallel Subqueries : in INSERT, UPDATE, DELETE statements.
    > Parallel Execution : of application code(user-defined SQL functions)
    > Parallel Joins :
    nested loop,
    sort-merge,
    star join optimization(creation of cartesian products plus the
    nested loop join),
    hash joins(7.3).
    > Parallel Anti-Joins : NOT IN(7.3).
    > Parallel Summarization(CREATE TABLE AS SELECT) :
    query and insertion of rows into a rollup table.
    > Parallel Index Creation(CREATE INDEX) :
    table scans, sorts, index fragment construction.
    3. Q) Release 7.2와 7.3에서 추가된 optimization 기능에는 어떤 내용이 있습
    니까?
    A) 다음과 같은 기능들이 있습니다.
    1> Direct Database Reads
    Parallel query 프로세스들은 필터링이나, 소팅, 조인과 같은 작업을 수행하
    기 위해서는 아주 큰 테이블을 scanning해야 합니다. Direct Database Reads는
    read efficiency와 성능의 향상을 위해 contiguous memory read를 가능하게 해
    줍니다. 또한, concurrent OLTP와 같은 작업을 수행시 따르는 경합을 없애기 위
    해 버퍼 캐쉬를 bypass합니다.
    2> Direct Database Writes
    Parallel query 프로세스들은 intermediate sort runs, summarization
    (CREATE TABLE AS SELECT), index creation(CREATE INDEX)과 같은 작업의 수행
    결과를 디스크에 종종 기록해야 합니다.
    Direct Database Writes는 write efficiency와 성능의 향상을 위해 direct
    contiguous memory로 하여금 contiguous disk writes를 가능하게 해줍니다.
    또한, concurrent OLTP 작업과 DBWR 프로세스에 의한 경합을 없애기 위해 버
    퍼 캐쉬를 bypass합니다.
    결론적으로, Direct Database Reads와 Writes는 concurrent OLTP와 DSS 작
    업에 따르는 복잡한 부하를 조절하면서 Oracle 7 서버를 분리된 형태로, 또한 최
    적의 튜닝을 가능하게 해줍니다.
    3> Asynchronous I/O
    Oracle 7은 이미 sorts, summarization, index creation, direct-path
    loading 에 대한 asynchronous write 기능을 제공하고 있습니다.
    Release 7.3부터는 보다 나은 성능의 향상을 위해 asynchronous read-ahead
    기능을 제공하여 최대한 processing과 I/O의 병행성을 증가시켜 줍니다.
    4> Parallel Table Creation
    CREATE TABLE ... AS SELECT ...와 같은 구문을 제공하여 상세한 데이타를
    갖는 큰 테이블의 조회된 결과를 저장하기 위해 임시 테이블을 생성합니다.
    이 기능은 보통 intermediate operation의 결과를 저장하기 위해 drill-down
    분석을 할 때 사용됩니다.
    5> Support for the Star Query Optimization
    Oracle 7은 수행 속도의 향상을 위해 star 스키마가 존재하고, star query
    optimization을 invoke합니다. Star query는 먼저 여러 개의 작은 테이블을
    join하고, 그런 후에, 그 결과를 하나의 큰 테이블로 join합니다.
    6> Intelligent Function Shipping
    Release 7.3부터 parallel query를 처리하는 coordinator 프로세스는
    non-shared memory machine(cluster 또는 MPP) 내의 노드들을 처리하기 위해
    디스크나 데이타들 간의 유사성에 대해 인식하게 될 것입니다.
    이 사실에 근거하여, coordinator는 data들이 machine의 shared
    interconnect를 통해 전달될 필요가 없다는 점에서, 특정 node-disk pair로 수
    행되고 있는 프로세스들에게 parallel query operation을 지정할 수 있습니다.
    이 기능은 연관된 cost나 overhead없이 'shared nothing' 소프트웨어 아키텍
    쳐의 잇점을 제공하면서 효율성과 성능, 확장성을 개선할 수 있습니다.
    7> Histograms
    Release 7.3부터 Oracle optimizer는 테이블의 컬럼 내에 있는 데이타 값의
    분포에 관한 더 많은 정보를 이용할 수 있습니다. Value와 상대적 빈도수를 나타
    내는 histogram은 optimizer에게 index의 상대적 'selectivity'에 관한 정보와
    어떤 index를 사용해야할 것인가에 관한 더 좋은 아이디어를 제공해 줄 것입니다.
    적절한 선택을 한다면, query의 수행시간을 몇 분, 심지어 몇 시간씩이나 단축
    시킬 수가 있습니다.
    8> Parallel Hash Joins
    Release 7.3부터 Oracle 7은 join 처리시간의 단축을 위하여 hash join을 제
    공합니다. 해슁 테크닉을 사용하면 join을 하기 위해 데이타를 소트하지 않아도
    되며, 기존에 존재하는 인덱스를 사용하지 않으면서 'on-the-fly' 라는 개념을 제
    공합니다.
    따라서, star schema 데이타베이스에 전형적으로 적용되는 small-to-large
    테이블 join의 수행 속도를 향상시킬 것입니다.
    9> Parallel UNION and UNION ALL
    Release 7.3부터 Oracle 7은 UNION과 UNION ALL과 같은 set operator를 사
    용하여 완전히 parallel하게 query를 수행할 수 있습니다. 이러한 operator를 사
    용하면, 큰 테이블들을 여러 개의 작은 테이블의 집합으로 나누어 처리하기가 훨
    씬 쉬워질 것입니다.
    4. Q) Release 7.3에는 어떤 제품들이 있습니까?
    A) Oracle 7 서버 Release 7.3.3에 대한 제품 리스트는 다음과 같습니다.
    단, 모든 플랫폼들이 리스트된 모든 제품들을 지원하지는 않습니다.
    [ Product ] [ Revision ]
    Advanced replication option 7.3.3.0.0
    Parallel Query Option 7.3.3.0.0
    Parallel Server Option 7.3.3.0.0
    Oracle 7 Server 7.3.3.0.0
    Distributed Database Option 7.3.3.0.0
    Oracle*XA 7.3.3.0.0
    Oracle Spatial Data Option 7.3.3.0.0
    PL/SQL 2.3.3.0.0
    ICX 7.3.3.0.0
    OWSUTL 7.3.3.0.0
    Slax 7.3.3.0.0
    Context Option 2.0.4.0.0
    Pro*C 2.2.3.0.0
    Pro*PL/I 1.6.27.0.0
    Pro*Ada 1.8.3.0.0
    Pro*COBOL 1.8.3.0.0
    Pro*Pascal 1.6.27.0.0
    Pro*FORTRAN 1.8.3.0.0
    PRO*CORE 1.8.3.0.0
    Sqllib 1.8.3.0.0
    Codegen 7.3.3.0.0
    Oracle CORE 2.3.7.2.0
    SQL*Module Ada 1.1.5.0.0
    SQL*Module C 1.1.5.0.0
    Oracle CORE 3.5.3.0.0
    NLSRTL 2.3.6.1.0
    Oracle Server Manager 2.3.3.0.0
    Oracle Toolkit II(Dependencies of svrmgr) DRUID 1.1.7.0.0
    Multi-Media APIs(MM) 2.0.5.4.0
    OACORE 2.1.3.0.0
    Oracle*Help 2.1.1.0.0
    Oracle 7 Enterprise Backup Utility 2.1.0.0.2
    NLSRTL 3.2.3.0.0
    SQL*Plus 3.3.3.0.0
    Oracle Trace Daemon 7.3.3.0.0
    Oracle MultiProtocol Interchange 2.3.3.0.0
    Oracle DECnet Protocol Adapter 2.3.3.0.0
    Oracle LU6.2 Protocol Adapter 2.3.3.0.0
    Oracle Names 2.0.3.0.0
    Advanced Networking Option 2.3.3.0.0
    Oracle TCP/IP Protocol Adapter 2.3.3.0.0
    Oracle Remote Operations 1.3.3.0.0
    Oracle Named Pipes Protocol Adapter 2.3.3.0.0
    Oracle Intelligent Agent 7.3.3.0.0
    SQL*Net APPC 2.3.3.0.0
    SQL*Net/DCE 2.3.3.0.0
    Oracle OSI/TLI Protocol Adapter 2.3.3.0.0
    Oracle SPX/IPX Protocol Adapter 2.3.3.0.0
    NIS Naming Adapter 2.3.3.0.0
    NDS Naming Adapter 2.3.3.0.0
    Oracle Installer 4.0.1

    P.S. I have checked the CD rom itself by doing the installation in our classroom on a Windows XP Pro machine and it loaded like a charm. I have been emailing and calling Compaq customer support on this issue, and I've done everything they've suggested, including a Quick Format of the hard drive. I am still getting the same results. I have been able to load a small program (Palm Desktop) on the Compaq without a problem, so I don't think it's the CD drive that's the problem, either. Thanks for any help you can give me!!! Deborah

  • SAP QUERY -logical data base ADA

    I have created a SAP Query with logical data base ADA,I have selected four tables in it.Do i need to link these tables if yes..where and how?The report is for fields in asset master data.
    .But i get below error when i try to genaret the output :
    Fields from parallel tables within a line
    Line: 01
    Field: Asset description
    (ANLT-TXT50, table ANLT)
    Field: License plate no. of vehichle
    (ANLZ-KFZKZ, table ANLZ)
    i get such similar five messages but they are warning..when i execute with warning however i get the fields with description but not with Value.Ex:i get asset description and not Asset number as required.

    You don't have to link them, they ar linked that is the power of a logical data base
    To get the text in your report you need the key fields
    Like
    (Lanque Key)
    company code
    asset number
    Asset sub number
    Go to info sets and look to the standard ones like /SAPQUERY/AM01

  • Query report using LDB MSM

    Hi guys,
    I'm trying to logical database MSM to report on material master but for some reason the following message appears:
    The query specifications cannot be used to generate a list,
    i.e. the query will probably not return the list you desire.
    If you still want to execute the query, please use the
    "Generate" function.
    Errors are like this :
    Fields from parallel tables within a line
        Line: 01
      Field: Post to Inspection Stock
            (MARCV-INSMK, table MARCV)
      Field: Item category group from material master
            (MVKE-MTPOS, table MVKE)
    Any idea what is the reason why this happens?
    Thanks and regards
    Stefan
    Edited by: Stefan Tzandev on Sep 15, 2008 1:44 PM

    Hey Stefan,
    I know this is a long shot, but were you able to figure it out. I am having the same problem as we speak. I tried rearanging the fields according to the heirchy, it now works, but has a really bad output. Hope to hear from you.
    Best Regards,
    Matthew Ong

  • SAP / ABAP Query - using logical database

    Hi ,
    We have a mandate to implement SAP Query using only Logical Databases (LDB ) .
    We understand that there are several issues using this approach .
    1 ) Paralled tables in MM need to be displayed on separate lines .
    2 ) Statistics based on fields from 2 different tables cannot be produced eg: EKPO ( PO Number )  and EKKN . (Cost Center )
    Please share your experiences .
    Thank you in advance .
    Kishore
    Kishore

    Adeel,
    I do appreciate your experience and respect you for knowledge on SAP Query. 
    Joining tables seem simple to IT experts but not so for end users.  SAP Query is an end-user tool and users seem to need a simple user-friend, drag-and-drop solution to extract information using SAP Query based on a pre-defined infoset.  Various SAP conferences have been advocating the use of SAP delivered Logical Databses to create infosets in order to harness the various advantages of LDBs. 
    In MM there are several LDBs (e.g. ELM, EBM etc) to create queries on EKPO and EKKN.  The problem arises when you use the same LDB to extract information from more than the above two tables e.g. EKPO, EKET, EKKN and EKBE.  SAP expects you to display fields on multiple lines and also does not allow producing statistics based on fields from two parallel tables say EKKN and EKBE.  Moreover, multi-line reports cannot be produced in the ALV/SLV format.  
    We are also looking for best practise solutions in providing SAP Query to MM or FI users based on SAP delivered Logical Databases.  
    Pascal

  • Error in sap query

    Dear Experts ,
    I have a query and executing using SQ01 . Here im getting warnings as 
    The query specifications cannot be used to generate a list, i.e. the query will probably not return the list you desire.
    If you still want to execute the query, please use the "Generate" function . -> 'Generate'
    Here im not getitng the output i require . then the system says ** Fields from parallel tables within a line Line: 02
    Field: Account number of supplier or vendor  (LFB1-LIFNR, table LFB1) ;
    Field: Account number of supplier or vendor (LFBK-LIFNR, table LFBK)
    Same thing comes for Bank country key, bank key , bank account number .
    Please heklp as to what is wrong

    Hello,
    I am gettig the Same Error in SAP Query, But i have generated My Infosets & cross checked the Fields with Query.
    Plz let me know what could be the Error.
    Thanks.

Maybe you are looking for

  • Multiple iPods on 1 Computer, screwed up, HELP!

    So before I realized that you have to create a separate library for each iPod (on one computer), I logged out of my Dad's iTunes store and into mine. I proceeded to download a few songs and now it won't let me sync them with my iPod because it's on h

  • Overwriting Conditions data during Material Replication from R/3 to SRM.

    Hi,       When creating a new info record and then running the material replication program everything looks OK. However, if for the same material you create a new info record or change the existing info record and then run the material replication,

  • Error during the retrieval of the logon data store Message was Not Created

    Dear  Gurus,                      I got this error while creating support message. Error in Local Message System: Error during the retrieval of the logon data store Message was Not Created Message no. BCOS088 Wether this support message will be send

  • Starting managed server's via NodeManager from command line.

    In WLS 70 weblogic.Admin utility has been enhanced to start/stop/kill managed servers via NodeManager. Here's the syntax java weblogic.Admin -url {admin server url} -username {admin user} -password {admin password} START {managed server instance name

  • Sys Pref panel "Mail Contacts Calendar" freezes

    Sys Pref panel "Mail Contacts Calendar" completely freezes just by trying to open it. And I've discovered that If I remove my gmail account (from the mail.app) It works again. I've made 2 clean installs of Mountain lion and the problem stays. If it h