<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; ORA-12012</title>
	<atom:link href="https://www.xifenfei.com/tag/ora-12012/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Thu, 22 Oct 2026 15:45:06 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>ORA-12012: error on auto execute of job &#8220;SYS&#8221;.&#8221;ORA$AT_OS_OPT_SY_383&#8243;</title>
		<link>https://www.xifenfei.com/2017/08/ora-12012-sys-oraat_os_opt_sy.html</link>
		<comments>https://www.xifenfei.com/2017/08/ora-12012-sys-oraat_os_opt_sy.html#comments</comments>
		<pubDate>Sun, 06 Aug 2017 02:21:05 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[ORA-xxxxx]]></category>
		<category><![CDATA[ORA$AT_OS_OPT_SY]]></category>
		<category><![CDATA[ORA-12012]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=7185</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2017/08/ora-12012-sys-oraat_os_opt_sy.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2017/08/ora-12012-sys-oraat_os_opt_sy.html" target="_blank">ORA-12012: error on auto execute of job &#8220;SYS&#8221;.&#8221;ORA$AT_OS_OPT_SY_383&#8243;</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>12.2.0.1版本数据库报类似ORA-12012: error on auto execute of job &#8220;SYS&#8221;.&#8221;ORA$AT_OS_OPT_SY_383&#8243;错误</p>
<pre class="brush: bash; title: ; notranslate">
Errors in file /u01/app/oracle/diag/rdbms/xifenfei/xifenfei/trace/xifenfei_j000_10213.trc:
ORA-12012: error on auto execute of job &quot;SYS&quot;.&quot;ORA$AT_OS_OPT_SY_383&quot;
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 47207
ORA-06512: at &quot;SYS.DBMS_STATS_ADVISOR&quot;, line 882
ORA-06512: at &quot;SYS.DBMS_STATS_INTERNAL&quot;, line 20059
ORA-06512: at &quot;SYS.DBMS_STATS_INTERNAL&quot;, line 22201
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 47197
</pre>
<p>trace文件信息</p>
<pre class="brush: bash; title: ; notranslate">
Trace file /u01/app/oracle/diag/rdbms/xifenfei/xifenfei/trace/xifenfei_j000_10379.trc
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Build label:    RDBMS_12.2.0.1.0_LINUX.X64_170125
ORACLE_HOME:    /u01/app/oracle/product/12.2.0/db_1
System name:    Linux
Node name:      yoridb2
Release:        3.10.0-514.26.2.el7.x86_64
Version:        #1 SMP Tue Jul 4 15:04:05 UTC 2017
Machine:        x86_64
Instance name: xifenfei
Redo thread mounted by this instance: 1
Oracle process number: 148
Unix process pid: 10379, image: oracle@yoridb2 (J000)


*** 2017-08-04T14:41:26.486692+08:00
*** SESSION ID:(508.52539) 2017-08-04T14:41:26.486716+08:00
*** CLIENT ID:() 2017-08-04T14:41:26.486722+08:00
*** SERVICE NAME:(SYS$USERS) 2017-08-04T14:41:26.486727+08:00
*** MODULE NAME:(DBMS_SCHEDULER) 2017-08-04T14:41:26.486732+08:00
*** ACTION NAME:(ORA$AT_OS_OPT_SY_384) 2017-08-04T14:41:26.486738+08:00
*** CLIENT DRIVER:() 2017-08-04T14:41:26.486743+08:00

ORA-12012: error on auto execute of job &quot;SYS&quot;.&quot;ORA$AT_OS_OPT_SY_384&quot;
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 47207
ORA-06512: at &quot;SYS.DBMS_STATS_ADVISOR&quot;, line 882
ORA-06512: at &quot;SYS.DBMS_STATS_INTERNAL&quot;, line 20059
ORA-06512: at &quot;SYS.DBMS_STATS_INTERNAL&quot;, line 22201
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 47197
</pre>
<p>错误比较明显，是在执行统计信息分析的时候报错了，报错原因是由于SCHEDULER的task name无效.<br />
<br />
<strong>解决方法</strong></p>
<pre class="brush: sql; title: ; notranslate">
[oracle@yoridb2 trace]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Fri Aug 4 23:40:33 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL&gt; select name, ctime, how_created
  2    from sys.wri$_adv_tasks
  3   where owner_name = 'SYS'
   and name in ('AUTO_STATS_ADVISOR_TASK','INDIVIDUAL_STATS_ADVISOR_TASK');  4  

no rows selected

SQL&gt; EXEC dbms_stats.init_package();

PL/SQL procedure successfully completed.

SQL&gt; select name, ctime, how_created
  2    from sys.wri$_adv_tasks
  3   where owner_name = 'SYS'
   and name in ('AUTO_STATS_ADVISOR_TASK','INDIVIDUAL_STATS_ADVISOR_TASK');  4  

NAME
--------------------------------------------------------------------------------
CTIME     HOW_CREATED
--------- ------------------------------
AUTO_STATS_ADVISOR_TASK
04-AUG-17 CMD

INDIVIDUAL_STATS_ADVISOR_TASK
04-AUG-17 CMD
</pre>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/05/%e4%bd%bf%e7%94%a8dbms_metadata-get_ddl%e5%87%ba%e7%8e%b0ora-31605%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">使用dbms_metadata.get_ddl出现ORA-31605错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/05/ora-00600-16515.html" rel="bookmark" class="crp_title">收集统计信息报ORA-00600 16515问题解决</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/02/%e6%89%8b%e5%8a%a8%e6%8f%90%e4%ba%a4%e5%88%86%e5%b8%83%e5%bc%8f%e4%ba%8b%e5%8a%a1%e4%b8%80%e4%be%8b.html" rel="bookmark" class="crp_title">手动提交分布式事务一例</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/01/%e8%b7%b3%e8%bf%87obj%e5%9d%8f%e5%9d%97%e6%96%b9%e6%b3%95.html" rel="bookmark" class="crp_title">跳过obj$坏块方法</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/10/%e9%87%8d%e5%bb%badbms_stats%e5%8c%85.html" rel="bookmark" class="crp_title">重建DBMS_STATS包</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/10/expdp%e9%81%ad%e9%81%87ora-39006ora-39213%e6%95%85%e9%9a%9c%e8%a7%a3%e5%86%b3.html" rel="bookmark" class="crp_title">expdp遭遇ORA-39006/ORA-39213故障解决</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2020/08/upgrade-db-sys-dbms_sqltune.html" rel="bookmark" class="crp_title">数据库升级遭遇ORA-04063: package body &#8220;SYS.DBMS_SQLTUNE&#8221;</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2026/02/expdp-xml-ora-22924.html" rel="bookmark" class="crp_title">expdp导出xml列报ORA-22924故障处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/08/dbms_session-set_context-ora-01031.html" rel="bookmark" class="crp_title">DBMS_SESSION.set_context提示ORA-01031问题解决</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/09/mos%e5%8f%88%e4%b8%80%e6%ac%a1%e4%b8%8d%e9%9d%a0%e8%b0%b1-ora-27163-out-of-memory.html" rel="bookmark" class="crp_title">MOS又一次不靠谱&#8212;ORA-27163: out of memory</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2018/01/ora-20001.html" rel="bookmark" class="crp_title">ORA-20001: Latest xml inventory is not loaded into table</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/08/joxcsys-release-mismatch.html" rel="bookmark" class="crp_title">joxcsys: release mismatch, 19.0.0.0.0 1.8 in database (classes.bin)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2017/08/ora-12012-sys-oraat_os_opt_sy.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
