oracle 11g ora31626,重建DBMS_STATS解决ORA-31626 ORA-21633以及ORA-04063 ORA-06508 错误

本文记录了在Oracle 11g环境中,由于意外修改DBMS_STATS包导致的各种错误,如ORA-31626、ORA-31633和ORA-04063,以及如何通过重建DBMS_STATS包和将表空间设置为读写模式来解决问题的详细步骤。
摘要由CSDN通过智能技术生成

在PL/SQL中无意间修改了package body-DBMS_STATS 的内容导致在系统多处功能异常。 如下

[Oracle@mhxy01 ~]$ expdp scott/tiger directory=DMP dumpfile=emp.dump tables=emp

Export: Release 11.2.0.4.0 - Production on Tue Oct 11 19:35:59 2016

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

ORA-31626: job does not exist

ORA-31633: unable to create master table "SCOTT.SYS_EXPORT_TABLE_05"

ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95

ORA-06512: at "SYS.KUPV$FT", line 1038

ORA-01647: tablespace 'USERS' is read-only, cannot allocate space in it

SQL> exec dbms_stats.gather_table_stats(ownname => 'scott',tabname => 'emp');

BEGIN dbms_stats.gather_table_stats(ownname => 'scott',tabname => 'emp'); END;

*

ERROR at line 1:

ORA-04063: package body "SYS.DBMS_STATS" has errors

ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_STATS"

ORA-06512: at line 1

重建DBMS_STATS包,解决以上问题, 当然也有个ORA错误不是它引起来的,以下是重建过程

[oracle@mhxy01 ~]$ sqlplus / as sysdba

SQL> set linesize 400

SQL> select * from v$version;

BANNER

----------------------------------------------------------------------------------------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

PL/SQL Release 11.2.0.4.0 - Production

CORE 11.2.0.4.0 Production

TNS for Linux: Version 11.2.0.4.0 - Production

NLSRTL Version 11.2.0.4.0 - Production

SQL> exec dbms_stats.gather_table_stats(ownname

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值