11g auto maintenance
DBA_AUTOTASK
Check the current status of the autotask job。
Dba_Autotask_Client:(task 名稱,執行視窗,資源組,狀態)
select client_name,client_tag,status,window_group,consumer_group from Dba_Autotask_Client
select job_class_name,resource_consumer_group,service from dba_scheduler_job_classes;
PLAN and CONSUMER_GROUPS:
1,select * from dba_rsrc_plans where plan='DEFAULT_MAINTENANCE_PLAN';
2,Select plan,group_or_subplan,type from dba_rsrc_plan_directives where plan not like 'DSS%' and plan not like 'ETL%' and plan not like 'MIXED%' order by plan;
3,select * from DBA_RSRC_CONSUMER_GROUPS
Maintenance Window Groups:
檢視資料庫的視窗組和視窗資訊:
select * from dba_scheduler_window_groups;
select * from dba_scheduler_wingroup_members;
select a.window_name,a.resource_plan,a.repeat_interval from dba_scheduler_windows a;
(ORA$AT_WGRP_OS,ORA$AT_WGRP_SA,ORA$AT_WGRP_SQ的彙總表。)
select * from DBA_AUTOTASK_WINDOW_CLIENTS;
WINDOW
select window_name, REPEAT_INTERVAL, DURATION,resource_plan from DBA_SCHEDULER_WINDOWS;---檢視資料庫定義的windown :定義的job的開始時間和資源使用情況
The duration times for windows of Monday thru Friday are from 10:00PM till 02:00AM and those for windows of Saturday thru Sunday are from 06:00AM till 02:00AM.
WINDOW_GROUPS
select * from DBA_SCHEDULER_WINDOW_GROUPS;
預設4個時間視窗組:3個AUTOTASK使用,1個MAINTENANCE_WINDOW_GROUP。
WINGROUP_MEMBERS
AUTOTASKE_WINDOW_GROUP:
(ORA$AT_WGRP_OS,ORA$AT_WGRP_SA, ORA$AT_WGRP_SQ)
select * from DBA_SCHEDULER_WINGROUP_MEMBERS where window_group_name = 'ORA$AT_WGRP_OS';
MAINTENANCE_WINDOW_GROUP:
select OWNER,JOB_NAME,STATE,SCHEDULE_NAME from dba_scheduler_jobs –(這裡面有些job用到MAINTENANCE_WINDOW_GROUP視窗)
select OWNER,JOB_NAME,STATE,SCHEDULE_NAME from dba_scheduler_job(這裡面有些job用到MAINTENANCE_WINDOW_GROUP視窗)
(SCHEDULE_NAME:Name of the schedule that the job uses,can be a window or a window group。Job的開始時間--Scheduled Date)
檢視是資料庫自動維護作業否正在執行:
select * from DBA_AUTOTASK_WINDOW_CLIENTS; ---視窗開啟,是否到了時間?
----只有在執行的時候該檢視才有內容的(DBA_AUTOTASK_CLIENT_JOB):
---- displays information about currently running Scheduler jobs created for automated maintenance tasks
select job_name,client_name, JOB_SCHEDULER_STATUS from DBA_AUTOTASK_CLIENT_JOB;--job是否已經執行完成?
手動執行計劃:
EXEC DBMS_AUTO_TASK_IMMEDIATE.GATHER_OPTIMIZER_STATS;
關閉正在執行的任務:
--
BEGIN
DBMS_SCHEDULER.stop_JOB
(job_name => ' ORA$AT_SQ_SQL_SW_26',force=>true);
END;
/
檢視歷史執行情況:
select * from DBA_AUTOTASK_JOB_HISTORY;
select * from dba_scheduler_job_run_details;(包含所有的scheduler)
關閉AUTOTASK_JOB:
select client_name,status from Dba_Autotask_Client
select * from DBA_AUTOTASK_WINDOW_CLIENTS
BEGIN
DBMS_AUTO_TASK_ADMIN.DISABLE(
client_name => 'auto optimizer stats collection',
operation => NULL, window_name => NULL);
END;
/
修改執行策略:
SHAPE \* MERGEFORMAT |
BEGIN
dbms_auto_task_admin.disable(client_name
=>'auto optimizer stats collection',
operation =>NULL, window_name
=>'THURSDAY_WINDOW');
dbms_auto_task_admin.disable(client_name
=>'auto optimizer stats collection',
operation =>NULL, window_name
=>'SATURDAY_WINDOW');
END;
BEGIN
dbms_auto_task_admin.enable(client_name => 'auto optimizer stats collection', operation => NULL,
window_name => NULL);
END;
How To Manually Execute the Optimizer Statistics Auto Task in Oracle11g (文件 ID 731935.1)
SOLUTION
In 11g the Auto-Task infrastructure replaced the need for the gather_stats_job and you can execute the following command to accomplish manual statistics collection:
SQL> exec DBMS_AUTO_TASK_IMMEDIATE.GATHER_OPTIMIZER_STATS
Note: The user performing this command must have DBA privilege
This prompts the Automated Maintenance Tasks subsystem into
starting a job that will gather optimizer statistics, unless such a job is
already running. The latter occurs if a maintenance window is currently open.
If the job is spawned it will be named ORA$_AT_OS_MANUAL_nnnnnn (nnnnn is one
or more decimal digits). Unlike regular Automated Maintenance jobs, the
"MANUAL" job is not tied to a specific maintenance window.
To monitor the progress of the execution of the task use the following command:
SQL> select job_name,state from dba_scheduler_jobs where program_name='GATHER_STATS_PROG';
To interrupt the task use the following commands:
SQL>
variable jobid varchar2(32)
SQL>
exec select job_name into :jobid from dba_scheduler_jobs where program_name='GATHER_STATS_PROG';
SQL> print :jobid
SQL> exec dbms_scheduler.stop_job(:jobid,false)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20747382/viewspace-2130417/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 11g RAC Administration and Maintenance Tasks and UtilitiesAINaN
- Oracle OCP 1Z0 053 Q610( auto-task in maintenance window)OracleAINaN
- 10g,11g sql auto tuning 測試SQL
- oracle 11g中auto_sample_size是如何工作的Oracle
- 2.3.3 Application MaintenanceAPPAINaN
- ALLOCATE CHANNEL FOR MAINTENANCE 命令AINaN
- Give root password for maintenanceAINaN
- Maintenance of Global Partitioned IndexesAINaNIndex
- SQL Database Maintenance WizardSQLDatabaseAINaN
- 2.3.3.1 About Application MaintenanceAPPAINaN
- Cannot find folder "Maintenance Plans".AINaN
- Three commands for OCR maintenanceAINaN
- Android Auto-Building Apps for Auto,Getting Started with AutoAndroidUIAPP
- three predefined automated maintenance tasksAINaN
- 上海:International Release and Maintenance EngineerAINaN
- Recovery Catalog creation and MaintenanceAINaN
- zabbix_maintenance web管理系統AINaNWeb
- auto型別型別
- inherit與auto
- Auto CAD
- android auto-Providing Audio Playback for AutoAndroid
- PostgreSQL DBA(170) - pgAdmin(Queries For Index Maintenance)SQLIndexAINaN
- EMD_MAINTENANCE 引起統計資訊收集AINaN
- 【RMAN】Run Allocate Channel For Maintenance From Script FailsAINaN
- 使用VIEW_MAINTENANCE_CALL維護tableviewViewAINaN
- Oracle 11g中dynamic sampling自動調節(auto-adjusted)機制Oracle
- 關於 MYSQL auto_increment_offset和auto_increment_incrementMySqlREM
- mysql的auto_increment_offset和auto_increment_increment配置MySqlREM
- auto_ptr_ref和auto_ptr的關係 (轉)
- z-index:autoIndex
- macOS Development - Auto LayoutMacdev
- MySQL AUTO_INCREMENTMySqlREM
- Auto關鍵字
- 備份時報no channel allocated for maintenance(of an appropriate type)AINaNAPP
- 維護型開發者(maintenance developer)的神話AINaNDeveloper
- SAP一句話入門:Plant MaintenanceAINaN
- android auto-Providing Messaging for Auto(UnreadConversation)Android
- redis:auto-completeRedis