`
阿尔萨斯
  • 浏览: 4187632 次
社区版块
存档分类
最新评论

无法成功执行catalog.sql,ORA-04045 ORA-04064

 
阅读更多

最近同事报料,数据库无法执行一些关于数据字典的查询。即使是查询dba_users都会出现错误。从错误日志来看,全部是数据字典的一些错误信息,而用户数据还是ok的。Google了一下,看了看metalink,需要重建数据字典。那就执行catalog.sql吧。晕,竟然连执行这个SQL语句都报错!数据没有备份呢,汗!!! 如果你也是无法成功执行catalog.sql,接着往下看。


一、故障现象
--后台alert log日志出现大量的ORA-00604,ORA-04045的错误信息
Tue Nov 5 14:14:02 2013
Errors in file /u02/database/XA4701/udump/XA4701_ora_30871.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-04045: errors during recompilation/revalidation of LBACSYS.LBAC_EVENTS
ORA-04064: not executed, invalidated
ORA-04064: not executed, invalidated package body "LBACSYS.LBAC_EVENTS"
ORA-06508: PL/SQL: could not find program unit being called: "LBACSYS.LBAC_EVENTS"
ORA-06512: at line 2
ORA-06508: PL/SQL: could not find program unit being called: "LBACSYS.LBAC_EVENTS"
ORA-06512: at line 2

--下面是trace文件的具体信息
oracle@DBBK10P:~> more /u02/database/XA4701/udump/XA4701_ora_30871.trc
/u02/database/XA4701/udump/XA4701_ora_30871.trc
Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
ORACLE_HOME = /users/oracle/OraHome10g
System name: Linux
Node name: linux-ejad
Release: 2.6.16.60-0.54.5-smp
Version: #1 SMP Fri Sep 4 01:28:03 UTC 2009
Machine: x86_64
Instance name: XA4701
Redo thread mounted by this instance: 1
Oracle process number: 22
Unix process pid: 30871, image:
oracleXA4701@linux-ejad

*** SERVICE NAME:(XA4701) 2013-11-05 14:14:02.308
*** SESSION ID:(1092.3369) 2013-11-05 14:14:02.308
Skipped error 604 during the execution of LBACSYS.LBAC$LOGON
*** 2013-11-05 14:14:02.326
ksedmp: internal or fatal error
ORA-00604: error occurred at recursive SQL level 1
ORA-04045: errors during recompilation/revalidation of LBACSYS.LBAC_EVENTS
ORA-04064: not executed, invalidated
ORA-04064: not executed, invalidated package body "LBACSYS.LBAC_EVENTS"
ORA-06508: PL/SQL: could not find program unit being called: "LBACSYS.LBAC_EVENTS"
ORA-06512: at line 2
ORA-06508: PL/SQL: could not find program unit being called: "LBACSYS.LBAC_EVENTS"
ORA-06512: at line 2

--查询数据字典,收到类似的错误
SQL> select comp_id, comp_name, version, status from dba_registry;
select comp_id, comp_name, version, status from dba_registry
*
ERROR at line 1:
ORA-04045: errors during recompilation/revalidation of SYS.DBA_REGISTRY
ORA-04064: not executed, invalidated
ORA-04064: not executed, invalidated package body "LBACSYS.LBAC_EVENTS"
ORA-06508: PL/SQL: could not find program unit being called: "LBACSYS.LBAC_EVENTS"
ORA-06512: at line 2
ORA-06508: PL/SQL: could not find program unit being called: "LBACSYS.LBAC_EVENTS"
ORA-06512: at line 2
ORA-00904: "DBMS_REGISTRY"."SCHEMA_LIST_STRING": invalid identifier


二、故障分析
oracle@DBBK10P:~> oerr ora 4045
04045, 00000, "errors during recompilation/revalidation of %s.%s"
// *Cause: This message indicates the object to which the following
// errors apply. The errors occurred during implicit
// recompilation/revalidation of the object.
// *Action: Check the following errors for more information, and
// make the necessary corrections to the object.
--从前面的错误描述来看及所发生的对象来看,系统用户LBACSYS这个对象错误了,为无效对象

--尝试重新编译,问题依旧

--下面直接执行catalog,执行时其日志文件出现大量的错误提示。也就是说无法重建数据字典
--尝试了使用restirct 方式来重启DB后执行,依旧出现相同的错误
SQL> @?/rdbms/admin/catalog
create or replace
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-04045: errors during recompilation/revalidation of LBACSYS.LBAC_EVENTS
ORA-04064: not executed, invalidated
ORA-04064: not executed, invalidated package body "LBACSYS.LBAC_EVENTS"
ORA-06508: PL/SQL: could not find program unit being called:
"LBACSYS.LBAC_EVENTS"
ORA-06512: at line 2
ORA-06508: PL/SQL: could not find program unit being called:
"LBACSYS.LBAC_EVENTS"
ORA-06512: at line 2
--Author : Leshami
--Blog :
http://blog.csdn.net/leshami

--折腾了一下下午,后来参照Doc ID 457415.1给出的解决方案搞定


三、故障解决
--下面直接列出Doc ID 457415.1文章给出的解决方案与步骤,具体不再演示
metalink上的文章:ORA-4045 Error During Recompilation/Revalidation Of SYS.DBMS_STANDARD (Doc ID 457415.1)
Symptoms
Catproc.sql fails with the following error:

ERROR at line 1:
ORA-04045: errors during recompilation/revalidation of SYS.DBMS_STANDARD
ORA-04021: timeout occurred while waiting to lock object SYS.CDC_ALTER_CTABLE_BEFORE
Cause
Trying to create a database from a database that already exists.

1. Modify init.ora to contain:

_system_trig_enabled=FALSE
job_queue_processes=0
aq_tm_processes=0
Save init.ora

The following instructions are to be completed from sqlplus as the SYS user:

2. Issue a shutdown immediate:
SQL> shutdown immediate

3. SQL> startup pfile='<insert full path of init.ora here>'

4. SQL> @catalog.sql

5. SQL> @catproc.sql

6. Check for invalids from dba_objects:

SQL> select owner, object_name from dba_objects where status='INVALID';

7. Run utlrp.sql:
SQL> @utlrp.sql

8. Check for invalids again.

SQL> select owner, object_name from dba_objects where status='INVALID';

Oracle&nbsp;牛鹏社 Oracle DBsupport

更多参考

有关Oracle RAC请参考
使用crs_setperm修改RAC资源的所有者及权限
使用crs_profile管理RAC资源配置文件
RAC 数据库的启动与关闭
再说 Oracle RAC services
Services in Oracle Database 10g
Migrate datbase from single instance to Oracle RAC
Oracle RAC 连接到指定实例
Oracle RAC 负载均衡测试(结合服务器端与客户端)
Oracle RAC 服务器端连接负载均衡(Load Balance)
Oracle RAC 客户端连接负载均衡(Load Balance)
ORACLE RAC 下非缺省端口监听配置(listener.ora tnsnames.ora)
ORACLE RAC 监听配置 (listener.ora tnsnames.ora)
配置 RAC 负载均衡与故障转移
CRS-1006 , CRS-0215 故障一例
基于Linux (RHEL 5.5) 安装Oracle 10g RAC
使用 runcluvfy 校验Oracle RAC安装环境

有关Oracle 网络配置相关基础以及概念性的问题请参考:
配置非默认端口的动态服务注册
配置sqlnet.ora限制IP访问Oracle
Oracle 监听器日志配置与管理
设置 Oracle 监听器密码(LISTENER)
配置ORACLE 客户端连接到数据库

有关基于用户管理的备份和备份恢复的概念请参考
Oracle 冷备份
Oracle 热备份
Oracle 备份恢复概念
Oracle 实例恢复
Oracle 基于用户管理恢复的处理
SYSTEM 表空间管理及备份恢复
SYSAUX表空间管理及恢复
Oracle 基于备份控制文件的恢复(unsing backup controlfile)

有关RMAN的备份恢复与管理请参考
RMAN 概述及其体系结构
RMAN 配置、监控与管理
RMAN 备份详解
RMAN 还原与恢复
RMAN catalog 的创建和使用
基于catalog 创建RMAN存储脚本
基于catalog 的RMAN 备份与恢复
RMAN 备份路径困惑
使用RMAN实现异机备份恢复(WIN平台)
使用RMAN迁移文件系统数据库到ASM
linux 下RMAN备份shell脚本
使用RMAN迁移数据库到异机

有关ORACLE体系结构请参考
Oracle 表空间与数据文件
Oracle 密码文件
Oracle 参数文件
Oracle 联机重做日志文件(ONLINE LOG FILE)
Oracle 控制文件(CONTROLFILE)
Oracle 归档日志
Oracle 回滚(ROLLBACK)和撤销(UNDO)
Oracle 数据库实例启动关闭过程
Oracle 10g SGA 的自动化管理
Oracle 实例和Oracle数据库(Oracle体系结构)

分享到:
评论

相关推荐

    Oracle9i Database Error Messages

    2 ORA-00000 to ORA-00899 3 ORA-00900 to ORA-01499 4 ORA-01500 to ORA-02099 5 ORA-02100 to ORA-04099 6 ORA-04100 to ORA-07499 7 ORA-07500 to ORA-09857 8 ORA-09858 to ORA-12299 9 ORA-12300 to ORA-12399 ...

    Oracle9i的init.ora参数中文说明

    如果设置为 FALSE, 将执行 PL/SQL V3 行为, 而不允许 V2 行为; 否则在运行 PL/SQL V3 时将接受某些 PL/SQL V2 行为。 值范围: TRUE | FALSE 默认值: FALSE plsql_native_make_utility: 说明: 指定 make 实用程序 ...

    linux系统给oracle数据库增加新的实例.pdf

    /rdbms/admin/catalog.sql; SQL&gt; @?/rdbms/admin/catproc.sql; SQL&gt; @?/sqlplus/admin/pupbld.sql; SQL&gt;startup force; SQL&gt;exit; 5、建监听 cd $ORACLE_BASE/product/10.2.0/db_1/network/admin vim listener.ora ...

    linux系统给oracle数据库增加新的实例(1).pdf

    /rdbms/admin/catalog.sql; SQL&gt; @?/rdbms/admin/catproc.sql; SQL&gt; @?/sqlplus/admin/pupbld.sql; SQL&gt;startup force; SQL&gt;exit; 5、建监听 cd $ORACLE_BASE/product/10.2.0/db_1/network/admin vim listener.ora ...

    最全的oracle常用命令大全.txt

    读取init.ora文件,启动instance,即启动SGA和后台进程,这种启动只需要init.ora文件。 2、startup mount dbname 安装启动,这种方式启动下可执行: 数据库日志归档、 数据库介质恢复、 使数据文件联机或脱机, ...

    oracle详解

    ·为了在SQL中执行EXP,USERID必须用三个引号,在UNIX中也必须注意避免“/”的使用 ·在816和以后,必须使用sysdba才能操作 ·这个命令在SQL中必须放置在一行(这里是因为显示问题放在了两行) 3.拷贝数据文件到另一...

    hibernate.properties

    #hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb ## Pointbase #hibernate.dialect org.hibernate.dialect.PointbaseDialect #hibernate.connection.driver_class ...

    oracle实验报告

    本数据库(oracle)7个实验报告... start E:\app\oracle\product\11.1.0\db_1\RDBMS\ADMIN\catalog.sql 9、创建package 包 start E:\app\oracle\product\11.1.0\db_1\RDBMS\ADMIN\catproc.sql 10、实验结果如图:

    数据库管理系统检查命令清单.docx

    cat /$ORACLE_HOME/rdbms/admin/utlpwdmg.sql cat /$ORACLE_HOME/network/admin/sqlnet.ora select * from v$version; select username,account_status from dba_users; select resource_name,limit from dba_...

    oracle学习文档 笔记 全面 深刻 详细 通俗易懂 doc word格式 清晰 连接字符串

     DELETE_CATALOG_ROLE, EXECUTE_CATALOG_ROLE,SELECT_CATALOG_ROLE这些角色主要用于访问数据字典视图和包。  EXP_FULL_DATABASE, IMP_FULL_DATABASE这两个角色用于数据导入导出工具的使用。  自定义角色 ...

Global site tag (gtag.js) - Google Analytics