Skip to content

Instantly share code, notes, and snippets.

@sebastianwebber
Created March 1, 2016 17:44
Show Gist options
  • Select an option

  • Save sebastianwebber/bc2b1e94843b1378d9bb to your computer and use it in GitHub Desktop.

Select an option

Save sebastianwebber/bc2b1e94843b1378d9bb to your computer and use it in GitHub Desktop.
SELECT to generate SQL statement to exec trace command
SELECT
'exec SYS.DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION (' || p.pid || ', ' || p.serial# || ', true); ' AS start_trace_cmd,
p.tracefile
FROM v$process p, v$session s
WHERE p.addr = s.paddr
AND LOWER(s.username) LIKE LOWER('%user_name%');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment