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 -> Capturing SQL

Capturing SQL

From: argon <a_____n_at_my-deja.com>
Date: Fri, 01 Dec 2000 20:58:37 GMT
Message-ID: <9093do$rku$1@nnrp1.deja.com>

Hello,

I need to create auditing of sorts: track certain changes to a certain column - who /what is changing it. I also need to capture the SQL update statement that did it.

So I created a holding table and a trigger that would populate the holding table on update to the column in question. I've tried to capture the SQL using:

select t2.sql_text
from sys.v_$session t1, sys.v_$sqltext t2 where t1.audsid = userenv('sessionid')
and t2.address = t1.prev_sql_addr
and t2.hash_value = t1.prev_hash_value
order by t2.piece

It does not work - always brings the generic 'update ts$ set inc#=:2 where ts#=:1'

Any suggestions?

Andrew A.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Dec 01 2000 - 14:58:37 CST

Original text of this message

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