自动化维护任务 – 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来进行操作.可以跟线程一样可以轻松的对执行的方法进行控制. 顺便提一下, ...
随机推荐
- 10 个最佳的 Node.js 的 MVC 框架
补充:http://nokit.org/ https://thinkjs.org/zh-cn/doc/index.html Node.js 是一个基于Chrome JavaScript 运行时建立的一 ...
- What's the difference between @Component, @Repository & @Service annotations in Spring?
@Component is equivalent to <bean> @Service, @Controller , @Repository = {@Component + some mo ...
- Spring.NET入门
Spring.NET入门 http://www.cnblogs.com/haogj/archive/2011/06/10/2077540.html http://www.cnblogs.com/ha ...
- [LeetCode]29. Divide Two Integers两数相除
Given two integers dividend and divisor, divide two integers without using multiplication, division ...
- 个人MySQL股票数据库的建立日记
#!/usr/bin/python# -*- coding: UTF-8 -*- import tushare as tsfrom sqlalchemy import create_engine co ...
- Web安全入门笔记-XSS
windows 10 360浏览器 0x00.概述 1.什么是 XSS Cross-Site Scripting(跨站脚本攻击)简称 XSS,是一种代码注入攻击.攻击者通过在目标网站上注入恶意脚本,使 ...
- Siebel 集成中的“发布-订阅”与“阅读”
将 Siebel 应用程序中存储的数据提供给企业中的其他应用程序时,通常需要遵循以下两种基本模式之一: 发布-订阅 阅读 “发布-订阅”是一种机制,根据该机制,一个系统(发布者)将更改或更新的数据提供 ...
- 別人寫的git的總結,寫自己這裡學習用
這裡是原文,http://www.cnblogs.com/ang-/p/7352909.html 貼這裡慢慢學. git入门大全 阅读目录 前言 基本概念 文件几种状态 创建新仓库 配置 检出仓库 ...
- WCF如何使用X509证书
如何创建证书: makecert.exe -sr LocalMachine -ss My -a sha1 -n CN=JiangServer -sky exchange -pe (服务端证书) ...
- 多设备同时安装apk(安卓)
前几天在做安卓设备的多个设备同时安装的小脚本.因为目前我这边设备有点多,想顺便做一下安装的测试.而且因为公司的app测试人手上有点不足,就想通过这个办法去在安装的时候更方便省事一点. 本来是想弄个复杂 ...