ITPub博客

首页 > 数据库 > Oracle > SYS.DBMS_STATS_INTERNAL(ORA-04063.ORA-06508.ORA-06512)

SYS.DBMS_STATS_INTERNAL(ORA-04063.ORA-06508.ORA-06512)

原创 Oracle 作者:sss_basis 时间:2017-04-20 17:52:56 0 删除 编辑
如下图所示,执行程序时报ORA错误

原因:包体损坏或者不一致导致
解决方法:Drop和重建包

1、停止数据库进入upgrade模式

SQL> shutdown immediate

SQL> startup upgrade

2、删除packagedbms_statsdbms_stats_internal

SQL> drop package dbms_stats;

Package dropped.

SQL> drop package dbms_stats_internal;

Package dropped.

3、重建包,不能出现error,如果有show errors并解决

SQL> @?/rdbms/admin/dbmsstat.sql

Session altered.

Package created.

No errors.

Synonym created.

Grant succeeded.

Role created.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Role created.

Grant succeeded.

Grant succeeded.

Library created.

Session altered.

SQL> @?/rdbms/admin/prvtstas.plb

Session altered.

Type created.

Synonym created.

Grant succeeded.

Type created.

No errors.

Synonym created.

Synonym created.

Type created.

Synonym created.

Synonym created.

Type dropped.

Type created.

No errors.

Synonym created.

Synonym created.

Type created.

Synonym created.

Synonym created.

Type created.

Synonym created.

Synonym created.

No errors.

Type created.

No errors.

Synonym created.

Synonym created.

Type created.

Synonym created.

Synonym created.

Type created.

No errors.

Synonym created.

Synonym created.

Type created.

Synonym created.

Synonym created.

No errors.

Package created.

No errors.

Session altered.

SQL> @?/rdbms/admin/prvtstat.plb

Session altered.

Type body created.

No errors.

Package body created.

No errors.

Session altered.

SQL> @?/rdbms/admin/prvtstai.plb

Session altered.

Package body created.

No errors.

Session altered.

4、查看重建后的objects状态

SQL> select status from dba_objects  where object_name='DBMS_STATS_INTERNAL';

STATUS

-------

VALID

VALID

SQL> select status from dba_objects  where object_name='DBMS_STATS';

STATUS

-------

VALID

VALID

问题解决

5、可以导出包试试(这步可以不做)

EHR:orahrd 57> expdp \' / as sysdba \' directory=backup dumpfile=package_pro_0412_1.dmp full=y include=package

Export: Release 12.1.0.2.0 - Production on Wed Apr 12 12:25:46 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Starting "SYS"."SYS_EXPORT_FULL_03":  "/******** AS SYSDBA" directory=backup dumpfile=package_pro_0412_1.dmp full=y include=package

Estimate in progress using BLOCKS method...

Total estimation using BLOCKS method: 0 KB

Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE/PACKAGE_SPEC

Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE_BODIES/PACKAGE/PACKAGE_BODY

Master table "SYS"."SYS_EXPORT_FULL_03" successfully loaded/unloaded

******************************************************************************

Dump file set for SYS.SYS_EXPORT_FULL_03 is:

  /oracle/package_pro_0412_1.dmp

Job "SYS"."SYS_EXPORT_FULL_03" successfully completed at Wed Apr 12 12:27:29 2017 elapsed 0 00:01:42



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30782175/viewspace-2137701/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2016-01-12

  • 博文量
    22
  • 访问量
    23954