{"id":1208,"date":"2019-12-22T10:41:50","date_gmt":"2019-12-22T02:41:50","guid":{"rendered":"http:\/\/www.821121.com\/?p=1208"},"modified":"2020-12-22T10:57:21","modified_gmt":"2020-12-22T02:57:21","slug":"12c%e6%95%b0%e6%8d%ae%e5%ba%93%e6%95%85%e9%9a%9c%e5%a4%84%e7%90%86%e6%a1%88%e4%be%8b%ef%bc%88%e4%b8%80%ef%bc%89","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=1208","title":{"rendered":"12c\u6570\u636e\u5e93\u6545\u969c\u5904\u7406\u6848\u4f8b\uff08\u4e00\uff09"},"content":{"rendered":"<pre><code class=\"language-sql\">\u6570\u636e\u5e93\uff1a12.2.0.1.0    \u7cfb\u7edf\uff1alinux7.5<\/code><\/pre>\n<h1>1.\u544a\u8b66\u65e5\u5fd7\u60c5\u51b5<\/h1>\n<pre><code class=\"language-sql\">\u5728\u4e00\u53f0\u65b0\u5efa\u7684\u6570\u636e\u5e9312c\u7684\u6570\u636e\u5e93\u4e0a\uff0c\u6211\u4eec\u505a\u7cfb\u7edf\u6d4b\u8bd5\u4e86\u4e00\u9635\u5b50\uff0c\u67e5\u770b\u544a\u8b66\u65e5\u5fd7\uff0c\u53d1\u73b0\u544a\u8b66\u65e5\u5fd7\u4e2d\u51fa\u73b0\n\u53cd\u590d\u7684\u65e5\u5fd7\u62a5\u9519\uff0c\u5e76\u751f\u6210\u8ffd\u8e2a\u65e5\u5fd7\uff0c\u65e5\u5fd7\u5982\u4e0b\uff1a\nErrors in file \/opt\/u01\/app\/oracle\/diag\/rdbms\/jcpt\/jcpt\/trace\/jcpt_j000_2603.trc:\nORA-12012: error on auto execute of job &quot;SYS&quot;.&quot;ORA$AT_OS_OPT_SY_14350&quot;\nORA-20001: Statistics Advisor: Invalid task name for the current user\nORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 47207\nORA-06512: at &quot;SYS.DBMS_STATS_ADVISOR&quot;, line 882\nORA-06512: at &quot;SYS.DBMS_STATS_INTERNAL&quot;, line 20059\nORA-06512: at &quot;SYS.DBMS_STATS_INTERNAL&quot;, line 22201\nORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 4719\n<\/code><\/pre>\n<h1>2.\u544a\u8b66\u5206\u6790<\/h1>\n<pre><code class=\"language-sql\">\u6839\u636e\u544a\u8b66\u65e5\u5fd7\u7684\u5185\u5bb9\u5206\u65f6\u662f\u81ea\u52a8\u7edf\u8ba1\u987e\u95ee\u51fa\u73b0\u6267\u884c\u62a5\u9519\uff0c\u53ef\u80fd\u4f1a\u5bf9\u81ea\u52a8\u7edf\u8ba1\u4fe1\u606f\u7684\u6536\u96c6\u4f1a\u6709\u5f71\u54cd\uff0c\u800c\u6536\u96c6\u7edf\u8ba1\u4fe1\u606f\u53c8\u662foracle\u6570\u636e\u5e93\u6700\u91cd\u8981\u7684\n\u4e00\u6b65\u64cd\u4f5c\uff0c\u6240\u4ee5\u7ee7\u7eed\u6839\u636e\u6545\u969c\u5185\u5bb9\u67e5\u770bmos\u6587\u6863\uff0c\u6587\u6863ID 2127675.1\u3002\u6570\u636e\u5e93\u5f88\u53ef\u80fd\u662f\u7531\u4e8e\u672a\u8fd0\u884cdbms_stats.init_package\u8f6f\u4ef6\u5305\u800c\u521b\u5efa\u7684\u3002 \nDbms_stats.init_package\u521b\u5efa\u7edf\u8ba1\u987e\u95ee\u3002\u5728\u6570\u636e\u5e93\u521b\u5efa\u671f\u95f4\u6267\u884c\u6b64\u8fc7\u7a0b\u3002\u5982\u679c\u5728\u6570\u636e\u5e93\u521b\u5efa\u8fc7\u7a0b\u4e2d\u51fa\u4e86\u70b9\u95ee\u9898\uff08\u4f8b\u5982\uff0c\u7531\u4e8e\u67d0\u79cd\u539f\u56e0\u672a\u8c03\u7528init_package\uff09\uff0c\n\u5219\u5728\u5c1d\u8bd5\u6267\u884c\u81ea\u52a8\u4f5c\u4e1a\u65f6\uff0c\u53ef\u80fd\u4f1a\u5728\u8b66\u62a5\u65e5\u5fd7\u4e2d\u770b\u5230\u6b64\u7c7b\u9519\u8bef\n<\/code><\/pre>\n<h1>3.\u89e3\u51b3\u65b9\u6cd5<\/h1>\n<pre><code class=\"language-sql\">\u5728sys\u7528\u6237\u4e0b\uff0c\u6267\u884cEXEC DBMS_STATS.INIT_PACKAGE();\n\u8fc7\u7a0b\u5165\u4e0b\uff1a\nsqlplus \/ as sysdba\nSQL*Plus: Release 12.2.0.1.0 Production on Sat Jan 12 10:17:11 2019\nCopyright (c) 1982, 2016, Oracle.  All rights reserved.\nConnected to:\nOracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production\nSQL&gt; select name, ctime, how_created\n  from sys.wri$_adv_tasks\n where owner_name = &#039;SYS&#039;\n  and name in (&#039;AUTO_STATS_ADVISOR_TASK&#039;,&#039;INDIVIDUAL_STATS_ADVISOR_TASK&#039;);\nno rows selected\nSQL&gt; EXEC dbms_stats.init_package();\nPL\/SQL procedure successfully completed.\nSQL&gt; select name, ctime, how_created\n    from sys.wri$_adv_tasks\n  where owner_name = &#039;SYS&#039;\n    and name in (&#039;AUTO_STATS_ADVISOR_TASK&#039;,&#039;INDIVIDUAL_STATS_ADVISOR_TASK&#039;);\nNAME\n--------------------------------------------------------------------------------\nCTIME      HOW_CREATED\n--------- ------------------------------\nAUTO_STATS_ADVISOR_TASK\n12-JAN-19 CMD\n\nINDIVIDUAL_STATS_ADVISOR_TASK\n12-JAN-19 CMD\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6570\u636e\u5e93\uff1a12.2.0.1.0 \u7cfb\u7edf\uff1alinux7.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,39],"tags":[],"class_list":["post-1208","post","type-post","status-publish","format-standard","hentry","category-oracle-12c","category-39"],"_links":{"self":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1208"}],"version-history":[{"count":2,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1208\/revisions"}],"predecessor-version":[{"id":1210,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1208\/revisions\/1210"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1208"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}