Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3673237
  • 博文数量: 715
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7745
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(715)

文章存档

2023年(75)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

分类: Oracle

2021-01-16 17:33:53

自动收集统计信息从22点开始,默认2点结束,只干活4小时,有时为了避免与夜晚跑批作业冲突,需要进行调整。

  1. --调整统计信息收集窗口为6个小时
  2. col WINDOW_NAME for a18
  3. col REPEAT_INTERVAL for a60
  4. col DURATION for a30
  5. set linesize 120
  6. SELECT t1.window_name, t1.repeat_interval, t1.duration
  7.   FROM dba_scheduler_windows t1, dba_scheduler_wingroup_members t2
  8.  WHERE t1.window_name = t2.window_name
  9.    AND t2.window_group_name IN
  10.        ('MAINTENANCE_WINDOW_GROUP', 'BSLN_MAINTAIN_STATS_SCHED');

  11. BEGIN
  12.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.MONDAY_WINDOW',
  13.                                    attribute => 'REPEAT_INTERVAL',
  14.                                    VALUE => 'freq=daily;byday=MON;byhour=22;byminute=0;bysecond=0');
  15.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.MONDAY_WINDOW',
  16.                                    attribute => 'DURATION',
  17.                                    VALUE => '0 06:00:00');
  18. END;
  19. /

  20. BEGIN
  21.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.TUESDAY_WINDOW',
  22.                                    attribute => 'REPEAT_INTERVAL',
  23.                                    VALUE => 'freq=daily;byday=TUE;byhour=22;byminute=0;bysecond=0');
  24.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.TUESDAY_WINDOW',
  25.                                    attribute => 'DURATION',
  26.                                    VALUE => '0 06:00:00');
  27. END;
  28. /

  29. BEGIN
  30.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.WEDNESDAY_WINDOW',
  31.                                    attribute => 'REPEAT_INTERVAL',
  32.                                    VALUE => 'freq=daily;byday=WED;byhour=22;byminute=0;bysecond=0');
  33.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.WEDNESDAY_WINDOW',
  34.                                    attribute => 'DURATION',
  35.                                    VALUE => '0 06:00:00');
  36. END;
  37. /

  38. BEGIN
  39.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.THURSDAY_WINDOW',
  40.                                    attribute => 'REPEAT_INTERVAL',
  41.                                    VALUE => 'freq=daily;byday=THU;byhour=22;byminute=0;bysecond=0');
  42.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.THURSDAY_WINDOW',
  43.                                    attribute => 'DURATION',
  44.                                    VALUE => '0 06:00:00');
  45. END;
  46. /

  47. BEGIN
  48.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.FRIDAY_WINDOW',
  49.                                    attribute => 'REPEAT_INTERVAL',
  50.                                    VALUE => 'freq=daily;byday=FRI;byhour=22;byminute=0;bysecond=0');
  51.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.FRIDAY_WINDOW',
  52.                                    attribute => 'DURATION',
  53.                                    VALUE => '0 06:00:00');
  54. END;
  55. /

  56. BEGIN
  57.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.SATURDAY_WINDOW',
  58.                                    attribute => 'REPEAT_INTERVAL',
  59.                                    VALUE => 'freq=daily;byday=SAT;byhour=6;byminute=0;bysecond=0');
  60.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.SATURDAY_WINDOW',
  61.                                    attribute => 'DURATION',
  62.                                    VALUE => '0 20:00:00');
  63. END;
  64. /

  65. BEGIN
  66.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.SUNDAY_WINDOW',
  67.                                    attribute => 'REPEAT_INTERVAL',
  68.                                    VALUE => 'freq=daily;byday=SUN;byhour=6;byminute=0;bysecond=0');
  69.   sys.dbms_scheduler.set_attribute(NAME => 'SYS.SUNDAY_WINDOW',
  70.                                    attribute => 'DURATION',
  71.                                    VALUE => '0 20:00:00');
  72. END;
  73. /


阅读(22634) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~