共计 1218 个字符,预计需要花费 4 分钟才能阅读完成。
一个测试环境的 Oracle 12.2.0.1 数据库后台 alert 不断报出以下错误信息:
Errors in file /d12/app/oracle/diag/rdbms/test/test/trace/test_j001_4981.trc:
ORA-12012: error on auto execute of job “SYS”.”ORA$AT_OS_OPT_SY_21″
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at “SYS.DBMS_STATS”, line 47207
ORA-06512: at “SYS.DBMS_STATS_ADVISOR”, line 882
ORA-06512: at “SYS.DBMS_STATS_INTERNAL”, line 20059
ORA-06512: at “SYS.DBMS_STATS_INTERNAL”, line 22201
ORA-06512: at “SYS.DBMS_STATS”, line 47197
看了一下报错频率,大概是每隔 10 分钟报一次。该库是 12.2.0.1 的 CDB,其中还有两个 pdb。
从 MOS 找到一篇对应的文章:ORA-12012 Error on auto execute of job “SYS”.”ORA$AT_OS_OPT_SY_<NN> in 12.2 Database (Doc ID 2127675.1)
分析可能是在建库的时候没有执行 dbms_stats.init_package()
$ sqlplus / as sysdba
SQL> EXEC dbms_stats.init_package();
PL/SQL procedure successfully completed.
SQL> column name format A35
SQL> set linesize 120
SQL>
SQL> select name, ctime, how_created
2 from sys.wri$_adv_tasks
3 where owner_name = ‘SYS’
4 and name in (‘AUTO_STATS_ADVISOR_TASK’,’INDIVIDUAL_STATS_ADVISOR_TASK’);
NAME CTIME HOW_CREATED
———————————– ——— ——————————
AUTO_STATS_ADVISOR_TASK 17-JUN-17 CMD
INDIVIDUAL_STATS_ADVISOR_TASK 17-JUN-17 CMD
执行结束后,观察日志,不再继续报错!
更多 Oracle 相关信息见 Oracle 专题页面 https://www.linuxidc.com/topicnews.aspx?tid=12
: