自动化维护任务 – Automated Maintenance Task

转自:http://os2ora.com/automated-maintenance-task/

这是11g引入的一套新的自动化机制。Oracle的官方文档大而全,不过想理清楚里面的来龙去脉可不是一件容易的事情。

不过下面几点知识要点是应该记住的。
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对很多语句从原来的索引访问者变成了致命的全表扫描了。

时间: 2024-10-17 12:40:36

自动化维护任务 – Automated Maintenance Task的相关文章

ocp-411

QUESTION NO: 411 The Database Resource Manager is automatically enabled in the maintenance window that runs the Automated Maintenance Task. What is the reason for this? A. to prevent the creation of an excessive number of scheduler job classes B. to

FAQ: Automatic Statistics Collection (文档 ID 1233203.1)

In this Document   Purpose   Questions and Answers   What kind of statistics do the Automated tasks collect   How do I revert to a previous set of statistics?   Does the automatic statistic collection jobs populate CHAIN_CNT?   11g+ Automatic Mainten

所有表和动态视图列表(dict)

TABLE_NAME    COMMENTSDBA_CONS_COLUMNS    Information about accessible columns in constraint definitionsDBA_LOG_GROUP_COLUMNS    Information about columns in log group definitionsDBA_LOBS    Description of LOBs contained in all tablesDBA_CATALOG    A

ocp-460

QUESTION NO: 460 Which setting enables the baselines by default in Oracle Database 11g? A. setting the STATISTICS_LEVEL parameter to TYPICAL B. adding filters to the Automatic Database Diagnostic Monitor (ADDM) C. enabling Automated Maintenance Task

053(五十四)

266.View the Exhibit to examine the parameters set for your database instance. You execute the following command to perform I/O calibration after the declaration of bind variables in the session that are used inthe command:SQL> EXECUTE dbms_resource_

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

200.Which operation requires that you create an auxiliary instance manually before executing the operation? (Choose all that apply.) A. Backup-based database duplication. B. Active database duplication. C. Tablespace point-in-time recovery. D. No ope

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

--//链接http://www.itpub.net/thread-1911421-1-1.html的讨论,还没注意原先的帖子是2015年.--//如果查询select task_name,client_name,status,CURRENT_JOB_NAME from dba_autotask_task ;没有输出,--//一定是基表SYS.KET$_CLIENT_TASKS 没有记录.--//通过测试发现一些以前没有注意的问题. 1.环境:[email protected]> @ &r/

Maintenance Plan Usage3:Task Usage (Maintain Index)

Maintenance Plan用于维护Index Fragmentation 和 Statistics的Task 共有三个,后台是使用相应的TSQL来进行data维护. Reorganize Index Task Move index pages into a more efficient search order. This task uses the ALTER INDEX REORGANIZE statement with SQL Server 2012 databases. Rebui

自动化运帷之分布式监控-zabbix 配置指南

zabbix 配置指南: Hosts zabbix中的hosts就是指你想监控的设备,如服务器.工作站.交换机等等.如果你想监控某个主机X的某个变量,你必须先创建一个主机X,然后再给该主机添加监控items.hosts可以被有组织的安排进host group中. 通过zabbix的前端web界面配置hosts: ? 1 Configuration->Hosts->Create Host 此页面中有5个表单:Host.Template.IPMI.Macros.Host inventory. Ho