Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: raise_application_error generates trace file

Re: raise_application_error generates trace file

From: Sybrand Bakker <oradba_at_sybrandb.demon.nl>
Date: Fri, 30 Nov 2001 15:42:29 +0100
Message-ID: <dg6f0u8d9a205gp3pitp5tn3uv277g8nmn@4ax.com>


On 30 Nov 2001 06:23:28 -0800, robvl66_at_hotmail.com (rob) wrote:

>I've created a logon trigger to check if users ip adres is in out
>range. The strange thing is : it now and then generates a trace file.
>Could someone explain why.
>Oracle8i Enterprise Edition Release 8.1.7.2.0
>SunOS 5.8
>I've edited the ip-range in the trigger for security reasons
>
>Alert.log entry:
>Errors in file /u01/app/oracle/admin/hlpdtest/udump/sid_ora_7112.trc:
>ORA-00604: error occurred at recursive SQL level 1
>ORA-20001: This service is for authorized personnel only
>ORA-06512: at line 32
>
>The trigger:
>CREATE OR REPLACE TRIGGER on_logon
>AFTER LOGON
>ON DATABASE
>DECLARE
> v_ip varchar2(15);
> v_usr varchar2(40);
> v_ses varchar2(40);
> v_host varchar2(40);
> v_date date;
>BEGIN
> SELECT SYS_CONTEXT('USERENV','IP_ADDRESS')
> , SYS_CONTEXT('USERENV','HOST')
> , SYS_CONTEXT('USERENV','OS_USER')
> , SYS_CONTEXT('USERENV','SESSION_USER')
> , sysdate
> INTO v_ip
> , v_usr
> , v_ses
> , v_host
> , v_date
> FROM dual;
>
> IF v_ip NOT LIKE 'xxx.xxx.%'
> THEN
> INSERT
> INTO intruders
> VALUES (v_ip
> ,v_usr
> ,v_ses
> ,v_host
> ,v_date);
> COMMIT;
> RAISE_APPLICATION_ERROR(-20001, 'This service is for authorized
>personnel only');
> END IF;
>END;
>/

Yup, if you don't have serveroutput, this is what will happen. However, Oracle Connection Manager can block ip-addresses. You'll probably better configure it, and remove checks like this. If you don't do so you have to revise the trigger each time someone revises the range of ip-addresses. Not a good idea, IMO

Hth

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Fri Nov 30 2001 - 08:42:29 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US