This content has been marked as final. Show 6 replies
JE-DBA wrote:realize that SQL in the SGA is a shared resource & is NOT tied to any specific session.
The job is a PL/SQL Package.
what problem are you really trying to solve.
If you know the Session ID & SERIAL# you can trace the activity using call below
DBMS_MONITOR.SESSION_TRACE_ENABLE( session_id IN BINARY_INTEGER DEFAULT NULL, serial_num IN BINARY_INTEGER DEFAULT NULL, waits IN BOOLEAN DEFAULT TRUE, binds IN BOOLEAN DEFAULT FALSE, plan_stat IN VARCHAR2 DEFAULT NULL);
How can I find out what SQL Command the Scheduled Job is currently running?DBA_SCHEDULER_JOBS, DBA_SCHEDULER_SCHEDULES, DBA_SCHEDULER_PROGRAMS, DBA_SCHEDULER_JOB_CLASSES, DBA_JOBS.
you need the SCHEDULER_ADMIN role to see the dba_scheduler tables (however this may grant you too may rights)
Why not use something like DBMS_APPLICATION_INFO to track what is running?
Edit: You will need to change the package to plumb in application info. If you need to see something that is running right now and you do not have the luxury of changing code at the moment, look at the session in v$session and find the sql_id it is running then look it up in v$sql. Many DBA and Developer tools do this for you automatically just by looking at the list of current sessions.