• oracle修改统计信息收集时间以及窗口持续时间


    查看任务状态
    select client_name,status from dba_autotask_client;
    修改窗口执行开始时间和持续时间
    begin
    dbms_scheduler.disable( name => 'SUNDAY_WINDOW', force => TRUE);
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."SUNDAY_WINDOW"',attribute=>'REPEAT_INTERVAL',value=>'freq=daily;byday=SUN;byhour=1;byminute=0; bysecond=0');
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."SUNDAY_WINDOW"',attribute=>'DURATION',value=>numtodsinterval(240, 'minute'));
    dbms_scheduler.enable( name => 'SUNDAY_WINDOW');
    dbms_scheduler.disable( name => 'SATURDAY_WINDOW', force => TRUE);
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."SATURDAY_WINDOW"',attribute=>'REPEAT_INTERVAL',value=>'freq=daily;byday=SAT;byhour=1;byminute=0; bysecond=0');
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."SATURDAY_WINDOW"',attribute=>'DURATION',value=>numtodsinterval(240, 'minute'));
    dbms_scheduler.enable( name => 'SATURDAY_WINDOW');
    dbms_scheduler.disable( name => 'FRIDAY_WINDOW', force => TRUE);
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."FRIDAY_WINDOW"',attribute=>'REPEAT_INTERVAL',value=>'freq=daily;byday=FRI;byhour=1;byminute=0; bysecond=0');
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."FRIDAY_WINDOW"',attribute=>'DURATION',value=>numtodsinterval(240, 'minute'));
    dbms_scheduler.enable( name => 'FRIDAY_WINDOW');
    dbms_scheduler.disable( name => 'THURSDAY_WINDOW', force => TRUE);
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."THURSDAY_WINDOW"',attribute=>'REPEAT_INTERVAL',value=>'freq=daily;byday=THU;byhour=1;byminute=0; bysecond=0');
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."TUESDAY_WINDOW"',attribute=>'DURATION',value=>numtodsinterval(240, 'minute'));
    dbms_scheduler.enable( name => 'THURSDAY_WINDOW');
    dbms_scheduler.disable( name => 'WEDNESDAY_WINDOW', force => TRUE);
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."WEDNESDAY_WINDOW"',attribute=>'REPEAT_INTERVAL',value=>'freq=daily;byday=WED;byhour=1;byminute=0; bysecond=0');
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."WEDNESDAY_WINDOW"',attribute=>'DURATION',value=>numtodsinterval(240, 'minute'));
    dbms_scheduler.enable( name => 'WEDNESDAY_WINDOW');
    dbms_scheduler.disable( name => 'TUESDAY_WINDOW', force => TRUE);
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."TUESDAY_WINDOW"',attribute=>'REPEAT_INTERVAL',value=>'freq=daily;byday=TUE;byhour=1;byminute=0; bysecond=0');
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."TUESDAY_WINDOW"',attribute=>'DURATION',value=>numtodsinterval(240, 'minute'));
    dbms_scheduler.enable( name => 'TUESDAY_WINDOW');
    dbms_scheduler.disable( name => 'MONDAY_WINDOW', force => TRUE);
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."MONDAY_WINDOW"',attribute=>'REPEAT_INTERVAL',value=>'freq=daily;byday=MON;byhour=1;byminute=0; bysecond=0');
    DBMS_SCHEDULER.SET_ATTRIBUTE(name=>'"SYS"."MONDAY_WINDOW"',attribute=>'DURATION',value=>numtodsinterval(240, 'minute'));
    dbms_scheduler.enable( name => 'MONDAY_WINDOW');
    end;
    /
    
    查看窗口执行时间和持续时间
    select * from dba_scheduler_windows;
    

     查看历史执行情况

    SELECT a.CLIENT_NAME,a.WINDOW_START_TIME,a.WINDOW_DURATION  FROM dba_autotask_client_history a WHERE client_name like '%stats%';
    

      

  • 相关阅读:
    数据库第1,2,3范式学习
    node.js安装及小例子
    WorkSkill整理之 技能体系
    PTE 准备之 Read aloud
    PTE 准备之 Personal introduction
    PTE准备的时候,用英式英语还是美式英语
    sqlserver2014无法打开报Cannot find one or more components_修复方案
    beego 框架用的页面样式模板
    Go语言开发中MongoDB数据库
    xmind8 破解激活教程
  • 原文地址:https://www.cnblogs.com/omsql/p/13515356.html
Copyright © 2020-2023  润新知