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. tomcat8.5.8遇到的两个问题

    压力测试场景,前端nginx反向代理到4个tomcat实例,在其中的一个实例上产生了大量的countDownConnection Incorrect connection count警告 WARNIN ...

  2. dojo入门

    1.引入dojo.js dojo的发行包里有4个子目录,要引入的文件是名叫"dojo"的子目录里的dojo.js. 假设你是这样的目录结构: project | +--dojo-l ...

  3. c#-IO和序列化操作

    IO 用到的命名空间:using System.IO; 文件和目录的管理! File类 FileInfo类 Directory类 DirectoryInfo类 操作文件的类! FileStream{ ...

  4. C# ADO.NET

    ADO.NET 作业总结难点 数据库语句掌握太差 //查询 select * from Users //查询表中所有数据 select * from Users where UserName = 'l ...

  5. C# 数据库连接增删改查

    C# 连接数据库 using System.Data.sqlCliect; // 加在头 main函数里面用法(删) //连接字符串 string Connectionstring = "s ...

  6. IntelliJ IDEA 12 设置优化

    1.IntelliJ IDEA简介 IntelliJ IDEA是Eclipse之外又一强大的IDE,Google在今年发布了新的Android开发IDE---Android Studio就是基于Int ...

  7. 纯CSS的三角符号

    项目中经常用到三角形,现在给大家讲下用纯CSS写的下三角实心图形 .triangle{ border-width: 5px 4px 0 4px; border-color: #454A7B trans ...

  8. PAT 1053 Path of Equal Weight

    #include <cstdio> #include <cstdlib> #include <vector> #include <algorithm> ...

  9. Canvas知识点汇总

    本文主要记录Canvas基础知识汇总. 1.Canvas定义 <canvas> 元素是HTML5中的新元素,通过它可以在网页中绘制出所需的图形.<canvas>标签只是图形的容 ...

  10. node的版本控制之nvm的安装与使用

    NVM的安装 windows下的安装: windows下的离线安装: nvm 的windows下载地址:https://github.com/coreybutler/nvm-windows/relea ...