Solve the problem that the database cannot automatically collect statistics due to Oracle 11g installation.

Source: Internet
Author: User

Solve the problem that the database cannot automatically collect statistics due to Oracle 11g installation.

Recently, it was found that some Oracle 11g databases could not automatically collect statistics. Some View query results are as follows:

SQL> select client_name, status from dba_autotask_client where client_name = 'Auto optimizer stats collect ';
 
CLIENT_NAME STATUS
------------------------------------------------------------------------
Auto optimizer stats collection ENABLED
 
SQL>
 
SQL> select client_name, status from dba_autotask_task;
 
CLIENT_NAME STATUS
------------------------------------------------------------------------
 
SQL>
SQL> select window_name, autotask_status from DBA_AUTOTASK_WINDOW_CLIENTS;
 
WINDOW_NAME AUTOTASK_STATUS
---------------------------------------------
WEDNESDAY_WINDOW DISABLED
FRIDAY_WINDOW DISABLED
SATURDAY_WINDOW DISABLED
THURSDAY_WINDOW DISABLED
TUESDAY_WINDOW DISABLED
SUNDAY_WINDOW DISABLED
MONDAY_WINDOW DISABLED
 
7 rows selected

All jobs are found to be DISABLED. The test shows that the "Enable Automatic maintenance task" option is the same as the "Enable Automatic maintenance task" option during database installation (selected by default). This option may be deselected during DBA installation, for example:

 

Because "Enable Automatic maintenance task" is not checked, the data installation will execute the following command, causing the job to disable:

Execute DBMS_AUTO_TASK_ADMIN.disable ();

In the future, if the database needs to start the automatic maintenance task, you only need to execute the following command:

SQL> execute DBMS_AUTO_TASK_ADMIN.enable ();
 
PL/SQL procedure successfully completed
 
SQL> select window_name, autotask_status from DBA_AUTOTASK_WINDOW_CLIENTS;
 
WINDOW_NAME AUTOTASK_STATUS
---------------------------------------------
WEDNESDAY_WINDOW ENABLED
FRIDAY_WINDOW ENABLED
SATURDAY_WINDOW ENABLED
THURSDAY_WINDOW ENABLED
TUESDAY_WINDOW ENABLED
SUNDAY_WINDOW ENABLED
MONDAY_WINDOW ENABLED
 
7 rows selected

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.