Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Tracing by default

Status
Not open for further replies.

SMS636

IS-IT--Management
Apr 20, 2005
20
CA
Quick questions.
How can i turn on SQL Tracing by default for newly connected session.

New session is running a command with-in a second once getting connected.

After the connection if i turn the tracing on it will be upto no avail as i cannot capture the issue.

Can someone help, how to enabled SQL TRACING by default for new specific connection from a machine let say T1 using uname scott.

Regards
 

You could create a 'DATABASE EVENT' trigger, kind like:
Code:
Create Trigger Set_Trace_On_T1
After LOGON On Database
Begin
  If SYS_CONTEXT('USERENV', 'SESSION_USER') = 'SCOTT' And
     SYS_CONTEXT('USERENV', 'TERMINAL')     = 'T1'   Then
    Execute Immediate 'ALTER SESSION SET SQL_TRACE = TRUE';
  End If;
End;
[3eyes]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Thanks, I guess this will do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top