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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Trigger not firing!!!!!!!!!!(URGENT)

Re: Trigger not firing!!!!!!!!!!(URGENT)

From: Radoulov, Dimitre <cichomitiko_at_gmail.com>
Date: Thu, 9 Jun 2005 16:11:50 +0200
Message-ID: <03ea01c56cfd$3166e600$1a03310a@IBME1D11967173>


Hmm ... I'm still thinkin' that it logs all the sessions and commits without autonomous transaction:

16:00:07 SQL> CREATE OR REPLACE TRIGGER logon_audit AFTER LOGON ON DATABASE
16:00:18   2  BEGIN
16:00:18   3  execute immediate
16:00:18   4  'alter session set events ''10046 trace name context 
forever,level 12'' ';
16:00:24   5  insert into sys.log_info
16:00:24   6  values(sysdate,ora_client_ip_address,ora_login_user);
16:00:24   7  END;
16:00:24   8  /

Trigger created.

Elapsed: 00:00:00.31
16:00:25 SQL> conn test/test_at_dbarepo1
Connected.
16:00:32 SQL> select 'X' from dual;

'
-
X

Elapsed: 00:00:00.01
16:00:42 SQL> exit

I think the first commit is here(rlbk=0):

STAT #1 id=1 cnt=1 pid=0 pos=1 obj=222 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=99 us)'
XCTEND rlbk=0, rd_only=0 -----> !!!
WAIT #0: nam='log file sync' ela= 22244 p1=7 p2=0 p3=0

$ view dbarepo1_ora_13832.trc
"dbarepo1_ora_13832.trc" [Read only] 210 lines, 11911 characters /app/oracle/admin/dbarepo1/udump/dbarepo1_ora_13832.trc Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production
ORACLE_HOME = /app/oracle/product/9i
System name: SunOS

Node name:      ess038
Release:        5.8
Version:        Generic_117350-02
Machine:        sun4u

Instance name: dbarepo1
Redo thread mounted by this instance: 1
Oracle process number: 10
Unix process pid: 13832, image: oracle_at_ess038 (TNS V1-V3)

But, it commits even if the user issues rollback or fail to exit correctly:

16:05:36 SQL> select * from sys.log_info;

no rows selected

Elapsed: 00:00:00.01
16:05:49 SQL> conn test/test_at_dbarepo1;
Connected.

16:05:58 SQL> conn / as sysdba
Connected.
16:06:03 SQL> select * from sys.log_info;

LOGIN_DAT IPADDS USERNAME

--------- -------------------- ------------------------------
09-JUN-05 10.44.19.31          TEST
09-JUN-05                      SYS

Elapsed: 00:00:00.00
16:06:04 SQL> conn test/test_at_dbarepo1
Connected.
16:06:12 SQL> rollback;

Rollback complete.

Elapsed: 00:00:00.01
16:06:17 SQL> conn / as sysdba
Connected.
16:06:20 SQL> select * from sys.log_info;

LOGIN_DAT IPADDS USERNAME

--------- -------------------- ------------------------------
09-JUN-05 10.44.19.31          TEST
09-JUN-05                      SYS
09-JUN-05 10.44.19.31          TEST
09-JUN-05                      SYS

Elapsed: 00:00:00.00
16:06:24 SQL> conn test/test_at_dbarepo1
Connected.
16:08:19 SQL> Killed
$ sqlplus '/ as sysdba'

SQL*Plus: Release 9.2.0.4.0 - Production on Thu Jun 9 16:08:39 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production

16:08:40 SQL> select * from sys.log_info;

LOGIN_DAT IPADDS USERNAME

--------- -------------------- ------------------------------
09-JUN-05 10.44.19.31          TEST
09-JUN-05                      SYS
09-JUN-05 10.44.19.31          TEST
09-JUN-05                      SYS
09-JUN-05 10.44.19.31          TEST
09-JUN-05                      SYS

6 rows selected.

Elapsed: 00:00:00.01

Cheers
Dimitre Radoulov

ETNØTEAM

> Hi Dimitre,
>
> Some programs may auto-commit or auto-rollback on disconnect.  Check a
> 10046 trace to see where the COMMIT happens.  The row stays, so
> logically it must happen somewhere in the connection, right?
>
> Oooh, a LOGON trigger for a 10046 trace!  :)
>
> Rich
>
> -----Original Message-----
> From: Radoulov, Dimitre [mailto:cichomitiko_at_gmail.com]=20
> Sent: Thursday, June 09, 2005 8:38 AM
> To: Jesse, Rich; oracle-l_at_freelists.org
> Subject: Re: Trigger not firing!!!!!!!!!!(URGENT)
>
>
>> 3) Wouldn't it be "better" if a procedure with a PRAGMA
>> AUTONOMOUS_TRANSACTION were called to do this, including the
> obligitory
>> COMMIT, thereby helping ensure that all connections (not just from the
>> SQL*Plus program) are logged?
>
> Why do you think that only the sqlplus's sessions will be logged?
>
>
> Regards
> Dimitre Radoulov
> --
> http://www.freelists.org/webpage/oracle-l 

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jun 09 2005 - 10:19:02 CDT

Original text of this message

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