客户数据库碰到如下报错:
ORA-04023: Object could not be validated or authorized
ORA-04023 无法验证或授权对象
*** --》 这个是客户的视图名
相关信息:
SQL> select count(*) from ***;
select count(*) from ***
*
µؠ1 ѐ³:
ORA-04023: Ϟ·¨ҩ֤»¨¶Տlect count(*) from ***
[oracle@zc ~]$ oerr ora 4023
04023, 00000, "Object %s%s%s%s%s could not be validated or authorized"
// *Cause: A number of attempts were made to validate or authorize an
// object but failed.
// *Action: Please report this error to Oracle Support Services.
检查发现,这个对象是个同义词,指向的是个视图,客户自述,此视图做过重新编译,基表有过改变
另外还发现,客户报错的是个adg备库,主库查询是没有问题的。
备库 ALTER SESSION SET CURRENT_SCHEMA 之后查询也是没问题的
SQL> ALTER SESSION SET CURRENT_SCHEMA =客户的用户名;
»Ựӑ¸
SQL> select count(*) from ***;
COUNT(*)
----------
257503
猜测:重启备库大概率解决此问题
首先,尝试主库重新编译这个对象,然后再次查询
重编译不起 作用
SQL> ALTER VIEW MEDREC.*** COMPILE;
视图已变更。
报错依旧
SQL> select count(*) from ***;
select count(*) from ***
*
µؠ1 ѐ³:
ORA-04023: Ϟ·¨ҩ֤»¨¶Տlect count(*) from ***
查询mos发现如下文档:
Bug 23521523 - ORA-4023 or ORA-4020 or ORA-44201 in Active Data Guard (ADG) - Superseded (Doc ID 23521523.8)
疑似命中bug ,根据mos指示操作
备库:
SQL> alter system flush shared_pool;
再次查询
SQL> select count(*) from ***;
COUNT(*)
----------
257503
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69924215/viewspace-3061708/ ,如需转载,请注明出处,否则将追究法律责任。