查找oracle的数据库job任务的命令
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
select * from dba_scheduler_job_run_details
where JOB_NAME='JOB_NHM_PPM_WLAN_AP_PERF'
order by log_date
select job, last_date, next_date, broken, failures
from user_jobs
查询job
select LOG_ID,
TO_CHAR(LOG_DATE, 'yyyy-mm-dd hh24:mi:ss') LOG_DATE,
OWNER,
JOB_NAME,
JOB_SUBNAME,
STATUS,
ERROR#,
TO_CHAR(REQ_START_DATE, 'yyyy-mm-dd hh24:mi:ss') REQ_START_DATE,
TO_CHAR(ACTUAL_START_DATE, 'yyyy-mm-dd hh24:mi:ss') ACTUAL_START_DATE,
RUN_DURATION,
INSTANCE_ID,
SESSION_ID,
SLAVE_PID,
CPU_USED,
ADDITIONAL_INFO
from DBA_SCHEDULER_JOB_RUN_DETAILS
where OWNER in ('FM', 'NHM', 'RM')
order by LOG_DATE
job的查询完善:
select LOG_ID,
TO_CHAR(LOG_DATE, 'yyyy-mm-dd hh24:mi:ss') LOG_DATE,
OWNER,
JOB_NAME,
JOB_SUBNAME,
STATUS,
ERROR#,
TO_CHAR(REQ_START_DATE, 'yyyy-mm-dd hh24:mi:ss') REQ_START_DATE,
TO_CHAR(ACTUAL_START_DATE, 'yyyy-mm-dd hh24:mi:ss') ACTUAL_START_DATE,
RUN_DURATION,
INSTANCE_ID,
SESSION_ID,
SLAVE_PID,
CPU_USED,
ADDITIONAL_INFO
from DBA_SCHEDULER_JOB_RUN_DETAILS
where LOG_DATE > TRUNC(sysdate)
and OWNER in ('FM', 'NHM', 'RM')
order by LOG_ID
根据job查到的session_id来查找对应的日志
比如以上的语句查出来session_id为2196.48567
就要按以下的格式来查询
select count(*), B.OBJECT_NAME, EVENT_NAME
from SYS.WRH$_ACTIVE_SESSION_HISTORY A, DBA_OBJECTS B, V$EVENT_NAME C
where A.CURRENT_OBJ# = B.DATA_OBJECT_ID and A.EVENT_ID=C.EVENT_ID
and A.SESSION_ID = 2196
and A.SESSION_SERIAL# = 48567
and A.SAMPLE_TIME >= TRUNC(sysdate-1)
group by B.OBJECT_NAME, ;
完善的:
select count(*), B.OBJECT_NAME, EVENT_NAME
from SYS.WRH$_ACTIVE_SESSION_HISTORY A, DBA_OBJECTS B, V$EVENT_NAME C
where A.CURRENT_OBJ# = B.DATA_OBJECT_ID(+) and A.EVENT_ID=C.EVENT_ID(+)
and A.SESSION_ID = 1950
and A.SESSION_SERIAL# = 21082
/*and A.SAMPLE_TIME >= TRUNC(sysdate)*/
group by B.OBJECT_NAME, ;