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. asp.net5中使用NLog进行日志记录

    asp.net5中提供了性能强大的日志框架,本身也提供了几种日志记录方法,比如记录到控制台或者事件中等,但是,对大部分程序员来说,更喜欢使用类似log4net或者Nlog这种日志记录方式,灵活而强大. ...

  2. iis win7 注册

    http://blog.sina.com.cn/s/blog_7ed5a8080100rinj.html vs2010默认的是4.0框架,4.0的框架是独立的CLR,和2.0的不同,如果想运行4.0的 ...

  3. Linux.net && mono

    资料: http://www.cnblogs.com/xiaodiejinghong/archive/2013/04/01/2994216.html http://www.cnblogs.com/sh ...

  4. MySQL中在原表中做数据去重(按日期去重,保留id最小的记录)

    表名称 code600300 delete from code600300 where id not in (select minid from (select min(id) as minid fr ...

  5. 【Linux】安装配置Tomcat7

    第一步:下载Tomcat安装包 下载地址:https://tomcat.apache.org/download-70.cgi [root@localhost ~]# wget http://mirro ...

  6. IntelliJ IDEA热部署教程,只要两步!

    一.开启idea自动build功能1.File -> Settings -> Build,Execution,Deployment -> Compiler -> Build p ...

  7. QTableview 只显示横向线

    #include <QApplication> #include <QTableWidget> #include <QPainter> #include <Q ...

  8. css 字体样式设置大全

    css样式大全(整理版)   字体属性:(font) 大小 {font-size: x-large;}(特大) xx-small;(极小) 一般中文用不到,只要用数值就可以,单位:PX.PD 样式 { ...

  9. 检查你要加入到gradle的第三方library是否是最新版本

    开发者从博客.github readme  或者 官方文档中找到如何在gradle 文件中加入dependency  的时候,往往版本已经比较老旧了,想要找到最新版,介绍一个利器 http://gra ...

  10. Informatica 9.1.0 Domain地址变化修改

    由于公司机房的变动,infa所连数据库的IP地址变化,致使INFA不能启动.经过查找资料终于解决,现分享给大家,解决方法如下: 1.查看日志路径: Informatica/9.1.0/tomcat/l ...