Solve the problem that the database cannot automatically collect statistics due to oracle11g installation.
Recently, it was found that some 11 GB 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 collection';CLIENT_NAME STATUS---------------------------------------------------------------- --------auto optimizer stats collection ENABLEDSQL>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 DISABLEDFRIDAY_WINDOW DISABLEDSATURDAY_WINDOW DISABLEDTHURSDAY_WINDOW DISABLEDTUESDAY_WINDOW DISABLEDSUNDAY_WINDOW DISABLEDMONDAY_WINDOW DISABLED7 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 completedSQL> select window_name,autotask_status from DBA_AUTOTASK_WINDOW_CLIENTS;WINDOW_NAME AUTOTASK_STATUS------------------------------ ---------------WEDNESDAY_WINDOW ENABLEDFRIDAY_WINDOW ENABLEDSATURDAY_WINDOW ENABLEDTHURSDAY_WINDOW ENABLEDTUESDAY_WINDOW ENABLEDSUNDAY_WINDOW ENABLEDMONDAY_WINDOW ENABLED7 rows selected