Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fabricating a ORA-02049 message

43 views
Skip to first unread message

Peter Leijsten

unread,
Jul 21, 2004, 10:00:41 AM7/21/04
to
Believe it or not, for analyzing some problem at work my boss actually
wants me to to write a script that will generate a ORA-02049
(time-out: distributed transaction waiting for lock) message. From
searching in the archives of this newsgroup I believe it has something
to do with accessing tables at remote databases and the
DISTRIBUTED_LOCK_TIMEOUT parameter. Is there an easy way to 'generate'
this oracle error message using a two databases connected via a
database link?

thanks in advance,
Peter Leijsten

Sybrand Bakker

unread,
Jul 21, 2004, 2:24:51 PM7/21/04
to
On 21 Jul 2004 07:00:41 -0700, boz...@xs4all.nl (Peter Leijsten)
wrote:

raise_application_error(-20409) in any procedure will do.
What problem are you trying to resolve other than to keep your job.


--
Sybrand Bakker, Senior Oracle DBA

David Fitzjarrell

unread,
Jul 21, 2004, 2:47:26 PM7/21/04
to
boz...@xs4all.nl (Peter Leijsten) wrote in message news:<2b39ddad.04072...@posting.google.com>...

declare
tst_wait exception;
pragma exception_init(tst_wait, -2049);
begin
raise tst_wait;
end;
/

SQL> @2049
declare
*
ERROR at line 1:
ORA-02049: timeout: distributed transaction waiting for lock
ORA-06512: at line 5

Easy as that.

David Fitzjarrell

Peter Leijsten

unread,
Jul 21, 2004, 4:39:03 PM7/21/04
to
> raise_application_error(-20409) in any procedure will do.
> What problem are you trying to resolve other than to keep your job.


Thx Sybrand, and David as well. Keeping my job won't be a problem;-).
We just want to try some stuff in the exception handler, that's all

Thanks again.

kind regards,
Peter


0 new messages