Some knowledge of the automated collection of statistics by Oracle 11g Systems

Source: Internet
Author: User

---11g is Monday to Friday 22:00-2:00 Saturday Sunday 6:00-4:00
SELECT W.window_name, W.repeat_interval, W.duration, w.enabled
From Dba_autotask_window_clients C, Dba_scheduler_windows W
WHERE C.window_name = W.window_name
and c.optimizer_stats = ' ENABLED ';
Window_name Repeat_interval DURATION
-------------------- ------------------------------------------------------------ ---------------
Sunday_window freq=daily;byday=sun;byhour=6;byminute=0; Bysecond=0 +000 20:00:00
Friday_window freq=daily;byday=fri;byhour=22;byminute=0; Bysecond=0 +000 04:00:00
Wednesday_window freq=daily;byday=wed;byhour=22;byminute=0; Bysecond=0 +000 04:00:00
Saturday_window freq=daily;byday=sat;byhour=6;byminute=0; Bysecond=0 +000 20:00:00
Thursday_window freq=daily;byday=thu;byhour=22;byminute=0; Bysecond=0 +000 04:00:00
Tuesday_window freq=daily;byday=tue;byhour=22;byminute=0; Bysecond=0 +000 04:00:00
Monday_window freq=daily;byday=mon;byhour=22;byminute=0; Bysecond=0 +000 04:00:00

--Disable automatic collection
EXEC dbms_auto_task_admin. DISABLE (client_name = ' Auto Optimizer stats collection ', operation = Null,window_name = NULL);
--Enable automatic collection
EXEC dbms_auto_task_admin. ENABLE (client_name = ' Auto Optimizer stats collection ', operation = Null,window_name = NULL);
--View Job

Select Client_name,status from Dba_autotask_client;

client_name                     &NB Sp                                status
- -----------------------------------------------------------------------
Auto Optimizer stats collection                                  enabled
Auto Space advisor                             &NBSP ;                 ENABLED
SQL Tuning Advisor           & nbsp                          ,         ENA BLED

--Collect statistics for all users under the current database
EXEC dbms_stats.gather_database_stats (user);
--collects statistics for all objects under the current database user
EXEC dbms_stats.gather_schema_stats (user);
--collecting statistics for data dictionaries
exec dbms_stats.gather_dictionary_stats ();
--Get Global Statistics collection settings options
Select Dbms_stats.get_prefs (' method_opt ') from dual;
Select Dbms_stats.get_prefs (' concurrent ') from dual;
Select Dbms_stats.get_prefs (' granularity ') from dual;
--Set STATISTICS collection options for global
EXEC Dbms_stats. Set_param (' degree ', 4);

Some knowledge of the automated collection of statistics by Oracle 11g Systems

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.