-
Enable Tracing For A Particular Program
Hi,
I am using the following LOGON trigger, in order to get the SQL TRACING enable for the session, which is currently running EXCEL.EXE Program.
But in this way, the SQL TRACING for other sessions were also enable, when they logon to the database using other program rather than EXCEL.
Because, we only need to enable the SQL TRACING, for the session which is running the EXCEL PROGRAM, not for other programs/sessions.
I am looking forward to an advice .
Chuck
CREATE OR REPLACE TRIGGER testtrg
AFTER LOGON ON DATABASE
DECLARE
v_sid number;
v_serial# number;
v_username VARCHAR2(30);
v_program VARCHAR2(64);
v_time date;
BEGIN
select username,sid,serial#,program,logon_time into v_username,v_sid,v_serial#,v_program,
v_time from v$session s
where sys_context('userenv','SESSIONID')=s.audsid and s.program='EXCEL.EXE';
if (v_program = 'EXCEL.EXE') then
execute immediate
'exec dbms_system.set_sql_trace_in_session(v_sid,v_serial#,true)' ;
END IF;
else
null;
END;
/
-
a point for you to consider - what happens when I rename excel.exe to i_am_cool.exe
I can get past your trigger easily
-
Originally posted by davey23uk
a point for you to consider - what happens when I rename excel.exe to i_am_cool.exe
I can get past your trigger easily
Actually not. Because the original poster has screwed his database even more than he (and you ) thinks. If you try what you suggested you won't be able to connect to his database at all. What will happen? An unhandled predefined exception NO_DATA_FOUND will be raised in the logon trigger, so you will be thrown out. In fact, noone with will be able to log on, unless his program represents itself like "EXCEL.EXE".
So in fact, I think the original poster has not realy provided his/her actual code of logon trigger (or he/she didn't mention that suddenly noone is able to connect to the database unless the connection has been made by something that represents itself as "EXCEL.EXE" to the database).
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
aahh the benefits of actually reading the code
-
Well, the fact is that that trigger doesn't even get compiled, because of the syntactical errors!!
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
Originally posted by jmodic
Well, the fact is that that trigger doesn't even get compiled, because of the syntactical errors!!
Picky picky picky. I can't stand these perfectionists.
By the way, shouldn't it be "because of the syntax errors"?
-
Originally posted by slimdave
By the way, shouldn't it be "because of the syntax errors"?
If you say so. Gee, I realy can't stand those bloody language purists...
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
ENABLE SQL TRACING FOR A PARTICULAR SESSION
Hi Everyone,
The logon trigger which I posted earlier has been compiled succesfully.
The problem is that it enables SQL TRACING for all the session.
However I wanted to enable sql tracing For a particular session which is using EXCEL.
WHAT PART OF CODE I CHANGE IN ORDER TO ENABLE SQL TRACING FOR THAT PARTICULAR SESSION WHICH IS USING EXXCEL.
Only comments from serious people.
Thanks
Chuck
-
Re: ENABLE SQL TRACING FOR A PARTICULAR SESSION
Originally posted by Chuck
The logon trigger which I posted earlier has been compiled succesfully.
No it hasn't. There's an obvious syntax error that prevents compilation.
-
Hi,
Try msqry32.exe instead of excel.exe
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|