ORA-01000: Too many open cursors -- Need Help

Hi All,
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
I am getting error ora-01000 for  the following procedures gather stats
Could you please guide how to get-rid-off this error.
thanks in advance;
CREATE OR REPLACE PROCEDURE SHEMA_NAME ANALYZE_TABLES IS
   rec_table_name   VARCHAR2 (30);
   CURSOR c1
   IS
      SELECT table_name
        FROM USER_tables;  ------ 18000 table for this cursor
BEGIN
   OPEN c1;
   LOOP
      FETCH c1 INTO rec_table_name;
      EXIT WHEN c1%NOTFOUND;
      -- block was hereÿÿÿ
      BEGIN
         DBMS_STATS.
         GATHER_TABLE_STATS (
            OWNNAME            => 'SHEMA_NAME',
            TABNAME            => rec_table_name,
            PARTNAME           => NULL,
            ESTIMATE_PERCENT   => 30,
            METHOD_OPT         => 'FOR ALL COLUMNS SIZE AUTO',
            DEGREE             => 5,
            CASCADE            => TRUE);
      END;
   END LOOP;
   CLOSE c1;
EXCEPTION
   WHEN OTHERS
   THEN
      raise_application_error (
         -20001,
         'An error was encountered - ' || SQLCODE || ' -ERROR- ' || SQLERRM);
END;

Look at the following:
SQL> begin
  2          raise no_data_found;
  3  end;
  4  /
begin
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at line 2
The error code the caller executing this code receive is -01403. A unique error number that has a known and specific meaning.
In addition, the error stack tells the caller that this unique error occurred on line 2 in the source code.
The caller knows EXACTLY what the error is and where it occurred.
SQL> begin
  2          raise no_data_found;
  3  exception when OTHERS then
  4          raise_application_error(
  5                  -20000,
  6                  'oh damn some error happened. the error is '||SQLERRM
  7          );
  8  end;
  9  /
begin
ERROR at line 1:
ORA-20000: oh damn some error happened. the error is ORA-01403: no data found
ORA-06512: at line 4
In this case the caller gets the error code -20000. It is meaningless as the same error code will be use for ALL errors (when OTHERS). So the caller will never know what the actual real error is.
For the caller to try and figure that out, it will need to parse and process the error message text to look for the real error code. A very silly thing to do.
In addition, the error stack says that the error was caused by line 4 in the code called.. except that this is the line that raised the meaningless generic error and not the actual line causing the error.
There are 3 basic reasons for writing an exception handler:
- the exception is not an error
- the exception is a system exception (e.g. no data found) and needs to be turned into meaningful application exceptions (e.g. invoice not found, customer not found, zip code not found, etc)
- the exception handler is used as a try..finally resource protection block (which means it re-raises the exception)
If your exception handler cannot tick one of these three reasons for existing, you need to ask yourself why you are writing that handler.

Similar Messages

  • ORA-29270: too many open HTTP requests

    Hi,
    We have a requirement like, we will get bulk data (2 GB) data file with different languages(Russian, chinese, Japanese, German) etc. and we need to load these data into our databse also we have to translate the same.
    We are using Oracle 11g.
    We had used Oracle httpuritype - And the below mentioned procedure PROCEDURE TEST.PRC_TRANS_GERMAN will call the function - trans_jef
    Input parameter for PRC_TRANS_GERMAN - > To_language and from Language. and this procedure will store the translated word in the seperate table.
    Input parameter for the function trans_jef - > Word to be translated , from languae, to_language. And this function will return the translated word.
    The issue I am facing is when I am passing the table of around 10000 records, around 4000 rows are not getting translated. So when i try to capture the error in exception- the error is
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1819
    ORA-29270: too many open HTTP requests
    When I try to re execute the missed words, they were translated. But they are not getting translated in one go because of the too many http open request.
    So could you please let me know how to resolve this ORA-29270 errror. I know we have to end the request and start again. But not sure how to do. Can some one help with this~!!!!
    Translator
    CREATE OR REPLACE FUNCTION trans_jef (v_RawText    IN VARCHAR2,
                                          v_SrcLang    IN VARCHAR2,
                                          v_DestLang   IN VARCHAR2)
       RETURN CLOB
    IS
        v_EscRawText    VARCHAR2 (3000);
       v_XlateUrl      VARCHAR (3000);
       --v_SrcLang Varchar(10) ;-- := 'de';
       --v_DestLang Varchar(10) ; -- := 'en';
       v_XlateResult   CLOB;
       l_result        CLOB;
    BEGIN
       DBMS_OUTPUT.ENABLE (10000000);
        v_EscRawText := UTL_URL.escape (v_RawText, TRUE, 'UTF-8');
       v_XlateUrl :=
             'http://translate.google.com/translate_a/t?client=t&text='
          || v_EscRawText
          || '&hl='
          || v_DestLang
          || '&sl='
          || v_SrcLang
          || '&tl='
          || v_DestLang
          || '&ie=UTF-8&oe=UTF-8&multires=1&oc=1&prev=btn&ssel=0&tsel=0&sc=1';
         v_XlateResult := httpuritype (v_XlateUrl).getclob ();
       -- dbms_output.put_line (v_XlateResult);
       l_result := TRIM (BOTH '"' FROM REGEXP_SUBSTR (v_XlateResult, '"[^"]+"'));
        RETURN l_result;
    END;
    /* Formatted on 07-09-2012 09:21:05 (QP5 v5.215.12089.38647) */
    CREATE OR REPLACE PROCEDURE TEST.PRC_TRANS_GERMAN (TO_LANG1     IN VARCHAR2,
                                                       FROM_LANG1   IN VARCHAR2)
    IS
       P_CHINESE         VARCHAR2 (3000);
       FROM_LANG         VARCHAR2 (3000);
       FROM_LANG_CODE    VARCHAR2 (3000);
       TO_LANG_CODE      VARCHAR2 (3000);
       FROM_LANG_CODE1   VARCHAR2 (3000);
       TO_LANG_CODE1     VARCHAR2 (3000);
       cnt               NUMBER := 1;
       counter           NUMBER;
       CURSOR C1
       IS
          SELECT RAW_VAL_TXT FROM T_TRANS_VAL;
       VC1               C1%ROWTYPE;
    BEGIN
       OPEN C1;
       LOOP
          FETCH C1 INTO VC1;
          EXIT WHEN C1%NOTFOUND;
          BEGIN
             TO_LANG_CODE :=
                CASE TO_LANG1
                   WHEN 'English' THEN 'en'
                   WHEN 'Chinese Simplified' THEN 'zh-CN'
                   WHEN 'Chinese Tradational' THEN 'zh-TW'
                   WHEN 'German' THEN 'de'
                   WHEN 'Japanese' THEN 'ja'
                --other languages
                END;
             FROM_LANG_CODE :=
                CASE FROM_LANG1
                   WHEN 'English' THEN 'en'
                   WHEN 'Chinese Simplified' THEN 'zh-CN'
                   WHEN 'Chinese Tradational' THEN 'zh-TW'
                   WHEN 'German' THEN 'de'
                   WHEN 'Japanese' THEN 'ja'
                other languages
                --                 else 'auto'
                END;
             SELECT trans_jef (VC1.RAW_VAL_TXT, FROM_LANG_CODE, TO_LANG_CODE)
               INTO P_CHINESE
               FROM DUAL;
    -- same translator function is used. Language used is simplied chinese.
    -- We can use traditional Chinese as well ('zh-TW'), which works perfectly.
             FROM_LANG_CODE1 := --decode(from_lang,'en','English','ar','Arabic', from_lang);
                CASE FROM_LANG_CODE
                   WHEN 'en' THEN 'English'
                   WHEN 'zh-CN' THEN 'Chinese Simplified'
                   WHEN 'zh-TW' THEN 'Chinese Tradational'
                   WHEN 'de' THEN 'German'
                   WHEN 'ja' THEN 'Japanese'
                --other languages
                END;
             TO_LANG_CODE1 := --decode(from_lang,'en','English','ar','Arabic', from_lang);
                CASE TO_LANG_CODE
                   WHEN 'en' THEN 'English'
                   WHEN 'zh-CN' THEN 'Chinese Simplified'
                   WHEN 'zh-TW' THEN 'Chinese Tradational'
                   WHEN 'de' THEN 'German'
                   WHEN 'ja' THEN 'Japanese'
                --  other languages
                END;
             INSERT INTO t_trans
                  VALUES (FROM_LANG_CODE1,
                          VC1.RAW_VAL_TXT,
                          TO_LANG_CODE1,
                          P_CHINESE);
             COMMIT;
          EXCEPTION
             WHEN OTHERS
             THEN
                 INSERT INTO excep_trans (P_WORD_EXP, UPDATE_TIME, COUNTER)
                     VALUES (VC1.RAW_VAL_TXT, SYSDATE, cnt);
                INSERT INTO error_message
                     VALUES (DBMS_UTILITY.FORMAT_ERROR_STACK);
                 COMMIT;
          END;
        END LOOP;
       CLOSE C1;
    END;
    /Edited by: 950814 on 6 Sep, 2012 11:16 PM

    Simply add the call to your exception hander. E.g.
    EXCEPTION
             WHEN OTHERS
             THEN
                   UTL_TCP.Close_All_Connections;
                   INSERT INTO excep_trans (P_WORD_EXP, UPDATE_TIME, COUNTER)
                     VALUES (VC1.RAW_VAL_TXT, SYSDATE, cnt);
    ..etc..
    END;Also consider using proper coding standards. There is NO modern day programming language standard that says to write (selective) reserved words in uppercase. Write in lowercase. Use camelcase and pascalcase for variable names and procedures/functions/methods. Restrict the use of uppercase to defining identifiers such as compiler macros or constants.
    Do yourself a favour and read, understand and apply the basic naming standards as detailed in .Net Guidelines for Names and Code Conventions for the Java Programming Language.

  • Getting ORA-06512: at "SYS.UTL_HTTP", line 1022 ORA-29270: too many open

    hi
    I am getting the following error while calling the procedure in the batch process
    ORA-06512: at "SYS.UTL_HTTP", line 1022
    ORA-29270: too many open HTTP requests
    Could you please help me on this? As this is getting affected in the live databases.
    ORA-06512: at "SYS.UTL_HTTP", line 1022
    ORA-29270: too many open HTTP requests
    CREATE OR REPLACE PROCEDURE Send_To_Spg(
    PTRANSACTION_ID               IN          VARCHAR2,
    PCHANNEL_TYPE               IN VARCHAR2 DEFAULT NULL,
    PCSS_ORDER_NUMBER          IN VARCHAR2 DEFAULT NULL,
    PTELEPHONE_NUMBER          IN VARCHAR2 DEFAULT NULL,
    PSCENARIO_TYPE               IN VARCHAR2 DEFAULT NULL,
    PCUSTOMER_REQUIRED_DATE IN          VARCHAR2 DEFAULT NULL,
    PCUSTOMER_REQUIRED_TIME IN          VARCHAR2 DEFAULT NULL,
    PCANCELLATION_REASON     IN          VARCHAR2 DEFAULT NULL,
    PCANCELLATION_NOTES          IN          VARCHAR2 DEFAULT NULL,
    PSMPF_RETENTION               IN          VARCHAR2 DEFAULT NULL,
    PEMERGENCY_WINBACK          IN          VARCHAR2 DEFAULT NULL,
    PCSS_PROJECT_ID               IN          VARCHAR2 DEFAULT NULL,
    PCSS_ORDER_NOTES          IN          VARCHAR2 DEFAULT NULL,
    PREASON_FOR_CESSATION     IN          VARCHAR2 DEFAULT NULL,
    P_RESPONSE                    OUT VARCHAR2,
    PSMART_USER_ID               IN VARCHAR2 DEFAULT NULL,
    PORACLE_ERROR               OUT VARCHAR2,
    PORACLE_ERROR_MESSAGE     OUT          VARCHAR2,
    PRESPONSE_TIME               OUT          NUMBER,
    PDATA_TRANSFER_STATUS     OUT          VARCHAR2)
    IS
    v_scenario_type               VARCHAR2(20); -- Varialble to Hold Time Out of every request to SPG
    v_transaction_time          NUMBER;          -- Total time in which Request to SPG was processed
    v_record_inserted_at     DATE;          -- Date/Time about the record insertion to the Error Handler
    v_start_time               NUMBER;          -- Variable to hold Start Time for calculationg Transaction Time
    v_url                         VARCHAR2(32767);-- URL to use when sending data to SPG
    vtransaction_id               VARCHAR2(18); -- Variable to hold Transaction ID for the request
    v_buffer                    VARCHAR2(32760);-- Variable to read response from the SPG interface
    v_timeout                    PLS_INTEGER; -- Time Out for each Transaction
    v_oracle_err_msg          VARCHAR2(600); -- Variable to hold Oracle Error Message
    v_resp                UTL_HTTP.RESP; -- Response Object
    v_req                UTL_HTTP.REQ; -- Request Object
    v_userid_pwd               SMT_ORACLE_PARAMETERS%ROWTYPE; --Variable declared to contain User ID & Password
    vl_RetCode          VARCHAR2(5000);
    vl_std_returnCode     VARCHAR2(3000);
    --PDATA_TRANSFER_STATUS Holds the Data Transfer Status which can have possible values as
    -- N => Data Has not been sent to SPG
    -- Y => Received Successful response from SPG
    -- F => On the First try to Send data to SPG Oracle Error Occured or response from SPG was a faulure
    -- S => On the Second try to Send data to SPG Oracle Error Occured or response from SPG was a faulure
    -- T => Data Has been transferred to the Error Log Table
    -- X => Data need not be transfered to Error Log Table.
    --Location of the timeout, URL & User Id & Password in Standing Data.
    c_url_stopwlr SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_WLR';-- Stop WLR URL
    c_url_cancelown SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_OWN';-- Cancel own URL
    c_url_cancelother SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_OTH';-- Cancel other URL
    c_url_amendcrd SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_CRD';--Amend CRD URL
    c_spg_useridpwd SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPGIDPWD'; --Contains user id and pwd
    ctimeout smt_parameters.parameter_code%TYPE:='SPGTO'; --This holds the timeout parameter
    BEGIN
         --In case the calling batch process can pass this value this SQL read will not be required & can be deleted
         --Read data transfer status for the transaction Id
         SELECT data_transfer_status INTO PDATA_TRANSFER_STATUS     FROM SPG_INTERFACE_TABLE
         WHERE transaction_id     =     PTRANSACTION_ID;
         --Record the start time
         v_start_time:=DBMS_UTILITY.GET_TIME;
         --If Data transfer status is S then send the record to error handler
         IF PDATA_TRANSFER_STATUS = 'S' THEN
              Error_Handler(PTRANSACTION_ID,PSMART_USER_ID,PORACLE_ERROR,PORACLE_ERROR_MESSAGE,v_record_inserted_at,PDATA_TRANSFER_STATUS);
         ELSE
         --In case Data Tranfer Status is something other than S then send the request to SPG
              --Initialise other variables which will be populated during the journey
              P_RESPONSE                    :=     '';
              PORACLE_ERROR               :=     NULL;
              PORACLE_ERROR_MESSAGE     :=     NULL;
              PRESPONSE_TIME               :=     0;
         --Read timeout parameter from standing data.
              BEGIN
                   SELECT VALUE INTO v_timeout FROM smt_parameters WHERE parameter_code=ctimeout;
              EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                   v_timeout:=30;
              WHEN OTHERS THEN
                   v_timeout:=30;
              END;
         -- Construct the URL for Stop WLR Scenario
              IF PSCENARIO_TYPE = 'STOP_WLR' THEN
                   BEGIN
                   -- Read the Initial URL from Standing Data
                   SELECT VALUE
                        INTO v_url
                        FROM SMT_ORACLE_PARAMETERS
                        WHERE parameter_code = c_url_stopwlr
                        AND host_id = ( SELECT host_id
                                                      FROM SMART_HOSTS A
                                                      WHERE EXISTS ( SELECT 1
                                                                     FROM DB_PARAMETERS b
                                                                     WHERE A.hostname = b.hostname
                                                                     AND A.database_id = b.database_id));
                   --handle unforseen exception
                   EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                        v_url:='Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_winback_details'; --After testing the same, URL will be fetched from the Query
                   WHEN OTHERS THEN
                        v_url:='Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_winback_details'; --After testing the same, URL will be fetched from the Query
                   END;
                   --construct the URL depending on the parameters to be passed to the url
                   v_url := v_url || '?';
                   v_url := v_url || 'p_data_entered=' || Smart_Urlencode('xmloverhttp') || '&';
                   v_url := v_url || 'p_channel_type=' || Smart_Urlencode(PCHANNEL_TYPE)|| '&';
                   v_url := v_url || 'p_css_start_order_no=' || Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
                   v_url := v_url || 'p_tel_no=' || Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
                   v_url := v_url || 'p_crd=' || Smart_Urlencode(PCUSTOMER_REQUIRED_DATE)|| '&';
                   v_url := v_url || 'p_take_over_time=' || Smart_Urlencode(PCUSTOMER_REQUIRED_TIME)|| '&';
                   v_url := v_url || 'p_retainsmpf=' || Smart_Urlencode(PSMPF_RETENTION)|| '&';
                   --v_url := v_url || 'p_emergency_winback='                    || Smart_Urlencode(PEMERGENCY_WINBACK)|| '&';
                   v_url := v_url || 'p_projectno=' || Smart_Urlencode(PCSS_PROJECT_ID)|| '&';
                   v_url := v_url || 'p_ordernotes=' || Smart_Urlencode(PCSS_ORDER_NOTES)|| '&';
                   v_url := v_url || 'p_reason_cessation=' || Smart_Urlencode(PREASON_FOR_CESSATION);
              ELSIF PSCENARIO_TYPE='CANCEL_OWN' THEN
              --Fetch the URL for cancel own from standing data.
                   BEGIN
                        SELECT VALUE
                        INTO v_url
                        FROM SMT_ORACLE_PARAMETERS
                        WHERE parameter_code = c_url_cancelown
                        AND host_id = ( SELECT host_id
                                                      FROM SMART_HOSTS A
                                                      WHERE EXISTS ( SELECT 1
                                                                     FROM DB_PARAMETERS b
                                                                     WHERE A.hostname = b.hostname
                                                                     AND A.database_id = b.database_id));
              --handle unforseen exception
                   EXCEPTION
                             WHEN NO_DATA_FOUND THEN
                             v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelown_details'; --After testing the same, URL will be fetched from the Query
                   WHEN OTHERS THEN
                             v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelown_details'; --After testing the same, URL will be fetched from the Query
                   END;
              --construct the URL
              v_url := v_url || '?';
              v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
              v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
              v_url := v_url || 'p_css_start_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
              v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
              v_url := v_url || 'p_cancel_reason=' ||Smart_Urlencode(PCANCELLATION_REASON)|| '&';
              v_url:= v_url || 'p_cancel_notes=' ||Smart_Urlencode(PCANCELLATION_NOTES);
              ELSIF PSCENARIO_TYPE='CANCEL_OTHER' THEN
              --Fetch the URL for cancel own from standing data.
              BEGIN
              SELECT VALUE
                        INTO v_url
                        FROM SMT_ORACLE_PARAMETERS
                        WHERE parameter_code = c_url_cancelother
                        AND host_id = ( SELECT host_id
                                                      FROM SMART_HOSTS A
                                                      WHERE EXISTS ( SELECT 1
                                                                     FROM DB_PARAMETERS b
                                                                     WHERE A.hostname = b.hostname
                                                                     AND A.database_id = b.database_id));
              --handle unforseen exception
              EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                        v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelother_details'; --After testing the same, URL will be fetched from the Query
                   WHEN OTHERS THEN
                        v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelother_details'; --After testing the same, URL will be fetched from the Query
              END;
              --construct the URL
              v_url := v_url || '?';
              v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
              v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
              v_url := v_url || 'p_css_stop_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
              v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
              v_url := v_url || 'p_cancel_reason=' ||Smart_Urlencode(PCANCELLATION_REASON);
              ELSIF Pscenario_type='AMEND_CRD' THEN
              --Fetch the URL for cancel own from standing data.
              BEGIN
              SELECT VALUE
                        INTO v_url
                        FROM SMT_ORACLE_PARAMETERS
                        WHERE parameter_code = c_url_amendcrd
                        AND host_id = ( SELECT host_id
                                                      FROM SMART_HOSTS A
                                                      WHERE EXISTS ( SELECT 1
                                                                     FROM DB_PARAMETERS b
                                                                     WHERE A.hostname = b.hostname
                                                                     AND A.database_id = b.database_id));
              --handle unforseen exception
              EXCEPTION
              WHEN NO_DATA_FOUND THEN
                   v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_amendcrd_details'; -- After testing the same , URL will be fetched from the Query
              WHEN OTHERS THEN
                   v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_amendcrd_details'; -- After testing the same , URL will be fetched from the Query
              END;
              --construct the URL
              v_url := v_url || '?';
              v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
              v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
              v_url := v_url || 'p_css_start_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
              v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
              v_url := v_url || 'p_crd='                         ||Smart_Urlencode(PCUSTOMER_REQUIRED_DATE)|| '&';
              v_url := v_url || 'p_css_change_order_numbers='||Smart_Urlencode(PCANCELLATION_REASON);
              END IF;
              --this is start of setting parameters for utl http object. the show begins...
              utl_http.set_transfer_timeout(v_timeout);
              --Set the wallet
              --XXXXX e.g.UTL_HTTP.SET_WALLET(?file:DirectoryPath?,'put password here?);
              --Set proxy
              --YYYYY e.g. utl_http.set_proxy(p_proxy_in, p_no_proxy_domains_in);
              v_url := REPLACE(v_url,'%27%27','%27'); -- Fix to ensure Double Quotes are converted to Single Quotes
              --set the required URL to utl http.
              v_req := utl_http.begin_request(v_url);
              --Authentication setting
              --Fetch the user id and password from stnding data.
              BEGIN
                   SELECT *
                        INTO v_userid_pwd
                        FROM SMT_ORACLE_PARAMETERS
                        WHERE PARAMETER_CODE=c_spg_useridpwd
                        AND HOST_ID = ( SELECT HOST_ID
                                            FROM SMART_HOSTS A
                                            WHERE EXISTS ( SELECT 1
                                                                FROM DB_PARAMETERS B
                                                                WHERE A.HOSTNAME = B.HOSTNAME
                                                                AND A.DATABASE_ID = B.DATABASE_ID));
              EXCEPTION
                   WHEN NO_DATA_FOUND THEN
                   P_RESPONSE := 'ORACLE_ERROR: USER id AND Password NOT configured IN SMT_ORACLE_PARAMETERS:SPGIDPWD';
                   WHEN OTHERS THEN
                   P_RESPONSE := 'ORACLE_ERROR: USER id AND Password NOT configured IN SMT_ORACLE_PARAMETERS:SPGIDPWD';
              END;
              --utl_http.set_authentication(v_req, p_username_in, p_password_in);
              utl_http.set_authentication(v_req, v_userid_pwd.description, v_userid_pwd.VALUE);
              v_resp := utl_http.get_response(v_req);
              --Fill in the the response time
              PRESPONSE_TIME := (DBMS_UTILITY.GET_TIME - v_start_time)/100;
              IF v_resp.reason_phrase = 'OK' THEN
                   -- Fetch the response
                   BEGIN
                        LOOP
                        utl_http.read_line(v_resp, v_buffer);
                             P_RESPONSE := P_RESPONSE || v_buffer;
                        END LOOP;
                             utl_http.end_response(v_resp);
                        EXCEPTION
                        WHEN utl_http.end_of_body THEN
                        utl_http.end_response(v_resp);
                        P_RESPONSE := P_RESPONSE || v_buffer;
                   END;
              ELSIF v_resp.reason_phrase <> 'OK' OR P_RESPONSE = '' THEN
                   --error handling starts
                   --If the HTTP Status is not OK then store the error information
                   PORACLE_ERROR_MESSAGE     :=     'Status Code: '|| v_resp.STATUS_CODE||'. Reason Phrase ' ||v_resp.reason_phrase;
                   P_RESPONSE                    :=     'ORACLE_ERROR: '||     ' Reason Phrase ' ||     v_resp.reason_phrase;
                   PORACLE_ERROR               :=     v_resp.STATUS_CODE;
              END IF;
              --In case we got successful response from SPG
              IF P_RESPONSE LIKE '%<RetCde>0</RetCde>%' THEN
                   PDATA_TRANSFER_STATUS     :=     'Y';
              ELSE
                   BEGIN
    SELECT message
                                  INTO vl_std_returnCode
                                  FROM SMT_MESSAGES
                                  WHERE MESSAGE_CODE='SPGANTIDTS';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
         vl_std_returnCode := '-12545,-29273,-1,401,';
    WHEN OTHERS THEN
                        vl_std_returnCode := '-12545,-29273,-1,401,';
    END;
                   --In case there was an error do not update Data Transfer Status
                   IF PORACLE_ERROR <> NULL AND INSTR(vl_std_returnCode, PORACLE_ERROR || ',', 1, 1) <> 0 THEN
                             PDATA_TRANSFER_STATUS:=PDATA_TRANSFER_STATUS;
                   ELSE
                        vl_RetCode := SUBSTR(P_RESPONSE, INSTR(P_RESPONSE,'<RetCde>', 1, 1),
                        INSTR(P_RESPONSE,'</RetCde>',1,1)+9 - INSTR(P_RESPONSE,'<RetCde>', 1, 1));
                        BEGIN
                             SELECT VALUE
                                  INTO vl_std_returnCode
                                  FROM SMT_ORACLE_PARAMETERS
                                  WHERE PARAMETER_CODE='SPGRCS'
                                  AND HOST_ID = ( SELECT HOST_ID
                                       FROM SMART_HOSTS A
                                       WHERE EXISTS ( SELECT 1
                                                           FROM DB_PARAMETERS B
                                                           WHERE A.HOSTNAME = B.HOSTNAME
                                                           AND A.DATABASE_ID = B.DATABASE_ID));
                   EXCEPTION
                        WHEN NO_DATA_FOUND THEN
                             vl_std_returnCode := '<RetCde>4244</RetCde><RetCde>4245</RetCde><RetCde>4246</RetCde>';
                        WHEN OTHERS THEN
                             vl_std_returnCode := '<RetCde>4244</RetCde><RetCde>4245</RetCde><RetCde>4246</RetCde>';
                        END;
                        IF INSTR(vl_std_returnCode, vl_RetCode, 1, 1) <> 0 THEN
                             --needs not to re attempted.
                             PDATA_TRANSFER_STATUS:='X';
                        ELSE
                             --In case we did'nt got SUCCESSFUL response FROM SPG THEN UPDATE the Data Transfer Status so that the failed requests can be picked up BY the NEXT batch job RUN
                             IF PDATA_TRANSFER_STATUS='N' THEN
                                  --initially if data transfer status was N then update it now to F
                                  PDATA_TRANSFER_STATUS     :=     'F';
                             ELSIF PDATA_TRANSFER_STATUS='F' THEN
                                  --initially if data transfer status was N then update it now to S
                                  PDATA_TRANSFER_STATUS     :=     'S';
                             END IF;
                        END IF;
                   END IF;
              END IF;
              --Now Update all the modified Values
         UPDATE SPG_INTERFACE_TABLE
                   SET     response          =     P_RESPONSE,
                   data_transfer_status     =     PDATA_TRANSFER_STATUS,
                   oracle_error               =     PORACLE_ERROR,
                   oracle_error_message     =     PORACLE_ERROR_MESSAGE,
                   response_time               =     PRESPONSE_TIME
                   WHERE transaction_id     =     PTRANSACTION_ID;
              COMMIT;
    END IF;
    EXCEPTION
         WHEN OTHERS THEN
         --Handling the unhandled exception
         PORACLE_ERROR               :=     SQLCODE;
         PORACLE_ERROR_MESSAGE     :=     SQLERRM;
         P_RESPONSE                    :=     'ORACLE_ERROR: '|| PORACLE_ERROR_MESSAGE;
         PRESPONSE_TIME               :=     (DBMS_UTILITY.GET_TIME - v_start_time)/100;
         SELECT data_transfer_status INTO PDATA_TRANSFER_STATUS
         FROM SPG_INTERFACE_TABLE
         WHERE transaction_id=PTRANSACTION_ID;
         --New functionality to update the oracle error and oracle error message and not the Data Transfer Status
    BEGIN
    SELECT message
    INTO vl_std_returnCode
    FROM SMT_MESSAGES
    WHERE MESSAGE_CODE='SPGANTIDTS';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    vl_std_returnCode := '-12545,-29273,-1,';
    WHEN OTHERS THEN
    vl_std_returnCode := '-12545,-29273,-1,';
    END;
         vl_RetCode     :=     PORACLE_ERROR || ',';
    IF INSTR(vl_std_returnCode, vl_RetCode, 1, 1) <> 0 THEN
    --If the error is found in above maintained standing data do not change the Data Transfer Status
                   pdata_transfer_status:=pdata_transfer_status;
    ELSE
              IF pdata_transfer_status='N' THEN
                             PDATA_TRANSFER_STATUS     :=     'F';
                             DBMS_OUTPUT.PUT_LINE('DUE TO ERROR DATA COULDN''T GET TRANSFERED TO SPG FOR TRANSACTION'||' '||PTRANSACTION_ID);
                             DBMS_OUTPUT.PUT_LINE(SQLERRM);
              ELSIF pdata_transfer_status='F' THEN
                             PDATA_TRANSFER_STATUS     :=     'S';
                             DBMS_OUTPUT.PUT_LINE('DUE TO ERROR DATA COULDN''T GET TRANSFERED TO SPG FOR TRANSACTION'||' '||PTRANSACTION_ID);
                             DBMS_OUTPUT.PUT_LINE(SQLERRM);
    ELSE
                             DBMS_OUTPUT.PUT_LINE('Failure WHEN sending data TO Error LOG. Data Transfer Status IS ' || PDATA_TRANSFER_STATUS || '. TRANSACTION ID '|| PTRANSACTION_ID);
              END IF;
    END IF;
              --Now update all the information gathered above to the table
         UPDATE SPG_INTERFACE_TABLE
              SET     response          =     P_RESPONSE,
              data_transfer_status     =     PDATA_TRANSFER_STATUS,
              oracle_error               =     PORACLE_ERROR,
              oracle_error_message     =     PORACLE_ERROR_MESSAGE,
              response_time               =     PRESPONSE_TIME
              WHERE transaction_id     =     PTRANSACTION_ID;
              COMMIT;
    END;
    /

    I have fixed the problem by own.
    Seems there are some while space in the endpoint url.
    Fix
    http_req:= utl_http.begin_request
    trim(l_endpoint_url)
    ,'POST'
    ,'HTTP/1.1'
    It works...
    Regards
    BS

  • ORA-30678: too many open connections

    Hi,
    I executed this procedure..
    CREATE OR REPLACE procedure
    TRY.e_mail_message
    from_name in varchar2,
    to_name in varchar2,
    subject in varchar2,
    message in varchar2
    is
    l_mailhost VARCHAR2(64);
    l_from VARCHAR2(64);
    l_to VARCHAR2(64);
    crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
    l_mail_conn UTL_SMTP.connection;
    mesg VARCHAR2( 4000 );
    BEGIN
    select a.SERVER into l_mailhost from email_setting a where a.SERVER is not null;
    select a.USERNAME into l_from from email_setting a where a.SERVER is not null;
    l_from := from_name;
    --UTL_SMTP.open_data(l_mail_conn);
    dbms_output.put_line('email test ');
    mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
    'From: <'||l_from||'>' || crlf ||
    'Subject: ' ||subject|| crlf ||
    'To: '||to_name || crlf || '' || crlf ;
    mesg:=mesg||message;
    dbms_output.put_line(mesg);
    l_mail_conn := UTL_SMTP.open_connection(l_mailhost, 25);
    UTL_SMTP.helo(l_mail_conn, l_mailhost);
    UTL_SMTP.mail(l_mail_conn, l_from);
    UTL_SMTP.rcpt(l_mail_conn, to_name);
    UTL_SMTP.data(l_mail_conn, mesg);
    UTL_SMTP.quit(l_mail_conn);
    exception
    when others then dbms_output.put_line(sqlerrm);
    END;
    However, email could not be sent to recipient. Below is the error message.
    Sending email to subject: Reminder to settle outstanding bil for Invoice No: CA/01062010/555
    call email_mssg cmd 3
    email test
    Date: 23 June 10 15:11:50
    From: <>
    Subject: Reminder to settle outstanding bil for Invoice No: CA/01062010/555
    To: [email protected]
    Please Settle Outstanding Bil for your Invoice No: CA/01062010/555. Thank you
    ORA-30678: too many open connections
    Below is the username I keyed in the email_setting table, with reference to the select username statement from the procedure as above.
    username in email_setting => [email protected]
    I also tried key in as '[email protected]' but still not working.
    Could someone suggest any solution? Thanks..

    Mr. Saubhik,
    Yes, no data passed for the From: as shown from the dbms output error message shown below:
    Sending email to subject: Reminder to settle outstanding bil for Invoice No: CA/01062010/555
    call email_mssg cmd 3
    email test
    Date: 23 June 10 16:15:04
    From:
    Subject: Reminder to settle outstanding bil for Invoice No: CA/01062010/555
    To: [email protected]
    Please Settle Outstanding Bil for your Invoice No: CA/01062010/555. Thank you
    ORA-29279: SMTP permanent error: 501 5.1.7 Invalid address
    I am clueless how to settle this. I don't want to hard code the sender's email address. Please help. Thank you.

  • UTL_MAIL --- ORA-30678: too many open connections

    Hello,
    I have a pl/sql package that sends out emails using UTL_MAIL pkg pointing to an Exchange server, an APEX app calls this pkg.. This package used to work fine for months but I recently noticed that some emails are not being sent as expected. The package loops through a set of action items satisfying some conditions and send emails based on that ( this number is expected to grow every day ). I checked the errors log and I found this error:
    ORA-30678: too many open connections
    I think this means that I have to close the connection everytime I send en email, but UTL_MAIL does NOT have a function or a proc to close connections, right ?
    I don't know what causes this error to happen, but I suspect that this started happening right after we re-pointed the UTL_MAIL pkg from a Lotus Notes server to an Exchange server.
    I am also seeing this error:
    ORA-29279: SMTP permanent error: 501 5.1.3 Invalid address
    I know where this error comes from (usually a null email id in the FROM or TO field ), but can this be causing the first error to happen ?
    Please advise if you got this error before, is it a bug in oracle 10g as I read in some blog ? or is the second error happening make the Exchange server refuse SMTP connections ???
    Thanks,
    Sam

    Hi Sam,
    seems to be a bug in UTL_MAIL if you ask me, as you are right - there is only /send/, no option to close, so I'd expect this to be done automatically.
    Anyway, though UTL_MAIL is usable for basic mailing, I prefer using a custom mail implementation based on UTL_SMTP. The most important reason is that most mail servers don't work without authentication. And if you have done this once, you can reuse the function/procedure/package as simple as UTL_MAIL. The good news is, that there are several examples published that provide you with the functionality you have in UTL_MAIL at once - with the difference, that you definetly get your connection closed when you expect it to be closed.
    You'll also be able to handle empty addresses. Perhaps this error actually causes UTL_MAIL to "forget" to close the connection, if this exception isn't caught before in order to close an open connection before raising it to the outside.
    One example implementation for using UTL_SMTP can be found [url http://www.morganslibrary.com/reference/pkgs/utl_smtp.html]here
    -Udo

  • Report causes too many open cursors

    Hello there!
    I've got the following situation:
    I've a very heavy report used for generating our Users Manual. In Reports 6i this Report works fine, generating the Manual works.
    In 10g the Report starts, and formats about 240 pages (in 6i I can generate over 1000 pages and more with this report), and cancels with the message "too many open cursors".
    So I took a look at the open cursors:
    In 6i there are about 100 open cursors caused by this report; in 10g there are...uhm...in all cases to much for the max_open_cursors parameter of the database (standard value which is used by our application is 1000; increasing this to e.g. 5000 resulted in the same behaviour => too many open cursors).
    Checked the open cursors while running the report which showed the following behaviour:
    The report formats about 230 pages, and opens about 20 cursors (~30 sec.). for the next 10 sites the report opens the pending 980 cursors (~5 sec.), and stops formatting...
    So it seems the report server causes some bad recursion: When restarting the reports server and re-running the report, I get sometimes the following error:
    Mit Fehler beendet: REP-536870981: Interner Fehler REP-62204: Interner Fehler beim Schreiben des Bildes BandCombine: a row of the matrix does not have the correct number of entries, should be OpImage.getExpandedNumBands(source0.getSampleModel(), source0.getColorModel()) + 1.. REP-0069: Interner Fehler REP-50125: Exception abgefangen: java.lang.NullPointerException REP-0002: Unable to retrieve a string from the Report Builder message file. REP-536870981:
    or maybe the report server tries to paralellize some querys (as this report consists of about 5 querys)?
    As said - this is a very complex report (my colleague spent about 3 months of his life with creating it and that's not why he is a lamer in reports ;-)) so it's very hard to give you a repcase, but if anyone knows some advice like "edit the <repservername>.conf; append 'DO NEVER EVER PARALLELYZE QUERYS' to the config" or something this would be very useful ;-).
    many thanks
    best regards
    Christian

    I've now located the problem:
    The report consists of several querys based on a ref cursor; and this cursors are opend and not closed in 10g...
    I'll open a SR on metalink....
    best regards
    Christian

  • ORA-30678: too many open connections with UTL_MAIL.send

    I'm have just recently started getting the ORA-30678: too many open connections error while calling the UTL_MAIL.send procedure to send emails via a pl/sql package. The call is made within a loop and there can be a significant number of calls made to this procedure. In fact, I received this error over 1400 times within the last three days. This was previously working until I made a change to the processing which now results in a larger number of emails/calls to this procedure. I don't see any documentation on how (or if) I can close the connection with UTL_MAIL.
    I'm using Oracle 11g. Any insight would be much appreciated.
    Thanks,
    Teri

    Looks like a bug possibly, check out this MOS Note:
    Ora-30678: Too Many Open Connections From UTL_MAIL [ID 788442.1]
    The bug note says it was fixed in 11.2. Not sure which version of 11 you are running.
    Edited by: Centinul on Apr 26, 2010 2:07 PM

  • TOO many OPEN CURSORS during loop of INSERT's

    Running ODP.NET beta2 (can't move up yet but will do that soon)
    I don't think it is related with ODP itself but probably on how .Net works with cursors. We have a for/next loop that executes INSERT INTO xxx VALUES (:a,:b,:c)
    statements. Apparently, when monitoring v$sysstat (current open cursors) we see these raising with 1 INSERT = 1 cursor. If subsequently we try to perform another action, we get max cursors exceeded. We allready set open_cursor = 1000, but the number of inserts can be very high. Is there a way to release these cursors (already wrote oDataAdaptor.dispose, oCmd.dispose but this does not help.
    Is it normal that each INSERT has it's own cursor ? they all have the same hashvalue in v$open_cursor. They seem to be released after a while, especially when moving to another asp.net page, but it's not clear when that happens and if it is possible to force the release of the (implicit?) cursors faster.
    Below is a snippet of the code, I unrolled a couple of function-calls into the code so this is just an example, not sure it will run without errors like this, but the idea should be clear (the code looks rather complex for what it does but the unrolled functions make the code more generic and we have a database-independend datalayer):
    Try
    ' Set the Base Delete statement
    lBaseSql = _
    "INSERT INTO atable(col1,col2,col3) " & _
    "VALUES(:col1,:col2,:col3)"
    ' Initialize a transaction
    lTransaction = oConnection.BeginTransaction()
    ' Create the parameter collection, containing for each
    ' row in the list the arguments
    For Each lDataRow In aList.Rows
    lOracleParamters = New OracleParameterCollection()
    lOracleParameter = New OracleParameter("luserid", OracleDbType.Varchar2,
    _ CType(aCol1, Object))
    lOracleParamters.Add(lOracleParameter)
    lOracleParameter = New OracleParameter("part_no", OracleDbType.Varchar2, _
    CType(lDataRow.Item("col2"), Object))
    lOracleParamters.Add(lOracleParameter)
    lOracleParameter = New OracleParameter("revision", OracleDbType.Int32, _
    CType(lDataRow.Item("col3"), Object))
    lOracleParamters.Add(lOracleParameter)
    ' Execute the Statement;
    ' If the execution fails because the row already exists,
    ' then the insert should be considered as succesfull.
    Try
    Dim aCommand As New OracleCommand()
    Dim retval As Integer
    'associate the aConnection with the aCommand
    aCommand.Connection = oConnection
    'set the aCommand text (stored procedure name or SQL statement)
    aCommand.CommandText = lBaseSQL
    'set the aCommand type
    aCommand.CommandType = CommandType.Text
    'attach the aCommand parameters if they are provided
    If Not (lOracleParameters Is Nothing) Then
    Dim lParameter As OracleParameter
    For Each lParameter In lOracleParameters
    'check for derived output value with no value assigned
    If lParameter.Direction = ParameterDirection.InputOutput _
    And lParameter.Value Is Nothing Then
    lParameter.Value = Nothing
    End If
    aCommand.Parameters.Add(lParameter)
    Next lParameter
    End If
    Return
    ' finally, execute the aCommand.
    retval = cmd.ExecuteNonQuery()
    ' detach the OracleParameters from the aCommand object,
    ' so they can be used again
    cmd.Parameters.Clear()
    Catch ex As Exception
    Dim lErrorMsg As String
    lErrorMsg = ex.ToString
    If Not lTransaction Is Nothing Then
    lTransaction.Rollback()
    End If
    End Try
    Next
    lTransaction.Commit()
    Catch ex As Exception
    lTransaction.Rollback()
    Throw New DLDataException(aConnection, ex)
    End Try

    I have run into this problem as well. To my mind
    Phillip's solution will work but seems completey unnecessary. This is work the provider itself should be managing.
    I've done extensive testing with both ODP and OracleClient. Here is one of the scenarios: In a tight loop of 10,000 records, each of which is either going to be inserted or updated via a stored procedure call, the ODP provider throws the "too many cursor errors at around the 800th iteration. With over 300 cursors being open. The exact same code with OracleClient as the provider never throws an error and opens up 40+ cursors during execution.
    The applicaation I have updates a Oracle8i database from a DB2 database. There are over 30 tables being updated in near real time. Reusing the command object is not an option and adding all the code Phillip did for each call seems highly unnecessary. I say Oracle needs to fix this problem. As much as I hate to say it the microsoft provider seems superior at this point.

  • Runtime Error - DBIF_RSQL_INVALID_RSQL - Too many OPEN CURSOR

    When I try to train a Decision Tree Model via an APD process in RSANWB, I get a runtime error when my model is configured with too many parameter fields or too many leaves (with 2 leaves it works, with more it fails).
    By searching SAP Notes I see that there are many references to this kind of runtime errors. But no note on occurences of it in RSANWB / RSDMWB .
    Any information on this anyone?
    Claudio Ciardelli
    Runtime Errors         DBIF_RSQL_INVALID_RSQL
    Date and Time          29.07.2005 16:19:21
    |ShrtText                                                                                |
    |    Error in RSQL module of database interface.                                                   |
    |What happened?                                                                                |
    |    Error in ABAP application program.                                                            |
    |                                                                                |
    |    The current ABAP program "SAPLRS_DME_DECISION_TREE_PRED" had to be terminated                 |
    |     because one of the                                                                           |
    |    statements could not be executed.                                                             |
    |                                                                                |
    |    This is probably due to an error in the ABAP program.                                         |
    |                                                                                |
    |Error analysis                                                                                |
    |    The system attempted to open a cursor for a SELECT or OPEN CURSOR                             |
    |    statement but all 16 cursors were already in use.                                             |
    |    The statement that failed accesses table "/BIC/0CDT000030 ".                                  |
    |    The erroneous statement accesses table "/BIC/0CDT000030 ".                                    |
    |Trigger Location of Runtime Error                                                                 |
    |    Program                                 SAPLRS_DME_DECISION_TREE_PRED                         |
    |    Include                                 LRS_DME_DECISION_TREE_PREDU06                         |
    |    Row                                     103                                                   |
    |    Module type                             (FUNCTION)                                            |
    |    Module Name                             RS_DME_DTP_EVALUATE                                   |
    |Source Code Extract                                                                               |
    |Line |SourceCde                                                                                |
    |   73|* Prepare for Data evaluation                                                               |
    |   74|  CATCH SYSTEM-EXCEPTIONS OTHERS = 15.                                                      |
    |   75|    CREATE DATA ref TYPE (i_enum_dbtab).                                                    |
    |   76|    ASSIGN ref->* TO <fs_wkarea>.                                                           |
    |   77|    ASSIGN COMPONENT gv_class_dbposit OF STRUCTURE                                          |
    |   78|                      <fs_wkarea> TO <fs_class>.                                            |
    |   79|    CREATE DATA ref TYPE TABLE OF (i_enum_dbtab).                                           |
    |   80|    ASSIGN ref->* TO <ft_data>.                                                             |
    |   81|                                                                                |
    |   82|  ENDCATCH.                                                                                |
    |   83|  IF sy-subrc = 15.                                                                         |
    |   84|*   Error on Assignment.                                                                    |
    |   85|    CALL FUNCTION 'RS_DME_COM_ADDMSG_NOLOG'                                                 |
    |   86|      EXPORTING                                                                             |
    |   87|        i_type    = 'E'                                                                     |
    |   88|        i_msgno   = 301                                                                     |
    |   89|        i_msgv1   = 'EVALUATION_PHASE'                                                      |
    |   90|      IMPORTING                                                                             |
    |   91|        es_return = ls_return.                                                              |
    |   92|    APPEND ls_return TO e_t_return.                                                         |
    |   93|    EXIT.                                                                                |
    |   94|  ENDIF.                                                                                |
    |   95|                                                                                |
    |   96|* For the un-trained Rec-Ids, evaluate.....                                                 |
    |   97|  REFRESH lt_recinp.                                                                        |
    |   98|  APPEND LINES OF i_t_records TO lt_recinp.                                                 |
    |   99|  SORT lt_recinp .                                                                          |
    |  100|* Open Cursor..                                                                             |
    |  101|  DATA: l_curs TYPE cursor.                                                                 |
    |  102|  DATA: l_psize TYPE i VALUE 10000.                                                         |
    |>>>>>|  OPEN CURSOR WITH HOLD l_curs FOR                                                          |
    |  104|   SELECT * FROM (i_enum_dbtab)                                                             |
    |  105|     WHERE rsdmdt_recid NOT IN                                                              |
    |  106|        ( SELECT rsdmdt_recid FROM                                                          |
    |  107|             (i_learn_tab) ).                                                               |
    |  108|                                                                                |
    |  109|*  Start Fetch...                                                                           |
    |  110|  DO.                                                                                |
    |  111|    FETCH NEXT CURSOR l_curs                                                                |
    |  112|      INTO CORRESPONDING FIELDS OF TABLE <ft_data>                                          |
    |  113|      PACKAGE SIZE l_psize.                                                                 |
    |  114|    IF sy-subrc NE space.                                                                   |
    |  115|      EXIT.                                                                                |
    |  116|    ENDIF.                                                                                |
    |  117|                                                                                |
    |  118|*     Process records...                                                                    |
    |  119|    LOOP AT <ft_data> ASSIGNING <fs_wkarea>.                                                |
    |  120|                                                                                |
    |  121|*     Call Prediction Function.                                                             |
    |  122|      CALL FUNCTION 'RS_DME_DTP_PREDICT_STRUCTURE'                                          |

    Hi Claudio,
    well the message is very clear and I think in your case you need to split your model into a few somehow equal models, each not having more than 2 leaves.
    Another option might be to do more things serially instead of parallel.
    Hope it helps
    regards
    Siggi

  • Too many open cursors

    Could someone help me understand this problem, and how to remedy it? We're getting warnings as the number of open cursors nears 1200. I've located the V$OPEN_CURSOR view, and after investigating it, this is what I think:
    Currently:
    SQL> select count(*)
    2 from v$open_cursor;
    COUNT(*)
    535
    1) I have one session open in the database, and 40 records in this view. Does that mean my cursors are still in the cursor cache?
    2) Many of these cursors are associated with our analysts, and it looks like they are likely queries TOAD runs in order to gather meta-data for the interface. Can I overcome this?
    3) I thought that the optimizer only opened a new cursor when a query that didn't match one in the cache was executed. When I run the following, I get 105 SQL statements with the same hash_value and sql_id, of which, they total 314 of the 535 open cursors (60% of the open cursors):
    SQL> ed
    Wrote file afiedt.buf
    1 SELECT COUNT(*), SUM(cnt)
    2 FROM (SELECT hash_value,
    3 sql_id,
    4 COUNT(*) as cnt
    5 FROM v$open_cursor
    6 GROUP BY hash_value, sql_id
    7* HAVING COUNT(*) > 1)
    SQL> /
    COUNT(*) SUM(CNT)
    104 314
    4) Most of our connections in production will use Oracle Forms. Is there something we need to do in order to get Forms to use bind variables, or will it do so by default?
    Thanks for helping me out with this.
    -Chuck

    CURSOR_SHARING=EXACT
    OPEN_CURSORS=500
    CURSOR_SHARING
    From what I've read, cursor sharing is always in effect, although we have the most conservative method set. So I'm not sure how this affects things. Several identical queries are being submitted in several separate cursors.
    OPEN_CURSORS
    This value corresponds with the maximum number of cursors allowed for a single session. We're using shared servers, so I'm exactly sure if this is still 'per session' or 'per shared server', but 500 should be more than enough.
    It sounds like you're suggesting that a warning is being triggered based upon our init params. If that's the case, then what are people seeing as a limit for cursors on a 2-CPU Linux box with 2G of memory?
    -Chuck

  • Too many open cursors exception caused by LRS Iterator

    Using Kodo4.1.4 with Oracle10, and Large Result Set Proxies, I encountered
    the error "maximum number of open cursors exceeded".
    It seems to have been caused because of incomplete LRSProxy iterators within
    the context of a single PersistenceManager. These iterators were over
    collections obtained by reachability, not directly from Queries or Extents.
    The Iterator is always closed, but the max-cursors exception still occurs.
    Following is a pseudocode example of the case... Note that if the code is
    refactored to remove the break; statement, then the program works fine, with
    no max-cursors exception.
    Any suggestions?
    // This code pattern is called hundreds of times
    // within the context of a PersistenceManager
    Collection c = persistentObject.getSomeCollection(); // LRS Collection
    Iterator i = c.iterator()
    try
    while(i.hasNext())
    Object o = i.next();
    if (someCondition)
    break; // if this break is removed, everything is fine
    finally
    KodoJDOHelper.close(i);
    }

    XSQL Servlet v. 0.9.9.1
    Netscape Enterprise / JRUN 2.3.3 / Windows NT
    I modified the document demo (insert request).
    The XSQL document:
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="newdocinsform.xsl"?>
    <page connection="demo" xmlns:xsql="urn:oracle-xsql">
    <xsql:insert-request table="xmlclob" transform="newdocins.xsl"/>
    <data>
    <xsql:query null-indicator="yes" max-rows="4">
    select id, doc
    from xmlclob
    order by id desc
    </xsql:query>
    </data>
    </page>
    The difference between this and your demo is the table: the table xmlclob has
    ID NUMBER and DOC CLOB. No constraints were enforced, so I was inserting the ID and the DOC. Upon page reload, several rows with the same values were inserted.
    I had a similar problem in the previous release.
    As a general question, how can I configure the XSQLConfig file for optimal performance?
    Although you provided default values, I'm not sure how much is necessary for connection pooling.

  • TOO MANY OPEN CURSORS PROBLEM ... PLEASE HELP

    Hi,
    my problem is the following :
    I got data from a system in flat file format. ( ascii, semicolon separated )
    I wrote mapping classes to different tables and insert via Oracle thin driver.
    The data I got isn't 100% consistent. It may happen that there are double
    records for tables whith unique indexes.
    I catched the Exception like in the segment below
    Statement insertStmnt = null;
    try{
    insertStmnt = connection.createStatement();
    insertStmnt.execute(insertString);
    connection.commit(); // autocommit is diabled
    } catch ( Exception sql ) {
    System.out.println(sql.toString());
    connection.rollback();
    insertStmnt.close();
    The Problem : when receiving the SQLException ( UNIQUE CONSTRAINT VIOLATED )
    the cursor remains open.
    After exeeding the open_cursors system property ( Oracle )
    no more data is loaded.
    ( the input files contains sometimes more than one million rows )
    Any suggestion to my Mail
    [email protected]
    Thanks

    Hi!
    Now you only close your statement when you catch an error. You will have to close it if things works out fine as well:
    Statement insertStmnt = null;
    try{
    insertStmnt = connection.createStatement();
    insertStmnt.execute(insertString);
    connection.commit(); // autocommit is diabled
    insertStmnt.close();
    } catch ( Exception sql ) {
    System.out.println(sql.toString());
    connection.rollback();
    insertStmnt.close();
    Good luck!
    /Tale

  • Too many real instruments; Need help bouncing tracks

    Hello, I've been using GarageBand to record a demo for my band. Unfortunately, I've hit my peak number of real instrument tracks. I have a lot of tracks that are the same (well, not EXACTLY the same, but the same musical part), where one is panned left and the other is panned right. Is there a way I can take tracks like these and bounce them down to one stereo track without losing quality or the panning of the tracks? Thanks a ton.
    -Kevin

    I use an external FireWire drive which I move between machines and rooms, thus I plug in to the iBook and record, unplug and plug into the iMac and mix.
    You could copy the files (they'll be huge) over ethernet, or airport (You could get a cheap hub or router for hooking the machines up. In fact, CompUSA has a 4 port (and wireless) router on sale this week for $4.99 <sic> after rebate), or perhaps burn them to CD-RW/DVD-RW.
    how many more tracks do you think I'd be able to get out of my iMac G5
    I'm not sure. I think the max I have done so far was 36 (that got pared down to 34). I guess some day I'm going to have to try this myself, see how far I can actually get. I remember doing a simple none Real World test months ago (I'm sure the post is gone by now <sigh>) in which I simply compared my iBook's internal drive an an external drive.
    Unfortunately in trying to make the test doable in a reasonable amount of time I only recorded 1 minute tracks, and I'm sure that's a factor, but I seem to recall getting more than 40 with GB(1) and the external drive.

  • Too many id's need help setting up family sharing

    We currently have one apple id (tjc) that is associated with the apple store and one that is associated with itunes (m7).  The itunes one (m7) does not have an icloud account attached to it, used only for purchases from itunes store.  Husband uses the apple store id (tjc) and I have my own (jj).  Can I set up family sharing with the itunes id (m7) as the purchaser?  Or how do I keep all my itunes purchases if we make husbands/apple store id (tjc) the primary?
    Currently running OS X yosemite and ios 8 on an imac, iphones, and ipads.
    Thanks for your assistance!

    Hi bremaura,
    Thanks for the question. If I understand correctly, you want to havde all purchases from one Apple ID available in Family sharing. I would recommend that you read this article, it may be able to help you isolate or resolve the issue.
    Family Sharing - Apple Support
    All your family’s purchases, on all your family’s devices.
    Once you’ve set up Family Sharing, all the eligible songs, albums, movies, TV shows, books, and apps ever purchased by family members are immediately available to everyone else in the family. And, of course, so are new purchases. 
    Thanks for using Apple Support Communities.
    Have a great day,
    Mario

  • Insert ORA-00913: too many values  --  urgent help

    Hi there
    Its pretty urgent, got  stuck up....
    To avoid the undo snapshot error, I am using this procedure to migrate the smaller chunks of  huge volume of  table data into new tables. This below code works well if the columns  are very less. And this procedure is not working if the tables columns are morethan 30 columns and throwing the error   PL/SQL: ORA-00913: too many values
    CREATE OR REPLACE PROCEDURE migration AS
       TYPE array_tp IS TABLE OF tranproc%ROWTYPE;
       l_array array_tp;
       CURSOR c IS
          select * from tranproc p where trunc(date)<=trunc(sysdate)-180;
       l_cnt1 NUMBER :=0;
       l_cnt2 NUMBER :=0;
       l_cnt3 NUMBER :=0;
    BEGIN
       OPEN c;
       LOOP
          FETCH c BULK COLLECT INTO l_array LIMIT 10000;
          EXIT WHEN l_array.COUNT = 0;
          l_cnt1 := c%ROWCOUNT;
          FORALL i IN 1 .. l_array.COUNT
             INSERT INTO TMP_Transpoc VALUES l_array(i);
          l_cnt2 := l_cnt2 + SQL%rowcount;
       END LOOP;
       l_cnt3 := c%ROWCOUNT;
       CLOSE c;
       END;
    16    22    PL/SQL: ORA-00913: too many values
    its falling
    line 16: INSERT INTO TMP_Transpoc VALUES l_array(i);
    Above table i.e tranproc  has around 80 columns .
    i am not pl/sql expert, kindly advise how to resolve it.. i am fine with  alternative approach, just i need a smaller chunk commit.

    Actually, Direct Path does not necessarily require NOLOGGING. If you successfully invoke Direct Path (look for LOAD AS SELECT or DIRECT LOAD INTO in the execution plan) then you are inserting into blocks above the high-water mark (HWM) and there is virtually no UNDO generated for the changes in the table segment.
    However, the index maintenance (if any) will require UNDO, and it may be a lot. If this is going into a new table, then you should be able to create the index after the table is populated.
    Also beware of the NOLOGGING advice. In many cases, an individual SQL statement can not disable logging. And yet, if you do bypass REDO logging, be very sure you understand the consequences for your ability to recover.

Maybe you are looking for

  • TV as display

    I keep trying to set my TV up as a display, but it stays black. I can hear sound through my TV, but no picture, no matter what resolution or color setting I put it at. How can I get it to work?

  • Laptop crashed, moved HDD to another PC to use CS5 but it gives me a Configuration Error. Error:6

    Hi, My laptop containing Adobe CS5 recently crashed. I do not have the serial as this was activated at my school and they only do it once for everyone. What I did was to take the HDD out and put it onto my PC and try to use the application from there

  • Sharepoint 2013 Document library Issue

    Hi In sharepoint 2013 Doc lib,I uploaded a document and I can see it was successful, but then I can't close the window, or get back to the customer documents unless I "control/alt/delete" and close all IE windows & re-log in. Now, 4 minutes later it

  • Oracle 11g client for Windows 8 - 64bit exists impromptu without error msg

    HI all. I just got a new laptop and its running Windows 8 Pro 64 bit os. I downloaded Oracle Client 11g 64bit from the oracle website. After clicking the setup.exe installer a msg box pops up saying '[INS -13003] Environment does not meet the require

  • Pop-Ups, Ad's, Virus? its ANNOYING! HELP!!

    How can i get rid of these Pop-Up ads for "cleaning my mac." every time i click on a link or some type of button, a new tab opens and a add appears. Maybe its a virus or malware but I'm not too sure. I've gone to the finder and deleted anything un us