Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all articles
Browse latest Browse all 1640

Enable trace whenever user logged into DB

$
0
0

We can accomplish this by creating a trigger.

Please note that you disable this trigger after you done with your activity. Else it will fill up user dump destination,

Script :

create or replace trigger set_trace after logon on database
begin
if user  in ('SCOTT') then
execute immediate
'Alter session set events ''10046 trace name context forever, level 12''';
execute immediate
'Alter session set timed_statistics=true';
execute immediate
'Alter session set statistics_level=typical';
execute immediate
'Alter session set tracefile_identifier=''TEST1_trace''';
execute immediate 'alter session set max_dump_file_size=unlimited';
end if;
exception
when others then
null;
end;
/



Viewing all articles
Browse latest Browse all 1640

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>