<?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; XMLCONCAT</title>
	<atom:link href="https://www.xifenfei.com/tag/xmlconcat/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>Sat, 07 Nov 2026 15:45:44 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>数据库升级遭遇ORA-04063: package body &#8220;SYS.DBMS_SQLTUNE&#8221;</title>
		<link>https://www.xifenfei.com/2020/08/upgrade-db-sys-dbms_sqltune.html</link>
		<comments>https://www.xifenfei.com/2020/08/upgrade-db-sys-dbms_sqltune.html#comments</comments>
		<pubDate>Fri, 21 Aug 2020 14:37:31 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle安装升级]]></category>
		<category><![CDATA[DBMS_SQLTUNE]]></category>
		<category><![CDATA[SYS.DBMS_SQLTUNE]]></category>
		<category><![CDATA[XMLCONCAT]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=8798</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2020/08/upgrade-db-sys-dbms_sqltune.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/2020/08/upgrade-db-sys-dbms_sqltune.html" target="_blank">数据库升级遭遇ORA-04063: package body &#8220;SYS.DBMS_SQLTUNE&#8221;</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>数据库从11.2.0.2升级到11.2.0.4,遇到一下错误</p>
<pre class="brush: bash; title: ; notranslate">
Oracle Database 11.2 Post-Upgrade Status Tool           08-21-2020 20:43:36
.
Component                               Current      Version     Elapsed Time
Name                                    Status       Number      HH:MM:SS
.
Oracle Server
.   ORA-04063: package body &quot;SYS.DBMS_SQLTUNE&quot; 有错误
.   ORA-06508: PL/SQL: 无法找到正在调用 : &quot;SYS.DBMS_SQLTUNE&quot; 的程序单元
.   ORA-06512: 在 line 8
.                                       INVALID      11.2.0.4.0  00:07:28
JServer JAVA Virtual Machine
.                                         VALID      11.2.0.4.0  00:01:45
Oracle Workspace Manager
.                                         VALID      11.2.0.4.0  00:00:20
OLAP Analytic Workspace
.                                         VALID      11.2.0.4.0  00:00:35
OLAP Catalog
.                                         VALID      11.2.0.4.0  00:00:57
Oracle OLAP API
.                                         VALID      11.2.0.4.0  00:00:12
Oracle Enterprise Manager
.   ORA-01422: 实际返回的行数超出请求的行数
.   ORA-06512: 在 line 6
.   ORA-01422: 实际返回的行数超出请求的行数
.   ORA-06512: 在 line 5
.   SP2-1506: START, @ 或 @@ 命令没有参数
.   ORA-01422: 实际返回的行数超出请求的行数
.   ORA-06512: 在 line 5
.   SP2-1506: START, @ 或 @@ 命令没有参数
.   ORA-01422: 实际返回的行数超出请求的行数
.   ORA-06512: 在 line 5
.   SP2-1506: START, @ 或 @@ 命令没有参数
.   ORA-01422: 实际返回的行数超出请求的行数
.   ORA-06512: 在 line 5
.   SP2-1506: START, @ 或 @@ 命令没有参数
.   ORA-01422: 实际返回的行数超出请求的行数
.   ORA-06512: 在 line 5
.   SP2-1506: START, @ 或 @@ 命令没有参数
.   ORA-01422: 实际返回的行数超出请求的行数
.   ORA-06512: 在 line 5
.   SP2-1506: START, @ 或 @@ 命令没有参数
.   ORA-01422: 实际返回的行数超出请求的行数
.   ORA-06512: 在 line 5
.   SP2-1506: START, @ 或 @@ 命令没有参数
.   ORA-01422: 实际返回的行数超出请求的行数
.                                         VALID      11.2.0.4.0  00:00:24
Oracle XDK
.                                         VALID      11.2.0.4.0  00:00:16
Oracle Text
.                                         VALID      11.2.0.4.0  00:00:33
Oracle XML Database
.                                         VALID      11.2.0.4.0  00:01:21
Oracle Database Java Packages
.                                         VALID      11.2.0.4.0  00:00:05
Oracle Multimedia
.   ORA-04063: package body &quot;SYS.DBMS_SQLTUNE&quot; 有错误
.   ORA-06508: PL/SQL: 无法找到正在调用 : &quot;SYS.DBMS_SQLTUNE&quot; 的程序单元
.   ORA-06512: 在 &quot;SYS.UTL_RECOMP&quot;, line 865
.   ORA-06512: 在 &quot;SYS.UTL_RECOMP&quot;, line 878
.   ORA-06512: 在 line 1
.                                         VALID      11.2.0.4.0  00:00:53
Spatial
.                                         VALID      11.2.0.4.0  00:03:25
Oracle Expression Filter
.                                         VALID      11.2.0.4.0  00:00:08
Oracle Rules Manager
.                                         VALID      11.2.0.4.0  00:00:06
Oracle Application Express
.                                         VALID     3.2.1.00.10
Final Actions
.                                                                00:00:00
Total Upgrade Time: 00:18:38

PL/SQL 过程已成功完成。
</pre>
<p>查询mos发现类似解决方案</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; select owner, object_name, object_type, status from dba_objects  where object_name = 'DBMS_STATS';

OWNER                          OBJECT_NAME
                                        OBJECT_TYPE         STATUS
------------------------------ -----------------------------------------------------------------------------------------
--------------------------------------- ------------------- -------
SYS                            DBMS_STATS
                                        PACKAGE             VALID
SYS                            DBMS_STATS
                                        PACKAGE BODY        VALID
PUBLIC                         DBMS_STATS
                                        SYNONYM             VALID

SQL&gt; select owner, object_name, object_type, status from dba_objects  where object_name = 'DBMS_SQLTUNE'
  2  /

OWNER                          OBJECT_NAME
                                        OBJECT_TYPE         STATUS
------------------------------ -----------------------------------------------------------------------------------------
--------------------------------------- ------------------- -------
SYS                            DBMS_SQLTUNE
                                        PACKAGE             VALID
SYS                            DBMS_SQLTUNE
                                        PACKAGE BODY        INVALID
PUBLIC                         DBMS_SQLTUNE
                                        SYNONYM             INVALID

SQL&gt; alter package DBMS_SQLTUNE compile body;

警告: 更改的包体带有编译错误。

SQL&gt; show error;
PACKAGE BODY DBMS_SQLTUNE 出现错误:

LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0      PLS-00801: 内部错误 [phdite:node kind]
10210/5  PL/SQL: ORA-01775: 同义词的循环链
10210/5  PL/SQL: SQL Statement ignored
13917/7  PL/SQL: Statement ignored
16995/5  PL/SQL: SQL Statement ignored
17060/12 PL/SQL: ORA-01775: 同义词的循环链
17657/7  PL/SQL: Statement ignored
17660/31 PLS-00231: 函数 'SQLERRM' 不能在 SQL 中使用
19718/5  PL/SQL: SQL Statement ignored
19718/12 PL/SQL: ORA-01775: 同义词的循环链
19782/5  PL/SQL: Statement ignored

LINE/COL ERROR
-------- -----------------------------------------------------------------
19782/17 PLS-00231: 函数 'BUILD_SQL_DETAIL_XML' 不能在 SQL 中使用
SQL&gt; select owner, object_name, object_type, status from dba_objects  where object_name = 'XMLCONCAT';

OWNER
------------------------------
OBJECT_NAME
--------------------------------------------------------------------------------
OBJECT_TYPE         STATUS
------------------- -------
PUBLIC
XMLCONCAT
SYNONYM             VALID


SQL&gt; drop public synonym XMLCONCAT;

同义词已删除。

SQL&gt;  alter package DBMS_SQLTUNE compile body;

程序包体已变更。

</pre>
<p>重新跑升级脚本catupgrd.sql,一切正常</p>
<pre class="brush: bash; title: ; notranslate">
Oracle Database 11.2 Post-Upgrade Status Tool           08-21-2020 21:08:31
.
Component                               Current      Version     Elapsed Time
Name                                    Status       Number      HH:MM:SS
.
Oracle Server
.                                         VALID      11.2.0.4.0  00:06:44
JServer JAVA Virtual Machine
.                                         VALID      11.2.0.4.0  00:00:00
Oracle Workspace Manager
.                                         VALID      11.2.0.4.0  00:00:00
OLAP Analytic Workspace
.                                         VALID      11.2.0.4.0  00:00:00
OLAP Catalog
.                                         VALID      11.2.0.4.0  00:00:00
Oracle OLAP API
.                                         VALID      11.2.0.4.0
Oracle Enterprise Manager
.                                         VALID      11.2.0.4.0  00:00:00
Oracle XDK
.                                         VALID      11.2.0.4.0  00:00:00
Oracle Text
.                                         VALID      11.2.0.4.0  00:00:00
Oracle XML Database
.                                         VALID      11.2.0.4.0  00:00:00
Oracle Database Java Packages
.                                         VALID      11.2.0.4.0  00:00:00
Oracle Multimedia
.                                         VALID      11.2.0.4.0  00:00:00
Spatial
.                                         VALID      11.2.0.4.0  00:00:00
Oracle Expression Filter
.                                         VALID      11.2.0.4.0  00:00:00
Oracle Rules Manager
.                                         VALID      11.2.0.4.0
Oracle Application Express
.                                         VALID     3.2.1.00.10
Final Actions
.                                                                00:00:00
Total Upgrade Time: 00:06:51

PL/SQL 过程已成功完成。
</pre>
<p>参考解决方案:Upgrade From 10G To 11G Fails On Dbms_sqltune : ORA-04063: Package Body &#8220;SYS.DBMS_SQLTUNE&#8221; Has Errors (Doc ID 1271490.1)<br />
DBMS_STATS , DBMS_SQLTUNE_INTERNAL , DBMS_SQLTUNE Package Can Not be Recompiled during/After Upgrade reporting &#8220;ORA-04063&#8243; , &#8220;ORA-06508&#8243; . &#8220;ORA-06512&#8243; (Doc ID 761961.1)</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2023/12/patch-nls_language.html" rel="bookmark" class="crp_title">数据库打patch建议设置nls_language为英文</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/09/%e5%8d%87%e7%ba%a7%e5%88%b0oracle-10-2-0-4.html" rel="bookmark" class="crp_title">升级到Oracle 10.2.0.4</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/2011/11/%e6%b7%b1%e5%85%a5%e5%88%86%e6%9e%90%e6%95%b0%e6%8d%ae%e5%ba%93%e7%89%88%e6%9c%ac%e7%9b%b8%e5%85%b3%e8%a7%86%e5%9b%be.html" rel="bookmark" class="crp_title">深入分析数据库版本相关视图</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/ora-06553-pls-801-internal-error-56319.html" rel="bookmark" class="crp_title">ORA-06553: PLS-801: internal error [56319]</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/05/exp%e5%af%bc%e5%87%ba%e6%95%b0%e6%8d%ae%e6%8a%a5exp-00056ora-01403%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">exp导出数据报EXP-00056/ORA-01403错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/07/11gr2%e5%8d%87%e7%ba%a7%e5%88%b012gr1%e5%b9%b6%e6%8f%92%e5%85%a5cdb.html" rel="bookmark" class="crp_title">11GR2升级到12CR1并插入CDB</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/10/11-2-0-4-upgrade-19c.html" rel="bookmark" class="crp_title">11.2.0.4升级到19c详细操作过程</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/vpwfile_users%e5%92%8c%e5%af%86%e7%a0%81%e6%96%87%e4%bb%b6%e5%85%b3%e7%b3%bb%e7%bb%ad.html" rel="bookmark" class="crp_title">V$PWFILE_USERS和密码文件关系(续)</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/2015/04/oracle-12-1-0-2-%e7%9a%84olap-api%e7%bb%84%e4%bb%b6%e6%97%a0%e6%95%88%e7%9a%84%e5%a4%84%e7%90%86%e8%bf%87%e7%a8%8b.html" rel="bookmark" class="crp_title">Oracle 12.1.0.2 的OLAP API组件无效的处理过程</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2020/08/upgrade-db-sys-dbms_sqltune.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
