经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 数据库/运维 » Oracle » 查看文章
ORA-04045: errors during recompilation/revalidation of LBACSYS.LBAC_EVENTS
来源:cnblogs  作者:潇湘隐者  时间:2019/6/26 9:12:05  对本文有异议

使用orachk工具检查数据库实例的时候,发现报告里面有类似下面这样一些错误(最近有给Oracle 10g应用补丁PSU 10.2.0.5.180717,不清楚是这个产生的还是其他原因导致),使用脚本检查,发现有很多INVALID对象(具体参考[转载]—Health Check Reports Problem: Dependency$ p_timestamp mismatch for VALID objects (文档 ID 781959.1)

 

[W] - P_OBJ#=37817 D_OBJ#=38416 

[W] - P_OBJ#=38014 D_OBJ#=38605 

[W] - P_OBJ#=38020 D_OBJ#=38611 

[W] - P_OBJ#=38043 D_OBJ#=38634 

[W] - P_OBJ#=38061 D_OBJ#=38652 

[W] - P_OBJ#=38064 D_OBJ#=38655 

[W] - P_OBJ#=38087 D_OBJ#=38678 

[W] - P_OBJ#=38090 D_OBJ#=38681

 

  1. select 
  1. do.obj# d_obj,do.name d_name, do.type# d_type,
  1. po.obj# p_obj,po.name p_name,
  1. to_char(p_timestamp,'DD-MON-YYYY HH24:MI:SS') "P_Timestamp",
  1. to_char(po.stime ,'DD-MON-YYYY HH24:MI:SS') "STIME",
  1. decode(sign(po.stime-p_timestamp),0,'SAME','*DIFFER*') X
  1. from sys.obj$ do, sys.dependency$ d, sys.obj$ po
  1. where P_OBJ#=po.obj#(+)
  1. and D_OBJ#=do.obj#
  1. and do.status=1 /*dependent is valid*/
  1. and po.status=1 /*parent is valid*/
  1. and po.stime!=p_timestamp /*parent timestamp not match*/
  1. order by 2,1;

 

然后在执行编译一些INVALID对象时遇到了下面错误ORA-04045如下所示

 

  1. SQL> alter public synonym "SM$VERSION" compile;
  1. alter public synonym "SM$VERSION" compile
  1. *
  1. ERROR at line 1:
  1. ORA-00604: error occurred at recursive SQL level 1
  1. ORA-04045: errors during recompilation/revalidation of LBACSYS.LBAC_EVENTS
  1. ORA-04064: not executed, invalidated
  1. ORA-04064: not executed, invalidated package body "LBACSYS.LBAC_EVENTS"
  1. ORA-06508: PL/SQL: could not find program unit being called:
  1. "LBACSYS.LBAC_EVENTS"
  1. ORA-06512: at line 2
  1. ORA-06508: PL/SQL: could not find program unit being called:
  1. "LBACSYS.LBAC_EVENTS"

 

clip_image001

 

 

如下所示,LBACSYS下有很多INVALID对象,最奇怪的是,执行了上面脚本,会触发ORA-04045,似乎还会导致其他会话执行脚本时也触发这个错误:

 

 

 

 

  1.  
  1. SQL> col comp_name for a36;
  1. SQL> col version for a30;
  1. SQL> col version for a10;
  1. col status for a8;
  1. select comp_id, comp_name, version, status
  1. from dba_registry
  1. where comp_name='Oracle Label Security';
  1.  
  1. COMP_ID                        COMP_NAME                            VERSION    STATUS
  1. ------------------------------ ------------------------------------ ---------- --------
  1. OLS                            Oracle Label Security                10.2.0.5.0 VALID
  1.  
  1. SQL>
  1.  
  1. SQL>  select * from v$option where parameter = 'Oracle Label Security';
  1.  
  1. PARAMETER                                                        VALUE
  1. ---------------------------------------------------------------- --------------
  1. Oracle Label Security                                            FALSE
  1.  
  1. SQL>

 

 

clip_image002

 

  1.  
  1.  
  1. Tue Jun 25 20:15:01 HKT 2019
  1. Errors in file /u01/app/oracle/admin/xxx/udump/xxx_ora_11203.trc:
  1. ORA-00604: error occurred at recursive SQL level 1
  1. ORA-04045: errors during recompilation/revalidation of LBACSYS.LBAC_EVENTS
  1. ORA-04064: not executed, invalidated
  1. ORA-04064: not executed, invalidated package body "LBACSYS.LBAC_EVENTS"
  1. ORA-06508: PL/SQL: could not find program unit being called: "LBACSYS.LBAC_EVENTS"
  1. ORA-06512: at line 2
  1. ORA-06508: PL/SQL: could not find program unit being called: "LBACSYS.LBAC_EVENTS"
  1. ORA-06512: at line 2
  1.  
  1.  
  1.  
  1. [oracle@xxxxx bdump]$ more  /u01/app/oracle/admin/xxxx/udump/xxx_ora_11203.trc
  1. /u01/app/oracle/admin/EPPS/udump/epps_ora_11203.trc
  1. Oracle Database 10g Release 10.2.0.5.0 - 64bit Production
  1. ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1
  1. System name:    Linux
  1. Node name:      xxxx
  1. Release:        2.6.32-200.13.1.el5uek
  1. Version:        #1 SMP Wed Jul 27 21:02:33 EDT 2011
  1. Machine:        x86_64
  1. Instance name: xxx
  1. Redo thread mounted by this instance: 1
  1. Oracle process number: 48
  1. Unix process pid: 11203, image: oracle@xxxx (TNS V1-V3)
  1.  
  1. *** ACTION NAME:() 2019-06-25 20:15:01.745
  1. *** MODULE NAME:(sqlplus@xxxx (TNS V1-V3)) 2019-06-25 20:15:01.745
  1. *** SERVICE NAME:(SYS$USERS) 2019-06-25 20:15:01.745
  1. *** SESSION ID:(113.2150) 2019-06-25 20:15:01.745
  1. Error in executing triggers on connect internal
  1. *** 2019-06-25 20:15:01.750
  1. ksedmp: internal or fatal error
  1. ORA-00604: error occurred at recursive SQL level 1
  1. ORA-04045: errors during recompilation/revalidation of LBACSYS.LBAC_EVENTS
  1. ORA-04064: not executed, invalidated
  1. ORA-04064: not executed, invalidated package body "LBACSYS.LBAC_EVENTS"
  1. ORA-06508: PL/SQL: could not find program unit being called: "LBACSYS.LBAC_EVENTS"
  1. ORA-06512: at line 2
  1. ORA-06508: PL/SQL: could not find program unit being called: "LBACSYS.LBAC_EVENTS"
  1. ORA-06512: at line 2

 

 

当时参考“ORA-04045: errors during recompilation/revalidation of LBACSYS.LBAC_EVENTS这篇文章做了如下处理,告警日志里面不会出现ORA-04045错误了,但是如果我使用

 

上面的语句编译INVALID对象。就又会触发这个错误出现。似乎这种方法是指标不治本

 

 

  1. shutdown immediate;
  1.  
  1. startup migrate;
  1.  
  1. alter view lbacsys.lbac$all_table_policies compile;
  1.  
  1. alter package lbacsys.lbac_events compile body;
  1.  
  1. shutdown immediate;
  1.  
  1. startup;

 

 

最后参考官方文档ORA-07445 [zllcini] or ORA-04045 in a Database with OLS Set to FALSE (文档 ID 233110.1)给出解决方案:

 

 

ORA-4045 related to LBACSYS.LBAC_EVENTS

 

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

 

 

 

   ORA-00604: error occurred at recursive SQL level 1

 

   ORA-04045: errors during recompilation/revalidation of LBACSYS.LBAC_EVENTS

 

   ORA-06508: PL/SQL: could not find program unit being called

 

   ORA-06512: at line 2

 

   ORA-06508: PL/SQL: could not find program unit being called

 

   ORA-06512: at line 2

 

 

Solution Description

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

 

 

 

 

 

1. Install Oracle Label Security with the Oracle Universal Installer

 

2. Run $ORACLE_HOME/rdbms/admin/catnools.sql script to disable OLS

 

3. Optionally de-install 'The Label Security' software

 

 

 

 

 

Explanation

-----------

 

The Oracle Universal Installer may install OLS components in some cases:

patchset apply

 

 

 

解决方案:

 

 

1:卸载Oracle Label Security

 

@?/rdbms/admin/catnools.sql

 

 

2:运行/tmp/compiling.lst重编译失效对象

 

具体参考[转载]—Health Check Reports Problem: Dependency$ p_timestamp mismatch for VALID objects (文档 ID 781959.1)

 

 

3:运行@?/rdbms/admin/catols.sql脚本安装Oracle Label Security

 

 

第三步可以做也可以不做,是具体情况而定。

 

 

 

 

参考资料:

 

http://www.itpux.com/thread-568-1-1.html

 

ORA-07445 [zllcini] or ORA-04045 in a Database with OLS Set to FALSE (文档 ID 233110.1)

 

 

 

原文链接:http://www.cnblogs.com/kerrycode/p/11087317.html

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号