enable oracle tracing for a user
Posted: Thu 06 Nov 2014 15:52
Hello,
to find some bottle necks , we would like to trace all activity from a certain user.
our database access it self happens on a wcf service , and Entity Framework connects to the database with the same login using Devart for Oracle.
So the database does not know who the user is.
When starting a wcf service call, is check my settings for the current client-user,
and if needed, i try to call a stored proc
PROCEDURE set_session_identifier (p_identifier IN VARCHAR2,
p_tracefile OUT VARCHAR2
)
IS
l_identifier VARCHAR2 (100);
BEGIN
IF p_identifier IS NOT NULL
THEN
l_identifier := REPLACE (p_identifier, 'WGK-WVL\', '');
EXECUTE IMMEDIATE 'ALTER SESSION SET sql_trace = true';
EXECUTE IMMEDIATE
'ALTER SESSION SET tracefile_identifier = "'
|| l_identifier
|| '"';
SELECT --value into p_tracefile
regexp_substr(value, '[^\]*$') into p_tracefile
FROM v$diag_info
WHERE name = 'Default Trace File';
END IF;
END;
before executing any Entity Framework logic.
Since this call happens before any EF logic, it appears to use a different connection, and so my statements do not appear in this trace file.
Is there any way i can make this logic happen at the moment that EF gets its first connection, so i can execute that stored proc in the same session ?
to find some bottle necks , we would like to trace all activity from a certain user.
our database access it self happens on a wcf service , and Entity Framework connects to the database with the same login using Devart for Oracle.
So the database does not know who the user is.
When starting a wcf service call, is check my settings for the current client-user,
and if needed, i try to call a stored proc
PROCEDURE set_session_identifier (p_identifier IN VARCHAR2,
p_tracefile OUT VARCHAR2
)
IS
l_identifier VARCHAR2 (100);
BEGIN
IF p_identifier IS NOT NULL
THEN
l_identifier := REPLACE (p_identifier, 'WGK-WVL\', '');
EXECUTE IMMEDIATE 'ALTER SESSION SET sql_trace = true';
EXECUTE IMMEDIATE
'ALTER SESSION SET tracefile_identifier = "'
|| l_identifier
|| '"';
SELECT --value into p_tracefile
regexp_substr(value, '[^\]*$') into p_tracefile
FROM v$diag_info
WHERE name = 'Default Trace File';
END IF;
END;
before executing any Entity Framework logic.
Since this call happens before any EF logic, it appears to use a different connection, and so my statements do not appear in this trace file.
Is there any way i can make this logic happen at the moment that EF gets its first connection, so i can execute that stored proc in the same session ?