Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How enable trace to a particular user not to session.

DBAMay 18 2010 — edited May 18 2010
Hi,

I have to enable trace to a particular user, is this possible? reason being we are executing a procedure which in turns spans many sessions appox...200+.. Normally we used to enable trace to for a particular session based on sid,Serial# but in our parent process spawns many child processes and those getting very fastly. so i though to use "Enabling the trace to the user level". Please help me the same.


Regards
DBA.

Comments

PrafullaNath
I think there is no such command to trace a session.when ever a user gets connected to DB a session with sid,serial# gets associated with the user.

select sid,serial# from v$session where username='USER_NAME';

after that use

execute dbms_system.set_sql_trace_in_session(sid,serial#,true);

execute dbms_monitor.session_trace_enable(sid,serial#,true);
Pavan Kumar
Hi,
Enabling the trace to the user level
User level - its self reflects to Sessionw which it gets connected to ORACLE in order to Access the data/information.
Check with EXECUTE dbms_support.start_trace_in_session (9,29); else enable the trace @DB level for particular time and disable with out restart.

HTH

- Pavan Kumar N
- ORACLE OCP - 9i/10g
https://www.oracleinternals.blogspot.com
Aman....
I would not recommend to use DBMS_SUPPORT package since its not documented and is only meant for support. If you are on 10g and above, you can use DBMS_MONITOR package for the same.

HTH
Aman....
Pavan Kumar
Hi Aman,

Agree on that.. Sir... !! :-)

- Pavan Kumar N
DBA
Hi..Gurus,

thanks for the updates. I have used all these options earlier ,which were posted by you all, but sill i am not able to get the trace for spawned(child ) processes automatically. Only options is that i need to monitor closely v$session, and i need to enable the trace for each new spawned process, but it is very tedious job reason being my program takes approximately 5 hours to complete the entire job,


regards
DBA.
PrafullaNath
then better trace the entire instance/database
Hemant K Chitale
The procedure actually creates new sessions ? How and why ? How does it supply the SQLs to be executed by the child sessions ?

You could modify the code so that the SQL code it passes to the child session includes the DBMS_SESSION.START_TRACE call !



OR write a database LOGON trigger that enables tracing, based on the username.


Hemant K Chitale
1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 15 2010
Added on May 18 2010
7 comments
7,480 views