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: Help: Is there any way I can catch the sql that calls the function from inside the function?

Re: Help: Is there any way I can catch the sql that calls the function from inside the function?

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 14 Nov 2005 17:12:44 -0800
Message-ID: <1132017249.243334@yasure>


NewRacGuy wrote:
> Tracing is not acceptable. It is application we are talking about.
>
> Fine_Grained Access Auditing works great in this case.
>
> You add a policy to the table, when anybody select the table, Oracle will
> insert a row with sql in sys.dba_fga_audit_trail. All I need to do is in my
> function, I just add
> .....
> l_sql_text varchar2(2000);
> Begin
>
> select sql_text into l_sql_text from (select sql_text from
> sys.dba_fga_audit_trail
> where session_id=sys_context('USERENV','SESSIONID')
> order by timestamp desc) where rownum < 1;
> ......
> end;
>
>
>
>

>>I don't see how fined grained auditing or autonomous transaction is
>>relevant to your request. Your calling SQL and the SQL inside the
>>function are both in library cache (v$sql e.g.). But the difficulty is
>>how to associate them. If you find a good answer, please post back.

Top posting too is unacceptable and yet you still do it. ;-)

A full demo of DBMS_FGA is in Morgan's Library at www.psoug.org.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Mon Nov 14 2005 - 19:12:44 CST

Original text of this message

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