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

Similar Messages

  • 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

  • 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.

  • 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

  • Too Many open connections. UTL_HTTP

    I am submiiting The URL for multiple times.
    So i am getting the too many open connections error. How to avoid the code.
    For your reference i have attached my code.
    DECLARE
      req   UTL_HTTP.REQ;
      resp  UTL_HTTP.RESP;
      value VARCHAR2(1024);
      url   VARCHAR2(4000);
      OPT   varchar2(1000);
      CURSOR MOB IS SELECT MOB FROM MOBILE_NUMBER;
    BEGIN
    -- UTL_HTTP.SET_PROXY('proxy.my-company.com', 'corp.my-company.com');
    FOR I IN MOB
    LOOP
    DBMS_OUTPUT.PUT_LINE(I.MOB);
    URL:='http://www.meru.co.in/wip/sendsms?username=11|'&'||'password=11|'&'||'to='||I.MOB||'&'||'message=this%20is%20shanmugam';
    DBMS_OUTPUT.PUT_LINE(URL);
      req := UTL_HTTP.begin_REQUEST(url);
      UTL_HTTP.SET_HEADER(req, 'User-Agent', 'Mozilla/4.0');
      resp := UTL_HTTP.GET_RESPONSE(req);
      UTL_HTTP.READ_LINE(resp, value, TRUE);
        DBMS_OUTPUT.PUT_LINE(value);
      END LOOP;
      UTL_HTTP.END_RESPONSE(resp); 
    EXCEPTION
      WHEN UTL_HTTP.END_OF_BODY THEN
        UTL_HTTP.END_RESPONSE(resp);
    END;how to close the connection for each record????
    Can anyone help me out in this??
    Thanks in Advance.
    Cheers,
    Shan

    Move UTL_HTTP.END_RESPONSE(resp); inside the loop. I mean
    UTL_HTTP.END_RESPONSE(resp);
    END LOOP;

  • Too many open connections from Tomcat to MySQL?

    <?xml version='1.0' encoding='utf-8'?>
    <Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <Resource
    name="jdbc/RealmDB" auth="Container" type="javax.sql.DataSource"
    username="root" password="password" driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/monk"
    maxActive="-1" maxIdle="5" maxWait="5000"
    removeAbandoned="true" removeAbandonedTimeout="60"
    testWhileIdle="true" timeBetweenEvictionRunsMillis="180000"/>
    <Realm
    className="org.apache.catalina.realm.DataSourceRealm"
    dataSourceName="jdbc/RealmDB" localDataSource="true"
    digest="MD5"
    userTable="user" userNameCol="user_name" userCredCol="password"
    userRoleTable="tcrole" roleNameCol="role_name" />
    </Context>
    Is there a way in here to auto close inactive connections after say 10 seconds? Is that the removeAbandonedTimeout or the Eviction section? Would this be better off posted on the tomcat user listing?
    Edited by: TheWhiteKnight on Oct 29, 2009 8:00 PM

    Actually BalusC, I like this. This seems to define the entire cycle quite nicely and CLEAN. This will be very helpful when phase II rolls out. Right now I need to just patch the thing and get it running "well".
    I've also had to implement some new methods to clean up some of the junk that is left open. I have found RS's that are closed, but no corresponding connection / statement's are being closed. So when I have a return statement like:
    return ConnectionPool.getConnection().createStatement().executeQuery(sqlStatement);
    {code]
    that is called from the presentation layer, logically (to me) the only place to close the connection / statement associated with that RS is in the presentation layer.  As of right now.  This will change on phase II.  If I am wrong please correct me in this.
    Something that is happening now though since I have started explicitly closing the connections and statements.  It seems that my ConnectionPool is running out of connections. I can increase the size of the pool, but it worked just fine before with the amount of connections I have set.  When I call .close() on the connection, does that "recycle" the connection back to the pool?  I know there has to be resources bleeding someplace, however, this has only started happening (more often) since I have been closing things where I find them.
    Any ideas on this?
    Also will converting the basic generic queries to stored procedures help in the performance?  I know that I'll still have to have a connection, but if I can have less java coded sql statements and more SP's would that help in efficiency between MySQL and Tomcat?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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.

  • What have "Too many open Files" to do with FIFOs?

    Hi folks.
    I've just finished a middleware service for my company, that receives files via a TCP/IP connection and stores them into some cache-directory. An external program gets called, consumes the files from the cache directory and puts a result-file there, which itself gets sent back to the client over TCP/IP.
    After that's done, the cache file (and everything leftover) gets deleted.
    The middleware-server is multithreaded and creates a new thread for each request connection.
    These threads are supposed to die when the request is done.
    All works fine, cache files get deleted, threads die when they should, the files get consumed by the external program as expected and so on.
    BUT (there's always a butt;) to migrate from an older solution, the old data gets fed into the new system, creating about 5 to 8 requests a second.
    After a time of about 20-30 minutes, the service drops out with "IOException: Too many open files" on the very line where the external program gets called.
    I sweeped through my code, seeking to close even the most unlikely stream, that gets opened (even the outputstreams of the external process ;) but the problem stays.
    Things I thought about:
    - It's the external program: unlikely since the lsof-command (shows the "list of open files" on Linux) says that the open files belong to java processes. Having a closer look at the list, I see a large amount of "FIFO" entries that gets bigger, plus an (almost) constant amount of "normal" open file handles.
    So perhaps the handles get opened (and not closed) somehwere else and the external program is just the drop that makes the cask flood over.
    - Must be a file handle that's not closed: I find only the "FIFO" entries to grow. Yet I don't really know what that means. I just think it's something different than a "normal" file handle, but maybe I'm wrong.
    - Must be a socket connection that's not closed: at least the client that sends requests to the middleware service closes the connection properly, and I am, well, quite sure that my code does it as well, but who knows? How can I be sure?
    That was a long description, most of which will be skipped by you. To boil it down to some questions:
    1.) What do the "FIFO" entries of the lsof-command under Linux really mean ?
    2.) How can I make damn sure that every socket, stream, filehandle etc. pp. is closed when the worker thread dies?
    Answers will be thanked a lot.
    Tom

    Thanks for the quick replies.
    @BIJ001:
    ls -l /proc/<PID>/fdGives the same information as lsof does, namely a slowly but steadily growing amount of pipes
    fuserDoesn't output anything at all
    Do you make exec calls? Are you really sure stdout and stderr are consumed/closed?Well, the external program is called by
    Process p = Runtime.getRuntime().exec(commandLine);and the stdout and stderr are consumed by two classes that subclass Thread (named showOutput) that do nothing but prepending the corresponding outputs with "OUT:" and "ERR" and putting them into a log.
    Are they closed? I hope so: I call the showOutput's halt method, that should eventually close the handles.
    @sjasja:
    Sounds like a pipe.Thought so, too ;)
    Do you have the waitFor() in there?Mentioning the waitFor():
    my code looks more like:
    try  {
         p = Runtime.getRuntime.exec(...);
         outshow = new showOutput(p.getInputStream(), "OUT").start;
         errshow = new showOutput(p.getErrorStream(), "ERR").start;
         p.waitFor();
    } catch (InterruptedException e) {
         //can't wait for process?
         //better go to sleep some.
         log.info("Can't wait for process! Going to sleep 10sec.");
         try{ Thread.sleep(10000); } catch (InterruptedException ignoreMe) {}
    } finally {
         if (outShow!=null) outShow.halt();
         if (errShow!=null) errShow.halt();
    /**within the class showOutput:*/
    /**This method gets called by showOutput's halt:*/
    public void notifyOfHalt() {
         log.debug("Registered a notification to halt");
         try {
              myReader.close(); //is initialized to read from the given InputStream
         } catch (IOException ignoreMe) {}
    }Seems as if the both of you are quite sure that the pipes are actually created by the exec command and not closed afterwards.
    Would you deem it unlikely that most of the handles are opened somewhere else and the exec command is just the final one that crashes the prog?
    That's what I thought.
    Thanks for your time
    Tom

  • ORA-02020: too many database links in use ; but OK with where clause...

    Hello all,
    I have a view called V_MEDGEN_LISTRADIO but I can't run
    SELECT * FROM V_MEDGEN_LISTRADIO
    ORA-02020: too many database links in useThe cause is that we call in the view 5 tables over dblink and the open_links parameter is set to 4.
    What is strange is that when I run this select by adding a where clause then it works!
    SELECT * FROM V_MEDGEN_LISTRADIO WHERE SPRR = 3645;Can someone explain me ? (use of index so all tables are not called ???)
    Thanks

    Explain plan for SELECT * FROM V_MEDGEN_LISTRADIO WHERE SPRR = 3645;
    | Id  | Operation                              | Name            | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop | Inst   |IN-OUT|
    |   0 | SELECT STATEMENT                       |                 |     1 |   244 |    19   (6)| 00:00:01 |       |       |        |      |
    |   1 |  SORT ORDER BY                         |                 |     1 |   244 |    19   (6)| 00:00:01 |       |       |        |      |
    |   2 |   NESTED LOOPS                         |                 |     1 |   244 |    18   (0)| 00:00:01 |       |       |        |      |
    |   3 |    NESTED LOOPS                        |                 |     1 |   218 |    17   (0)| 00:00:01 |       |       |        |      |
    |   4 |     NESTED LOOPS                       |                 |     1 |   188 |    15   (0)| 00:00:01 |       |       |        |      |
    |   5 |      NESTED LOOPS                      |                 |     3 |   384 |    10   (0)| 00:00:01 |       |       |        |      |
    |   6 |       NESTED LOOPS                     |                 |     3 |   186 |     4   (0)| 00:00:01 |       |       |        |      |
    |   7 |        REMOTE                          | SPRR            |     1 |    20 |     2   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    |   8 |        REMOTE                          | MPAT_MF         |     3 |   126 |     2   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    |   9 |       REMOTE                           | SPER_P          |     1 |    66 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |* 10 |      TABLE ACCESS BY GLOBAL INDEX ROWID| DOSSIER_MEDICAL |     1 |    60 |     3   (0)| 00:00:01 | ROWID | ROWID |        |      |
    |* 11 |       INDEX RANGE SCAN                 | DOSMED_MPR_IDX2 |     2 |       |     1   (0)| 00:00:01 |       |       |        |      |
    |  12 |     REMOTE                             | MEP             |     1 |    30 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  13 |    REMOTE                              | SSV             |     1 |    26 |     1   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    Predicate Information (identified by operation id):
      10 - filter("DM"."EXAM_TYPE"='TELEM')
      11 - access("DM"."MPR"="P"."SPER")
    Remote SQL Information (identified by operation id):
       7 - SELECT "SPRR","MNEMO" FROM "SPRR" "MP" WHERE "SPRR"=3645 (accessing 'DEV10_DBLK' )
       8 - SELECT "SPAT","DU","RMPB","SPRR_MF","AU" FROM "MPAT_MF" "MF" WHERE "SPRR_MF"=3645 AND NVL("AU",:1+1)>=:2 AND
           "RMPB"='PRINC' AND "DU"<=:3 (accessing 'DEV10_DBLK' )
       9 - SELECT "SPER","NOM","PRENOM","DTE_NAI" FROM "SPER_P" "P" WHERE "SPER"=:1 (accessing 'ORAP_DBLK' )
      12 - SELECT "MSJ","MEPNO_SEQ","SSV_OU_PAT_SEJOURNE" FROM "MEP" "MEP" WHERE :1="MSJ" AND :2="MEPNO_SEQ" (accessing 'ORAP_DBLK' )
      13 - SELECT "SSV","LIB_1" FROM "SSV" "SSV" WHERE :1="SSV" (accessing 'ORAP_DBLK' )Explain plan for SELECT * FROM V_MEDGEN_LISTRADIO
    Plan hash value: 3820716840
    | Id  | Operation                                | Name                  | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop | Inst   |IN-OUT|
    |   0 | SELECT STATEMENT                         |                       |     7 |  1708 |   771   (1)| 00:00:10 |       |       |        |      |
    |   1 |  SORT ORDER BY                           |                       |     7 |  1708 |   771   (1)| 00:00:10 |       |       |        |      |
    |   2 |   NESTED LOOPS                           |                       |     7 |  1708 |   770   (1)| 00:00:10 |       |       |        |      |
    |   3 |    NESTED LOOPS                          |                       |     7 |  1568 |   763   (1)| 00:00:10 |       |       |        |      |
    |   4 |     NESTED LOOPS                         |                       |     7 |  1386 |   756   (1)| 00:00:10 |       |       |        |      |
    |   5 |      NESTED LOOPS                        |                       |     7 |  1176 |   742   (1)| 00:00:09 |       |       |        |      |
    |   6 |       NESTED LOOPS                       |                       |   194 | 24444 |   414   (1)| 00:00:05 |       |       |        |      |
    |   7 |        TABLE ACCESS BY GLOBAL INDEX ROWID| DOSSIER_MEDICAL       |   194 | 11640 |    23   (0)| 00:00:01 | ROWID | ROWID |        |      |
    |*  8 |         INDEX RANGE SCAN                 | DOSMED_EXAM_TYPE_IDX2 |   194 |       |     1   (0)| 00:00:01 |       |       |        |      |
    |   9 |        REMOTE                            | SPER_P                |     1 |    66 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  10 |       REMOTE                             | MPAT_MF               |     1 |    42 |     2   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    |  11 |      REMOTE                              | MEP                   |     1 |    30 |     2   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  12 |     REMOTE                               | SSV                   |     1 |    26 |     1   (0)| 00:00:01 |       |       | ORAP_~ | R->S |
    |  13 |    REMOTE                                | SPRR                  |     1 |    20 |     1   (0)| 00:00:01 |       |       | DEV10~ | R->S |
    Predicate Information (identified by operation id):
       8 - access("DM"."EXAM_TYPE"='TELEM')
    Remote SQL Information (identified by operation id):
       9 - SELECT "SPER","NOM","PRENOM","DTE_NAI" FROM "SPER_P" "P" WHERE :1="SPER" (accessing 'ORAP_DBLK' )
      10 - SELECT "SPAT","DU","RMPB","SPRR_MF","AU" FROM "MPAT_MF" "MF" WHERE NVL("AU",:1+1)>=:2 AND "RMPB"='PRINC' AND "DU"<=:3 AND
            :4="SPAT" (accessing 'DEV10_DBLK' )
      11 - SELECT "MSJ","MEPNO_SEQ","SSV_OU_PAT_SEJOURNE" FROM "MEP" "MEP" WHERE :1="MSJ" AND :2="MEPNO_SEQ" (accessing 'ORAP_DBLK' )
      12 - SELECT "SSV","LIB_1" FROM "SSV" "SSV" WHERE :1="SSV" (accessing 'ORAP_DBLK' )
      13 - SELECT "SPRR","MNEMO" FROM "SPRR" "MP" WHERE :1="SPRR" (accessing 'DEV10_DBLK' )

  • Operation Could Not Be Completed:  Too Many Open...

    I've had this error showing up a lot in the Safari 3.2 and 4.0 beta activity window when loading multiple tabs of pages with many images (usually gallery type pages or blogs with lots of thumbnails). The result is that some images or other elements like style sheets don't load, leading to the blue question mark, or messed up formatting. Unfortunately, the activity window can't be stretched wide enough to see the whole error, but in fact it's "Operation Could Not Be Completed: Too Many Open Files". The error "socket(PF_ROUTE) failed: Too many open files" shows up in the Console as well, at least with Safari 4. I had also experienced similar problems with "Operation Timed Out" errors as well.
    I've been pulling my hair out on this one, because it's rather inconsistent, not to mention annoying. You can usually get an individual page to load completely by refreshing it, but that kind of defeats the purpose of loading multiple tabs all at once. It's also less of a problem if more of those pages are already cached, but you never know for sure. Running your connection through a proxy also helps a bit, but not always.
    I found a fix, but it's actually not Safari's "fault" per se. The issue lies in the allowable number of open files per user process, which is set by the system's launchd process at boot time. Note that Safari is not entirely innocent, as FireFox doesn't have this problem. It Seems that Safari just tries to load everything all at once, whereas FireFox does a better job of managing its load requests. Anyway if you run the following command in Terminal:
    sudo launchctl limit
    the following list should show up (with perhaps slightly different values)
    cpu unlimited unlimited
    filesize unlimited unlimited
    data 6291456 unlimited
    stack 8388608 67104768
    core 0 unlimited
    rss unlimited unlimited
    memlock unlimited unlimited
    maxproc 200 532
    maxfiles 256 unlimited
    The second column is a "soft limit" and the third column is a "hard limit", though to be honest I'm not exactly sure what the difference entails. The image loading problem is caused by hitting the maxfiles limit of just 256 files. The solution is to change maxfiles to 4096/unlimited, and also change maxproc to 1000/2000 since it's pretty low as well. That sounds like a pretty big change, but OS X server is supposed to change them to numbers like this when services like Apache are enabled, and Apple even mentions how to change maxproc at http://support.apple.com/kb/TS1659
    To make these changes, run the following two commands in Terminal and restart the computer:
    echo "limit maxproc 1000 2000" | sudo tee -a /etc/launchd.conf
    echo "limit maxfiles 4096 unlimited" | sudo tee -a /etc/launchd.conf
    The commands add the two lines in quotes to the launchd.conf file in /etc/ (if no file exists yet, it creates it). That should clear up the loading issues. I haven't noticed any other problems with these increased numbers, but I'll report back if anything seems to go amiss. Hopefully this will be helpful to someone.

    I faced the same problem with an image gallery using css for image resizing. Thanks for the explanation.

  • STARTING DATABASE : PROBLEM OF Linux Error: 23: Too many open files in syst

    Hi everybody,
    I am running an RMAN script and get this error,
    9> @/u01/app/oracle/admin/devpose/backup/configuration.rcv
    RMAN> ###################################################################
    2> # Configuration file used to set Rman policies.
    3> #
    4> ###################################################################
    5>
    6> CONFIGURE DEFAULT DEVICE TYPE TO DISK;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of configure command at 08/26/2009 20:03:30
    RMAN-06403: could not obtain a fully authorized session
    ORA-01034: ORACLE not available
    RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of configure command at 08/26/2009 20:03:30
    RMAN-06403: could not obtain a fully authorized session
    ORA-01034: ORACLE not available
    RMAN> #CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
    2> CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of configure command at 08/26/2009 20:03:30
    RMAN-06403: could not obtain a fully authorized session
    ORA-01034: ORACLE not available
    RMAN>
    RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/app/oracle/backup/db/ora_df%t_s%s_s%p';
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of configure command at 08/26/2009 20:03:30
    RMAN-06403: could not obtain a fully authorized session
    ORA-01034: ORACLE not available
    But this problem is understandable, as the database is not running. The main problem why database is not running, I have found the reason but do not understand how to solve the problem.
    Since, the database was not running, I tried to startup the database, I then came across the following which is my problem (Why so many files are open? Linux OS error says too many files open. See below,
    SQL> conn /as sysdba
    Connected to an idle instance.
    SQL> startup
    ORACLE instance started.
    Total System Global Area 419430400 bytes
    Fixed Size 779516 bytes
    Variable Size 258743044 bytes
    Database Buffers 159383552 bytes
    Redo Buffers 524288 bytes
    Database mounted.
    ORA-00313: open failed for members of log group 2 of thread 1
    ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/devpose/redo02.log'
    ORA-27041: unable to open file
    Linux Error: 23: Too many open files in system
    Can anybody has run into such problem and guide me to a solution, please?
    Thanks

    Hi,
    yes, this DB was functioning o.k. this configuration script was part of RMAN daily backup.
    Last night the backup failed. So, when I opened "Failed job" in the EM, I saw this type of messages.
    That was the starting point. Gradually, I tried to narrow down on to the actual problem and found the findings as I have posted.
    One way of sovling problem, I thought that, all these processes I would kill and then try to open the database, it might startup. However, that wouldnot lead me in ensuring this won't occur again.
    That's why I am trying to understand why it should open, so many processes (why spawn so many .flb files?) Any thoughts you have around this?
    I will try to restart the OS as the last resort.
    Thanks for your help and suggestions.
    Regards,

  • Java.util.zip.ZipException: Too many open files on Linux

    Hi,
    We have web application running on Caucho's resin server on jdk 1.5.0_11 and Red hat Linux. We are noticing that java process is running out of file handles within 24-30 hours. We have file limit of 5000 which it consumes in 24 hours throwing 'java.util.zip.ZipException: Too many open files'.
    I have made sure all sorts of file handles are closed from application point of view. Here is the snapshot of lsof (list of file handles) from java process. The following list keeps growing until it runs out of limit. Do you have tips/suggestions on how to mitigate this problem (considering we dont want to increase ulimit for this process)? Also, can you make out any thing more from the description of file handles like, are they unclosed POP3 connections or URL connection to external sites?
    java 7156 resin 120u IPv4 34930051 UDP localhost.localdomain:59693
    java 7156 resin 121u IPv4 34927823 UDP localhost.localdomain:59663
    java 7156 resin 122u IPv4 34931861 UDP localhost.localdomain:59739
    java 7156 resin 123u IPv4 34932023 UDP localhost.localdomain:59745
    java 7156 resin 124u IPv4 34930054 UDP localhost.localdomain:59700
    java 7156 resin 125u IPv4 34927826 UDP localhost.localdomain:59665
    java 7156 resin 126u IPv4 34927829 UDP localhost.localdomain:59666
    java 7156 resin 127u IPv4 34930057 UDP localhost.localdomain:59703
    java 7156 resin 128u IPv4 34930713 UDP localhost.localdomain:59727
    java 7156 resin 129u IPv4 34930716 UDP localhost.localdomain:59730
    java 7156 resin 130u IPv4 34932238 UDP localhost.localdomain:59789
    java 7156 resin 131u IPv4 34932026 UDP localhost.localdomain:59749
    java 7156 resin 132u IPv4 34932221 UDP localhost.localdomain:59770
    java 7156 resin 133u IPv4 34932224 UDP localhost.localdomain:59775
    java 7156 resin 134u IPv4 34932029 UDP localhost.localdomain:59753
    java 7156 resin 135u IPv4 34932032 UDP localhost.localdomain:59754
    java 7156 resin 138u IPv4 34932035 UDP localhost.localdomain:59760
    java 7156 resin 139u IPv4 34932038 UDP localhost.localdomain:59763
    java 7156 resin 140u IPv4 34932227 UDP localhost.localdomain:59780
    java 7156 resin 141u IPv4 34932230 UDP localhost.localdomain:59781
    java 7156 resin 144u IPv4 34932234 UDP localhost.localdomain:59786
    java 7156 resin 146u IPv4 34932241 UDP localhost.localdomain:59792
    java 7156 resin 147u IPv4 34932247 UDP localhost.localdomain:59802

    Finally we resolved this issue. It was oracle driver which had some compatibility issue, we upgraded our Oracle client driver to newer version, and this fixed the problem. Base line, there was nothing wrong with application code, code was doing good resource clean up, but oracle driver was leaking handles per every connection.

  • Too many authenticated connections

    I've got a customer with a BT line, sending via mail.btinternet.com.  For the last month or two they've complained that they keep getting asked for their password. 
    I've checked out the customer's system and I can see that it's not a password problem, but the SMTP server is instead coming back with "too many authenticated connections". 
    I can see that a host of BT customers on here are reporting password problems, I would guess that they are experiencing the same issue, that these are not password problems, but SMTP server issues on BT's new mail systems.  The message would suggest that the server is unable to take any more connections so some sort of resource issue at their end.
    Of-course unless you're looking under the bonnet of the SMTP connection, you won't be seeing this message, just the popup asking for your password again. It's not a password issue. If you try the connection multiple times, it will go in the end (when you get a connection that is willing to be accepted by the SMTP server. 
    I've configured the mail client to the letter, as per BT's stated configuration, and like I say, it will work on a percentage of connections. On a good run, you might get 10 out of 10 successes, other times 1 in 3.
    Please let me know if anyone is experiencing the same message.  The message could perhaps be a red-herring of some kind, perhaps not able to successfully negotiate the authentication / encryption using this particular mail client.  The customer is using Mac Mail and there do appear to be quite a few customers referencing Mac's / IOS on this forum, not many Outlook customers complaining.

    Hi Bookanengineer,
    Many thanks for your post, we have been away and asked some questions around this and the view is that this is unlikely to be an SMTP load issue. There is a limit to the number of authenticated connections we allow per user and the password pop ups being seen are more likely to be due to the customer having too many authenticated connections which could also be due to sessions not being closed correctly
    We believe that this is more likely to happen to client users as each time your client connects it opens an authenticated session. If, when you disconnect, the session does not close for whatever reason, the mail server still shows you with a session open. If that happens often you will quickly hit the limit for the number of sessions allowed per customer
    We do however need to eliminate other issues so need examples to further investigate, I appreciate that you are speaking on behalf of one of your customers, but  if you are able to send in any details to us so we can take a look that would be great. You can send in the details using the "Contact The Mods" link found in my profile.
    Thanks
    PaddyB
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • ORA-02020 too many database links

    Hello,
    I'm getting the ORA-02020 too many database links error in my Apex application. This error occurs when I run an interactive report in a page. There are 21 pages and 7 database links in the application. Each page has one interactive report that references one database link in the region source.
    The database links are referenced in each page as follows: database link1 (page 1); database link2 (pages 2 and 3); database link3 (pages 4-7), database link4 (pages 8-15); database link5 (pages 16-18); database link6 (pages 19); and database link7 (pages 20-21). Each database link is referenced to separate schemas in one remote Oracle database.
    I tried to eliminate the error by setting the open_links and open_links_per_instance parameters in the init.ora file of the remote and XE databases to 100 then restarted the both databases. This solution did not work. I created separate Application Processes from the Shared Components to close each database link by implementing the following:
    Click on Shared Components&gt; Logic &gt; Application Processes &gt; Create &gt;
    Name: CLOSE_LINK1
    Sequence: 1
    Point: On Load: Before Header (page template header)
    Type: PL/SQL Anonymous Block
    Process Text: execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
    Error Message: Database Link Error
    When I run the application now, the ORA-02081: database link is not open error appears.
    Please help anyone! I know someone has experienced these same errors.
    Thanks,
    Ms. H

    Joel,
    Thank you for your quick response. For clarification purposes, could you provide samples for 1) issuing the CLOSE DATABASE LINK and catching the exception; and 2) querying from V$DBLINK prior to issuing the CLOSE DATABASE LINK from the Shared Components &gt; Logic &gt; Application Processes?
    Lets assume the following query with a database link in the region source is referenced for Page 1.
    Page 1 - Employee Listing
    Region Source:
    select ename, job, hiredate
    from scott.emp@link1
    Lets assume the following Application Processes from the Shared Components is referenced to close the database link:
    Click on Shared Components&gt; Logic &gt; Application Processes &gt; Create &gt;
    Name: CLOSE_LINK1
    Sequence: 1
    Point: On Load: Before Header (page template header)
    Type: PL/SQL Anonymous Block
    Process Text: execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
    Error Message: Database Link Error
    My thoughts are to do the following:
    1. Log in SQL*Plus as SYS
    SQL&gt; grant select to v_$dblink to scott;
    2. In Apex, goto Shared Components&gt; Logic &gt; Application Processes and add the following queries in the Process Text:
    Name: CLOSE_LINK1
    Sequence: 1
    Process Text:
    select db_link from v$dblink;
    execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
    3. Catch the exception???
    Your assistance is greatly appreciated. :8}
    Ms. H

Maybe you are looking for

  • PDF file handling through BPEL

    Hi, We are exploring BPEL as an option to handle PDF files generated by Oracle EBS (BI Publisher). Basically we want to achieve following: Pick up PDF files from certain location on UNIX box and then a. Spliting the PDF file into two or more files (d

  • How to change the TCP session limit for Domain Controllers in TMG2010

    I've many errors in TMG2010, that relates with too many TCP sessions, that are generated from my two domain controllers. how can i change since settings? Regards! Lasandro Lopez

  • EhP5 and MDG

    I have a question around EhP5 and MDG.  Looking at this note, is this SP03 specific to only MDG or are these the notes related to MDG changes in SP03 (which is bundled with other non-MDG related EhP5 SP03 changes)? Note 1541825 - Master Data Governan

  • WRT160N V3 DMZ and Port-Forwarding dont work

    Hi All, i have a WRT160N V3 and DMZ or Portforwarding dont work. i tried locally following WAN_PC-> WAN-PORT -> WRT160N V3 -> LOCAL-PORT -> LOCAL_PC The WAN_PC has a Static-IP 192.168.1.2, Subnet 255.255.255.0 The WAN-PORT has a Static-IP 192.168.1.1

  • Firefox will not open but when i go t uninstall firefox to reload it says i must close firefox????

    Hi operating windows 7 starter pack on a samsung n150 netbook had no trouble until yesterday when trying to open firefox.