If you want to put a trace on the user who ran a scheduled job, would you take it from cmn_sch_job_runs.user_id?
regardless of who defined the schedule?
Did a little test. Interesting result.
Scheduled a job with an user ID. Logged out. Put the trace on.
Logged in with another ID and watch.
The job was run with the ID with which it was scheduled (cmn_sch_job_runs.user_id) and the trace created.
However, that particular user had no session. Only the scheduler had a session.
I don't follow what you mean by the difference between "the user who ran a scheduled job" and "who defined the schedule"?
But yes, that cmn_sch_job_runs.user_id is the user who ran the job (as I am interpreting the question).
To me it sounded so simple:
There is repeatedly a number of dealock errors in the log at a given hour.. Somebody related them to a job.
To know what is actually happening and what else is happening I should like to put the SQL trace on.
Which user to put the trace on?
Right OK I understand now...
I'm sure that I have put SQLTrace on my personal user account to trace online application processing and then also seen logs produced related to jobs scheduled (eg Timeslicing) under that same user-account - but that would have all been pre V13 SQL tracing so I don't have a definitive statement in V13.
Its going to create a LOT of log information if you trace the "admin" user I would suspect - ouch!
It is v12.1 SP3. Agreed on the size of the log. Hopefully the timeframe will allow to restrictk it.
Retrieving data ...