Gather shema stats for all objects in DB taking too much time

Dear ,
we schedule concurrent request " Gather Schema Statistics" to gather ALL schema on DB weekly . it takes on Test 4.5 hours to complete and 5 hours on Production system . we have only HR in Production and very soon it will start supply chain and Financial so I'm afraid from this time to increase in the near future . how could we reduce this time ? i tried to gather stats only with changed objects using " GATHER AUTO " option instead of " GATHER " but it gave me the following error
Cause: FDPSTP failed due to ORA-20001: NEW TABLE is an invalid identifier
ORA-06512: at "APPS.FND_STATS", line 799
ORA-06512: at line 1
The SQL statement being executed at the time of the error was: SELECT R.Conc_Login_Id,
Start of log messages from FND_FILE
In GATHER_SCHEMA_STATS , schema_name= ALL percent= 10 degree = 8 internal_flag= NOBACKUP
ORA-20001: NEW TABLE is an invalid identifier
End of log messages from FND_FILE
please if anyone knows how to reduce time for Gather stats or know how to solve this error he'll be much appreciated

Hi,
i tried to gather stats only with changed objects using " GATHER AUTO " option instead of " GATHERYoudo not have to change this parameter, just schedule the concurrent program for HR (as suggested above), and you can schedule it for other schemas on regular basis (at the weeke ends) when there is no activity on the system -- Please see (Note: 168136.1 - How Often Should Gather Schema Statistics Program be Run?).
Regards,
Hussein

Similar Messages

  • Creative Cloud is taking too much time to load and is not downloading the one month trial for Photoshop I just paid money for.

    Creative Cloud is taking too much time to load and is not downloading the one month trial for Photoshop I just paid money for.

    stop the download if it's stalled, and restart your download.

  • Taking too much time for saving PO with line item more than 600

    HI
    We are trying to save PO with line items more than 600, but it is taking too much time to save. It is taking more than 1 hour to save the PO.
    Kindly let me know is there any restriction for no. of line items in the PO. Pls guide
    regards
    Sanjay

    Hi,
    I suggest you to do a trace (tcode ST05) to identify the bottleneck.
    You can know some reasons in Note 205005 - Performance composite note: Purchase order.
    I hope this helps you
    Regards
    Eduardo

  • PRS600 ereader taking too much time to load all the books

    Whenever I open My PRS600 from complete shutdown it takes too much time to load all the files which are present in Memory card. Is anyone else facing same issue?

    Hello,
    Recently, I have been having some serious issues when it comes to my Sony PRS-600. I am running on a Windows 7 64-bit, and an updated Reader Library 3.3
    The issue comes when transferring books to the e-reader from the library, and from the e-reader to a collection. The problem is that the software becomes intolerably slow while it's processing the command. The Reader Library software window grays out, displays (Not Working) and if clicked on it, shades to a white color and displays either "cancel operation" or "wait until program responds". If I do close the operation, it appears as if the e-reader doesn't follow the operation and still displays "Do not disconnect". Since I do not see any other way to disconnect (other than the eject option), I remove the USB plug which causes a bit more issues with the reader (such as removing all of my collections, for example!).
    But anyway, that's not the main issue here. The main issue is that the book transferring is really slow. I need to wait a couple of minutes (or even more) just for the software to process. Moving just 1 MB of data requires so much time as if it's 1 GB. Sometimes it's random and does it fast, and sometimes the application is better not to be dealt with at all while it's processing the command. If I would inspect My Computer, the simple loading of the e-reader storage icons and information would make the Windows Explorer to "crash" (e.g, close all windows and then reopen them). It just happens that in all randomness even the creation of a collection makes the software slow.
    So to recap: the reader software is slow when adding and moving books.
    I hope someone will help me resolve this annoyance.
    Thank you,
    KQ

  • Variable screen is taking too much time for some reports

    Hi all,
    We are using a sales billing cube for our billing reports . For one query , variable screen takes lot of time to come , i have in RSRT , i have generated the reoprt there and also executed the report there , it s fine there.Morever iam not using any customer exit variable for this.
    Can anybody suggets me whats is the exact problem;

    How I can improve further. Will it be good enough if I create Indexes on the columns for the temp table and try.or what If I use derived tables??
    I suggest you start with index tuning.  Specifically, make sure columns specified in the WHERE and JOIN columns are properly indexed (ideally clustered or covering, and unique when possible).  Changing outer joins to inner joins is appropriate
    if you don't need outer joins in the first place.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Catbundle.sql taking too much time while running it for CPU-April2011

    Hi ,
    I am on oracle 11.1.0.7.0 and I am applying the CPU patch April 2011.
    OS is Solaris SPARC.
    As part of that , i am running the catbundle.sql.
    currently , for last 180 mins , the catbundle.sql is at this state :
    SQL> PROMPT Processing Oracle Java Supplied Packages...
    Processing Oracle Java Supplied Packages...
    SQL> ALTER SESSION SET current_schema = sys;
    Session altered.
    SQL> @?/rdbms/admin/initcdc.sql
    SQL> Rem
    SQL> Rem $Header: initcdc.sql 15-mar-2006.08:20:07 mbrey Exp $
    SQL> Rem
    SQL> Rem initcdc.sql
    SQL> Rem
    SQL> Rem Copyright (c) 2000, 2006, Oracle. All rights reserved.
    SQL> Rem
    SQL> Rem    NAME
    SQL> Rem      initcdc.sql - script used to load CDC jar files into the database
    SQL> Rem
    SQL> Rem    DESCRIPTION
    SQL> Rem      <short description of component this file declares/defines>
    SQL> Rem
    SQL> Rem    NOTES
    SQL> Rem      script must be run as SYS
    SQL> Rem
    SQL> Rem    MODIFIED   (MM/DD/YY)
    SQL> Rem    mbrey       03/15/06 - bug 5092790 add datapump registration
    SQL> Rem    pabingha    02/25/03 - fix undoc interfaces
    SQL> Rem    wnorcott    03/14/02 - bug-2239726 disable triggers.
    SQL> Rem    wnorcott    01/31/02 - function 'active' return 0 or 1.
    SQL> Rem    wnorcott    01/30/02 - disable CDC triggers, CREATE_CHANGE_TABLE re-enables.
    SQL> Rem    wnorcott    06/26/01 - rid trailing slash.  As per Mark Jungermann
    SQL> Rem    gviswana    05/25/01 - CREATE OR REPLACE SYNONYM
    SQL> Rem    jgalanes    11/17/00 - for Import/Export grant execute on util to
    SQL> REM                           SELECT_CATLOG_ROLE
    SQL> Rem    wnorcott    09/07/00 - new loadjava syntax for performance.
    SQL> Rem    wnorcott    07/18/00 - rid LOGMNR_UID$.clientid
    SQL> Rem    wnorcott    06/28/00 - move logmnr_dict view here
    SQL> Rem    wnorcott    03/28/00 - fix trigger install
    SQL> Rem    wnorcott    03/27/00 - Install change table triggers
    SQL> Rem    mbrey       01/26/00 - script to load CDC jars
    SQL> Rem    mbrey       01/26/00 - Created
    SQL> Rem
    SQL> call sys.dbms_java.loadjava('-v -f -r -s -g public rdbms/jlib/CDC.jar');It has run the @?/rdbms/admin/initcdc.sql script and now its not proceeding next.. I am not sure if its stuck or still running.. How do i find that..
    what should i do ?
    *PS : Ive read this note :Script Fails At Loadjava With ORA-03113 and ORA-03114 [ID 358232.1] But its when it errors out , for me its not erroring out also..*
    Thanks
    Kk
    Edited by: Kk on May 25, 2011 2:41 AM

    just an update :
    I sat watching it for 3 hours.. then i though of stopping it.. pressed CTRL-Z and boom , it just took me to SQL showing that it had completed...
    So , if someone else faces this issue , press CTRL-Z after some 5-10 minutes it will show that its running well.
    Regards
    Kk
    Edited by: Kk on May 25, 2011 3:55 AM

  • Update statement taking too much time

    Hi All,
    I defined a cursor in which there are almost 94 lakh records and i want to update few fields of a table from another table which takes data over a dblink.
    my cursor is
    cursor c_tpo is
          select t.loc_loc_id,
                 t.till_no,
                 t.transaction_date,
                 t.sales_audit_txn_no,
                 t.third_party_order_ref
            from dwt_om_email_addresses t
           where (t.merc_loaded_date_time is null or t.ws_ordered_date_time is null or
                 t.copos_ordered_date_time is null)
    -- And for loop is
    for i in c_tpo loop
        select count(*)
          into ln_count
          from web_sales@nrstp
         where dmw_order = i.third_party_order_ref;
        if ln_count = 1 then
          select date_loaded, order_date, order_date, pkt_ctrl_nbr
            into ld_merc_load_date,
                 ld_ws_order_date,
                 ld_cop_order_date,
                 lc_pkt_ctrl_nbr
            from web_sales@nrstp
           where dmw_order = i.third_party_order_ref;
          update dwt_om_email_addresses t
             set merc_loaded_date_time   = ld_merc_load_date,
                 ws_ordered_date_time    = ld_ws_order_date,
                 copos_ordered_date_time = ld_cop_order_date
           where t.loc_loc_id = i.loc_loc_id
             and t.till_no = i.till_no
             and t.transaction_date = i.transaction_date
             and t.sales_audit_txn_no = i.sales_audit_txn_no;
      end if;
        ln_count          := 0;
        ln_count_pkt      := 0;
        ld_merc_load_date := null;
        ld_ws_order_date  := null;
        ld_cop_order_date := null;
        ld_pkms_date_time := null;
        lc_pkt_ctrl_nbr   := null;
      end loop;
      -----------The ln_count is used to avoid the exception no_data_found and too_many_rows. How do I speed up the process as it takes 1 hr to update 500 records.
    What would be the best approach to achieve this in less time.
    Thanks

    if you check the your condition some where you have metioned
    dmw_order = t.third_party_order_ref
    if both of these are unique keys or primary key then there is no problem
    but if for there are multiple values edit the query by using
    rownum <= 1
    update dwt_om_email_addresses t
    set (merc_loaded_date_time,ws_ordered_date_time,copos_ordered_date_time) =(select date_loaded, order_date, order_date, pkt_ctrl_nbr from( select date_loaded, order_date, order_date, pkt_ctrl_nbr
                                                                                 from web_sales@nrstp
                                                                                  where dmw_order = t.third_party_order_ref)
    where rownum<=1)
    where exists  (select '1'
                  from web_sales@nrstp i
                  where t.loc_loc_id = i.loc_loc_id
                  and t.till_no = i.till_no
                  and t.transaction_date = i.transaction_date
                  and t.sales_audit_txn_no = i.sales_audit_txn_no
                  and (t.merc_loaded_date_time is null or t.ws_ordered_date_time is null or
                 t.copos_ordered_date_time is null));and for exists clause there is no problem
    Edited by: 810345 on Jun 10, 2011 4:07 PM
    Edited by: 810345 on Jun 10, 2011 4:08 PM

  • UTL_FILE reqeust taking too much time for completion

    Hi,
    We are running utl_file reqeust.
    the select statement fetching 6000 records, for this it taking 22 mins for completion.
    the code is
    CREATE OR REPLACE PACKAGE BODY "XXC"."XXC_MOD_IN_068_AP_TO_FIS_PKG"
    AS
    * Module Type : PL/SQL
    * Module Name : XXC_MOD_IN_068_AP_FIS_PKG
    * Description : This package is used for AP to Fiscal Interface.
    * Run Env. : SQL*Plus
    * Procedure Name Description
    * XXC_MOD_068_AP_PR XXC_MOD_068_AP_PR Procedure is used to insert transactions
    * into CSV OutPut File from Oracle Account Payables.
    * Calling Module: None
    * Modules Called: XXC_COMMON_INT_PK.INSERT_AUDIT
    * Module Number : MOD_IN_068
    * Known Bugs and Restrictions: none
    * History
    * =======
    * Version Name Date Description of Change
    * 0.1 Sanjeev Khurana 25-JULY-2011 Initial Creation.
    * 0.2 Rohit 09-DEC-2011 Updated header details for the file
    * 0.3 Amit Kulwal 28-AUG-2012 Updated the cursor query for incident 671520
    * 0.4 Swaraj Goud 20-Nov-2012 Updated as per the CR 671520
    | PACKAGE BODY
    -- Actual Code Start Here
    -- Procedure : XXC_MOD_068_AP_PR
    -- Description : XXC_MOD_068_AP_PR Procedure is used to insert transactions
    -- into CSV OUTPUT File from Oracle Account Payables.
    -- Parameters:
    -- Parm Name I/O Description
    -- p_errbuf OUT Error message.
    -- p_retcode OUT Error code. Returns 0 if no errors otherwise returns 1.
    -- p_start_date IN Start Date
    -- p_end_date IN End Date
    PROCEDURE xxc_mod_068_ap_pr (
    p_errbuf OUT VARCHAR2,
    p_retcode OUT NUMBER,
    p_start_date IN VARCHAR2,
    p_end_date IN VARCHAR2
    IS
    -- Define variables and assign default values
    l_sucess_count NUMBER := 0;
    l_error_count NUMBER := 0;
    -- Standard declaration
    l_source VARCHAR2 (10);
    l_target VARCHAR2 (10);
    lc_module_description VARCHAR2 (50)
    := 'MOD_IN_068 - AP to Fiscal';
    l_status CONSTANT VARCHAR2 (50) := 'NEW';
    p_status NUMBER;
    l_batch_id NUMBER;
    l_batch_id_next NUMBER
    := apps_common_out_batch_id_s1.NEXTVAL;
    l_proc_name VARCHAR2 (100) := 'XXC_MOD_IN_068';
    l_request_id NUMBER
    := fnd_global.conc_request_id;
    l_audit_master_id NUMBER := NULL;
    l_mod_code VARCHAR2 (100);
    l_log_type NUMBER := 1; --INFORMATION
    l_det_status_success NUMBER := 0; --SUCCESS
    l_det_status_inprocess NUMBER := 3; --INPROCESS
    l_det_status_rejected NUMBER := 4; --REJECTED
    l_det_status_err NUMBER := 3; --Error
    l_det_status_complete NUMBER := 9; --COMPLETE
    -- Standard who Columns
    l_created_by NUMBER := fnd_global.user_id;
    l_creation_date DATE := SYSDATE;
    l_last_update_date DATE := SYSDATE;
    l_last_update_login NUMBER := fnd_global.user_id;
    v_file UTL_FILE.file_type;
    l_location VARCHAR2 (150);
    l_archive_location VARCHAR2 (150);
    l_date VARCHAR2 (50);
    l_filename VARCHAR2 (50);
    l_open_mode VARCHAR2 (1) := 'W';
    --- l_max_linesize NUMBER := 32767;
    l_max_linesize VARCHAR2 (150); -- Updated 09-Nov-2012
    --Cursor is used to fetch valid records for the interface
    CURSOR get_ap_data_inv
    IS
    SELECT asp.segment1 supplier_ref,
    -- asp.vendor_name supplier_name,
    replace(asp.vendor_name, ',', ' ') supplier_name,
    --aia.invoice_num invoice_number,
    replace(aia.invoice_num, ',','') invoice_number,
    aia.invoice_date,
    aia.invoice_amount amount,
    aia.doc_sequence_value unique_id,
    aia.creation_date date_invoice_entered,
    apsa.due_date date_invoice_paid,
    aia.SOURCE user_id,
    aia.payment_status_flag,
    aia.invoice_type_lookup_code doc_type,
    --aia.description,
    replace(aia.description, ',' , ' ') description,
    apsa.gross_amount
    FROM ap_invoices_all aia,
    ap_suppliers asp,
    apps.ap_payment_schedules_all apsa
    -- apps.iby_payments_all iba,
    -- apps.iby_docs_payable_all dp
    WHERE aia.invoice_id = apsa.invoice_id
    AND aia.vendor_id = asp.vendor_id
    AND aia.org_id = apsa.org_id
    -- AND apsa.payment_status_flag != 'Y' -- commented for CR
    -- AND dp.payment_id = iba.payment_id(+)
    -- AND aia.invoice_id = dp.calling_app_doc_unique_ref2(+)
    -- AND apsa.due_date <= (SYSDATE + 1)
    AND TRUNC (aia.creation_date)
    BETWEEN NVL (fnd_date.canonical_to_date (p_start_date),
    TRUNC (aia.creation_date))
    AND NVL (fnd_date.canonical_to_date (p_end_date),
    TRUNC (aia.creation_date));
         TYPE xxc_tbl IS TABLE OF get_ap_data_inv%ROWTYPE;
    xxc_tbl1 xxc_tbl;
    BEGIN
    l_batch_id := apps_common_out_batch_id_s1.CURRVAL;
    xxc_common_int_pk.insert_audit (p_batch_id => l_batch_id,
    p_request_id => l_request_id,
    p_source_system => l_source,
    p_proc_name => l_proc_name,
    p_log_type => l_log_type,
    p_det_status => l_det_status_inprocess,
    p_msg_code => NULL,
    p_entity => NULL,
    p_msg_desc => 'Process Starts',
    p_mast_request_id => l_request_id,
    p_record_id => NULL,
    p_source => l_source,
    p_target => l_target,
    p_email => NULL,
    p_mod_code => l_mod_code,
    p_audit_master_id => l_audit_master_id
    -- Get Module Code
    BEGIN
    SELECT TRIM (fval.flex_value),
    TRIM (SUBSTR (fval.description,
    1,
    INSTR (fval.description, ' -')
    INTO l_source,
    l_mod_code
    FROM fnd_flex_values_vl fval, fnd_flex_value_sets vset
    WHERE vset.flex_value_set_id = fval.flex_value_set_id
    AND vset.flex_value_set_name IN ('XXC_COMM_INT_CONFIG')
    AND fval.enabled_flag = 'Y'
    AND fval.description = lc_module_description;
    EXCEPTION
    WHEN OTHERS
    THEN
    xxc_common_int_pk.insert_audit (p_batch_id => l_batch_id,
    p_request_id => l_request_id,
    p_source_system => l_source,
    p_proc_name => l_proc_name,
    p_log_type => l_log_type,
    p_det_status => l_det_status_err,
    p_msg_code => NULL,
    p_entity => NULL,
    p_msg_desc => 'Error Mode Code',
    p_mast_request_id => l_request_id,
    p_record_id => NULL,
    p_source => l_source,
    p_target => l_target,
    p_email => NULL,
    p_mod_code => l_mod_code,
    p_audit_master_id => l_audit_master_id
    raise_application_error (-20045, SQLERRM);
    END;
    --File Location Path for OutPut File
    BEGIN
    SELECT fnd_profile.VALUE ('XXC_MOD_IN_068_AP_OUTBOUND'),
    fnd_profile.VALUE ('XXC_MOD_IN_068_AP_ARCHIVE')
    INTO l_location,
    l_archive_location
    FROM DUAL;
    EXCEPTION
    WHEN OTHERS
    THEN
    xxc_common_int_pk.insert_audit
    (p_batch_id => l_batch_id,
    p_request_id => l_request_id,
    p_source_system => l_source,
    p_proc_name => l_proc_name,
    p_log_type => l_log_type,
    p_det_status => l_det_status_rejected,
    p_msg_code => NULL,
    p_entity => NULL,
    p_msg_desc => 'Profile Value not found',
    p_mast_request_id => l_request_id,
    p_record_id => NULL,
    p_source => l_source,
    p_target => l_target,
    p_email => NULL,
    p_mod_code => l_mod_code,
    p_audit_master_id => l_audit_master_id
    END;
    BEGIN
    SELECT TO_CHAR (SYSDATE, 'YYYYMMDDhh24miss')
    INTO l_date
    FROM DUAL;
    EXCEPTION
    WHEN OTHERS
    THEN
    xxc_common_int_pk.insert_audit (p_batch_id => l_batch_id,
    p_request_id => l_request_id,
    p_source_system => l_source,
    p_proc_name => l_proc_name,
    p_log_type => l_log_type,
    p_det_status => l_det_status_rejected,
    p_msg_code => NULL,
    p_entity => NULL,
    p_msg_desc => 'status not found',
    p_mast_request_id => l_request_id,
    p_record_id => NULL,
    p_source => l_source,
    p_target => l_target,
    p_email => NULL,
    p_mod_code => l_mod_code,
    p_audit_master_id => l_audit_master_id
    END;
    l_filename := 'AP_Fiscal_' || l_date || '.csv';
    v_file :=
    UTL_FILE.fopen (LOCATION => l_location,
    filename => l_filename,
    open_mode => l_open_mode,
    max_linesize => l_max_linesize
    -- Changed as per Sarah's email on 9th Decemeber
    /* UTL_FILE.put_line (v_file,
    'SUPPLIER_REF'
    || ','
    || 'SUPPLIER_NAME'
    || ','
    || 'INVOICE_NUMBER'
    || ','
    || 'INVOICE_DATE'
    || ','
    || 'AMOUNT'
    || ','
    || 'UNIQUE_ID'
    || ','
    || 'DATE_INVOICE_ENTERED'
    || ','
    || 'DATE_INVOICE_PAID'
    || ','
    || 'USER_ID'
    || ','
    || 'PAYMENT_STATUS_FLAG'
    || ','
    || 'DOC_TYPE'
    || ','
    || 'DESCRIPTION'
    || ','
    || 'PAYMENT_AMOUNT'
    UTL_FILE.put_line (v_file,
    'SUPPLIERREF'
    || ','
    || 'SUPPLIERNAME'
    || ','
    || 'INVOICENUMBER'
    || ','
    || 'DATE'
    || ','
    || 'AMOUNT'
    || ','
    || 'UNIQUEID'
    || ','
    || 'DATEINVOICEENTERED'
    || ','
    || 'DATEINVOICEPAID'
    || ','
    || 'USERID'
    || ','
    || 'PAYMENTSTATUS'
    || ','
    || 'DOCTYPE'
    || ','
    || 'DESCRIPTION'
    || ','
    || 'PAYMENTAMOUNT');
    UTL_FILE.put_line (v_file,
    'XX'
    || ','
    || 'XX'
    || ','
    || 'XX'
    || ','
    || 'XX'
    || ','
    || 'XX'
    || ','
    || 'XX'
    || ','
    || 'XX'
    || ','
    || 'XX'
    || ','
    || 'XX'
    || ','
    || 'XX'
    || ','
    || 'XX'
    || ','
    || 'XX'
    || ','
    || 'XX');
                             open get_ap_data_inv;
                             loop
                             fetch get_ap_data_inv bulk collect into xxc_tbl1 limit 6000;
    fnd_file.put_line(fnd_file.log, 'Cursor Count is : '||xxc_tbl1.count);
                             for i in xxc_tbl1.first .. xxc_tbl1.count
    --FOR cur_rec IN get_ap_data_inv
    LOOP
    BEGIN
    --Common package used for proper sequence for Record_id and Bath_id
    l_sucess_count := l_sucess_count + 1;
    --Insert into CSV file
    fnd_file.put_line (fnd_file.LOG, 'Before Utl file');
    UTL_FILE.put_line (v_file,
    xxc_tbl1(i).supplier_ref
    || ','
    || xxc_tbl1(i).supplier_name
    || ','
    || xxc_tbl1(i).invoice_number
    || ','
    || xxc_tbl1(i).invoice_date
    || ','
    || xxc_tbl1(i).amount
    || ','
    || xxc_tbl1(i).unique_id
    || ','
    || xxc_tbl1(i).date_invoice_entered
    || ','
    || xxc_tbl1(i).date_invoice_paid
    || ','
    || xxc_tbl1(i).user_id
    || ','
    || xxc_tbl1(i).payment_status_flag
    || ','
    || xxc_tbl1(i).doc_type
    || ','
    || xxc_tbl1(i).description
    || ','
    || xxc_tbl1(i).gross_amount);
    fnd_file.put_line (fnd_file.LOG,
    'Supplier Reference : ' || xxc_tbl1(i).supplier_ref);
    xxc_common_int_pk.insert_audit
    (p_batch_id => l_batch_id,
    p_request_id => l_request_id,
    p_source_system => l_source,
    p_proc_name => l_proc_name,
    p_log_type => l_log_type,
    p_det_status => l_det_status_complete,
    p_msg_code => NULL,
    p_entity => NULL,
    p_msg_desc => 'Inserting records from AP to Fiscal Successfully',
    p_mast_request_id => l_request_id,
    p_record_id => NULL,
    p_source => l_source,
    p_target => l_target,
    p_email => NULL,
    p_mod_code => l_mod_code,
    p_audit_master_id => l_audit_master_id
    EXCEPTION
    WHEN OTHERS
    THEN
    l_error_count := l_error_count + 1;
    fnd_file.put_line (fnd_file.LOG,
    'Error While Inserting from AP to Fiscal '
    || SQLERRM);
    -- Create audit log for AP Inv records insert Exception
    --Insert into the Audit table XXC_COMM_AUDIT_DETAIL_LOG and XXC_COMM_AUDIT_MASTER_LOG
    xxc_common_int_pk.insert_audit
    (p_batch_id => l_batch_id,
    p_request_id => l_request_id,
    p_source_system => l_source,
    p_proc_name => l_proc_name,
    p_log_type => l_log_type,
    p_det_status => l_det_status_rejected,
    p_msg_code => NULL,
    p_entity => NULL,
    p_msg_desc => 'Error While Inserting from AP to Fiscal',
    p_mast_request_id => l_request_id,
    p_record_id => NULL,
    p_source => l_source,
    p_target => l_target,
    p_email => NULL,
    p_mod_code => l_mod_code,
    p_audit_master_id => l_audit_master_id
    END;
    END LOOP;
    exit when get_ap_data_inv%NOTFOUND;
    end loop;
         close get_ap_data_inv;
    UTL_FILE.fclose (v_file);
    UTL_FILE.fcopy (l_location,
    l_filename,
    l_archive_location,
    l_filename
    -- Create audit log for Successfully processed records
    -- Procedure call to insert in Audit tables
    xxc_common_int_pk.insert_audit
    (p_batch_id => l_batch_id,
    p_request_id => l_request_id,
    p_source_system => l_source,
    p_proc_name => l_proc_name,
    p_log_type => l_log_type,
    p_det_status => l_det_status_complete,
    p_msg_code => NULL,
    p_entity => NULL,
    p_msg_desc => 'Compeleted Sucessfully AP to Fiscal',
    p_mast_request_id => l_request_id,
    p_record_id => NULL,
    p_source => l_source,
    p_target => l_target,
    p_email => NULL,
    p_mod_code => l_mod_code,
    p_audit_master_id => l_audit_master_id
    --Insert into the Audit table XXC_COMM_AUDIT_DETAIL_LOG and XXC_COMM_AUDIT_MASTER_LOG for populating email drop table
    BEGIN
    SELECT transaction_status
    INTO p_status
    FROM xxc_comm_audit_master_log
    WHERE audit_master_id = l_audit_master_id;
    EXCEPTION
    WHEN OTHERS
    THEN
    xxc_common_int_pk.insert_audit (p_batch_id => l_batch_id,
    p_request_id => l_request_id,
    p_source_system => l_source,
    p_proc_name => l_proc_name,
    p_log_type => l_log_type,
    p_det_status => l_det_status_err,
    p_msg_code => NULL,
    p_entity => NULL,
    p_msg_desc => 'Status Error',
    p_mast_request_id => l_request_id,
    p_record_id => NULL,
    p_source => l_source,
    p_target => l_target,
    p_email => NULL,
    p_mod_code => l_mod_code,
    p_audit_master_id => l_audit_master_id
    END;
    IF p_status <> 0
    THEN
    xxc_comm_audit_log_pk.populate_email_drop_table (l_audit_master_id,
    l_batch_id);
    END IF;
    EXCEPTION
    WHEN UTL_FILE.invalid_path
    THEN
    UTL_FILE.fclose (v_file);
    raise_application_error (-20000, 'File location is invalid.');
    WHEN UTL_FILE.invalid_mode
    THEN
    UTL_FILE.fclose (v_file);
    raise_application_error (-20001,
    'The open_mode parameter in FOPEN is invalid.');
    WHEN UTL_FILE.invalid_filehandle
    THEN
    UTL_FILE.fclose (v_file);
    raise_application_error (-20002, 'File handle is invalid.');
    WHEN UTL_FILE.invalid_operation
    THEN
    UTL_FILE.fclose (v_file);
    raise_application_error
    (-20003,
    'File could not be opened or operated on as requested.');
    WHEN UTL_FILE.write_error
    THEN
    UTL_FILE.fclose (v_file);
    raise_application_error
    (-20005,
    'Operating system error occurred during the write operation.');
    WHEN UTL_FILE.file_open
    THEN
    UTL_FILE.fclose (v_file);
    raise_application_error
    (-20008,
    'The requested operation failed because the file is open.');
    WHEN UTL_FILE.invalid_maxlinesize
    THEN
    UTL_FILE.fclose (v_file);
    raise_application_error
    (-20009,
    'The MAX_LINESIZE value for FOPEN() is invalid; it should '
    || 'be within the range 1 to 32767.');
    COMMIT;
    ROLLBACK TO data_extract;
    WHEN OTHERS
    THEN
    raise_application_error (-20045, SQLERRM);
    UTL_FILE.fclose (v_file);
    END xxc_mod_068_ap_pr;
    END xxc_mod_in_068_ap_to_fis_pkg;
    Show Errors
    Iam implemented BULK collect concept in programe,can anyone please suggest how can I imporve performance....
    Thanks,
    Rakesh

      CREATE OR REPLACE PACKAGE BODY "XXC"."XXC_MOD_IN_068_AP_TO_FIS_PKG"
    AS
      PROCEDURE xxc_mod_068_ap_pr (
        p_errbuf                         OUT      VARCHAR2,
        p_retcode                        OUT      NUMBER,
        p_start_date                     IN       VARCHAR2,
        p_end_date                       IN       VARCHAR2
      IS
        -- Define variables and assign default values
        l_sucess_count                          NUMBER := 0;
        l_error_count                           NUMBER := 0;
        -- Standard declaration
        l_source                                VARCHAR2 (10);
        l_target                                VARCHAR2 (10);
        lc_module_description                   VARCHAR2 (50)
                                                     := 'MOD_IN_068 - AP to Fiscal';
        l_status                       CONSTANT VARCHAR2 (50) := 'NEW';
        p_status                                NUMBER;
        l_batch_id                              NUMBER;
        l_batch_id_next                         NUMBER
                                             := apps_common_out_batch_id_s1.NEXTVAL;
        l_proc_name                             VARCHAR2 (100) := 'XXC_MOD_IN_068';
        l_request_id                            NUMBER
                                                      := fnd_global.conc_request_id;
        l_audit_master_id                       NUMBER := NULL;
        l_mod_code                              VARCHAR2 (100);
        l_log_type                              NUMBER := 1;   --INFORMATION
        l_det_status_success                    NUMBER := 0;   --SUCCESS
        l_det_status_inprocess                  NUMBER := 3;   --INPROCESS
        l_det_status_rejected                   NUMBER := 4;   --REJECTED
        l_det_status_err                        NUMBER := 3;   --Error
        l_det_status_complete                   NUMBER := 9;   --COMPLETE
        -- Standard who Columns
        l_created_by                            NUMBER := fnd_global.user_id;
        l_creation_date                         DATE := SYSDATE;
        l_last_update_date                      DATE := SYSDATE;
        l_last_update_login                     NUMBER := fnd_global.user_id;
        v_file                                  UTL_FILE.file_type;
        l_location                              VARCHAR2 (150);
        l_archive_location                      VARCHAR2 (150);
        l_date                                  VARCHAR2 (50);
        l_filename                              VARCHAR2 (50);
        l_open_mode                             VARCHAR2 (1) := 'W';
    --- l_max_linesize                          NUMBER := 32767;
        l_max_linesize                          VARCHAR2 (150); -- Updated 09-Nov-2012
        --Cursor is used to fetch valid records for the interface
        CURSOR get_ap_data_inv
        IS
          SELECT       asp.segment1 supplier_ref,
                 -- asp.vendor_name supplier_name,
                 replace(asp.vendor_name, ',', ' ') supplier_name,
                 --aia.invoice_num invoice_number,
                 replace(aia.invoice_num, ',','') invoice_number,
                 aia.invoice_date,
                 aia.invoice_amount amount,
                 aia.doc_sequence_value unique_id,
                 aia.creation_date date_invoice_entered,
                 apsa.due_date date_invoice_paid,
                 aia.SOURCE user_id,
                 aia.payment_status_flag,
                 aia.invoice_type_lookup_code doc_type,
                 --aia.description,
                 replace(aia.description, ',' , ' ') description,
                 apsa.gross_amount
          FROM   ap_invoices_all aia,
                 ap_suppliers asp,
                 apps.ap_payment_schedules_all apsa
                -- apps.iby_payments_all iba,
            --     apps.iby_docs_payable_all dp
          WHERE  aia.invoice_id = apsa.invoice_id
          AND    aia.vendor_id  = asp.vendor_id
          AND    aia.org_id     = apsa.org_id
      --  AND    apsa.payment_status_flag != 'Y'   -- commented for CR
      --  AND    dp.payment_id = iba.payment_id(+)
      --  AND    aia.invoice_id = dp.calling_app_doc_unique_ref2(+)
      --  AND    apsa.due_date <= (SYSDATE + 1)
          AND    TRUNC (aia.creation_date)
                   BETWEEN NVL (fnd_date.canonical_to_date (p_start_date),
                                TRUNC (aia.creation_date))
                       AND NVL (fnd_date.canonical_to_date (p_end_date),
                                TRUNC (aia.creation_date));
                                     TYPE xxc_tbl IS TABLE OF get_ap_data_inv%ROWTYPE;
                                  xxc_tbl1 xxc_tbl;
      BEGIN
        l_batch_id                      := apps_common_out_batch_id_s1.CURRVAL;
        xxc_common_int_pk.insert_audit (p_batch_id                        => l_batch_id,
                                        p_request_id                      => l_request_id,
                                        p_source_system                   => l_source,
                                        p_proc_name                       => l_proc_name,
                                        p_log_type                        => l_log_type,
                                        p_det_status                      => l_det_status_inprocess,
                                        p_msg_code                        => NULL,
                                        p_entity                          => NULL,
                                        p_msg_desc                        => 'Process Starts',
                                        p_mast_request_id                 => l_request_id,
                                        p_record_id                       => NULL,
                                        p_source                          => l_source,
                                        p_target                          => l_target,
                                        p_email                           => NULL,
                                        p_mod_code                        => l_mod_code,
                                        p_audit_master_id                 => l_audit_master_id
    -- Get Module Code
        BEGIN
          SELECT TRIM (fval.flex_value),
                 TRIM (SUBSTR (fval.description,
                               1,
                               INSTR (fval.description, ' -')
          INTO   l_source,
                 l_mod_code
          FROM   fnd_flex_values_vl fval, fnd_flex_value_sets vset
          WHERE  vset.flex_value_set_id = fval.flex_value_set_id
          AND    vset.flex_value_set_name IN ('XXC_COMM_INT_CONFIG')
          AND    fval.enabled_flag = 'Y'
          AND    fval.description = lc_module_description;
        EXCEPTION
          WHEN OTHERS
          THEN
            xxc_common_int_pk.insert_audit (p_batch_id                        => l_batch_id,
                                            p_request_id                      => l_request_id,
                                            p_source_system                   => l_source,
                                            p_proc_name                       => l_proc_name,
                                            p_log_type                        => l_log_type,
                                            p_det_status                      => l_det_status_err,
                                            p_msg_code                        => NULL,
                                            p_entity                          => NULL,
                                            p_msg_desc                        => 'Error Mode Code',
                                            p_mast_request_id                 => l_request_id,
                                            p_record_id                       => NULL,
                                            p_source                          => l_source,
                                            p_target                          => l_target,
                                            p_email                           => NULL,
                                            p_mod_code                        => l_mod_code,
                                            p_audit_master_id                 => l_audit_master_id
            raise_application_error (-20045, SQLERRM);
        END;
    --File Location Path for OutPut File
        BEGIN
          SELECT fnd_profile.VALUE ('XXC_MOD_IN_068_AP_OUTBOUND'),
                 fnd_profile.VALUE ('XXC_MOD_IN_068_AP_ARCHIVE')
          INTO   l_location,
                 l_archive_location
          FROM   DUAL;
        EXCEPTION
          WHEN OTHERS
          THEN
            xxc_common_int_pk.insert_audit
                                          (p_batch_id                        => l_batch_id,
                                           p_request_id                      => l_request_id,
                                           p_source_system                   => l_source,
                                           p_proc_name                       => l_proc_name,
                                           p_log_type                        => l_log_type,
                                           p_det_status                      => l_det_status_rejected,
                                           p_msg_code                        => NULL,
                                           p_entity                          => NULL,
                                           p_msg_desc                        => 'Profile Value not found',
                                           p_mast_request_id                 => l_request_id,
                                           p_record_id                       => NULL,
                                           p_source                          => l_source,
                                           p_target                          => l_target,
                                           p_email                           => NULL,
                                           p_mod_code                        => l_mod_code,
                                           p_audit_master_id                 => l_audit_master_id
        END;
        BEGIN
          SELECT TO_CHAR (SYSDATE, 'YYYYMMDDhh24miss')
          INTO   l_date
          FROM   DUAL;
        EXCEPTION
          WHEN OTHERS
          THEN
            xxc_common_int_pk.insert_audit (p_batch_id                        => l_batch_id,
                                            p_request_id                      => l_request_id,
                                            p_source_system                   => l_source,
                                            p_proc_name                       => l_proc_name,
                                            p_log_type                        => l_log_type,
                                            p_det_status                      => l_det_status_rejected,
                                            p_msg_code                        => NULL,
                                            p_entity                          => NULL,
                                            p_msg_desc                        => 'status not found',
                                            p_mast_request_id                 => l_request_id,
                                            p_record_id                       => NULL,
                                            p_source                          => l_source,
                                            p_target                          => l_target,
                                            p_email                           => NULL,
                                            p_mod_code                        => l_mod_code,
                                            p_audit_master_id                 => l_audit_master_id
        END;
        l_filename                      := 'AP_Fiscal_' || l_date || '.csv';
        v_file                          :=
          UTL_FILE.fopen (LOCATION                          => l_location,
                          filename                          => l_filename,
                          open_mode                         => l_open_mode,
                          max_linesize                      => l_max_linesize
                           -- Changed as per Sarah's email on 9th Decemeber
        /* UTL_FILE.put_line (v_file,
                               'SUPPLIER_REF'
                            || ','
                            || 'SUPPLIER_NAME'
                            || ','
                            || 'INVOICE_NUMBER'
                            || ','
                            || 'INVOICE_DATE'
                            || ','
                            || 'AMOUNT'
                            || ','
                            || 'UNIQUE_ID'
                            || ','
                            || 'DATE_INVOICE_ENTERED'
                            || ','
                            || 'DATE_INVOICE_PAID'
                            || ','
                            || 'USER_ID'
                            || ','
                            || 'PAYMENT_STATUS_FLAG'
                            || ','
                            || 'DOC_TYPE'
                            || ','
                            || 'DESCRIPTION'
                            || ','
                            || 'PAYMENT_AMOUNT'
        UTL_FILE.put_line (v_file,
                              'SUPPLIERREF'
                           || ','
                           || 'SUPPLIERNAME'
                           || ','
                           || 'INVOICENUMBER'
                           || ','
                           || 'DATE'
                           || ','
                           || 'AMOUNT'
                           || ','
                           || 'UNIQUEID'
                           || ','
                           || 'DATEINVOICEENTERED'
                           || ','
                           || 'DATEINVOICEPAID'
                           || ','
                           || 'USERID'
                           || ','
                           || 'PAYMENTSTATUS'
                           || ','
                           || 'DOCTYPE'
                           || ','
                           || 'DESCRIPTION'
                           || ','
                           || 'PAYMENTAMOUNT');
        UTL_FILE.put_line (v_file,
                              'XX'
                           || ','
                           || 'XX'
                           || ','
                           || 'XX'
                           || ','
                           || 'XX'
                           || ','
                           || 'XX'
                           || ','
                           || 'XX'
                           || ','
                           || 'XX'
                           || ','
                           || 'XX'
                           || ','
                           || 'XX'
                           || ','
                           || 'XX'
                           || ','
                           || 'XX'
                           || ','
                           || 'XX'
                           || ','
                           || 'XX');
                                open get_ap_data_inv;
                                loop
                                fetch get_ap_data_inv bulk collect into xxc_tbl1 limit 6000;
                 fnd_file.put_line(fnd_file.log, 'Cursor Count is : '||xxc_tbl1.count);
                                for i in xxc_tbl1.first .. xxc_tbl1.count
        --FOR cur_rec IN get_ap_data_inv
        LOOP
          BEGIN
            --Common package used for proper sequence for Record_id and Bath_id
            l_sucess_count                  := l_sucess_count + 1;
            --Insert into CSV file
            fnd_file.put_line (fnd_file.LOG, 'Before Utl file');
            UTL_FILE.put_line (v_file,
                                  xxc_tbl1(i).supplier_ref
                               || ','
                               || xxc_tbl1(i).supplier_name
                               || ','
                               || xxc_tbl1(i).invoice_number
                               || ','
                               || xxc_tbl1(i).invoice_date
                               || ','
                               || xxc_tbl1(i).amount
                               || ','
                               || xxc_tbl1(i).unique_id
                               || ','
                               ||  xxc_tbl1(i).date_invoice_entered
                               || ','
                               ||  xxc_tbl1(i).date_invoice_paid
                               || ','
                               ||  xxc_tbl1(i).user_id
                               || ','
                               ||  xxc_tbl1(i).payment_status_flag
                               || ','
                               ||  xxc_tbl1(i).doc_type
                               || ','
                               ||  xxc_tbl1(i).description
                               || ','
                               ||  xxc_tbl1(i).gross_amount);
            fnd_file.put_line (fnd_file.LOG,
                               'Supplier Reference : ' ||  xxc_tbl1(i).supplier_ref);
            xxc_common_int_pk.insert_audit
                  (p_batch_id                        => l_batch_id,
                   p_request_id                      => l_request_id,
                   p_source_system                   => l_source,
                   p_proc_name                       => l_proc_name,
                   p_log_type                        => l_log_type,
                   p_det_status                      => l_det_status_complete,
                   p_msg_code                        => NULL,
                   p_entity                          => NULL,
                   p_msg_desc                        => 'Inserting records from AP to Fiscal Successfully',
                   p_mast_request_id                 => l_request_id,
                   p_record_id                       => NULL,
                   p_source                          => l_source,
                   p_target                          => l_target,
                   p_email                           => NULL,
                   p_mod_code                        => l_mod_code,
                   p_audit_master_id                 => l_audit_master_id
          EXCEPTION
            WHEN OTHERS
            THEN
              l_error_count                   := l_error_count + 1;
              fnd_file.put_line (fnd_file.LOG,
                                    'Error While Inserting from AP to Fiscal '
                                 || SQLERRM);
                 -- Create audit log for AP Inv records insert Exception
              --Insert into the Audit table XXC_COMM_AUDIT_DETAIL_LOG and XXC_COMM_AUDIT_MASTER_LOG
              xxc_common_int_pk.insert_audit
                           (p_batch_id                        => l_batch_id,
                            p_request_id                      => l_request_id,
                            p_source_system                   => l_source,
                            p_proc_name                       => l_proc_name,
                            p_log_type                        => l_log_type,
                            p_det_status                      => l_det_status_rejected,
                            p_msg_code                        => NULL,
                            p_entity                          => NULL,
                            p_msg_desc                        => 'Error While Inserting from AP to Fiscal',
                            p_mast_request_id                 => l_request_id,
                            p_record_id                       => NULL,
                            p_source                          => l_source,
                            p_target                          => l_target,
                            p_email                           => NULL,
                            p_mod_code                        => l_mod_code,
                            p_audit_master_id                 => l_audit_master_id
          END;
        END LOOP;
         exit when get_ap_data_inv%NOTFOUND;
        end loop;
         close get_ap_data_inv;
        UTL_FILE.fclose (v_file);
        UTL_FILE.fcopy (l_location,
                        l_filename,
                        l_archive_location,
                        l_filename
          -- Create audit log for Successfully processed records
        -- Procedure call to insert in Audit tables
        xxc_common_int_pk.insert_audit
                               (p_batch_id                        => l_batch_id,
                                p_request_id                      => l_request_id,
                                p_source_system                   => l_source,
                                p_proc_name                       => l_proc_name,
                                p_log_type                        => l_log_type,
                                p_det_status                      => l_det_status_complete,
                                p_msg_code                        => NULL,
                                p_entity                          => NULL,
                                p_msg_desc                        => 'Compeleted Sucessfully AP to Fiscal',
                                p_mast_request_id                 => l_request_id,
                                p_record_id                       => NULL,
                                p_source                          => l_source,
                                p_target                          => l_target,
                                p_email                           => NULL,
                                p_mod_code                        => l_mod_code,
                                p_audit_master_id                 => l_audit_master_id
        --Insert into the Audit table XXC_COMM_AUDIT_DETAIL_LOG and XXC_COMM_AUDIT_MASTER_LOG for populating email drop table
        BEGIN
          SELECT transaction_status
          INTO   p_status
          FROM   xxc_comm_audit_master_log
          WHERE  audit_master_id = l_audit_master_id;
        EXCEPTION
          WHEN OTHERS
          THEN
            xxc_common_int_pk.insert_audit (p_batch_id                        => l_batch_id,
                                            p_request_id                      => l_request_id,
                                            p_source_system                   => l_source,
                                            p_proc_name                       => l_proc_name,
                                            p_log_type                        => l_log_type,
                                            p_det_status                      => l_det_status_err,
                                            p_msg_code                        => NULL,
                                            p_entity                          => NULL,
                                            p_msg_desc                        => 'Status Error',
                                            p_mast_request_id                 => l_request_id,
                                            p_record_id                       => NULL,
                                            p_source                          => l_source,
                                            p_target                          => l_target,
                                            p_email                           => NULL,
                                            p_mod_code                        => l_mod_code,
                                            p_audit_master_id                 => l_audit_master_id
        END;
        IF p_status <> 0
        THEN
          xxc_comm_audit_log_pk.populate_email_drop_table (l_audit_master_id,
                                                           l_batch_id);
        END IF;
      EXCEPTION
        WHEN UTL_FILE.invalid_path
        THEN
          UTL_FILE.fclose (v_file);
          raise_application_error (-20000, 'File location is invalid.');
        WHEN UTL_FILE.invalid_mode
        THEN
          UTL_FILE.fclose (v_file);
          raise_application_error (-20001,
                                   'The open_mode parameter in FOPEN is invalid.');
        WHEN UTL_FILE.invalid_filehandle
        THEN
          UTL_FILE.fclose (v_file);
          raise_application_error (-20002, 'File handle is invalid.');
        WHEN UTL_FILE.invalid_operation
        THEN
          UTL_FILE.fclose (v_file);
          raise_application_error
                           (-20003,
                            'File could not be opened or operated on as requested.');
        WHEN UTL_FILE.write_error
        THEN
          UTL_FILE.fclose (v_file);
          raise_application_error
                     (-20005,
                      'Operating system error occurred during the write operation.');
        WHEN UTL_FILE.file_open
        THEN
          UTL_FILE.fclose (v_file);
          raise_application_error
                        (-20008,
                         'The requested operation failed because the file is open.');
        WHEN UTL_FILE.invalid_maxlinesize
        THEN
          UTL_FILE.fclose (v_file);
          raise_application_error
                    (-20009,
                        'The MAX_LINESIZE value for FOPEN() is invalid; it should '
                     || 'be within the range 1 to 32767.');
          COMMIT;
          ROLLBACK TO data_extract;
        WHEN OTHERS
        THEN
          raise_application_error (-20045, SQLERRM);
          UTL_FILE.fclose (v_file);
      END xxc_mod_068_ap_pr;
    END xxc_mod_in_068_ap_to_fis_pkg;Please verify...

  • 0BBP_BPART_BUYID_ATTR Datasource taking too much time for full load

    Hello Gurus,
    This Data source is fetching 95000 records for five hours in full load. There is no Delta capability. When I run trace and try to see code, It has Oracle and MS SQL inxes but not DB2, and we are on DB2 database. Also all the fields are hidden except Business partner and Buyer ID. I didnot find any notes on this datasource.
    Did any one faced this issue, Help me how can I make this loading Faster in Daily Full loads.

    Hi,
    Divide the load using selections in different infopackages
    Thanks
    HP

  • JDBC adapter taking too much time for inserting

    we` have given a "update insert" query to be used in the JDBC adapter to insert these records into the database. Consists of 3 tables with 29fields in first, 4 fields in the other two.
    While message in XI gets processed in just 1-3 secs, the database processing time goes up to as much as 8 minutes for one record to get inserted.
    As immediate solution, is there any way we can have the JDBC adapter process these messages faster? These messages get queued up and hence all the other messages also get queued up delaying the other interfaces. We have a central adapter engine...
    Also is there any way we can get alert when the status is in "Processing/To be delivered/Delivering" and the message count exceeds a certain number say 1000

    I am using only one receiver JDBC channel
    We have been inserting three different table by using 3 different statemets tags(i.e) statement1(for table1),statement2(for table2),statement3(for table3).
    My structure is,
    <messagetype Name>
        <Statement1>
                 <tag1>
                          <action>UPDATE_INSERT</action>
                          <table>Table1</table>
                           <access>
                                        <field1>
                                         <field2>
                                          <field28>
                            <key>
                                   <MatNumber>
                 </tag1>
        </statement1>
       <Statement2>
                 <tag1>
                          <action>UPDATE_INSERT</action>
                          <table>Table2</table>
                           <access>
                                        <field1>
                                         <field2>
                                          <field4>
                            <key>
                                   <MatNumber>
                 </tag1>
        </statement2>
        <Statement3>
                 <tag3>
                         <action>UPDATE_INSERT</action>
                          <table>Table3</table>
                           <access>
                                        <field1>
                                         <field2>
                                          <field4>
                            <key>
                                   <MatNumber>
                 </tag3>
        </statement3>
    You can see we are also using key as well.In the first table we have 28 fields,second & third we are having 4.
    Edited by: rajesh shanmugasundaram on Jul 31, 2008 11:08 AM

  • Simple Update statement is taking too much time

    Hi,
    I have following update statement which is taking approx. 1 hour to update 4 lacs records. there is no any where clause in this statement and no any index on the updating column. there are only two indexes except primary key which are on other columns.
    update cp_t_exception set module_cd='DEFAULT';
    Please suggest me what can be the reason of this slowness?
    Regards,
    Sachin

    914014 wrote:
    Hi,
    please see the following details-
    Database Version -
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Execution Plan -
    PLAN_TABLE_OUTPUT
    Plan hash value: 2176582109
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | UPDATE STATEMENT | | 422K| 3298K| 31637 (1)| 00:06:20 |
    | 1 | UPDATE | CP_T_EXCEPTION | | | | |
    | 2 | TABLE ACCESS FULL| CP_T_EXCEPTION | 422K| 3298K| 31637 (1)| 00:06:20 |
    Regards,
    SachinThanks Sachin.
    I have certain suggestions for your situation: Please see which you like the most and can be implemented
    _1. Modify the Update Statement_
    Add the Complementary Set condition in the Where Predicate, thus eliminating the set of records that need not be updated.
    viz.
      update table table_name set column_name = 'DEFAULT' where column_name != 'DEFAULT';_2. Parallel Queries_
    Check if your Software supports Parallel Query Execution. Also read the Parallel Hint for DML and Parallel_Index Hint.
    _3. Create Table As Select (This option wouldn't really be required for such small amount of data.)_
    You can create a New Table and drop the existing table.
    a. Create a New Table new_table as select column_1.. columnN, decode(status, 'DEFAULT', 'DEFAULT', 'DEFAULT') from base_table; -- No Logging Mode
    b. Build the Index, Triggers, Constraints.
    c. Alter the table to LOGGING.
    d. Drop the Base_table; -- Verify if the entire data in New_Table is same as Base_Table.
    e. Rename the New_table to base_table.
    Check the Suggestions 1 and 2 to compare the performance with the DML without using them. Let us know if you still face same problem.

  • HT201250 looking for the hard disk (time capsule) and preparing the backup is taking too much time (wirelessely) !! what shall i do

    when i conect it by to my laptop with the cable, it do the back up smoothly,
    but wirelessly, it doesnt !!!!
    whats the problem ?
    how can i solve it ?
    what shall i do ?

    Try 10.7.5 supplemental update.
    This update seems to have solved this problem for many.
    Best.

  • Query is taking too much time for inserting into a temp table and for spooling

    Hi,
    I am working on a query optimization project where I have found a query which takes hell lot of time to execute.
    Temp table is defined as follows:
    DECLARE @CastSummary TABLE (CastID INT, SalesOrderID INT, ProductionOrderID INT, Actual FLOAT,
    ProductionOrderNo NVARCHAR(50), SalesOrderNo NVARCHAR(50), Customer NVARCHAR(MAX), Targets FLOAT)
    SELECT
    C.CastID,
    SO.SalesOrderID,
    PO.ProductionOrderID,
    F.CalculatedWeight,
    PO.ProductionOrderNo,
    SO.SalesOrderNo,
    SC.Name,
    SO.OrderQty
    FROM
    CastCast C
    JOIN Sales.Production PO ON PO.ProductionOrderID = C.ProductionOrderID
    join Sales.ProductionDetail d on d.ProductionOrderID = PO.ProductionOrderID
    LEFT JOIN Sales.SalesOrder SO ON d.SalesOrderID = SO.SalesOrderID
    LEFT JOIN FinishedGoods.Equipment F ON F.CastID = C.CastID
    JOIN Sales.Customer SC ON SC.CustomerID = SO.CustomerID
    WHERE
    (C.CreatedDate >= @StartDate AND C.CreatedDate < @EndDate)
    It takes almost 33% for Table Insert when I insert the data in a temp table and then 67% for Spooling. I had removed 2 LEFT joins and made it as JOIN from the above query and then tried. Query execution became bit fast. But still needs improvement.
    How I can improve further. Will it be good enough if I create Indexes on the columns for the temp table and try.or what If I use derived tables?? Please suggest.
    -Pep

    How I can improve further. Will it be good enough if I create Indexes on the columns for the temp table and try.or what If I use derived tables??
    I suggest you start with index tuning.  Specifically, make sure columns specified in the WHERE and JOIN columns are properly indexed (ideally clustered or covering, and unique when possible).  Changing outer joins to inner joins is appropriate
    if you don't need outer joins in the first place.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • How to gather table stats for tables in a different schema

    Hi All,
    I have a table present in one schema and I want to gather stats for the table in a different schema.
    I gave GRANT ALL ON SCHEMA1.T1 TO SCHEMA2;
    And when I tried to execute the command to gather stats using
    DBMS_STATS.GATHER_TABLE_STATS (OWNNAME=>'SCHMEA1',TABNAME=>'T1');
    The function is failing.
    Is there any way we can gather table stats for tables in one schema in an another schema.
    Thanks,
    MK.

    You need to grant analyze any to schema2.
    SY.

  • Audit activity for all objects in a schema

    Hi,
    Is there a way to audit all DDL statements and certain DML statements (i.e. DELETE) for all objects in a particular schema? I've been going through the Oracle documentation, and there doesn't seem to be a straightforward way to do this. For example, I've figured out that I can audit all DELETEs (too broad) or DELETEs on a particular schema object (too narrow), but nothing in between.
    The "AUDIT...BY <USER>" statement looked promising, but it doesn't cover statements issued by other users with access to the schema.
    Any help greatly appreciated!

    Is there a way to audit all DDL statements and certain DML statements (i.e. DELETE) for all objects in a particular schema?You can audit all the DDLs you need and the DMLs you need.
    For example, I've figured out that I can audit all
    DELETEs (too broad) or DELETEs on a particular schema
    object (too narrow), but nothing in between.I think you need to explain more on what you need to do because your "but nothing in between" is not clear.
    Something in between ?
    SQL>AUDIT DELETE ON EMP;
    SQL>AUDIT DELETE ON EMP WHENEVER SUCCESSFUL;
    SQL>AUDIT DELETE ON EMP WHENEVER NOT SUCCESSFUL;
    SQL>AUDIT SELECT ON EMP;
    The "AUDIT...BY <USER>" statement looked promising, but it doesn't cover statements issued by other users with access to the schemaYou can audit BY ACCESS, BY PROXY, BY SESSION

Maybe you are looking for

  • Expanding GarageBand?

    OK, so I'm a GarageBand newbie. I know I can get the Jam Packs to extend GB, but are there any good third-party plug-ins and effects (shareware or otherwise) about? I'm looking for everything from loops, to effects and anything that expands functiona

  • Syncing photos on my ipad mini

    Please could someone explain the following? "unable to sync photos because you do not have write access to the folder "Pictures" ? This message came up after trying to sync my new ipad mini, i've never had a problem before & i've been an Apple user f

  • URGENT : SM36 print Layout

    Hi, In SM36 where I am scheduling a job for a report program. I want to have a specific layout for a particular printer. Currently the particular layout in SM36 (rows by column) is not available to print my specific format. Can you tel me how to have

  • Facebook problem.please help !!

    I got a problem with my ipad. i couldn't use facebook app. it want me to set password in setting but when use my password to log in, it always say " Error signing in / Could not communicate with the serve". I couldn't remove that account as well ! Pl

  • Automatic gpupdate /force on login

    I need the group policy to be updated each time the user log in. I tried restarting the machine but didn't work I even tried to use a bat file as a log on script through gp but also didn't work the only way to update the policy is using manual gpupda