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

目录
相关文章
|
存储 云计算 智慧交通
云计算的智慧城市架构
智慧城市的发展是现代化城市发展的必然趋势,云计算为智慧城市建设的关键点,更是智慧城市的“智慧”所在。在智慧城市的建设中,建立以云计算为核心,综合多应用、多行业、多系统的智慧城市设计,已经成为目前智慧城市发展的一个重要思路。
3425 0
|
缓存 前端开发 JavaScript
【面试题】金九银十,你准备好面试了吗? (30w字前端面试题总结)( React)
【面试题】金九银十,你准备好面试了吗? (30w字前端面试题总结)( React)
348 0
|
8月前
|
存储 供应链 监控
供应链复杂、工厂分散,半导体行业如何安全访问总部ERP系统?
电子元器件与半导体行业面临供应链复杂、生产计划多变等挑战,智能化ERP系统成为提升效率的关键。然而,数据安全至关重要,许多企业选择本地部署并结合内网穿透技术实现远程访问。以神州讯盟ERP为例,搭配贝锐花生壳,无需公网IP即可安全接入总部系统。花生壳采用多重加密与权限控制,保障数据传输安全,同时支持高速跨地区访问,仅需三步即可完成配置,满足多地协同办公需求,助力企业高效管理。
234 0
uniapp使用路由名称跳转
【9月更文挑战第11天】在UniApp中,可通过定义路由名称实现页面跳转,需在`pages.json`中设置页面的`name`属性。使用`uni.navigateTo`等API并指定名称即可跳转,例如`name: 'detailPage'`。目标页面可在`onLoad`函数中获取传递的参数,这种方式使代码更清晰且便于维护,尤其适合大型项目。
432 1
|
监控 关系型数据库 Serverless
扩缩容操作对 PolarDB Serverless 性能的影响
扩缩容操作对 PolarDB Serverless 性能的影响
379 156
|
索引 Python
【Leetcode刷题Python】从列表list中创建一颗二叉树
本文介绍了如何使用Python递归函数从列表中创建二叉树,其中每个节点的左右子节点索引分别是当前节点索引的2倍加1和2倍加2。
359 7
|
人工智能 监控 数据可视化
智慧工地管理云平台可视化AI大数据建造工地源码
数字孪生可视化大屏,一张图掌握项目整体情况;
285 3
|
jenkins 持续交付 开发工具
Jenkins 与 Docker 集成的最佳实践
【8月更文第31天】随着容器技术的兴起,越来越多的团队开始采用 Docker 来构建和部署应用。Docker 提供了一种轻量级的虚拟化方法,使得应用可以在任何地方以相同的方式运行,这极大地提高了开发效率和部署的一致性。与此同时,Jenkins 作为一种广泛使用的持续集成/持续交付(CI/CD)工具,可以帮助团队自动化构建、测试和部署流程。本文将探讨如何将 Docker 与 Jenkins 集成,以简化开发环境的搭建和维护。
928 0