使用orachk工具檢查資料庫實例的時候,發現報告裡面有類似下麵這樣一些錯誤(最近有給Oracle 10g應用補丁PSU 10.2.0.5.180717,不清楚是這個產生的還是其他原因導致),使用腳本檢查,發現有很多INVALID對象(具體參考[轉載]—Health Check Reports Pr... ...
使用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
select
do.obj# d_obj,do.name d_name, do.type# d_type,
po.obj# p_obj,po.name p_name,
to_char(p_timestamp,'DD-MON-YYYY HH24:MI:SS') "P_Timestamp",
to_char(po.stime ,'DD-MON-YYYY HH24:MI:SS') "STIME",
decode(sign(po.stime-p_timestamp),0,'SAME','*DIFFER*') X
from sys.obj$ do, sys.dependency$ d, sys.obj$ po
where P_OBJ#=po.obj#(+)
and D_OBJ#=do.obj#
and do.status=1 /*dependent is valid*/
and po.status=1 /*parent is valid*/
and po.stime!=p_timestamp /*parent timestamp not match*/
order by 2,1;
然後在執行編譯一些INVALID對象時遇到了下麵錯誤ORA-04045,如下所示:
SQL> alter public synonym "SM$VERSION" compile;
alter public synonym "SM$VERSION" compile
*
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"
如下所示,LBACSYS下有很多INVALID對象,最奇怪的是,執行了上面腳本,會觸發ORA-04045,似乎還會導致其他會話執行腳本時也觸發這個錯誤:
SQL> col comp_name for a36;
SQL> col version for a30;
SQL> col version for a10;
col status for a8;
select comp_id, comp_name, version, status
from dba_registry
where comp_name='Oracle Label Security';
COMP_ID COMP_NAME VERSION STATUS
------------------------------ ------------------------------------ ---------- --------
OLS Oracle Label Security 10.2.0.5.0 VALID
SQL>
SQL> select * from v$option where parameter = 'Oracle Label Security';
PARAMETER VALUE
---------------------------------------------------------------- --------------
Oracle Label Security FALSE
SQL>
Tue Jun 25 20:15:01 HKT 2019
Errors in file /u01/app/oracle/admin/xxx/udump/xxx_ora_11203.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
[oracle@xxxxx bdump]$ more /u01/app/oracle/admin/xxxx/udump/xxx_ora_11203.trc
/u01/app/oracle/admin/EPPS/udump/epps_ora_11203.trc
Oracle Database 10g Release 10.2.0.5.0 - 64bit Production
ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1
System name: Linux
Node name: xxxx
Release: 2.6.32-200.13.1.el5uek
Version: #1 SMP Wed Jul 27 21:02:33 EDT 2011
Machine: x86_64
Instance name: xxx
Redo thread mounted by this instance: 1
Oracle process number: 48
Unix process pid: 11203, image: oracle@xxxx (TNS V1-V3)
*** ACTION NAME:() 2019-06-25 20:15:01.745
*** MODULE NAME:(sqlplus@xxxx (TNS V1-V3)) 2019-06-25 20:15:01.745
*** SERVICE NAME:(SYS$USERS) 2019-06-25 20:15:01.745
*** SESSION ID:(113.2150) 2019-06-25 20:15:01.745
Error in executing triggers on connect internal
*** 2019-06-25 20:15:01.750
ksedmp: internal or fatal error