环境描述:
Oracle 11.2.0.4 Active DataGuard环境中,查询业务出现ORA-04023错误:
SQL> select database_role,open_mode from v$database;
DATABASE_ROLE OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY READ ONLY WITH APPLY
SQL>
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 IBM/AIX RISC System/6000: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
在备库中查询语句报错:
SQL> select distinct a, b, c, c,e,f,g from as_bpm_v where 1 = 1 and rownum<11;
*
ERROR at line 1:
ORA-04023: Object select distinct a, b, c,
d,e,f,g from as_bpm_v where 1 = 1 and
rownum<11
查询as_bpm_v对象信息得知,该对象类型为同义词:
SQL> select owner,object_name,object_type from dba_objects where lower(object_name)='tg_bpm_cust_info_v';
OWNER OBJECT_NAME OBJECT_TYPE
------------------------------ -------------------- -------------------
BPMUSER TG_BPM_CUST_INFO_V SYNONYM
1 rows selected.
这是Oracle 11.2.0.4的一个BUG,详见:
Bug 22081947 - ORA-4023 in Active Data Guard - superseded (Doc ID 22081947.8)
解决方法:
备库刷新共享池:
alter system flush shared_pool;
刷新共享池后,问题解决。