1. Oracle有三个已定义好的automated maintenance tasks.

  1. Automatic Optimizer Statistics Collection—用于收集各种数据库对象的统计信息。这里又有三种模式:

    • ‘ALL’ – Statistics are collected for all objects in the system
    • ‘ORACLE’ – Statistics are collected for all Oracle owned objects
    • ‘AUTO’ – Oracle decides for which objects to collect statistics
    • 可以通过以下API进行设置
            DBMS_STATS.SET_GLOBAL_PREFS (
      pname VARCHAR2,
      pval VARCHAR2);

      pname为”AUTOSTATS_TARGET”,pval为以上三个值之一。

  2. Automatic Segment Advisor—Identifies segments that have space available for reclamation, and makes recommendations on how to defragment those segments. You can also run the Segment Advisor manually to obtain more up-to-the-minute recommendations or to obtain recommendations on segments that the Automatic Segment Advisor did not examine for possible space reclamation.
  3. Automatic SQL Tuning Advisor—Examines the performance of high-load SQL statements, and makes recommendations on how to tune those statements. You can configure this advisor to automatically implement SQL profile recommendations.

2. 这些automated maintenace tasks在maintenance windows里得到执行。同样,Oracle已经定义好的7个windows,对应每周的每一天。周一到周五是从22:00到次日的02:00,周六和周日是从06:00到次日的02:00。

3. 如果不想这些automated maintenance tasks在一些windows里不被执行,或者完全不希望执行这些tasks。可以通过下面的API。

DBMS_AUTO_TASK_ADMIN.DISABLE(...)

4. 对于maintenance windows,系统会切换到相应的resource plan。如果你不想你原来的resource plan 被切换掉的话,记得在你设置resource plan时,在resource plan的名字前面加上force:。如下面所示:

ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = 'FORCE:mydb_plan';

自动化是个好东西,不过这建立上你正确理解了它们的基础上,要不有时就会出现莫名其妙的结果了。

举个简单的例子:如果你在某个时候truncate了一个表,之后重新加载了海量的数据,如果在你truncate后,加载数据之前,收集统计信息的任务启动了,那么它会把这个表的统计信息更新为空表的数据。于是,你的很多涉及到这个表的SQL语句就会莫名其妙的慢下来甚至于执行不完了,原因就在于统计信息的错误变化(海量->空),导致CBO对很多语句从原来的索引访问者变成了致命的全表扫描了。

自动化维护任务 – Automated Maintenance Task (转)的更多相关文章

  1. 1Z0-050

    QUESTION 13 View the Exhibit.Examine the following command that is executed for the TRANSPORT table ...

  2. OCP读书笔记(23) - 题库(ExamC)

    200.Which operation requires that you create an auxiliary instance manually before executing the ope ...

  3. Oracle DB 数据库维护

    • 管理优化程序统计信息 • 管理自动工作量资料档案库(AWR) • 使用自动数据库诊断监视器(ADDM) • 说明和使用指导框架 • 设置预警阈值 • 使用服务器生成的预警 • 使用自动任务   数 ...

  4. FAQ: Automatic Statistics Collection (文档 ID 1233203.1)

    In this Document   Purpose   Questions and Answers   What kind of statistics do the Automated tasks ...

  5. Oracle 所有字典

    select * from DBA_CONS_COLUMNS ; ---Information about accessible columns in constraint definitions s ...

  6. [20180403]访问dba_autotask_task无输出问题.txt

    [20180403]访问dba_autotask_task无输出问题.txt --//链接http://www.itpub.net/thread-1911421-1-1.html的讨论,还没注意原先的 ...

  7. 深入了解SQL Tuning Advisor(转载)

    1.前言:一直以来SQL调优都是DBA比较费力的技术活,而且很多DBA如果没有从事过开发的工作,那么调优更是一项头疼的工作,即使是SQL调优很厉害的高手,在SQL调优的过程中也要不停的分析执行计划.加 ...

  8. 论文解读(AutoSSL)《Automated Self-Supervised Learning for Graphs》

    论文信息 论文标题:Automated Self-Supervised Learning for Graphs论文作者:Wei Jin, Xiaorui Liu, Xiangyu Zhao, Yao ...

  9. C# Task 用法

    C# Task 的用法 其实Task跟线程池ThreadPool的功能类似,不过写起来更为简单,直观.代码更简洁了,使用Task来进行操作.可以跟线程一样可以轻松的对执行的方法进行控制. 顺便提一下, ...

随机推荐

  1. jqGrid -treeGrid 按需加载

    Load Rows On Demand (AJAX) 参考:http://www.guriddo.net/demo/treegridjs/

  2. 分支结构case……end

    语法: case when 条件1 then 结果1 when 条件2 then 结果2 ……….. else 其它结果 end 执行顺序: 条件1成立执行结果1 条件2成立执行结果2 如果所有的wh ...

  3. 04.Continue,和三元表达式的学习

    立即结束本次循环,判断循环条件,如果成立,则进入下一次循环,否则退出循环. 举例:运动员跑步喝水的例子 比如:我编写代码的时候,上个厕所,回来继续写代码 练习1: namespace _09.练习02 ...

  4. 转:如何在ArcMap下将栅格图象矢量化的基本步骤 (对影像的校准和配准、栅格图象矢量化)

    矢量对象是以矢量的形式,即用方向和大小来综合表示目标的形式描述的对象.例如画面上的一段直线,一个矩形,一个点,一个圆,一个填充的封闭区域--等等. 矢量图形文件就是由这些矢量对象组合而成的描述性文件. ...

  5. Spring MVC开发初体验

    1.目标实现Spring MVC : Hello World! 2.工程创建步骤 new : Dynamic Web Project lib引入Spring框架libs/*.jar touch web ...

  6. list 和 iterate

    list 和 iterate 不同之处 a) list取所有: b) iterate 先取ID,等到用到的时候再根据ID来取对象: c) session 中 list 第二次发出,仍会到数据库查询: ...

  7. Android之Fragment 基本介绍(转)

    Fragment Android是在Android 3.0 (API level 11)开始引入Fragment的. 可以把Fragment想成Activity中的模块,这个模块有自己的布局,有自己的 ...

  8. Consul 配置ACLs

    比如consul.exe 在D:\consul来个json配置文件在 D:\consul\config.jsonjson 格式{ "acl_datacenter": "d ...

  9. git相关操作(githug)

    Level 15  restructure 关卡描述 你添加了一些文件到你的仓库,但现在知道你的项目需要进行调整.创建一个新的文件夹命名为“src”,使用git将所有的".html" ...

  10. ZT onActivityResult在android中的用法

    onActivityResult在android中的用法 举例说我想要做的一个事情是,在一个主界面(主Activity)上能连接往许多不同子功能模块(子Activity上去),当子模块的事情做完之后就 ...