惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - jimeper

RAC升级后,一个节点无法连接数据库,报ORA-12537: TNS:connection closed 升级到11.2.0.4后用srvctl无法启用数据库实例,报CRS-0254: authorization failure Oracle 11gR2 RAC DBCA无法识别ASM磁盘组(ORA-19504,ORA-15045,ORA-17502,ORA-15081) LINUX系统下添加映射存储LUN goldengate一些参数整理 - jimeper 原创:goldengate从11.2升级到12.1.2 Transaction recovery: lock conflict caught and ignored 搭建mongodb集群(副本集+分片) 不停止MySQL服务增加从库的两种方式 - jimeper Oracle Goldengate REPLICAT启动时报正在运行解决办法 Oracle 11g RAC环境下Private IP修改方法及异常处理 LOB字段存放在指定表空间 清理CLOB字段及压缩CLOB空间 (原创)INTERVAL分区表与RANGE分区表相互转化 删除数据报ORA-00600: internal error code, arguments: [ktbesc_plugged] OGG-03517 Conversion from character set failed解决方法 Redis之高可用方案 linux中shell变量$#,$@,$0,$1,$2的含义解释 Logdump使用指引 - jimeper 用飞信监控GoldenGate进程
Troubleshooting Scheduler Autotask Issues (Doc ID 1561498.1)
jimeper · 2017-05-04 · via 博客园 - jimeper

In this Document

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