Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 18563 invoked from network); 14 Dec 2007 14:03:17 -0600
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by static-ip-69-64-49-119.inaddr.intergenia.de with SMTP; 14 Dec 2007 14:03:17 -0600
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 799A27D4EB9;
 Fri, 14 Dec 2007 15:03:17 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 05018-04; Fri, 14 Dec 2007 15:03:17 -0500 (EST)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id E6C417D971A;
 Fri, 14 Dec 2007 15:03:16 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Fri, 14 Dec 2007 14:15:51 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 9E5DC7D8101
 for <oracle-l@freelists.org>; Fri, 14 Dec 2007 14:15:51 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 28384-06 for <oracle-l@freelists.org>;
 Fri, 14 Dec 2007 14:15:51 -0500 (EST)
Received: from smtp122.sbc.mail.re3.yahoo.com (smtp122.sbc.mail.re3.yahoo.com [66.196.96.95])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with SMTP id 891957D7F2A
 for <oracle-l@freelists.org>; Fri, 14 Dec 2007 14:15:45 -0500 (EST)
Received: (qmail 16088 invoked from network); 14 Dec 2007 19:15:38 -0000
Received: from unknown (HELO society.servebeer.com) (socpres@sbcglobal.net@99.139.219.90 with login)
  by smtp122.sbc.mail.re3.yahoo.com with SMTP; 14 Dec 2007 19:15:37 -0000
X-YMail-OSG: WiVhFfEVM1nEZvdVaR4cuibOE99SkLUxnjeom3DU7ZksgcqM
Received: from society.servebeer.com (localhost [127.0.0.1])
 by society.servebeer.com (Postfix) with ESMTP id 234C02064CF4
 for <oracle-l@freelists.org>; Fri, 14 Dec 2007 13:15:37 -0600 (CST)
Received: from internet.pkdy.com ([12.17.117.251])
        (SquirrelMail authenticated user rjesse);
        by society.servebeer.com with HTTP;
        Fri, 14 Dec 2007 13:15:37 -0600 (CST)
Message-ID: <42503.12.17.117.251.1197659737.squirrel@12.17.117.251>
Date: Fri, 14 Dec 2007 13:15:37 -0600 (CST)
Subject: RE: Intermittent 421 errors using UTL_SMTP
From: "Rich Jesse" <rjoralist@society.servebeer.com>
To: oracle-l@freelists.org
User-Agent: SquirrelMail/1.4.3a
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
X-archive-position: 3942
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: rjoralist@society.servebeer.com
Precedence: normal
Reply-to: rjoralist@society.servebeer.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain

Howdy,

In the interest of completeness, I thought I'd post my solution.  As
mentioned, I'm using a slightly improved version of maildemo.sql.  My
problem with this plagarism is not understanding the timing of the SMTP
calls and I had inadvertently opened the SMTP connection to Exchange before
starting my BULK COLLECT.  So, when the DB got busy, my queries ran longer,
causing Exchange to timeout, which apparently results in a 421 error.

The simple fix is to move the OPEN_CONNECTION call to be after the BULK
COLLECT instead of before.

Enjoy!
Rich

    * From: "Rich Jesse" <rjoralist@xxxxxxxxxxxxxxxxxxxxx>
    * To: oracle-l@xxxxxxxxxxxxx
    * Date: Mon, 22 Oct 2007 12:52:29 -0500 (CDT)

Hey all,

I have a few PL/SQL procedures in 10.1.0.5.0 on AIX 5.3 that indirectly use
UTL_SMTP to send out email (duh) through our Exchange server.  The package
that my procedures use to call UTL_SMTP is a slightly improved version of
"maildemo.sql" (Google it).

While this works fine most of the time, I have one weekly DBMS_SCHEDULER job
that now consistently fails, while the other ten jobs work flawlessly.
However, when I manually run the weekly job after a fail, it usually works
(this morning I needed to run it twice).  Since only this job fails, all
other jobs work, and all jobs use the same entry point to UTL_SMTP, I
believe that the mail server and related variables are correctly set.
Here's the important part of the error stack:

ORA-29278: SMTP transient error: ORA-29278: SMTP transient error: 421
Service not available
ORA-06512: at "SYS.UTL_SMTP", line 21
ORA-06512: at "SYS.UTL_SMTP", line 97
ORA-06512: at "SYS.UTL_SMTP", line 342
ORA-06512: at "RICH.MAILDEMO", line 332

UTL_SMTP is wrapped, so I can't say what those lines are, but the line my
package fails on (called "RICH.MAILDEMO" here) is calling
"UTL_SMTP.CLOSE_DATA".

This seems to happen when the instance has a lot of activity, but IMHO
nowhere near peak.  As I don't have visibility to the Exchange server
performance, I can't speak to that.  Also, I see that the parameter
"tx_timeout" in the call to UTL_SMTP.OPEN_CONNECTION is not present, which
should default to a NULL, or "wait indefinitely", according to the docs.
There is also mention in the package comments that this parameter may not
affect writes as documented, but it doesn't say what the implemented
handling is.  Finally, since this is from a DBMS_SCHEDULER job, I don't
believe it would qualify for BUG 4083461.

Anyone have some ideas on how to troubleshoot this?  While it's not a
priority, the intent of the job is to automate the report, which it's now
not doing...

TIA!
Rich


--
http://www.freelists.org/webpage/oracle-l


