自动化维护任务 – Automated Maintenance Task (转)
1. Oracle有三个已定义好的automated maintenance tasks.
- 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为以上三个值之一。
- 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.
- 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 (转)的更多相关文章
- 1Z0-050
QUESTION 13 View the Exhibit.Examine the following command that is executed for the TRANSPORT table ...
- OCP读书笔记(23) - 题库(ExamC)
200.Which operation requires that you create an auxiliary instance manually before executing the ope ...
- Oracle DB 数据库维护
• 管理优化程序统计信息 • 管理自动工作量资料档案库(AWR) • 使用自动数据库诊断监视器(ADDM) • 说明和使用指导框架 • 设置预警阈值 • 使用服务器生成的预警 • 使用自动任务 数 ...
- FAQ: Automatic Statistics Collection (文档 ID 1233203.1)
In this Document Purpose Questions and Answers What kind of statistics do the Automated tasks ...
- Oracle 所有字典
select * from DBA_CONS_COLUMNS ; ---Information about accessible columns in constraint definitions s ...
- [20180403]访问dba_autotask_task无输出问题.txt
[20180403]访问dba_autotask_task无输出问题.txt --//链接http://www.itpub.net/thread-1911421-1-1.html的讨论,还没注意原先的 ...
- 深入了解SQL Tuning Advisor(转载)
1.前言:一直以来SQL调优都是DBA比较费力的技术活,而且很多DBA如果没有从事过开发的工作,那么调优更是一项头疼的工作,即使是SQL调优很厉害的高手,在SQL调优的过程中也要不停的分析执行计划.加 ...
- 论文解读(AutoSSL)《Automated Self-Supervised Learning for Graphs》
论文信息 论文标题:Automated Self-Supervised Learning for Graphs论文作者:Wei Jin, Xiaorui Liu, Xiangyu Zhao, Yao ...
- C# Task 用法
C# Task 的用法 其实Task跟线程池ThreadPool的功能类似,不过写起来更为简单,直观.代码更简洁了,使用Task来进行操作.可以跟线程一样可以轻松的对执行的方法进行控制. 顺便提一下, ...
随机推荐
- What's the difference between @Component, @Repository & @Service annotations in Spring?
@Component is equivalent to <bean> @Service, @Controller , @Repository = {@Component + some mo ...
- React.js学习小结
最近一段时间都在学习React.js,感觉还不错,现在把自己的一些学习笔记记录一下,留着以后学习查看. 0.React全家桶(技术栈) 1.React主体 2.WebPack:grunt.gulp自动 ...
- String方法使用示例
import java.lang.String; public class StringMethodDemo1{ /** 熟悉String的常用方法. */ public static void ma ...
- 理解JavaScript作用域
这是一篇译文,这里贴上译文地址:http://www.zcfy.cc/article/understanding-scope-in-javascript-8213-scotch-4075.html 这 ...
- django内置组件——ContentTypes
一.什么是Django ContentTypes? Django ContentTypes是由Django框架提供的一个核心功能,它对当前项目中所有基于Django驱动的model提供了更高层次的抽象 ...
- 检测IE浏览器兼容Edge模式及IE11
document.documentMode || +(navigator.userAgent.match(/MSIE (\d+)/) && RegExp.$1) 判断布尔值
- STROME --realtime & online parallel computing
Data Collections ---> Stream to Channel (as source input) ----> Parallel Computing---> Resu ...
- Git 基本知识与常用指令
一.Git代码状态转换图 其中: 未被Git跟踪的状态为unstage状态: 已被Git跟踪的状态为stage状态(stage:阶段),因此包括staging状态和staged状态. untrack ...
- Multidex (方法数超过限制的处理)
报错 : Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536 ...
- Div+Css布局教程(-)CSS必备知识
目录: 1.Div+Css布局教程(-)CSS必备知识 注:本教程要求对html和css有基础了解. 一.CSS布局属性 Width:设置对象的宽度(width:45px). Height:设置对象的 ...