Troubleshooting Scheduler Autotask Issues (Doc ID 1561498.1)

简介: In this Document   Purpose   Troubleshooting Steps   References   APPLIES TO: Oracle Database - Enterprise Edition - Version 11.

In this Document

  Purpose
  Troubleshooting Steps
  References

 

APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.1.0.6 and later
Information in this document applies to any platform.

PURPOSE

 This document aims to provide troubleshooting steps and scripts to help solve some known Scheduler Autotasks or Maintainance issues. The most common problems are either    windows stopped running or they do run but tasks are not invoked.

TROUBLESHOOTING STEPS

 1. The following script gathers most of the information needed to troubleshoot the problem, the output is generated in a well formatted (HTML) file for the ease of viewing and analyzing

ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT ='DD/MM/YYYY HH24:MI:SS TZR TZD';
ALTER SESSION SET NLS_DATE_FORMAT ='DD-MM-YYYY HH24:MI:SS';
set pagesize 9999
spool /tmp/dba_autotask_client.html
set markup html on
select * from DBA_AUTOTASK_CLIENT;
select * from DBA_AUTOTASK_CLIENT_HISTORY;
select * from DBA_AUTOTASK_CLIENT_JOB;
select * from DBA_AUTOTASK_JOB_HISTORY order by JOB_START_TIME;
select * from DBA_AUTOTASK_OPERATION;
select * from DBA_AUTOTASK_SCHEDULE order by START_TIME;
select * from DBA_AUTOTASK_TASK;
select * from DBA_AUTOTASK_WINDOW_CLIENTS;
select * from DBA_AUTOTASK_WINDOW_HISTORY order by WINDOW_START_TIME;
select * from dba_scheduler_windows;
select * from dba_scheduler_window_groups;
select * from dba_scheduler_job_run_details order by ACTUAL_START_DATE;
select * from DBA_SCHEDULER_JOB_LOG;
SELECT program_name, program_action, enabled FROM dba_scheduler_programs;
spool off

2. The following script disables and reenables Autotasks, it also creates a test window to check whether the window is running and the tasks are being invoked during its open time as expected

exec dbms_isched.set_scheduler_attribute('SCHEDULER_DISABLED','FALSE','SYS',16 );
execute DBMS_AUTO_TASK_ADMIN.DISABLE;
execute DBMS_AUTO_TASK_ADMIN.ENABLE;
exec dbms_scheduler.create_window(window_name=>'TEST_WINDOW',resource_plan=>'DEFAULT_MAINTENANCE_PLAN',repeat_interval=>'freq=daily;byday=WED;byhour=12;' ||'byminute=20; bysecond=0',duration=>interval '4' hour,comments=>'TEST window for maintenance tasks'); -- Please modify this command to create a test window in an appropriate time for your system (and doesn't interfere with already created windows)
exec dbms_scheduler.set_attribute('TEST_WINDOW','SYSTEM',TRUE);
exec dbms_scheduler.set_attribute('TEST_WINDOW','FOLLOW_DEFAULT_TIMEZONE',TRUE);
exec dbms_autotask_prvt.setup(0);            
exec dbms_scheduler.add_window_group_member('MAINTENANCE_WINDOW_GROUP','TEST_WINDOW');
exec dbms_autotask_prvt.setup(3); 

3. If one of the windows was open when it shouldn't or in other words "DBA_SCHEDULER_WINDOWS.ACTIVE=TRUE" during hours where the window should be closed then please close the window manually. Please replace SATURDAY_WINDOW with the appropriate window name

EXECUTE DBMS_SCHEDULER.CLOSE_WINDOW ('SATURDAY_WINDOW');

4. If step 3 didn't help or if "DBA_AUTOTASK_WINDOW_CLIENTS.WINDOW_NEXT_TIME" showed a date in the past then please drop and recreate the windows

@?/rdbms/admin/catnomwn.sql -- this drops the maintenance window, it will give some errors that can be ignored.

-- Drop the windows manually:
execute dbms_scheduler.drop_window('MONDAY_WINDOW');
execute dbms_scheduler.drop_window('TUESDAY_WINDOW');
execute dbms_scheduler.drop_window('WEDNESDAY_WINDOW');
execute dbms_scheduler.drop_window('THURSDAY_WINDOW');
execute dbms_scheduler.drop_window('FRIDAY_WINDOW');
execute dbms_scheduler.drop_window('SATURDAY_WINDOW');
execute dbms_scheduler.drop_window('SUNDAY_WINDOW');

@?/rdbms/admin/catmwin.sql -- this recreates them

5. If the tasks stopped working then possibly the last successful (or failing) job is still stuck, if DBA_AUTOTASK_TASK showed a job consistently present then try to drop this job

exec DBMS_SCHEDULER.drop_job (job_name => 'ORA$AT_OS_OPT_SY_2611',force =>TRUE);

6. If the Windows were running but auto optimizer stats collection is not running then check DBA_SCHEDULER_PROGRAMS.PROGRAM_NAME, if you didn't find an entry for "GATHER_STATS_PROG" then gather statistics manually and create the windows as follows:

exec dbms_stats.gather_database_stats_job_proc;

@$ORACLE_HOME/rdbms/admin/catnomwn.sql  -- this drops 
@$ORACLE_HOME/rdbms/admin/catmwin.sql   -- this recreates

 

 

REFERENCES

NOTE:1320246.1 - Why Auto Optimizer Statistics Collection May Appear to be "Stuck"?
BUG:16599612 - AUTO TASKS NOT RUNNING:4W
BUG:16787364 - AUTOTASK STAS JOB IS NOT RUNNING

目录
相关文章
|
缓存 前端开发 JavaScript
【面试题】金九银十,你准备好面试了吗? (30w字前端面试题总结)( React)
【面试题】金九银十,你准备好面试了吗? (30w字前端面试题总结)( React)
329 0
|
7月前
|
存储 供应链 监控
供应链复杂、工厂分散,半导体行业如何安全访问总部ERP系统?
电子元器件与半导体行业面临供应链复杂、生产计划多变等挑战,智能化ERP系统成为提升效率的关键。然而,数据安全至关重要,许多企业选择本地部署并结合内网穿透技术实现远程访问。以神州讯盟ERP为例,搭配贝锐花生壳,无需公网IP即可安全接入总部系统。花生壳采用多重加密与权限控制,保障数据传输安全,同时支持高速跨地区访问,仅需三步即可完成配置,满足多地协同办公需求,助力企业高效管理。
203 0
uniapp使用路由名称跳转
【9月更文挑战第11天】在UniApp中,可通过定义路由名称实现页面跳转,需在`pages.json`中设置页面的`name`属性。使用`uni.navigateTo`等API并指定名称即可跳转,例如`name: 'detailPage'`。目标页面可在`onLoad`函数中获取传递的参数,这种方式使代码更清晰且便于维护,尤其适合大型项目。
411 1
|
NoSQL Java 应用服务中间件
大厂面试必备:如何轻松实现分布式Session管理?
这篇文章介绍三种分布式Session的实现方案:基于JWT的Token、基于Tomcat的Redis和基于Spring的Redis。JWT方案通过生成Token存储用户信息,实现无状态、可扩展的会话管理,但可能增加请求负载且数据安全性较低。Tomcat与Redis结合,通过配置Tomcat和Redis,实现Session集中管理和高性能存储,但配置相对复杂。Spring整合Redis适用于SpringBoot和SpringCloud项目,集成方便,扩展性强,但同样依赖外部Redis服务。每种方法有其优缺点,适用场景不同。作者小米是一个技术爱好者,欢迎关注其微信公众号“软件求生”获取更多技术内容
771 4
|
索引 Python
【Leetcode刷题Python】从列表list中创建一颗二叉树
本文介绍了如何使用Python递归函数从列表中创建二叉树,其中每个节点的左右子节点索引分别是当前节点索引的2倍加1和2倍加2。
333 7
|
人工智能 监控 数据可视化
智慧工地管理云平台可视化AI大数据建造工地源码
数字孪生可视化大屏,一张图掌握项目整体情况;
256 3
|
机器学习/深度学习 安全 网络协议
网络安全公开数据集Maple-IDS,恶意流量检测数据集开放使用!
【8月更文挑战第29天】Maple-IDS 是东北林业大学网络安全实验室发布的网络入侵检测评估数据集,旨在提升异常基础入侵检测和预防系统的性能与可靠性。该数据集包含多种最新攻击类型,如 DDoS 和 N-day 漏洞,覆盖多种服务和网络行为,兼容 CIC-IDS 格式,便于直接使用或生成 csv 文件,适用于多种现代协议。
1094 1
|
jenkins 持续交付 开发工具
Jenkins 与 Docker 集成的最佳实践
【8月更文第31天】随着容器技术的兴起,越来越多的团队开始采用 Docker 来构建和部署应用。Docker 提供了一种轻量级的虚拟化方法,使得应用可以在任何地方以相同的方式运行,这极大地提高了开发效率和部署的一致性。与此同时,Jenkins 作为一种广泛使用的持续集成/持续交付(CI/CD)工具,可以帮助团队自动化构建、测试和部署流程。本文将探讨如何将 Docker 与 Jenkins 集成,以简化开发环境的搭建和维护。
880 0
下一篇
oss云网关配置