Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

What does the scheduler$_job_run_details do ?

The sys.scheduler$_job_run_details is a table that resides in the SYSAUX tablespace.  The purpose of the scheduler$_job_run_details table is to store details on job run details.  Also see related scheduler$_event_log tips.
The scheduler$_job_run_details consumes a significant amount of space in the SYSAUX tablespace and it should be periodically truncated to keep the SYSAUX tablespace  from becoming full. 
Either of these statements will purge the rows on demand:
exec DBMS_SCHEDULER.PURGE_LOG();

truncate table sys.scheduler$_job_run_details;
Also see my other notes on purging from the SYSAUX tablespace.
This script will display details from scheduler$_event_log and scheduler$_job_run_details.
SELECT
   j.LOG_ID, 
   j.LOG_DATE, 
   e.OWNER,
DECODE(instr(e.NAME,'"'),0, e.NAME,substr(e.NAME,1,instr(e.NAME,'"')-1)),
DECODE(instr(e.NAME,'"'),0,NULL,substr(e.NAME,instr(e.NAME,'"')+1)),
e.STATUS, j.ERROR#, j.REQ_START_DATE, j.START_DATE, j.RUN_DURATION,
j.INSTANCE_ID, j.SESSION_ID, j.SLAVE_PID, j.CPU_USED,
decode(e.credential, NULL, NULL,
substr(e.credential, 1, instr(e.credential, '"')-1)),
decode(e.credential, NULL, NULL,
substr(e.credential, instr(e.credential, '"')+1,
length(e.credential) - instr(e.credential, '"'))),
decode(bitand(e.flags, 1), 0, NULL,
substr(e.destination, 1, instr(e.destination, '"')-1)),
decode(bitand(e.flags, 1), 0, e.destination,
substr(e.destination, instr(e.destination, '"')+1,
length(e.destination) - instr(e.destination, '"'))),
j.ADDITIONAL_INFO
FROM 
   scheduler$_job_run_details j, 
   scheduler$_event_log e
WHERE j.log_id = e.log_id
AND e.type# = 66 and e.dbid is null
AND ( e.owner = SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
or /* user has object privileges */
( select jo.obj# from obj$ jo, user$ ju where
DECODE(instr(e.NAME,'"'),0, e.NAME,substr(e.NAME,1,instr(e.NAME,'"')-1))
= jo.name and e.owner = ju.name and jo.owner# = ju.user#
and jo.subname is null and jo.type# = 66
) in
( select oa.obj#
from sys.objauth$ oa
where grantee# in ( select kzsrorol from x$kzsro )
)
or /* user has system privileges */
(exists ( select null from v$enabledprivs
where priv_number = -265 /* CREATE ANY JOB */
)
and e.owner!='SYS')
);

Comments

Popular posts from this blog

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

7 Steps to configure BDR replication in postgresql

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

Ora2PG - Oracle/MySQL to Postgres DB migration Version 20.0

PostgreSQL Introduction